diff --git a/platform.txt b/platform.txt index da61105a2af..da00e7caa39 100644 --- a/platform.txt +++ b/platform.txt @@ -23,8 +23,8 @@ compiler.prefix={build.tarch}-{build.target}-elf- # # ESP32 Support Start # -compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1404-gc13afea63" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_wifi/esp32/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/button/button/include" "-I{compiler.sdk.path}/include/json_parser" "-I{compiler.sdk.path}/include/json_parser/jsmn/include" "-I{compiler.sdk.path}/include/json_generator" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-face/face_detection/include" "-I{compiler.sdk.path}/include/esp-face/face_recognition/include" "-I{compiler.sdk.path}/include/esp-face/object_detection/include" "-I{compiler.sdk.path}/include/esp-face/image_util/include" "-I{compiler.sdk.path}/include/esp-face/pose_estimation/include" "-I{compiler.sdk.path}/include/esp-face/lib/include" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lulp -lwifi_provisioning -lbutton -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lqrcode -lws2812_led -lesp_littlefs -lesp-dsp -lesp-face -lesp32-camera -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lbutton -lesp_rainmaker -lmqtt -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lws2812_led -lesp-dsp -lesp-face -lpe -lfd -lfr -ldetection_cat_face -ldetection -ldl -lesp32-camera -lfb_gfx -lbt -lbtdm_app -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1594-g1d7068e4b" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/button/button/include" "-I{compiler.sdk.path}/include/json_parser" "-I{compiler.sdk.path}/include/json_parser/jsmn/include" "-I{compiler.sdk.path}/include/json_generator" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-face/face_detection/include" "-I{compiler.sdk.path}/include/esp-face/face_recognition/include" "-I{compiler.sdk.path}/include/esp-face/object_detection/include" "-I{compiler.sdk.path}/include/esp-face/image_util/include" "-I{compiler.sdk.path}/include/esp-face/pose_estimation/include" "-I{compiler.sdk.path}/include/esp-face/lib/include" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lulp -lwifi_provisioning -lbutton -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lqrcode -lws2812_led -lesp_littlefs -lesp-dsp -lesp-face -lesp32-camera -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lbutton -lesp_rainmaker -lmqtt -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lws2812_led -lesp-dsp -lesp-face -lpe -lfd -lfr -ldetection_cat_face -ldetection -ldl -lesp32-camera -lfb_gfx -lbt -lbtdm_app -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lperfmon -lesp32 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lrtc -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -x assembler-with-cpp -MMD -c @@ -38,8 +38,8 @@ build.extra_flags.esp32=-DARDUINO_SERIAL_PORT=0 # # ESP32S2 Support Start # -compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1404-gc13afea63" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_wifi/esp32s2/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-face/face_detection/include" "-I{compiler.sdk.path}/include/esp-face/face_recognition/include" "-I{compiler.sdk.path}/include/esp-face/object_detection/include" "-I{compiler.sdk.path}/include/esp-face/image_util/include" "-I{compiler.sdk.path}/include/esp-face/pose_estimation/include" "-I{compiler.sdk.path}/include/esp-face/lib/include" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32s2=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -ltouch_element -lulp -lusb -lwifi_provisioning -lesp_littlefs -lesp-dsp -lesp-face -lesp32-camera -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lperfmon -ltouch_element -lusb -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -larduino_tinyusb -lesp-dsp -lesp-face -lpe -lfd -lfr -ldetection_cat_face -ldetection -ldl -lesp32-camera -lfb_gfx -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1594-g1d7068e4b" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s2/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-face/face_detection/include" "-I{compiler.sdk.path}/include/esp-face/face_recognition/include" "-I{compiler.sdk.path}/include/esp-face/object_detection/include" "-I{compiler.sdk.path}/include/esp-face/image_util/include" "-I{compiler.sdk.path}/include/esp-face/pose_estimation/include" "-I{compiler.sdk.path}/include/esp-face/lib/include" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32s2=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -ltouch_element -lulp -lusb -lwifi_provisioning -lesp_littlefs -lesp-dsp -lesp-face -lesp32-camera -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lperfmon -ltouch_element -lusb -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -larduino_tinyusb -lesp-dsp -lesp-face -lpe -lfd -lfr -ldetection_cat_face -ldetection -ldl -lesp32-camera -lfb_gfx -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lxtensa -lesp32s2 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32s2=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -O2 -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -x assembler-with-cpp -MMD -c @@ -53,8 +53,8 @@ build.extra_flags.esp32s2=-DARDUINO_SERIAL_PORT={build.serial} # # ESP32C3 Support Start # -compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1404-gc13afea63" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32c3/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_wifi/esp32c3/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/fb_gfx/include" -compiler.c.elf.libs.esp32c3=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lwifi_provisioning -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -lfb_gfx -lbt -lbtdm_app -lbtbb -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc +compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-1594-g1d7068e4b" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32c3/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32c3/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/include/esp_supplicant" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/port/include/coap" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/coap/libcoap/include/coap2" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.c.elf.libs.esp32c3=-lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lconsole -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lwifi_provisioning -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_hid -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lwifi_provisioning -lprotocomm -lprotobuf-c -ljson -lfb_gfx -lbt -lbtdm_app -lesp_adc_cal -lmdns -lconsole -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_littlefs -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lmbedtls -lefuse -lapp_update -lbootloader_support -lesp_ipc -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -llwip -llog -lheap -lsoc -lesp_hw_support -lesp_pm -lesp_ringbuf -ldriver -lriscv -lesp32c3 -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lbtbb -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Og -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Og -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu++11 -fno-exceptions -fno-rtti -MMD -c compiler.S.flags.esp32c3=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Og -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -x assembler-with-cpp -MMD -c diff --git a/tools/platformio-build-esp32.py b/tools/platformio-build-esp32.py index 6b2147f5f99..e61903cb231 100644 --- a/tools/platformio-build-esp32.py +++ b/tools/platformio-build-esp32.py @@ -144,11 +144,12 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "xtensa", "esp32", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "vfs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_wifi", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_wifi", "esp32", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_event", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_netif", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_eth", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "tcpip_adapter", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_phy", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_phy", "esp32", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "app_trace", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_timer", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "mbedtls", "port", "include"), @@ -273,7 +274,7 @@ ], LIBS=[ - "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lspiffs", "-lulp", "-lwifi_provisioning", "-lbutton", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lqrcode", "-lws2812_led", "-lesp_littlefs", "-lesp-dsp", "-lesp-face", "-lesp32-camera", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lbutton", "-lesp_rainmaker", "-lmqtt", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-face", "-lpe", "-lfd", "-lfr", "-ldetection_cat_face", "-ldetection", "-ldl", "-lesp32-camera", "-lfb_gfx", "-lbt", "-lbtdm_app", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lrtc", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lspiffs", "-lulp", "-lwifi_provisioning", "-lbutton", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lesp_rainmaker", "-lqrcode", "-lws2812_led", "-lesp_littlefs", "-lesp-dsp", "-lesp-face", "-lesp32-camera", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lbutton", "-lesp_rainmaker", "-lmqtt", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-ljson_parser", "-ljson_generator", "-lesp_schedule", "-lqrcode", "-lws2812_led", "-lesp-dsp", "-lesp-face", "-lpe", "-lfd", "-lfr", "-ldetection_cat_face", "-ldetection", "-ldl", "-lesp32-camera", "-lfb_gfx", "-lbt", "-lbtdm_app", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lperfmon", "-lesp32", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lesp_phy", "-lphy", "-lesp_phy", "-lphy", "-lrtc", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -282,7 +283,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-1404-gc13afea63\\"'), + ("IDF_VER", '\\"v4.4-dev-1594-g1d7068e4b\\"'), "ESP_PLATFORM", "ARDUINO_ARCH_ESP32", "ESP32", diff --git a/tools/platformio-build-esp32c3.py b/tools/platformio-build-esp32c3.py index e1a784ad2e5..3ec16e21432 100644 --- a/tools/platformio-build-esp32c3.py +++ b/tools/platformio-build-esp32c3.py @@ -171,11 +171,12 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "riscv", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "vfs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_wifi", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_wifi", "esp32c3", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_event", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_netif", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_eth", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "tcpip_adapter", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_phy", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_phy", "esp32c3", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_timer", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "mbedtls", "port", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "mbedtls", "mbedtls", "include"), @@ -260,7 +261,7 @@ ], LIBS=[ - "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lspiffs", "-lwifi_provisioning", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_https_server", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lmqtt", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-lfb_gfx", "-lbt", "-lbtdm_app", "-lbtbb", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lbt", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lspiffs", "-lwifi_provisioning", "-lesp_littlefs", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_https_server", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lmqtt", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-lfb_gfx", "-lbt", "-lbtdm_app", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lriscv", "-lesp32c3", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lesp_phy", "-lphy", "-lesp_phy", "-lphy", "-lbtbb", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -269,7 +270,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-1404-gc13afea63\\"'), + ("IDF_VER", '\\"v4.4-dev-1594-g1d7068e4b\\"'), "ESP_PLATFORM", "ARDUINO_ARCH_ESP32", "ESP32", diff --git a/tools/platformio-build-esp32s2.py b/tools/platformio-build-esp32s2.py index b2136aeb3e4..1d6cf277b60 100644 --- a/tools/platformio-build-esp32s2.py +++ b/tools/platformio-build-esp32s2.py @@ -140,11 +140,12 @@ join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "xtensa", "esp32s2", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "vfs", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_wifi", "include"), - join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_wifi", "esp32s2", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_event", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_netif", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_eth", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "tcpip_adapter", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_phy", "include"), + join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_phy", "esp32s2", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "app_trace", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_timer", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "mbedtls", "port", "include"), @@ -263,7 +264,7 @@ ], LIBS=[ - "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-ltouch_element", "-lulp", "-lusb", "-lwifi_provisioning", "-lesp_littlefs", "-lesp-dsp", "-lesp-face", "-lesp32-camera", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_https_server", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lmqtt", "-lperfmon", "-ltouch_element", "-lusb", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-larduino_tinyusb", "-lesp-dsp", "-lesp-face", "-lpe", "-lfd", "-lfr", "-ldetection_cat_face", "-ldetection", "-ldl", "-lesp32-camera", "-lfb_gfx", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" + "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lasio", "-lcbor", "-lunity", "-lcmock", "-lcoap", "-lconsole", "-lnghttp", "-lesp-tls", "-lesp_adc_cal", "-lesp_hid", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lesp_https_server", "-lesp_lcd", "-lprotobuf-c", "-lprotocomm", "-lmdns", "-lesp_local_ctrl", "-lsdmmc", "-lesp_serial_slave_link", "-lesp_websocket_client", "-lexpat", "-lwear_levelling", "-lfatfs", "-lfreemodbus", "-ljsmn", "-ljson", "-llibsodium", "-lmqtt", "-lopenssl", "-lperfmon", "-lspiffs", "-ltouch_element", "-lulp", "-lusb", "-lwifi_provisioning", "-lesp_littlefs", "-lesp-dsp", "-lesp-face", "-lesp32-camera", "-lfb_gfx", "-lasio", "-lcbor", "-lcmock", "-lunity", "-lcoap", "-lesp_hid", "-lesp_lcd", "-lesp_local_ctrl", "-lesp_https_server", "-lesp_websocket_client", "-lexpat", "-lfreemodbus", "-ljsmn", "-llibsodium", "-lmqtt", "-lperfmon", "-ltouch_element", "-lusb", "-lwifi_provisioning", "-lprotocomm", "-lprotobuf-c", "-ljson", "-larduino_tinyusb", "-lesp-dsp", "-lesp-face", "-lpe", "-lfd", "-lfr", "-ldetection_cat_face", "-ldetection", "-ldl", "-lesp32-camera", "-lfb_gfx", "-lesp_adc_cal", "-lmdns", "-lconsole", "-lfatfs", "-lwear_levelling", "-lopenssl", "-lspiffs", "-lesp_littlefs", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lmbedtls", "-lefuse", "-lapp_update", "-lbootloader_support", "-lesp_ipc", "-lspi_flash", "-lnvs_flash", "-lpthread", "-lesp_gdbstub", "-lespcoredump", "-lesp_phy", "-lesp_system", "-lesp_rom", "-lhal", "-lvfs", "-lesp_eth", "-ltcpip_adapter", "-lesp_netif", "-lesp_event", "-lwpa_supplicant", "-lesp_wifi", "-llwip", "-llog", "-lheap", "-lsoc", "-lesp_hw_support", "-lesp_pm", "-lesp_ringbuf", "-ldriver", "-lxtensa", "-lesp32s2", "-lesp_common", "-lesp_timer", "-lfreertos", "-lnewlib", "-lcxx", "-lapp_trace", "-lnghttp", "-lesp-tls", "-ltcp_transport", "-lesp_http_client", "-lesp_http_server", "-lesp_https_ota", "-lsdmmc", "-lesp_serial_slave_link", "-lulp", "-lmbedtls", "-lmbedcrypto", "-lmbedx509", "-lcoexist", "-lcore", "-lespnow", "-lmesh", "-lnet80211", "-lpp", "-lsmartconfig", "-lwapi", "-lphy", "-lesp_phy", "-lphy", "-lesp_phy", "-lphy", "-lxt_hal", "-lm", "-lnewlib", "-lstdc++", "-lpthread", "-lgcc", "-lcxx", "-lapp_trace", "-lgcov", "-lapp_trace", "-lgcov", "-lc" ], CPPDEFINES=[ @@ -272,7 +273,7 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-1404-gc13afea63\\"'), + ("IDF_VER", '\\"v4.4-dev-1594-g1d7068e4b\\"'), "ESP_PLATFORM", "ARDUINO_ARCH_ESP32", "ESP32", diff --git a/tools/sdk/esp32/bin/bootloader_dio_40m.bin b/tools/sdk/esp32/bin/bootloader_dio_40m.bin index 30c732165c2..6cb0413134f 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dio_80m.bin b/tools/sdk/esp32/bin/bootloader_dio_80m.bin index 8ce4ecbc31f..b904746c54b 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_40m.bin b/tools/sdk/esp32/bin/bootloader_dout_40m.bin index 03357485cf0..c987ac98740 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_80m.bin b/tools/sdk/esp32/bin/bootloader_dout_80m.bin index 0919ec1bd31..602cab80bf7 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_40m.bin b/tools/sdk/esp32/bin/bootloader_qio_40m.bin index 57e658f82e7..8203db5b5c3 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_80m.bin b/tools/sdk/esp32/bin/bootloader_qio_80m.bin index 0f6b0558709..cfd93be2121 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_40m.bin b/tools/sdk/esp32/bin/bootloader_qout_40m.bin index add87ba22eb..96a5e3e8297 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_80m.bin b/tools/sdk/esp32/bin/bootloader_qout_80m.bin index d214206ef2e..0d061aac01a 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32/include/asio/port/include/esp_asio_config.h b/tools/sdk/esp32/include/asio/port/include/esp_asio_config.h index bcf8c38d40e..cba316527e6 100644 --- a/tools/sdk/esp32/include/asio/port/include/esp_asio_config.h +++ b/tools/sdk/esp32/include/asio/port/include/esp_asio_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_CONFIG_H_ #define _ESP_ASIO_CONFIG_H_ diff --git a/tools/sdk/esp32/include/asio/port/include/esp_exception.h b/tools/sdk/esp32/include/asio/port/include/esp_exception.h index cbf20d7a639..6f88866a4ea 100644 --- a/tools/sdk/esp32/include/asio/port/include/esp_exception.h +++ b/tools/sdk/esp32/include/asio/port/include/esp_exception.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_EXCEPTION_H_ #define _ESP_EXCEPTION_H_ diff --git a/tools/sdk/esp32/include/asio/port/include/openssl/conf.h b/tools/sdk/esp32/include/asio/port/include/openssl/conf.h index f125c3e6cf7..1ed025d93c1 100644 --- a/tools/sdk/esp32/include/asio/port/include/openssl/conf.h +++ b/tools/sdk/esp32/include/asio/port/include/openssl/conf.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_CONF_H #define _ESP_ASIO_OPENSSL_CONF_H diff --git a/tools/sdk/esp32/include/asio/port/include/openssl/dh.h b/tools/sdk/esp32/include/asio/port/include/openssl/dh.h index def713cfd3d..af72e083aa7 100644 --- a/tools/sdk/esp32/include/asio/port/include/openssl/dh.h +++ b/tools/sdk/esp32/include/asio/port/include/openssl/dh.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_DH_STUB_H #define _ESP_ASIO_OPENSSL_DH_STUB_H diff --git a/tools/sdk/esp32/include/asio/port/include/openssl/esp_asio_openssl_stubs.h b/tools/sdk/esp32/include/asio/port/include/openssl/esp_asio_openssl_stubs.h index fde5231722b..50627741079 100644 --- a/tools/sdk/esp32/include/asio/port/include/openssl/esp_asio_openssl_stubs.h +++ b/tools/sdk/esp32/include/asio/port/include/openssl/esp_asio_openssl_stubs.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_STUBS_H #define _ESP_ASIO_OPENSSL_STUBS_H diff --git a/tools/sdk/esp32/include/asio/port/include/openssl/rsa.h b/tools/sdk/esp32/include/asio/port/include/openssl/rsa.h index 5d9d10e82be..53018a33a8f 100644 --- a/tools/sdk/esp32/include/asio/port/include/openssl/rsa.h +++ b/tools/sdk/esp32/include/asio/port/include/openssl/rsa.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_RSA_STUB_H #define _ESP_ASIO_OPENSSL_RSA_STUB_H diff --git a/tools/sdk/esp32/include/asio/port/include/openssl/x509v3.h b/tools/sdk/esp32/include/asio/port/include/openssl/x509v3.h index 5ae8e784352..dad7475424a 100644 --- a/tools/sdk/esp32/include/asio/port/include/openssl/x509v3.h +++ b/tools/sdk/esp32/include/asio/port/include/openssl/x509v3.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_X509V3_STUB_H #define _ESP_ASIO_OPENSSL_X509V3_STUB_H diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_clock.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_clock.h index 98546e8290a..6b71f68f380 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_clock.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_clock.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h index 0723d195124..4d50649e019 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_common.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h index 8bf74852523..73aa48923d0 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash_config.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash_config.h index 6074faca2bc..8b802211325 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash_config.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_flash_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_mem.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_mem.h index bc54833ff3f..21c7114ce4c 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_mem.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_mem.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_random.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_random.h index 0c7b61eb9bc..44e988b0b25 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_random.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_random.h @@ -1,16 +1,8 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,33 +13,38 @@ extern "C" { #endif /** - * @brief Enable early entropy source for RNG + * @brief Enable an entropy source for RNG if RF is disabled * - * Uses the SAR ADC to feed entropy into the HWRNG. The ADC is put - * into a test mode that reads an internal reference voltage and - * constantly feeds the LSB of data into the HWRNG. Consult the - * SoC Technical Reference Manual for more information. + * The exact internal entropy source mechanism depends on the chip in use but + * all SoCs use the SAR ADC to continuously mix random bits (an internal + * noise reading) into the HWRNG. Consult the SoC Technical Reference + * Manual for more information. * * Can also be used from app code early during operation, if true - * random numbers are required before WiFi stack is initialised. - * Call this function from app code only if WiFi/BT are not yet - * enabled and I2S and ADC are not in use. - * - * Call bootloader_random_disable() when done. + * random numbers are required before RF is initialised. Consult + * ESP-IDF Programming Guide "Random Number Generation" section for + * details. */ void bootloader_random_enable(void); /** - * @brief Disable early entropy source for RNG + * @brief Disable entropy source for RNG * - * Disables SAR ADC source and resets the I2S hardware. + * Disables internal entropy source. Must be called after + * bootloader_random_enable() and before RF features, ADC, or + * I2S (ESP32 only) are initialized. * + * Consult the ESP-IDF Programming Guide "Random Number Generation" + * section for details. */ void bootloader_random_disable(void); /** * @brief Fill buffer with 'length' random bytes * + * @note If this function is being called from app code only, and never + * from the bootloader, then it's better to call esp_fill_random(). + * * @param buffer Pointer to buffer * @param length This many bytes of random data will be copied to buffer */ diff --git a/tools/sdk/esp32/include/bootloader_support/include/bootloader_util.h b/tools/sdk/esp32/include/bootloader_support/include/bootloader_util.h index a1b8d89c95a..c44c80619c2 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/bootloader_util.h +++ b/tools/sdk/esp32/include/bootloader_support/include/bootloader_util.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_app_format.h b/tools/sdk/esp32/include/bootloader_support/include/esp_app_format.h index 20237728dae..9be8784d3b2 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_app_format.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_app_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_data_types.h b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_data_types.h index fda6d5c645e..7b4171fdd32 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_data_types.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_data_types.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning esp_flash_data_types.h has been merged into esp_flash_partitions.h, please include esp_flash_partitions.h instead #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_encrypt.h b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_encrypt.h index 33e6aabed24..1fecd33bc74 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_encrypt.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_encrypt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_partitions.h b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_partitions.h index 1fc9d4f6c1b..b1a83640ce1 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_flash_partitions.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_flash_partitions.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_err.h" @@ -42,6 +34,9 @@ extern "C" { #define PART_FLAG_ENCRYPTED (1<<0) +/* The md5sum value is found this many bytes after the ESP_PARTITION_MAGIC_MD5 offset */ +#define ESP_PARTITION_MD5_OFFSET 16 + /* Pre-partition table fixed flash offsets */ #define ESP_BOOTLOADER_DIGEST_OFFSET 0x0 #define ESP_BOOTLOADER_OFFSET CONFIG_BOOTLOADER_OFFSET_IN_FLASH /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_image_format.h b/tools/sdk/esp32/include/bootloader_support/include/esp_image_format.h index 7e7e6a28e17..1db62442537 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_image_format.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_image_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32/include/bootloader_support/include/esp_secure_boot.h b/tools/sdk/esp32/include/bootloader_support/include/esp_secure_boot.h index 94118c327c9..b9436a43448 100644 --- a/tools/sdk/esp32/include/bootloader_support/include/esp_secure_boot.h +++ b/tools/sdk/esp32/include/bootloader_support/include/esp_secure_boot.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32/include/config/sdkconfig.h b/tools/sdk/esp32/include/config/sdkconfig.h index fde174c8dd4..7db239bfac5 100644 --- a/tools/sdk/esp32/include/config/sdkconfig.h +++ b/tools/sdk/esp32/include/config/sdkconfig.h @@ -118,8 +118,6 @@ #define CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP 1 #define CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM 100 #define CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD 20 -#define CONFIG_BTDM_COEX_BT_OPTIONS 1 -#define CONFIG_BTDM_COEX_BLE_ADV_HIGH_PRIORITY 1 #define CONFIG_BT_CTRL_MODE_EFF 1 #define CONFIG_BT_CTRL_BLE_MAX_ACT 10 #define CONFIG_BT_CTRL_BLE_MAX_ACT_EFF 10 @@ -244,6 +242,10 @@ #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 #define CONFIG_ESP_NETIF_TCPIP_LWIP 1 #define CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER 1 +#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 +#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 +#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 +#define CONFIG_ESP32_REDUCE_PHY_TX_POWER 1 #define CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT 1 #define CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE 32 #define CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE 2048 @@ -285,10 +287,6 @@ #define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 #define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 #define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 -#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 -#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 -#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 -#define CONFIG_ESP32_REDUCE_PHY_TX_POWER 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_850 1 #define CONFIG_FATFS_CODEPAGE 850 @@ -660,5 +658,5 @@ #define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "c13afea63" +#define CONFIG_ARDUINO_IDF_COMMIT "1d7068e4b" #define CONFIG_ARDUINO_IDF_BRANCH "master" diff --git a/tools/sdk/esp32/include/console/esp_console.h b/tools/sdk/esp32/include/console/esp_console.h index 29aab8b4fb7..a0b7cbf1783 100644 --- a/tools/sdk/esp32/include/console/esp_console.h +++ b/tools/sdk/esp32/include/console/esp_console.h @@ -1,16 +1,8 @@ -// Copyright 2016-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32/include/driver/esp32/include/driver/adc.h b/tools/sdk/esp32/include/driver/esp32/include/driver/adc.h index 6f012750146..c8f05fc9000 100644 --- a/tools/sdk/esp32/include/driver/esp32/include/driver/adc.h +++ b/tools/sdk/esp32/include/driver/esp32/include/driver/adc.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/esp32/include/driver/dac.h b/tools/sdk/esp32/include/driver/esp32/include/driver/dac.h index db9292473ab..2876ef07ca8 100644 --- a/tools/sdk/esp32/include/driver/esp32/include/driver/dac.h +++ b/tools/sdk/esp32/include/driver/esp32/include/driver/dac.h @@ -1,16 +1,8 @@ -// Copyright 2019-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h b/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h index d55c12e1099..fdb434f9e92 100644 --- a/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h +++ b/tools/sdk/esp32/include/driver/esp32/include/driver/touch_sensor.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/adc2_wifi_private.h b/tools/sdk/esp32/include/driver/include/driver/adc2_wifi_private.h index c4f622658d4..71481213a31 100644 --- a/tools/sdk/esp32/include/driver/include/driver/adc2_wifi_private.h +++ b/tools/sdk/esp32/include/driver/include/driver/adc2_wifi_private.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/adc_common.h b/tools/sdk/esp32/include/driver/include/driver/adc_common.h index f083b32d24f..3fa15d7143d 100644 --- a/tools/sdk/esp32/include/driver/include/driver/adc_common.h +++ b/tools/sdk/esp32/include/driver/include/driver/adc_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/can.h b/tools/sdk/esp32/include/driver/include/driver/can.h index e28a9c443f1..ec4c0e15dfe 100644 --- a/tools/sdk/esp32/include/driver/include/driver/can.h +++ b/tools/sdk/esp32/include/driver/include/driver/can.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/dac_common.h b/tools/sdk/esp32/include/driver/include/driver/dac_common.h index b1aefc9539f..f0f2ecadaea 100644 --- a/tools/sdk/esp32/include/driver/include/driver/dac_common.h +++ b/tools/sdk/esp32/include/driver/include/driver/dac_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/dedic_gpio.h b/tools/sdk/esp32/include/driver/include/driver/dedic_gpio.h index f381e2c64b0..0a40c179b89 100644 --- a/tools/sdk/esp32/include/driver/include/driver/dedic_gpio.h +++ b/tools/sdk/esp32/include/driver/include/driver/dedic_gpio.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/gpio.h b/tools/sdk/esp32/include/driver/include/driver/gpio.h index 3e497e04b2c..0912c831b53 100644 --- a/tools/sdk/esp32/include/driver/include/driver/gpio.h +++ b/tools/sdk/esp32/include/driver/include/driver/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "sdkconfig.h" diff --git a/tools/sdk/esp32/include/driver/include/driver/i2c.h b/tools/sdk/esp32/include/driver/include/driver/i2c.h index a2076cc459d..bbff4aad2f7 100644 --- a/tools/sdk/esp32/include/driver/include/driver/i2c.h +++ b/tools/sdk/esp32/include/driver/include/driver/i2c.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_I2C_H_ #define _DRIVER_I2C_H_ @@ -97,6 +89,9 @@ esp_err_t i2c_driver_install(i2c_port_t i2c_num, i2c_mode_t mode, size_t slv_rx_ /** * @brief I2C driver delete * + * @note This function does not guarantee thread safety. + * Please make sure that no thread will continuously hold semaphores before calling the delete function. + * * @param i2c_num I2C port number * * @return diff --git a/tools/sdk/esp32/include/driver/include/driver/i2s.h b/tools/sdk/esp32/include/driver/include/driver/i2s.h index 6b53db68a2a..4ee73b594d7 100644 --- a/tools/sdk/esp32/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32/include/driver/include/driver/i2s.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/ledc.h b/tools/sdk/esp32/include/driver/include/driver/ledc.h index 69660f3dda0..c1dc6d4d8c7 100644 --- a/tools/sdk/esp32/include/driver/include/driver/ledc.h +++ b/tools/sdk/esp32/include/driver/include/driver/ledc.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32/include/driver/include/driver/mcpwm.h index c19b80e4f18..8774941e482 100644 --- a/tools/sdk/esp32/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32/include/driver/include/driver/mcpwm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/pcnt.h b/tools/sdk/esp32/include/driver/include/driver/pcnt.h index 6236e5407c1..1e5af9c1efd 100644 --- a/tools/sdk/esp32/include/driver/include/driver/pcnt.h +++ b/tools/sdk/esp32/include/driver/include/driver/pcnt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/periph_ctrl.h b/tools/sdk/esp32/include/driver/include/driver/periph_ctrl.h index 3c6ff8503c7..adba0533cfb 100644 --- a/tools/sdk/esp32/include/driver/include/driver/periph_ctrl.h +++ b/tools/sdk/esp32/include/driver/include/driver/periph_ctrl.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_PERIPH_CTRL_H_ #define _DRIVER_PERIPH_CTRL_H_ diff --git a/tools/sdk/esp32/include/driver/include/driver/rmt.h b/tools/sdk/esp32/include/driver/include/driver/rmt.h index ef9d58107d8..a7e2aad5f24 100644 --- a/tools/sdk/esp32/include/driver/include/driver/rmt.h +++ b/tools/sdk/esp32/include/driver/include/driver/rmt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/rtc_cntl.h b/tools/sdk/esp32/include/driver/include/driver/rtc_cntl.h index 44fd015096b..2a0f5916c08 100644 --- a/tools/sdk/esp32/include/driver/include/driver/rtc_cntl.h +++ b/tools/sdk/esp32/include/driver/include/driver/rtc_cntl.h @@ -1,16 +1,8 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/rtc_io.h b/tools/sdk/esp32/include/driver/include/driver/rtc_io.h index 4cdcf74ba48..cbf32c4fc04 100644 --- a/tools/sdk/esp32/include/driver/include/driver/rtc_io.h +++ b/tools/sdk/esp32/include/driver/include/driver/rtc_io.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_RTC_GPIO_H_ #define _DRIVER_RTC_GPIO_H_ diff --git a/tools/sdk/esp32/include/driver/include/driver/sdio_slave.h b/tools/sdk/esp32/include/driver/include/driver/sdio_slave.h index c1bc1fb7a5e..8adee65dfff 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sdio_slave.h +++ b/tools/sdk/esp32/include/driver/include/driver/sdio_slave.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SDIO_SLAVE_H_ #define _DRIVER_SDIO_SLAVE_H_ diff --git a/tools/sdk/esp32/include/driver/include/driver/sdmmc_defs.h b/tools/sdk/esp32/include/driver/include/driver/sdmmc_defs.h index 4f1e6ddc6b7..54e051f354e 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sdmmc_defs.h +++ b/tools/sdk/esp32/include/driver/include/driver/sdmmc_defs.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32/include/driver/include/driver/sdmmc_host.h b/tools/sdk/esp32/include/driver/include/driver/sdmmc_host.h index e9da4ae1904..ff5ae71d011 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sdmmc_host.h +++ b/tools/sdk/esp32/include/driver/include/driver/sdmmc_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -59,8 +51,26 @@ extern "C" { * Extra configuration for SDMMC peripheral slot */ typedef struct { - gpio_num_t gpio_cd; ///< GPIO number of card detect signal - gpio_num_t gpio_wp; ///< GPIO number of write protect signal +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + gpio_num_t clk; ///< GPIO number of CLK signal. + gpio_num_t cmd; ///< GPIO number of CMD signal. + gpio_num_t d0; ///< GPIO number of D0 signal. + gpio_num_t d1; ///< GPIO number of D1 signal. + gpio_num_t d2; ///< GPIO number of D2 signal. + gpio_num_t d3; ///< GPIO number of D3 signal. + gpio_num_t d4; ///< GPIO number of D4 signal. Ignored in 1- or 4- line mode. + gpio_num_t d5; ///< GPIO number of D5 signal. Ignored in 1- or 4- line mode. + gpio_num_t d6; ///< GPIO number of D6 signal. Ignored in 1- or 4- line mode. + gpio_num_t d7; ///< GPIO number of D7 signal. Ignored in 1- or 4- line mode. +#endif // SOC_SDMMC_USE_GPIO_MATRIX + union { + gpio_num_t gpio_cd; ///< GPIO number of card detect signal + gpio_num_t cd; ///< GPIO number of card detect signal; shorter name. + }; + union { + gpio_num_t gpio_wp; ///< GPIO number of write protect signal + gpio_num_t wp; ///< GPIO number of write protect signal; shorter name. + }; uint8_t width; ///< Bus width used by the slot (might be less than the max width supported) uint32_t flags; ///< Features used by this slot #define SDMMC_SLOT_FLAG_INTERNAL_PULLUP BIT(0) @@ -72,18 +82,44 @@ typedef struct { #define SDMMC_SLOT_NO_CD GPIO_NUM_NC ///< indicates that card detect line is not used #define SDMMC_SLOT_NO_WP GPIO_NUM_NC ///< indicates that write protect line is not used -#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the default width for the slot (8 for slot 0, 4 for slot 1) +#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the maximum possible width for the slot + +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + +/** + * Macro defining default configuration of SDMMC host slot + */ +#define SDMMC_SLOT_CONFIG_DEFAULT() {\ + .clk = GPIO_NUM_14, \ + .cmd = GPIO_NUM_15, \ + .d0 = GPIO_NUM_2, \ + .d1 = GPIO_NUM_4, \ + .d2 = GPIO_NUM_12, \ + .d3 = GPIO_NUM_13, \ + .d4 = GPIO_NUM_33, \ + .d5 = GPIO_NUM_34, \ + .d6 = GPIO_NUM_35, \ + .d7 = GPIO_NUM_36, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ + .width = SDMMC_SLOT_WIDTH_DEFAULT, \ + .flags = 0, \ +} + +#else // SOC_SDMMC_USE_GPIO_MATRIX /** * Macro defining default configuration of SDMMC host slot */ #define SDMMC_SLOT_CONFIG_DEFAULT() {\ - .gpio_cd = SDMMC_SLOT_NO_CD, \ - .gpio_wp = SDMMC_SLOT_NO_WP, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ .width = SDMMC_SLOT_WIDTH_DEFAULT, \ .flags = 0, \ } +#endif // SOC_SDMMC_USE_GPIO_MATRIX + /** * @brief Initialize SDMMC host peripheral * @@ -226,6 +262,9 @@ esp_err_t sdmmc_host_deinit(void); /** * @brief Enable the pull-ups of sd pins. * + * This function is deprecated. Please set SDMMC_SLOT_FLAG_INTERNAL_PULLUP flag in + * sdmmc_slot_config_t::flags instead. + * * @note You should always place actual pullups on the lines instead of using * this function. Internal pullup resistance are high and not sufficient, may * cause instability in products. This is for debug or examples only. @@ -238,7 +277,7 @@ esp_err_t sdmmc_host_deinit(void); * - ESP_ERR_INVALID_ARG: if configured width larger than maximum the slot can * support */ -esp_err_t sdmmc_host_pullup_en(int slot, int width); +esp_err_t sdmmc_host_pullup_en(int slot, int width) __attribute__((deprecated)); #ifdef __cplusplus } diff --git a/tools/sdk/esp32/include/driver/include/driver/sdmmc_types.h b/tools/sdk/esp32/include/driver/include/driver/sdmmc_types.h index 25310830261..cbb796fdbb3 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sdmmc_types.h +++ b/tools/sdk/esp32/include/driver/include/driver/sdmmc_types.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32/include/driver/include/driver/sdspi_host.h b/tools/sdk/esp32/include/driver/include/driver/sdspi_host.h index 860ba1bfed4..abb690c39bc 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sdspi_host.h +++ b/tools/sdk/esp32/include/driver/include/driver/sdspi_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/sigmadelta.h b/tools/sdk/esp32/include/driver/include/driver/sigmadelta.h index d7e7eef122c..17f86b308e7 100644 --- a/tools/sdk/esp32/include/driver/include/driver/sigmadelta.h +++ b/tools/sdk/esp32/include/driver/include/driver/sigmadelta.h @@ -1,15 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/spi_common.h b/tools/sdk/esp32/include/driver/include/driver/spi_common.h index 5fee265c0ad..a36f55a87f9 100644 --- a/tools/sdk/esp32/include/driver/include/driver/spi_common.h +++ b/tools/sdk/esp32/include/driver/include/driver/spi_common.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/spi_common_internal.h b/tools/sdk/esp32/include/driver/include/driver/spi_common_internal.h index b490efeb7e0..31baaa75d70 100644 --- a/tools/sdk/esp32/include/driver/include/driver/spi_common_internal.h +++ b/tools/sdk/esp32/include/driver/include/driver/spi_common_internal.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header, don't use it in the user code diff --git a/tools/sdk/esp32/include/driver/include/driver/spi_master.h b/tools/sdk/esp32/include/driver/include/driver/spi_master.h index e6ed8c5a0af..da5f5b52144 100644 --- a/tools/sdk/esp32/include/driver/include/driver/spi_master.h +++ b/tools/sdk/esp32/include/driver/include/driver/spi_master.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/spi_slave.h b/tools/sdk/esp32/include/driver/include/driver/spi_slave.h index f03104bbc4d..92fa6004860 100644 --- a/tools/sdk/esp32/include/driver/include/driver/spi_slave.h +++ b/tools/sdk/esp32/include/driver/include/driver/spi_slave.h @@ -1,16 +1,8 @@ -// Copyright 2010-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SPI_SLAVE_H_ diff --git a/tools/sdk/esp32/include/driver/include/driver/spi_slave_hd.h b/tools/sdk/esp32/include/driver/include/driver/spi_slave_hd.h index b99d6feae23..5d6ff4c2b9e 100644 --- a/tools/sdk/esp32/include/driver/include/driver/spi_slave_hd.h +++ b/tools/sdk/esp32/include/driver/include/driver/spi_slave_hd.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/timer.h b/tools/sdk/esp32/include/driver/include/driver/timer.h index 609d1006add..204fc9db27d 100644 --- a/tools/sdk/esp32/include/driver/include/driver/timer.h +++ b/tools/sdk/esp32/include/driver/include/driver/timer.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/touch_pad.h b/tools/sdk/esp32/include/driver/include/driver/touch_pad.h index 4b7a021f558..0c2feebd8af 100644 --- a/tools/sdk/esp32/include/driver/include/driver/touch_pad.h +++ b/tools/sdk/esp32/include/driver/include/driver/touch_pad.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/touch_sensor_common.h b/tools/sdk/esp32/include/driver/include/driver/touch_sensor_common.h index f9855bc9dc3..e49c7d5de72 100644 --- a/tools/sdk/esp32/include/driver/include/driver/touch_sensor_common.h +++ b/tools/sdk/esp32/include/driver/include/driver/touch_sensor_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/twai.h b/tools/sdk/esp32/include/driver/include/driver/twai.h index 0cb744008ab..ce616fe1251 100644 --- a/tools/sdk/esp32/include/driver/include/driver/twai.h +++ b/tools/sdk/esp32/include/driver/include/driver/twai.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/uart.h b/tools/sdk/esp32/include/driver/include/driver/uart.h index 7269b3fa144..311f21a8334 100644 --- a/tools/sdk/esp32/include/driver/include/driver/uart.h +++ b/tools/sdk/esp32/include/driver/include/driver/uart.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/driver/include/driver/uart_select.h b/tools/sdk/esp32/include/driver/include/driver/uart_select.h index f7a21a315b6..578f8c9d901 100644 --- a/tools/sdk/esp32/include/driver/include/driver/uart_select.h +++ b/tools/sdk/esp32/include/driver/include/driver/uart_select.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _UART_SELECT_H_ #define _UART_SELECT_H_ diff --git a/tools/sdk/esp32/include/driver/include/esp_private/adc_cali.h b/tools/sdk/esp32/include/driver/include/esp_private/adc_cali.h index ab577a3121e..9c8a58d6d88 100644 --- a/tools/sdk/esp32/include/driver/include/esp_private/adc_cali.h +++ b/tools/sdk/esp32/include/driver/include/esp_private/adc_cali.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header for calibration, don't use in app diff --git a/tools/sdk/esp32/include/driver/include/esp_private/gdma.h b/tools/sdk/esp32/include/driver/include/esp_private/gdma.h index 2614a2d0fb3..5b548e0868e 100644 --- a/tools/sdk/esp32/include/driver/include/esp_private/gdma.h +++ b/tools/sdk/esp32/include/driver/include/esp_private/gdma.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // DO NOT USE THESE APIS IN ANY APPLICATIONS // GDMA driver is not public for end users, but for ESP-IDF developpers. diff --git a/tools/sdk/esp32/include/driver/include/esp_private/gpio.h b/tools/sdk/esp32/include/driver/include/esp_private/gpio.h index 1c4811393c0..c4227dc8c4f 100644 --- a/tools/sdk/esp32/include/driver/include/esp_private/gpio.h +++ b/tools/sdk/esp32/include/driver/include/esp_private/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse.h b/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse.h index 5aa61589804..4c06439e090 100644 --- a/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse.h +++ b/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse_table.h b/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse_table.h index ed06ad05a3a..a1f8cf3cdc0 100644 --- a/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse_table.h +++ b/tools/sdk/esp32/include/efuse/esp32/include/esp_efuse_table.h @@ -1,16 +1,8 @@ -// Copyright 2017-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at", -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifdef __cplusplus extern "C" { diff --git a/tools/sdk/esp32/include/efuse/include/esp_efuse.h b/tools/sdk/esp32/include/efuse/include/esp_efuse.h index 019657938ac..e84975e587d 100644 --- a/tools/sdk/esp32/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32/include/efuse/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h b/tools/sdk/esp32/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h index 2336a9cebc2..803023ecdd8 100644 --- a/tools/sdk/esp32/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h +++ b/tools/sdk/esp32/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_CRYPTO_H #define _ESP_TLS_CRYPTO_H diff --git a/tools/sdk/esp32/include/esp-tls/esp_tls.h b/tools/sdk/esp32/include/esp-tls/esp_tls.h index 72a78c5e7d9..9330f9dd699 100644 --- a/tools/sdk/esp32/include/esp-tls/esp_tls.h +++ b/tools/sdk/esp32/include/esp-tls/esp_tls.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_H_ #define _ESP_TLS_H_ @@ -171,7 +163,10 @@ typedef struct esp_tls_cfg { void *ds_data; /*!< Pointer for digital signature peripheral context */ bool is_plain_tcp; /*!< Use non-TLS connection: When set to true, the esp-tls uses - plain TCP transport rather then TLS/SSL connection */ + plain TCP transport rather then TLS/SSL connection. + Note, that it is possible to connect using a plain tcp transport + directly with esp_tls_plain_tcp_connect() API */ + struct ifreq *if_name; /*!< The name of interface for data to go through. Use the default interface without setting */ } esp_tls_cfg_t; @@ -599,6 +594,21 @@ int esp_tls_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp_tls void esp_tls_server_session_delete(esp_tls_t *tls); #endif /* ! CONFIG_ESP_TLS_SERVER */ +/** + * @brief Creates a plain TCP connection, returning a valid socket fd on success or an error handle + * + * @param[in] host Hostname of the host. + * @param[in] hostlen Length of hostname. + * @param[in] port Port number of the host. + * @param[in] cfg ESP-TLS configuration as esp_tls_cfg_t. + * @param[out] error_handle ESP-TLS error handle holding potential errors occurred during connection + * @param[out] sockfd Socket descriptor if successfully connected on TCP layer + * @return ESP_OK on success + * ESP_ERR_INVALID_ARG if invalid output parameters + * ESP-TLS based error codes on failure + */ +esp_err_t esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_error_handle_t error_handle, int *sockfd); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/esp-tls/esp_tls_errors.h b/tools/sdk/esp32/include/esp-tls/esp_tls_errors.h index bb281b0daea..5dfe74791c5 100644 --- a/tools/sdk/esp32/include/esp-tls/esp_tls_errors.h +++ b/tools/sdk/esp32/include/esp-tls/esp_tls_errors.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_ERRORS_H_ #define _ESP_TLS_ERRORS_H_ diff --git a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_error_capture_internal.h b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_error_capture_internal.h index fd065b2be4f..a59a3b7b344 100644 --- a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_error_capture_internal.h +++ b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_error_capture_internal.h @@ -1,16 +1,8 @@ -// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ #define __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ diff --git a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_mbedtls.h b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_mbedtls.h index 7440f0c3c74..78694fc858e 100644 --- a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_mbedtls.h +++ b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_mbedtls.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_wolfssl.h b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_wolfssl.h index f29e9332f86..a0c86730b7d 100644 --- a/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_wolfssl.h +++ b/tools/sdk/esp32/include/esp-tls/private_include/esp_tls_wolfssl.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h index 46d9cf16c63..bfb729b58b6 100755 --- a/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32/include/esp32-camera/driver/include/esp_camera.h @@ -104,7 +104,7 @@ typedef struct { int pin_href; /*!< GPIO pin for camera HREF line */ int pin_pclk; /*!< GPIO pin for camera PCLK line */ - int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 20KHz or 10KHz for OV2640 double FPS (Experimental) */ + int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode */ ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */ ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */ diff --git a/tools/sdk/esp32/include/esp_gdbstub/include/esp_gdbstub.h b/tools/sdk/esp32/include/esp_gdbstub/include/esp_gdbstub.h index 02fda63e58a..f1e7921de6b 100644 --- a/tools/sdk/esp32/include/esp_gdbstub/include/esp_gdbstub.h +++ b/tools/sdk/esp32/include/esp_gdbstub/include/esp_gdbstub.h @@ -14,13 +14,12 @@ #pragma once -#include "esp_gdbstub_arch.h" - #ifdef __cplusplus extern "C" { #endif -void esp_gdbstub_panic_handler(esp_gdbstub_frame_t *frame) __attribute__((noreturn)); +void esp_gdbstub_init(void); +void esp_gdbstub_panic_handler(void *frame); #ifdef __cplusplus } diff --git a/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h index 0f89972ff40..f6ef1da340e 100644 --- a/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_CLIENT_H #define _ESP_HTTP_CLIENT_H @@ -158,6 +150,7 @@ typedef enum { HttpStatus_TemporaryRedirect = 307, /* 4xx - Client Error */ + HttpStatus_BadRequest = 400, HttpStatus_Unauthorized = 401, HttpStatus_Forbidden = 403, HttpStatus_NotFound = 404, diff --git a/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h index 445d0c0c274..d14a943c108 100644 --- a/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32/include/esp_http_server/include/esp_http_server.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_SERVER_H_ #define _ESP_HTTP_SERVER_H_ diff --git a/tools/sdk/esp32/include/esp_http_server/include/http_server.h b/tools/sdk/esp32/include/esp_http_server/include/http_server.h index 56f73c5b74c..e28eb0af68d 100644 --- a/tools/sdk/esp32/include/esp_http_server/include/http_server.h +++ b/tools/sdk/esp32/include/esp_http_server/include/http_server.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning http_server.h has been renamed to esp_http_server.h, please update include directives #include "esp_http_server.h" diff --git a/tools/sdk/esp32/include/esp_hw_support/include/esp_random.h b/tools/sdk/esp32/include/esp_hw_support/include/esp_random.h index 7064fa8115c..cf4f408b513 100644 --- a/tools/sdk/esp32/include/esp_hw_support/include/esp_random.h +++ b/tools/sdk/esp32/include/esp_hw_support/include/esp_random.h @@ -24,27 +24,13 @@ extern "C" { /** * @brief Get one random 32-bit word from hardware RNG * - * The hardware RNG produces true random numbers under any of the following conditions: - * - * - An RF subsystem is running (i.e. Bluetooth or WiFi is enabled) - * - An internal entropy source has been enabled by calling bootloader_random_enable() - * and not yet disabled by calling bootloader_random_disable() - * - While the ESP-IDF bootloader is running (due to the internal entropy source being enabled - * for the duration of bootloader execution). - * - * If none of the above conditions are true, the hardware RNG will produce pseudo-random numbers only. - * - * When the hardware RNG is producing true random numbers, external entropy (noise samples) are - * continuously mixed into the internal hardware RNG state. Consult the SoC Technical Reference Manual - * for more details. + * If Wi-Fi or Bluetooth are enabled, this function returns true random numbers. In other + * situations, if true random numbers are required then consult the ESP-IDF Programming + * Guide "Random Number Generation" section for necessary prerequisites. * * This function automatically busy-waits to ensure enough external entropy has been - * introduced into the hardware RNG state, before returning a new random number. - * - * If generating random numbers from an app which has not yet enabled Bluetooth or Wi-Fi, call the - * API function bootloader_random_enable() before generating random numbers and then call - * bootloader_random_disable() before using any APIs for Bluetooth, Wi-Fi, ADC, or I2S. Consult the - * bootloader_random.h header for more details. + * introduced into the hardware RNG state, before returning a new random number. This delay + * is very short (always less than 100 CPU cycles). * * @return Random value between 0 and UINT32_MAX */ @@ -53,7 +39,8 @@ uint32_t esp_random(void); /** * @brief Fill a buffer with random bytes from hardware RNG * - * @note This function has the same restrictions regarding available entropy as esp_random() + * @note This function is implemented via calls to esp_random(), so the same + * constraints apply. * * @param buf Pointer to buffer to fill with random numbers. * @param len Length of buffer in bytes diff --git a/tools/sdk/esp32/include/esp_netif/include/esp_netif.h b/tools/sdk/esp32/include/esp_netif/include/esp_netif.h index 20f468739b6..92c937c1294 100644 --- a/tools/sdk/esp32/include/esp_netif/include/esp_netif.h +++ b/tools/sdk/esp32/include/esp_netif/include/esp_netif.h @@ -237,6 +237,54 @@ void esp_netif_action_disconnected(void *esp_netif, esp_event_base_t base, int32 */ void esp_netif_action_got_ip(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); +/** + * @brief Default building block for network interface action upon IPv6 multicast group join + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_join_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 multicast group leave + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_leave_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address added by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_add_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address removed by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_remove_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + /** * @} */ diff --git a/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h index 903a678e008..da01500db1c 100644 --- a/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h @@ -73,6 +73,18 @@ extern "C" { .route_prio = 20 \ }; +#define ESP_NETIF_INHERENT_DEFAULT_OPENTHREAD() \ + { \ + .flags = 0, \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(ip_info) \ + .get_ip_event = 0, \ + .lost_ip_event = 0, \ + .if_key = "OT_DEF", \ + .if_desc = "openthread", \ + .route_prio = 15 \ +}; + #define ESP_NETIF_INHERENT_DEFAULT_SLIP() \ { \ .flags = ESP_NETIF_FLAG_IS_SLIP, \ @@ -85,6 +97,7 @@ extern "C" { .route_prio = 16 \ }; + /** * @brief Default configuration reference of ethernet interface */ @@ -162,12 +175,12 @@ extern "C" { #define ESP_NETIF_BASE_DEFAULT_SLIP &_g_esp_netif_inherent_slip_config - #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip +#define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread // // Include default network stacks configs @@ -194,6 +207,27 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#if CONFIG_OPENTHREAD_ENABLED +/** +* @brief Default configuration reference of SLIP client +*/ +#define ESP_NETIF_DEFAULT_OPENTHREAD() \ + { \ + .base = ESP_NETIF_BASE_DEFAULT_OPENTHREAD, \ + .driver = NULL, \ + .stack = ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD, \ + } + +/** + * @brief Default base config (esp-netif inherent) of openthread interface + */ +#define ESP_NETIF_BASE_DEFAULT_OPENTHREAD &_g_esp_netif_inherent_openthread_config + +extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_openthread; +extern const esp_netif_inherent_config_t _g_esp_netif_inherent_openthread_config; + +#endif // CONFIG_OPENTHREAD_ENABLED + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h index 7c68c7172ab..c6a7f3d6236 100644 --- a/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h @@ -33,6 +33,8 @@ extern "C" { #define ESP_ERR_ESP_NETIF_DRIVER_ATTACH_FAILED ESP_ERR_ESP_NETIF_BASE + 0x08 #define ESP_ERR_ESP_NETIF_INIT_FAILED ESP_ERR_ESP_NETIF_BASE + 0x09 #define ESP_ERR_ESP_NETIF_DNS_NOT_CONFIGURED ESP_ERR_ESP_NETIF_BASE + 0x0A +#define ESP_ERR_ESP_NETIF_MLD6_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0B +#define ESP_ERR_ESP_NETIF_IP6_ADDR_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0C /** @brief Type of esp_netif_object server */ @@ -125,6 +127,12 @@ typedef struct { int ip_index; /*!< IPv6 address index */ } ip_event_got_ip6_t; +/** Event structure for ADD_IP6 event */ +typedef struct { + esp_ip6_addr_t addr; /*!< The address to be added to the interface */ + bool preferred; /*!< The default preference of the address */ +} ip_event_add_ip6_t; + /** Event structure for IP_EVENT_AP_STAIPASSIGNED event */ typedef struct { esp_ip4_addr_t ip; /*!< IP address which was assigned to the station */ diff --git a/tools/sdk/esp32/include/esp_wifi/esp32/include/phy_init_data.h b/tools/sdk/esp32/include/esp_phy/esp32/include/phy_init_data.h similarity index 100% rename from tools/sdk/esp32/include/esp_wifi/esp32/include/phy_init_data.h rename to tools/sdk/esp32/include/esp_phy/esp32/include/phy_init_data.h diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_phy_init.h b/tools/sdk/esp32/include/esp_phy/include/esp_phy_init.h similarity index 100% rename from tools/sdk/esp32/include/esp_wifi/include/esp_phy_init.h rename to tools/sdk/esp32/include/esp_phy/include/esp_phy_init.h diff --git a/tools/sdk/esp32/include/esp_wifi/include/phy.h b/tools/sdk/esp32/include/esp_phy/include/phy.h similarity index 100% rename from tools/sdk/esp32/include/esp_wifi/include/phy.h rename to tools/sdk/esp32/include/esp_phy/include/phy.h diff --git a/tools/sdk/esp32/include/esp_rom/include/esp_rom_md5.h b/tools/sdk/esp32/include/esp_rom/include/esp_rom_md5.h index 5bb71f3eb97..0deaca47148 100644 --- a/tools/sdk/esp32/include/esp_rom/include/esp_rom_md5.h +++ b/tools/sdk/esp32/include/esp_rom/include/esp_rom_md5.h @@ -34,6 +34,8 @@ typedef struct MD5Context { uint8_t in[64]; } md5_context_t; +#define ESP_ROM_MD5_DIGEST_LEN 16 + /** * @brief Initialize the MD5 context * @@ -46,9 +48,9 @@ void esp_rom_md5_init(md5_context_t *context); * * @param context MD5 context which has been initialized by `MD5Init` * @param buf Input buffer - * @param len Buffer length + * @param len Buffer length in bytes */ -void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len); +void esp_rom_md5_update(md5_context_t *context, const void *buf, uint32_t len); /** * @brief Extract the MD5 result, and erase the context @@ -56,7 +58,7 @@ void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len * @param digest Where to store the 128-bit digest value * @param context MD5 context */ -void esp_rom_md5_final(uint8_t digest[16], md5_context_t *context); +void esp_rom_md5_final(uint8_t *digest, md5_context_t *context); #ifdef __cplusplus } diff --git a/tools/sdk/esp32/include/esp_system/include/esp_task.h b/tools/sdk/esp32/include/esp_system/include/esp_task.h index 105de5994cc..37d78bca6e8 100644 --- a/tools/sdk/esp32/include/esp_system/include/esp_task.h +++ b/tools/sdk/esp32/include/esp_system/include/esp_task.h @@ -21,6 +21,8 @@ * 4. If the configMAX_PRIORITIES is modified, please make all priority are * greater than 0 * 5. Make sure esp_task.h is consistent between wifi lib and idf + * 6. If changing system task priorities, please check the values documented in /api-guides/performance/speed.rst + * are up to date */ #ifndef _ESP_TASK_H_ diff --git a/tools/sdk/esp32/include/espcoredump/include/esp_core_dump.h b/tools/sdk/esp32/include/espcoredump/include/esp_core_dump.h index 7d41b97e57f..40fd90d8b26 100644 --- a/tools/sdk/esp32/include/espcoredump/include/esp_core_dump.h +++ b/tools/sdk/esp32/include/espcoredump/include/esp_core_dump.h @@ -14,10 +14,11 @@ #ifndef ESP_CORE_DUMP_H_ #define ESP_CORE_DUMP_H_ +#include "sdkconfig.h" #include #include "esp_err.h" #include "esp_private/panic_internal.h" -#include "esp_core_dump_summary_extra_info.h" +#include "esp_core_dump_summary_port.h" #ifdef __cplusplus extern "C" { @@ -25,14 +26,7 @@ extern "C" { #define APP_ELF_SHA256_SZ (CONFIG_APP_RETRIEVE_LEN_ELF_SHA + 1) -/** - * @brief Backtrace information - */ -typedef struct { - uint32_t bt[16]; /*!< Backtrace (array of PC) */ - uint32_t depth; /*!< Number of backtrace entries */ - bool corrupted; /*!< Status flag for backtrace is corrupt or not */ -} esp_core_dump_bt_info_t; +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF /** * @brief Core dump summary, Most meaningful contents of the core dump @@ -48,6 +42,8 @@ typedef struct { esp_core_dump_summary_extra_info_t ex_info; /*!< Architecture specific extra data */ } esp_core_dump_summary_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + /**************************************************************************************/ /******************************** EXCEPTION MODE API **********************************/ /**************************************************************************************/ @@ -137,15 +133,32 @@ esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size); */ esp_err_t esp_core_dump_image_erase(void); +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + /** - * @brief Get the summary of a core dump. This function works only with ELF format core dumps. + * @brief Get the summary of a core dump. * * @param summary Summary of the core dump * * @return ESP_OK on success, otherwise \see esp_err_t + * + * @note This function works only if coredump is stored in flash and in ELF format + * + * Example usage: + * @code{c} + * esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t)); + * if (summary) { + * if (esp_core_dump_get_summary(summary) == ESP_OK) { + * // Do stuff + * } + * } + * free(summary); + * @endcode */ esp_err_t esp_core_dump_get_summary(esp_core_dump_summary_t *summary); +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h similarity index 51% rename from tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h index 510fdc06afe..f2b5d0d9e61 100644 --- a/tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #ifdef __cplusplus @@ -19,6 +20,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + +/** + * @brief Backtrace information + * + * For RISCV, backtrace cannot be generated on device without including and parsing + * DWARF sections. Including these sections would increase the binary size so provide + * the stackdump that can be later used to generate backtrace with the help of GDB or by parsing the ELF file + * on the host machine + */ +typedef struct { + uint8_t stackdump[CONFIG_ESP_COREDUMP_SUMMARY_STACKDUMP_SIZE]; /*!< Stack dump of the crashing task. */ + uint32_t dump_size; /*!< Size (in bytes) of the stack dump */ +} esp_core_dump_bt_info_t; + /** * @brief RISC-V architecture specific extra information */ @@ -27,9 +43,13 @@ typedef struct { uint32_t mtvec; /* Machine Trap-Vector Base Address */ uint32_t mcause; /* Machine Trap Cause */ uint32_t mtval; /* Machine Trap Value */ - uint32_t exc_a[8]; /*!< a register set when the exception caused */ + uint32_t ra; /* Return Address */ + uint32_t sp; /* Stack pointer */ + uint32_t exc_a[8]; /* A0-A7 registers when the exception caused */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h similarity index 70% rename from tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h index 3db7a70be82..815c1fff702 100644 --- a/tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #include @@ -20,8 +21,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + #define EPCx_REGISTER_COUNT XCHAL_NUM_INTLEVELS +/** + * @brief Backtrace information. + * + * For Xtensa, backtrace can be generated on device due to windowed register ABI. + */ +typedef struct { + uint32_t bt[16]; /*!< Backtrace (array of PC) */ + uint32_t depth; /*!< Number of backtrace entries */ + bool corrupted; /*!< Status flag for backtrace is corrupt or not */ +} esp_core_dump_bt_info_t; + /** * @brief Xtensa architecture specific extra information */ @@ -33,6 +47,8 @@ typedef struct { uint8_t epcx_reg_bits; /*!< Bit mask of available EPCx registers */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOSConfig.h b/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOSConfig.h index 1796f1886ad..c64cb980d85 100644 --- a/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32/include/freertos/include/freertos/FreeRTOSConfig.h @@ -136,11 +136,7 @@ #define configTICK_RATE_HZ ( CONFIG_FREERTOS_HZ ) /* This has impact on speed of search for highest priority */ -#ifdef SMALL_TEST -#define configMAX_PRIORITIES ( 7 ) -#else #define configMAX_PRIORITIES ( 25 ) -#endif /* Various things that impact minimum stack sizes */ diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/spi_flash_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/spi_flash_ll.h index d7314f87100..7c0862eddcc 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/spi_flash_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/spi_flash_ll.h @@ -402,6 +402,12 @@ static inline void spi_flash_ll_set_hold(spi_dev_t *dev, uint32_t hold_n) dev->user.cs_hold = (hold_n > 0? 1: 0); } +static inline void spi_flash_ll_set_cs_setup(spi_dev_t *dev, uint32_t cs_setup_time) +{ + dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0); + dev->ctrl2.setup_time = cs_setup_time - 1; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/touch_sensor_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/touch_sensor_ll.h index 0b876039b02..5642d28cc21 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/touch_sensor_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/touch_sensor_ll.h @@ -96,7 +96,7 @@ static inline void touch_ll_set_sleep_time(uint16_t sleep_time) */ static inline void touch_ll_get_sleep_time(uint16_t *sleep_time) { - *sleep_time = SENS.sar_touch_ctrl1.touch_meas_delay; + *sleep_time = SENS.sar_touch_ctrl2.touch_sleep_cycles; } /** diff --git a/tools/sdk/esp32/include/hal/include/hal/adc_types.h b/tools/sdk/esp32/include/hal/include/hal/adc_types.h index be0f3c67c80..b70d0948b3b 100644 --- a/tools/sdk/esp32/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32/include/hal/include/hal/adc_types.h @@ -56,9 +56,9 @@ typedef enum { */ typedef enum { ADC_ATTEN_DB_0 = 0, /*! @@ -30,21 +30,29 @@ NOTE: Thread safety is the responsibility fo the HAL user. All USB Host HAL #include "hal/usbh_ll.h" #include "hal/usb_types_private.h" -/* ----------------------------------------------------------------------------- -------------------------------- Macros and Types ------------------------------- ------------------------------------------------------------------------------ */ +// ------------------------------------------------ Macros and Types --------------------------------------------------- -// ---------------------------- Constants/Configs ------------------------------ +// ------------------ Constants/Configs -------------------- #define USBH_HAL_DMA_MEM_ALIGN 512 +#define USBH_HAL_FRAME_LIST_MEM_ALIGN 512 //The frame list needs to be 512 bytes aligned (contrary to the databook) #define USBH_HAL_NUM_CHAN 8 #define USBH_HAL_XFER_DESC_SIZE (sizeof(usbh_ll_dma_qtd_t)) +#define USBH_HAL_FIFO_TOTAL_USABLE_LINES 200 //Although we have a 256 lines, only 200 lines are usuable due to EPINFO_CTL -// ------------------------------- HAL States ---------------------------------- +/** + * @brief FIFO size configuration structure + */ +typedef struct { + uint32_t rx_fifo_lines; /**< Size of the RX FIFO in terms the number of FIFO lines */ + uint32_t nptx_fifo_lines; /**< Size of the Non-periodic FIFO in terms the number of FIFO lines */ + uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ +} usbh_hal_fifo_config_t; + +// --------------------- HAL States ------------------------ /** * @brief Channel states - * */ typedef enum { USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ @@ -52,7 +60,7 @@ typedef enum { USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ } usbh_hal_chan_state_t; -// ------------------------------- HAL Events ---------------------------------- +// --------------------- HAL Events ------------------------ /** * @brief Host port HAL events @@ -72,48 +80,46 @@ typedef enum { * @brief Channel events */ typedef enum { - USBH_HAL_CHAN_EVENT_SLOT_DONE, /**< The channel has completed execution of an entire transfer descriptor list. Channel is now halted */ - USBH_HAL_CHAN_EVENT_SLOT_HALT, /**< The channel as completed execution of a single transfer descriptor in a list. Channel is now halted */ + USBH_HAL_CHAN_EVENT_CPLT, /**< The channel has completed execution of a transfer descriptor that had the USBH_HAL_XFER_DESC_FLAG_HOC flag set. Channel is now halted */ USBH_HAL_CHAN_EVENT_ERROR, /**< The channel has encountered an error. Channel is now halted. */ USBH_HAL_CHAN_EVENT_HALT_REQ, /**< The channel has been successfully halted as requested */ + USBH_HAL_CHAN_EVENT_NONE, /**< No event (interrupt ran for internal processing) */ } usbh_hal_chan_event_t; -// ------------------------------- HAL Errors ---------------------------------- +// --------------------- HAL Errors ------------------------ /** * @brief Channel errors */ typedef enum { USBH_HAL_CHAN_ERROR_XCS_XACT = 0, /**< Excessive (three consecutive) transaction errors (e.g., no response, bad CRC etc */ - USBH_HAL_CHAN_ERROR_BNA, /**< Buffer Not Available error (i.e., transfer slot is unfilled */ + USBH_HAL_CHAN_ERROR_BNA, /**< Buffer Not Available error (i.e., An inactive transfer descriptor was fetched by the channel) */ USBH_HAL_CHAN_ERROR_PKT_BBL, /**< Packet babbler error (packet exceeded MPS) */ USBH_HAL_CHAN_ERROR_STALL, /**< STALL response received */ } usbh_hal_chan_error_t; -// ----------------------- Transfer Descriptor Related ------------------------- +// ------------- Transfer Descriptor Related --------------- /** * @brief Flags used to describe the type of transfer descriptor to fill */ -#define USBH_HAL_XFER_DESC_FLAG_IN 0x01 -#define USBH_HAL_XFER_DESC_FLAG_SETUP 0x02 -#define USBH_HAL_XFER_DESC_FLAG_NULL 0x04 -#define USBH_HAL_XFER_DESC_FLAG_HALT 0x08 +#define USBH_HAL_XFER_DESC_FLAG_IN 0x01 /**< Indicates this transfer descriptor is of the IN direction */ +#define USBH_HAL_XFER_DESC_FLAG_SETUP 0x02 /**< Indicates this transfer descriptor is an OUT setup */ +#define USBH_HAL_XFER_DESC_FLAG_HOC 0x04 /**< Indicates that the channel will be halted after this transfer descriptor completes */ /** * @brief Status value of a transfer descriptor * - * A transfer descriptor's status remains unexecuted until the entire transfer - * descriptor completes (either successfully or an error). Therefore, if a - * channel halt is requested before a transfer descriptor completes, the - * transfer descriptoor remains unexecuted. + * A transfer descriptor's status remains unexecuted until the entire transfer descriptor completes (either successfully + * or an error). Therefore, if a channel halt is requested before a transfer descriptor completes, the transfer + * descriptor remains unexecuted. */ #define USBH_HAL_XFER_DESC_STS_SUCCESS USBH_LL_QTD_STATUS_SUCCESS #define USBH_HAL_XFER_DESC_STS_PKTERR USBH_LL_QTD_STATUS_PKTERR #define USBH_HAL_XFER_DESC_STS_BUFFER_ERR USBH_LL_QTD_STATUS_BUFFER #define USBH_HAL_XFER_DESC_STS_NOT_EXECUTED USBH_LL_QTD_STATUS_NOT_EXECUTED -// ------------------------------ Object Types --------------------------------- +// -------------------- Object Types ----------------------- /** * @brief Endpoint characteristics structure @@ -131,6 +137,10 @@ typedef struct { }; uint32_t val; }; + struct { + usb_hal_interval_t interval; /**< The interval of the endpoint */ + uint32_t phase_offset_frames; /**< Phase offset in number of frames */ + } periodic; /**< Characteristic for periodic (interrupt/isochronous) endpoints only */ } usbh_hal_ep_char_t; /** @@ -143,29 +153,16 @@ typedef struct { uint32_t active: 1; /**< The channel is enabled */ uint32_t halt_requested: 1; /**< A halt has been requested */ uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ + uint32_t reserved: 1; uint32_t chan_idx: 4; /**< The index number of the channel */ - uint32_t reserved25: 25; + uint32_t reserved24: 24; }; uint32_t val; } flags; /**< Flags regarding channel's status and information */ usb_host_chan_regs_t *regs; /**< Pointer to the channel's register set */ usbh_hal_chan_error_t error; /**< The last error that occurred on the channel */ + usb_priv_xfer_type_t type; /**< The transfer type of the channel */ void *chan_ctx; /**< Context variable for the owner of the channel */ - //Transfer Descriptor List Slot - struct { - union { - struct { - uint32_t slot_acquired: 1; /**< The transfer descriptor list slot has been acquired */ - uint32_t reserved7: 7; - uint32_t cur_qtd_idx: 8; /**< Index of the first QTD in chain of QTDs being executed */ - uint32_t qtd_list_len: 8; /**< Length of QTD list in number of QTDs */ - uint32_t reserved8: 8; - }; - uint32_t val; - } flags; - void *owner_ctx; /**< Context variable for the owner of the slot */ - usbh_ll_dma_qtd_t *xfer_desc_list; /**< Pointer to transfer descriptor list */ - } slot; } usbh_hal_chan_t; /** @@ -176,10 +173,15 @@ typedef struct { usbh_dev_t *dev; /**< Pointer to base address of DWC_OTG registers */ usb_wrap_dev_t *wrap_dev; /**< Pointer to base address of USB Wrapper registers */ //Host Port related + uint32_t *periodic_frame_list; /**< Pointer to scheduling frame list */ + usb_hal_frame_list_len_t frame_list_len; /**< Length of the periodic scheduling frame list */ union { struct { - uint32_t dbnc_lock_enabled: 1; /**< Debounce lock enabled */ - uint32_t reserved31: 31; + uint32_t dbnc_lock_enabled: 1; /**< Debounce lock enabled */ + uint32_t fifo_sizes_set: 1; /**< Whether the FIFO sizes have been set or not */ + uint32_t periodic_sched_enabled: 1; /**< Periodic scheduling (for interrupt and isochronous transfers) is enabled */ + uint32_t reserved: 5; + uint32_t reserved24: 24; }; uint32_t val; } flags; @@ -191,9 +193,7 @@ typedef struct { } channels; } usbh_hal_context_t; -/* ----------------------------------------------------------------------------- ---------------------------------- Core (Global) -------------------------------- ------------------------------------------------------------------------------ */ +// -------------------------------------------------- Core (Global) ---------------------------------------------------- /** * @brief Initialize the HAL context and check if DWC_OTG is alive @@ -219,7 +219,7 @@ void usbh_hal_init(usbh_hal_context_t *hal); * @brief Deinitialize the HAL context * * Entry: - * - All channels should be properly disabled, and any pending events handled + * - All channels must be properly disabled, and any pending events handled * Exit: * - DWC_OTG global interrupt disabled * - HAL context deinitialized @@ -231,13 +231,9 @@ void usbh_hal_deinit(usbh_hal_context_t *hal); /** * @brief Issue a soft reset to the controller * - * This should be called when the host port encounters an error event or has - * been disconnected. Before calling this, users are responsible for safely - * freeing all channels as a soft reset will wipe all host port nd channel - * registers. - * - * This function will result in the host port being put back into same state as - * after calling usbh_hal_init(). + * This should be called when the host port encounters an error event or has been disconnected. Before calling this, + * users are responsible for safely freeing all channels as a soft reset will wipe all host port and channel registers. + * This function will result in the host port being put back into same state as after calling usbh_hal_init(). * * @note This has nothing to do with a USB bus reset. It simply resets the peripheral * @@ -245,18 +241,35 @@ void usbh_hal_deinit(usbh_hal_context_t *hal); */ void usbh_hal_core_soft_reset(usbh_hal_context_t *hal); -/* ----------------------------------------------------------------------------- ----------------------------------- Host Port ---------------------------------- ------------------------------------------------------------------------------ */ +/** + * @brief Set FIFO sizes + * + * This function will set the sizes of each of the FIFOs (RX FIFO, Non-periodic TX FIFO, Periodic TX FIFO) and must be + * called at least once before allocating the channel. Based on the type of endpoints (and the endpionts' MPS), there + * may be situations where this function may need to be called again to resize the FIFOs. If resizing FIFOs dynamically, + * it is the user's responsibility to ensure there are no active channels when this function is called. + * + * @note The totol size of all the FIFOs must be less than or equal to USBH_HAL_FIFO_TOTAL_USABLE_LINES + * @note After a port reset, the FIFO size registers will reset to their default values, so this function must be called + * again post reset. + * + * @param hal Context of the HAL layer + * @param fifo_config FIFO configuration + */ +void usbh_hal_set_fifo_size(usbh_hal_context_t *hal, const usbh_hal_fifo_config_t *fifo_config); + +// ---------------------------------------------------- Host Port ------------------------------------------------------ -// ---------------------------- Host Port Control ------------------------------ +// ------------------ Host Port Control -------------------- /** - * @brief Enable the host port's interrupt allowing port and channel events to occur + * @brief Initialize the host port + * + * - Will enable the host port's interrupts allowing port and channel events to occur * * @param hal Context of the HAL layer */ -static inline void usbh_hal_port_start(usbh_hal_context_t *hal) +static inline void usbh_hal_port_init(usbh_hal_context_t *hal) { //Configure Host related interrupts usbh_ll_haintmsk_dis_chan_intr(hal->dev, 0xFFFFFFFF); //Disable interrupts for all channels @@ -264,11 +277,13 @@ static inline void usbh_hal_port_start(usbh_hal_context_t *hal) } /** - * @brief Disable the host port's interrupt preventing any further port or channel events + * @brief Deinitialize the host port + * + * - Will disable the host port's interrupts preventing further port aand channel events from ocurring * * @param hal Context of the HAL layer */ -static inline void usbh_hal_port_stop(usbh_hal_context_t *hal) +static inline void usbh_hal_port_deinit(usbh_hal_context_t *hal) { //Disable Host port and channel interrupts usb_ll_dis_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_HCHINT); @@ -298,9 +313,8 @@ static inline void usbh_hal_port_toggle_power(usbh_hal_context_t *hal, bool powe * Exit: * - On release of the reset signal, a USBH_HAL_PORT_EVENT_ENABLED will be generated * - * @note If the host port is already enabled, then issuing a reset will cause - * it be disabled and generate a USBH_HAL_PORT_EVENT_DISABLED event. The - * host port will not be enabled until the reset signal is released (thus + * @note If the host port is already enabled, then issuing a reset will cause it be disabled and generate a + * USBH_HAL_PORT_EVENT_DISABLED event. The host port will not be enabled until the reset signal is released (thus * generating the USBH_HAL_PORT_EVENT_ENABLED event) * * @param hal Context of the HAL layer @@ -353,8 +367,7 @@ static inline void usbh_hal_port_suspend(usbh_hal_context_t *hal) * * Hosts should hold the resume signal for at least 20ms * - * @note If a remote wakeup event occurs, the resume signal is driven - * and cleared automatically. + * @note If a remote wakeup event occurs, the resume signal is driven and cleared automatically. * * @param hal Context of the HAL layer * @param enable Enable/disable resume signal @@ -371,9 +384,8 @@ static inline void usbh_hal_port_toggle_resume(usbh_hal_context_t *hal, bool ena /** * @brief Check whether the resume signal is being driven * - * If a remote wakeup event occurs, the core will automatically drive and clear - * the resume signal for the required amount of time. Call this function to - * check whether the resume signal has completed. + * If a remote wakeup event occurs, the core will automatically drive and clear the resume signal for the required + * amount of time. Call this function to check whether the resume signal has completed. * * @param hal Context of the HAL layer * @return true Resume signal is still being driven @@ -384,18 +396,89 @@ static inline bool usbh_hal_port_check_resume(usbh_hal_context_t *hal) return usbh_ll_hprt_get_port_resume(hal->dev); } -// -------------------------- Host Port Status/State --------------------------- +// ---------------- Host Port Scheduling ------------------- + +/** + * @brief Sets the periodic scheduling frame list + * + * @note This function must be called before attempting configuring any channels to be period via + * usbh_hal_chan_set_ep_char() + * + * @param hal Context of the HAL layer + * @param frame_list Base address of the frame list + * @param frame_list_len Number of entries in the frame list (can only be 8, 16, 32, 64) + */ +static inline void usbh_hal_port_set_frame_list(usbh_hal_context_t *hal, uint32_t *frame_list, usb_hal_frame_list_len_t len) +{ + assert(!hal->flags.periodic_sched_enabled); + //Clear and save frame list + hal->periodic_frame_list = frame_list; + hal->frame_list_len = len; +} + +/** + * @brief Get the pointer to the periodic scheduling frame list + * + * @param hal Context of the HAL layer + * @return uint32_t* Base address of the periodic scheduling frame list + */ +static inline uint32_t *usbh_hal_port_get_frame_list(usbh_hal_context_t *hal) +{ + return hal->periodic_frame_list; +} + +/** + * @brief Enable periodic scheduling + * + * @note The periodic frame list must be set via usbh_hal_port_set_frame_list() should be set before calling this + * function + * @note This function must be called before activating any periodic channels + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_enable(usbh_hal_context_t *hal) +{ + assert(hal->periodic_frame_list != NULL && !hal->flags.periodic_sched_enabled); + usbh_ll_set_frame_list_base_addr(hal->dev, (uint32_t)hal->periodic_frame_list); + usbh_ll_hcfg_set_num_frame_list_entries(hal->dev, hal->frame_list_len); + usbh_ll_hcfg_en_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 1; +} + +/** + * @brief Disable periodic scheduling + * + * Disabling periodic scheduling will save a bit of DMA bandwith (as the controller will no longer fetch the schedule + * from the frame list). + * + * @note Before disabling periodic scheduling, it is the user's responsibility to ensure that all periodic channels have + * halted safely. + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_disable(usbh_hal_context_t *hal) +{ + assert(hal->flags.periodic_sched_enabled); + usbh_ll_hcfg_dis_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 0; +} + +static inline uint32_t usbh_hal_port_get_cur_frame_num(usbh_hal_context_t *hal) +{ + return usbh_ll_get_frm_num(hal->dev); +} + +// --------------- Host Port Status/State ------------------ /** * @brief Check if a device is currently connected to the host port * - * This function is intended to be called after one of the following events - * followed by an adequate debounce delay + * This function is intended to be called after one of the following events followed by an adequate debounce delay * - USBH_HAL_PORT_EVENT_CONN * - USBH_HAL_PORT_EVENT_DISCONN * - * @note No other connection/disconnection event will occur again until the - * debounce lock is disabled via usbh_hal_disable_debounce_lock() + * @note No other connection/disconnection event will occur again until the debounce lock is disabled via + * usbh_hal_disable_debounce_lock() * * @param hal Context of the HAL layer * @return true A device is connected to the host port @@ -409,11 +492,10 @@ static inline bool usbh_hal_port_check_if_connected(usbh_hal_context_t *hal) /** * @brief Check the speed (LS/FS) of the device connected to the host port * - * @note This function should only be called after confirming that a device is - * connected to the host port + * @note This function should only be called after confirming that a device is connected to the host port * * @param hal Context of the HAL layer - * @return usb_priv_speed_t Speed of the connected device (FS or LS only on the esp32-s2) + * @return usb_priv_speed_t Speed of the connected device (FS or LS only on the esp32-s2 and esp32-s3) */ static inline usb_priv_speed_t usbh_hal_port_get_conn_speed(usbh_hal_context_t *hal) { @@ -423,9 +505,8 @@ static inline usb_priv_speed_t usbh_hal_port_get_conn_speed(usbh_hal_context_t * /** * @brief Disable the debounce lock * - * This function should be called after calling usbh_hal_port_check_if_connected() - * and will allow connection/disconnection events to occur again. Any pending - * connection or disconenction interrupts are cleared. + * This function must be called after calling usbh_hal_port_check_if_connected() and will allow connection/disconnection + * events to occur again. Any pending connection or disconenction interrupts are cleared. * * @param hal Context of the HAL layer */ @@ -439,11 +520,9 @@ static inline void usbh_hal_disable_debounce_lock(usbh_hal_context_t *hal) usb_ll_en_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_DISCONNINT); } -/* ----------------------------------------------------------------------------- ------------------------------------ Channel ------------------------------------ -------------------------------------------------------------------------------*/ +// ----------------------------------------------------- Channel ------------------------------------------------------- -// --------------------------- Channel Allocation ------------------------------ +// ----------------- Channel Allocation -------------------- /** * @brief Allocate a channel @@ -464,6 +543,8 @@ bool usbh_hal_chan_alloc(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, voi */ void usbh_hal_chan_free(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj); +// ---------------- Channel Configuration ------------------ + /** * @brief Get the context variable of the channel * @@ -475,8 +556,6 @@ static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) return chan_obj->chan_ctx; } -// ---------------------------- Channel Control -------------------------------- - /** * @brief Get the current state of a channel * @@ -502,10 +581,11 @@ static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *cha * @note the channel must be in the disabled state in order to change its EP * information * + * @param hal Context of the HAL layer * @param chan_obj Channel object * @param ep_char Endpoint characteristics */ -void usbh_hal_chan_set_ep_char(usbh_hal_chan_t *chan_obj, usbh_hal_ep_char_t *ep_char); +void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, usbh_hal_ep_char_t *ep_char); /** * @brief Set the direction of the channel @@ -514,8 +594,7 @@ void usbh_hal_chan_set_ep_char(usbh_hal_chan_t *chan_obj, usbh_hal_ep_char_t *ep * needing to reconfigure all of the channel's EP info. This is used primarily * for control transfers. * - * @note This function should only be called when the channel is in the disabled - * state or is halted from a USBH_HAL_CHAN_EVENT_SLOT_HALT event + * @note This function should only be called when the channel is halted * * @param chan_obj Channel object * @param is_in Whether the direction is IN @@ -563,6 +642,51 @@ static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) return usbh_ll_chan_get_pid(chan_obj->regs); } +// ------------------- Channel Control --------------------- + +/** + * @brief Activate a channel + * + * Activating a channel will cause the channel to start executing transfer descriptors. + * + * @note This function should only be called on channels that were previously halted + * @note An event will be generated when the channel is halted + * + * @param chan_obj Channel object + * @param xfer_desc_list A filled transfer descriptor list + * @param desc_list_len Transfer descriptor list length + * @param start_idx Index of the starting transfer descriptor in the list + */ +void usbh_hal_chan_activate(usbh_hal_chan_t *chan_obj, void *xfer_desc_list, int desc_list_len, int start_idx); + +/** + * @brief Get the index of the current transfer descriptor + * + * @param chan_obj Channel object + * @return int Descriptor index + */ +static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) +{ + return usbh_ll_chan_get_ctd(chan_obj->regs); +} + +/** + * @brief Request to halt a channel + * + * This function should be called in order to halt a channel. If the channel is already halted, this function will + * return true. If the channel is still active, this function will return false and users must wait for the + * USBH_HAL_CHAN_EVENT_HALT_REQ event before treating the channel as halted. + * + * @note When a transfer is in progress (i.e., the channel is active) and a halt is requested, the channel will halt + * after the next USB packet is completed. If the transfer has more pending packets, the transfer will just be + * marked as USBH_HAL_XFER_DESC_STS_NOT_EXECUTED. + * + * @param chan_obj Channel object + * @return true The channel is already halted + * @return false The halt was requested, wait for USBH_HAL_CHAN_EVENT_HALT_REQ + */ +bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); + /** * @brief Get a channel's error * @@ -587,178 +711,74 @@ static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) chan_obj->flags.error_pending = 0; } -/* ----------------------------------------------------------------------------- --------------------------- Transfer Descriptor List ---------------------------- -------------------------------------------------------------------------------*/ +// -------------------------------------------- Transfer Descriptor List ----------------------------------------------- /** * @brief Fill a single entry in a transfer descriptor list * - * - A single entry corresponds to a USB transfer in a particular direction - * (e.g., a BULK OUT). - * - The channel will automatically split the transfer into multiple MPS sized - * packets of the endpoint. - * - For multi direction transfers (such as the various stages of a control transfer), - * the direction and PID of channel must be managed manually. Set the - * USBH_HAL_XFER_DESC_FLAG_HALT flag to halt on each entry to flip the direction - * and PID of the channel. - * - For IN transfer entries, set the USBH_HAL_XFER_DESC_FLAG_IN. The transfer - * size must also be an integer multiple of the endpoint's MPS - * - * @note The USBH_HAL_XFER_DESC_FLAG_HALT must be set on the last descriptor of - * the list so that an interrupt is generated at the end of the list - * @note The USBH_HAL_XFER_DESC_FLAG_HALT can be set on every descriptor if users - * prefer to manually step through the list (such as change EP directions in between) + * - Depending on the transfer type, a single transfer descriptor may corresponds + * - A stage of a transfer (for control transfers) + * - A frame of a transfer interval (for interrupt and isoc) + * - An entire transfer (for bulk transfers) + * - Check the various USBH_HAL_XFER_DESC_FLAG_ flags for filling a specific type of descriptor + * - For IN transfer entries, set the USBH_HAL_XFER_DESC_FLAG_IN. The transfer size must also be an integer multiple of + * the endpoint's MPS + * * @note Critical section is not required for this function * - * @param xfer_desc_list Transfer descriptor list - * @param xfer_desc_idx Transfer descriptor index + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index * @param xfer_data_buff Transfer data buffer * @param xfer_len Transfer length * @param flags Transfer flags */ -static inline void usbh_hal_xfer_desc_fill(void *xfer_desc_list, int xfer_desc_idx, uint8_t *xfer_data_buff, int xfer_len, uint32_t flags) +static inline void usbh_hal_xfer_desc_fill(void *desc_list, uint32_t desc_idx, uint8_t *xfer_data_buff, int xfer_len, uint32_t flags) { - //Check if the channel should be halted on completion of this xfer descriptor - bool halt_on_xfer_cplt = flags & USBH_HAL_XFER_DESC_FLAG_HALT; - usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)xfer_desc_list; - if (flags & USBH_HAL_XFER_DESC_FLAG_NULL) { - usbh_ll_set_qtd_null(&qtd_list[xfer_desc_idx]); - } else if (flags & USBH_HAL_XFER_DESC_FLAG_IN) { - usbh_ll_set_qtd_in(&qtd_list[xfer_desc_idx], xfer_data_buff, xfer_len, halt_on_xfer_cplt); + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + if (flags & USBH_HAL_XFER_DESC_FLAG_IN) { + usbh_ll_set_qtd_in(&qtd_list[desc_idx], + xfer_data_buff, xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC); } else { - usbh_ll_set_qtd_out(&qtd_list[xfer_desc_idx], xfer_data_buff, xfer_len, halt_on_xfer_cplt, (flags & USBH_HAL_XFER_DESC_FLAG_SETUP)); + usbh_ll_set_qtd_out(&qtd_list[desc_idx], + xfer_data_buff, + xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC, + flags & USBH_HAL_XFER_DESC_FLAG_SETUP); } } /** - * @brief Parse a transfer decriptors results - * - * @param xfer_desc_list Transfer descriptor list - * @param xfer_desc_idx Transfer descriptor index - * @param[out] xfer_rem_len Remaining length of the transfer in bytes - * @param[out] xfer_status Status of the transfer - * - * @note Critical section is not required for this function - */ -static inline void usbh_hal_xfer_desc_parse(void *xfer_desc_list, int xfer_desc_idx, int *xfer_rem_len, int *xfer_status) -{ - usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)xfer_desc_list; - usbh_ll_get_qtd_status(&qtd_list[xfer_desc_idx], xfer_rem_len, xfer_status); -} - -/* ----------------------------------------------------------------------------- --------------------------------- Channel Slot ---------------------------------- -------------------------------------------------------------------------------*/ - -/** - * @brief Acquire a slot + * @brief Clear a transfer descriptor (sets all its fields to NULL) * - * Acquiring a channel's transfer descriptor list slot will cause a give ownership - * of the channel to the acquirer. The transfer descriptor list to be executed - * when the channel is activated. - * - * @param chan_obj Channel object - * @param xfer_desc_list A filled transfer descriptor list - * @param desc_list_len Length of the descriptor list - * @param owner_ctx Context variable of the owner + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index */ -static inline void usbh_hal_chan_slot_acquire(usbh_hal_chan_t *chan_obj, void *xfer_desc_list, int desc_list_len, void *owner_ctx) +static inline void usbh_hal_xfer_desc_clear(void *desc_list, uint32_t desc_idx) { - assert(!chan_obj->slot.flags.slot_acquired); - chan_obj->slot.xfer_desc_list = (usbh_ll_dma_qtd_t *)xfer_desc_list; - chan_obj->slot.owner_ctx = owner_ctx; - chan_obj->slot.flags.cur_qtd_idx = 0; //Start from the first descriptor - chan_obj->slot.flags.qtd_list_len = desc_list_len; - chan_obj->slot.flags.slot_acquired = 1; - //Store the descriptor list length in the HCTSIZ register. Address of desc list is set when channel is activated - usbh_ll_chan_set_qtd_list_len(chan_obj->regs, desc_list_len); + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); } /** - * @brief Get current owner of a slot + * @brief Parse a transfer decriptor's results * - * This function reqturns a slot's context variable that was set when the slot - * was acquired - * - * @param chan_obj Channel object - * @return void* Context variable of the owner of the slot - */ -static inline void *usbh_hal_chan_slot_get_owner(usbh_hal_chan_t *chan_obj) -{ - assert(chan_obj->slot.flags.slot_acquired); - return chan_obj->slot.owner_ctx; -} - -/** - * @brief Release a slot - * - * @note This should only be called after confirming that the transfer descriptor - * list has completed execution. - * @note Users should parse the completed transfer descriptor list to check the - * results of each transfer. - * - * @param[in] chan_obj Channel object - * @param[out] xfer_desc_list A completed transfer descriptor list - * @param[out] desc_list_len Length of the descriptor list - */ -static inline void usbh_hal_chan_slot_release(usbh_hal_chan_t *chan_obj, void **xfer_desc_list, int *desc_list_len) -{ - assert(chan_obj->slot.flags.slot_acquired); - *xfer_desc_list = (void *)chan_obj->slot.xfer_desc_list; - *desc_list_len = chan_obj->slot.flags.qtd_list_len; - chan_obj->slot.flags.slot_acquired = 0; -} - -/** - * @brief Activate a channel - * - * Activating a channel will cause it to start executing the transfer descriptor - * list in its slot starting from its next descriptor index. When a transfer - * descriptor completes execution and has the HALT flag set, an event will be - * generated. - * - * @param chan_obj Channel object - * @param num_to_skip Number of transfer descriptors to skip over - */ -void usbh_hal_chan_activate(usbh_hal_chan_t *chan_obj, int num_to_skip); - -/** - * @brief Get next transfer descriptor index - * - * This function returns the index of the next descriptor that will be executed - * in the transfer descriptor list. + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + * @param[out] xfer_rem_len Remaining length of the transfer in bytes + * @param[out] xfer_status Status of the transfer * - * @param chan_obj Channel object - * @return int Descriptor index + * @note Critical section is not required for this function */ -static inline int usbh_hal_chan_get_next_desc_index(usbh_hal_chan_t *chan_obj) +static inline void usbh_hal_xfer_desc_parse(void *desc_list, uint32_t desc_idx, int *xfer_rem_len, int *xfer_status) { - return chan_obj->slot.flags.cur_qtd_idx; + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_get_qtd_status(&qtd_list[desc_idx], xfer_rem_len, xfer_status); + //Clear the QTD to prevent it from being read again + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); } -/** - * @brief Request to halt a channel - * - * This function should be called in order to halt a channel. If the channel is - * already halted, this function will return true. If the channel is still - * active, this function will return false and users must wait for the - * USBH_HAL_CHAN_EVENT_HALT_REQ event before treating the channel as halted. - * - * @note When a transfer is in progress (i.e., the channel is active) and a halt - * is requested, the channel will halt after the next USB packet is completed. - * If the transfer has more pending packets, the transfer will just be - * marked as USBH_HAL_XFER_DESC_STS_NOT_EXECUTED. - * - * @param chan_obj Channel object - * @return true The channel is already halted - * @return false The halt was requested, wait for USBH_HAL_CHAN_EVENT_HALT_REQ - */ -bool usbh_hal_chan_slot_request_halt(usbh_hal_chan_t *chan_obj); - -/* ----------------------------------------------------------------------------- --------------------------------- Event Handling -------------------------------- ------------------------------------------------------------------------------ */ +// ------------------------------------------------- Event Handling ---------------------------------------------------- /** * @brief Decode global and host port interrupts @@ -776,13 +796,8 @@ usbh_hal_port_event_t usbh_hal_decode_intr(usbh_hal_context_t *hal); /** * @brief Gets the next channel with a pending interrupt * - * If no channel is pending an interrupt, this function will return NULL. If one - * or more channels are pending an interrupt, this function returns one of the - * channel's objects. Call this function repeatedly until it returns NULL. - * - * @note If a channel error event occurs, or a Slot halt/done event occurs, the - * channel is immediately halted and no further channel interrupt or errors - * can occur until it is reactivated. + * If no channel is pending an interrupt, this function will return NULL. If one or more channels are pending an + * interrupt, this function returns one of the channel's objects. Call this function repeatedly until it returns NULL. * * @param hal Context of the HAL layer * @return usbh_hal_chan_t* Channel object. NULL if no channel are pending an interrupt. diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/usbh_ll.h b/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h similarity index 90% rename from tools/sdk/esp32s2/include/hal/esp32s2/include/hal/usbh_ll.h rename to tools/sdk/esp32/include/hal/include/hal/usbh_ll.h index 6e7a9a06958..a6c03e302a4 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/usbh_ll.h +++ b/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h @@ -159,16 +159,6 @@ typedef struct { uint8_t *buffer; } usbh_ll_dma_qtd_t; -/* - * Enumeration of different possible lengths of the periodic frame list - */ -typedef enum { - USBH_LL_FRAME_LIST_LEN_8 = 0, - USBH_LL_FRAME_LIST_LEN_16, - USBH_LL_FRAME_LIST_LEN_32, - USBH_LL_FRAME_LIST_LEN_64, -} usbh_ll_frame_list_len_t; - /* ----------------------------------------------------------------------------- ------------------------------ USB Wrap Registers ------------------------------ ----------------------------------------------------------------------------- */ @@ -249,18 +239,33 @@ static inline bool usb_ll_check_dma_req_in_progress(usbh_dev_t *hw) return hw->grstctl_reg.dmareq; } -static inline void usb_ll_flush_tx_fifo(usbh_dev_t *hw, uint32_t chan_num) +static inline void usb_ll_flush_nptx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.txfnum = 0; //Set the TX FIFO number to 0 to select the non-periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //Flush the selected TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } +} + +static inline void usb_ll_flush_ptx_fifo(usbh_dev_t *hw) { - usb_grstctl_reg_t grstctl; - grstctl.val = hw->grstctl_reg.val; - grstctl.txfnum = chan_num; //Set channel number to flush - grstctl.txfflsh = 1; //Flush that channel's TX FIFO - hw->grstctl_reg.val = grstctl.val; + hw->grstctl_reg.txfnum = 1; //Set the TX FIFO number to 1 to select the periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //FLush the select TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } } static inline void usb_ll_flush_rx_fifo(usbh_dev_t *hw) { hw->grstctl_reg.rxfflsh = 1; + //Wait for the flushing to complete + while (hw->grstctl_reg.rxfflsh) { + ; + } } static inline void usb_ll_reset_frame_counter(usbh_dev_t *hw) @@ -320,20 +325,20 @@ static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) // --------------------------- GRXFSIZ Register -------------------------------- -static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t size) +static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) { //Set size in words - hw->grxfsiz_reg.rxfdep = size; + hw->grxfsiz_reg.rxfdep = num_lines; } // -------------------------- GNPTXFSIZ Register ------------------------------- -static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t size) +static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) { usb_gnptxfsiz_reg_t gnptxfsiz; gnptxfsiz.val = hw->gnptxfsiz_reg.val; gnptxfsiz.nptxfstaddr = addr; - gnptxfsiz.nptxfdep = size; + gnptxfsiz.nptxfdep = num_lines; hw->gnptxfsiz_reg.val = gnptxfsiz.val; } @@ -364,12 +369,12 @@ static inline void usb_ll_get_hardware_config(usbh_dev_t *hw, uint32_t *ghwcfg1, // --------------------------- HPTXFSIZ Register ------------------------------- -static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t size) +static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) { usb_hptxfsiz_reg_t hptxfsiz; hptxfsiz.val = hw->hptxfsiz_reg.val; hptxfsiz.ptxfstaddr = addr; - hptxfsiz.ptxfsize = size; + hptxfsiz.ptxfsize = num_lines; hw->hptxfsiz_reg.val = hptxfsiz.val; } @@ -394,9 +399,24 @@ static inline void usbh_ll_hcfg_dis_perio_sched(usbh_dev_t *hw) * * @param num_entires Number of entires in the frame list */ -static inline void usbh_ll_hcfg_set_num_frame_list_entries(usbh_dev_t *hw, usbh_ll_frame_list_len_t num_entries) +static inline void usbh_ll_hcfg_set_num_frame_list_entries(usbh_dev_t *hw, usb_hal_frame_list_len_t num_entries) { - hw->hcfg_reg.frlisten = num_entries; + uint32_t frlisten; + switch (num_entries) { + case USB_HAL_FRAME_LIST_LEN_8: + frlisten = 0; + break; + case USB_HAL_FRAME_LIST_LEN_16: + frlisten = 1; + break; + case USB_HAL_FRAME_LIST_LEN_32: + frlisten = 2; + break; + default: //USB_HAL_FRAME_LIST_LEN_64 + frlisten = 3; + break; + } + hw->hcfg_reg.frlisten = frlisten; } static inline void usbh_ll_hcfg_en_scatt_gatt_dma(usbh_dev_t *hw) @@ -417,18 +437,19 @@ static inline void usbh_ll_hcfg_set_fsls_pclk_sel(usbh_dev_t *hw) /** * @brief Sets some default values to HCFG to operate in Host mode with scatter/gather DMA * - * @param hw + * @param hw Start address of the USB Wrap registers + * @param speed Speed to initialize the host port at */ static inline void usbh_ll_hcfg_set_defaults(usbh_dev_t *hw, usb_priv_speed_t speed) { hw->hcfg_reg.descdma = 1; //Enable scatt/gatt - hw->hcfg_reg.fslssupp = 1; //FS/LS supp only + hw->hcfg_reg.fslssupp = 1; //FS/LS support only /* Indicate to the OTG core what speed the PHY clock is at Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. */ - hw->hcfg_reg.fslspclksel = (speed == USB_PRIV_SPEED_FULL) ? 1 : 2; //esp32-s2 only supports FS or LS + hw->hcfg_reg.fslspclksel = (speed == USB_PRIV_SPEED_FULL) ? 1 : 2; //PHY clock on esp32-sx for FS/LS-only hw->hcfg_reg.perschedena = 0; //Disable perio sched } @@ -444,7 +465,7 @@ static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t sp Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. */ - hfir.frint = (speed == USB_PRIV_SPEED_FULL) ? 48000 : 6000; //esp32-s2 only supports FS or LS + hfir.frint = (speed == USB_PRIV_SPEED_FULL) ? 48000 : 6000; //esp32-sx targets only support FS or LS hw->hfir_reg.val = hfir.val; } @@ -498,11 +519,27 @@ static inline void usbh_ll_haintmsk_dis_chan_intr(usbh_dev_t *hw, uint32_t mask) // --------------------------- HFLBAddr Register ------------------------------- +/** + * @brief Set the base address of the scheduling frame list + * + * @note For some reason, this address must be 512 bytes aligned or else a bunch of frames will not be scheduled when + * the frame list rolls over. However, according to the databook, there is no mention of the HFLBAddr needing to + * be aligned. + * + * @param hw Start address of the DWC_OTG registers + * @param addr Base address of the scheduling frame list + */ static inline void usbh_ll_set_frame_list_base_addr(usbh_dev_t *hw, uint32_t addr) { hw->hflbaddr_reg.hflbaddr = addr; } +/** + * @brief Get the base address of the scheduling frame list + * + * @param hw Start address of the DWC_OTG registers + * @return uint32_t Base address of the scheduling frame list + */ static inline uint32_t usbh_ll_get_frame_list_base_addr(usbh_dev_t *hw) { return hw->hflbaddr_reg.hflbaddr; @@ -513,7 +550,7 @@ static inline uint32_t usbh_ll_get_frame_list_base_addr(usbh_dev_t *hw) static inline usb_priv_speed_t usbh_ll_hprt_get_speed(usbh_dev_t *hw) { usb_priv_speed_t speed; - //esp32-s2 only supports FS or LS + //esp32-s2 and esp32-s3 only support FS or LS switch (hw->hprt_reg.prtspd) { case 1: speed = USB_PRIV_SPEED_FULL; @@ -529,6 +566,7 @@ static inline uint32_t usbh_ll_hprt_get_test_ctl(usbh_dev_t *hw) { return hw->hprt_reg.prttstctl; } + static inline void usbh_ll_hprt_set_test_ctl(usbh_dev_t *hw, uint32_t test_mode) { usb_hprt_reg_t hprt; @@ -604,6 +642,7 @@ static inline bool usbh_ll_hprt_get_port_resume(usbh_dev_t *hw) { return hw->hprt_reg.prtres; } + static inline bool usbh_ll_hprt_get_port_overcur(usbh_dev_t *hw) { return hw->hprt_reg.prtovrcurract; @@ -780,9 +819,7 @@ static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, void *dmaaddr, - uint32_t ntd, - uint32_t pktcnt, - uint32_t ctd) + uint32_t ntd) { int n; if (ntd == 2) { @@ -861,15 +898,15 @@ static inline usb_host_chan_regs_t *usbh_ll_get_chan_regs(usbh_dev_t *dev, int c * @param data_buff Pointer to buffer containing the data to transfer * @param xfer_len Number of bytes in transfer. Setting 0 will do a zero length IN transfer. * Non zero length must be mulitple of the endpoint's MPS. - * @param halt_on_cplt Generate a channel halted interrupt on completion of QTD + * @param hoc Halt on complete (will generate an interrupt and halt the channel) */ -static inline void usbh_ll_set_qtd_in(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool halt_on_cplt) +static inline void usbh_ll_set_qtd_in(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc) { qtd->buffer = data_buff; //Set pointer to data buffer qtd->buffer_status_val = 0; //Reset all flags to zero qtd->in_non_iso.xfer_size = xfer_len; - if (halt_on_cplt) { - qtd->in_non_iso.intr_cplt = 1; //Used to indicate successful completion + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd } qtd->in_non_iso.active = 1; @@ -882,11 +919,11 @@ static inline void usbh_ll_set_qtd_in(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff * @param data_buff Pointer to buffer containing the data to transfer * @param xfer_len Number of bytes to transfer. Setting 0 will do a zero length transfer. * For ctrl setup packets, this should be set to 8. - * @param halt_on_cplt Generate a channel halted interrupt on completion of QTD. + * @param hoc Halt on complete (will generate an interrupt) * @param is_setup Indicates whether this is a control transfer setup packet or a normal OUT Data transfer. * (As per the USB protocol, setup packets cannot be STALLd or NAKd by the device) */ -static inline void usbh_ll_set_qtd_out(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool halt_on_cplt, bool is_setup) +static inline void usbh_ll_set_qtd_out(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc, bool is_setup) { qtd->buffer = data_buff; //Set pointer to data buffer qtd->buffer_status_val = 0; //Reset all flags to zero @@ -894,9 +931,9 @@ static inline void usbh_ll_set_qtd_out(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buf if (is_setup) { qtd->out_non_iso.is_setup = 1; } - if (halt_on_cplt) { - qtd->out_non_iso.intr_cplt = 1; //Used to indicate successful completion - qtd->out_non_iso.eol = 1; //Used to halt the channel at this qtd + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD + qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd } qtd->out_non_iso.active = 1; } diff --git a/tools/sdk/esp32/include/libsodium/port_include/sodium/version.h b/tools/sdk/esp32/include/libsodium/port_include/sodium/version.h index c0bf5869deb..820996409e2 100644 --- a/tools/sdk/esp32/include/libsodium/port_include/sodium/version.h +++ b/tools/sdk/esp32/include/libsodium/port_include/sodium/version.h @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef sodium_version_H #define sodium_version_H diff --git a/tools/sdk/esp32/include/log/include/esp_log.h b/tools/sdk/esp32/include/log/include/esp_log.h index c41a9d3c2f2..02f7d167fe7 100644 --- a/tools/sdk/esp32/include/log/include/esp_log.h +++ b/tools/sdk/esp32/include/log/include/esp_log.h @@ -9,8 +9,10 @@ #include #include -#include "esp_rom_sys.h" #include "sdkconfig.h" +#if !defined(CONFIG_IDF_TARGET_LINUX) +#include "esp_rom_sys.h" +#endif // !CONFIG_IDF_TARGET_LINUX #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/ets_sys.h" // will be removed in idf v5.0 #elif CONFIG_IDF_TARGET_ESP32S2 diff --git a/tools/sdk/esp32/include/lwip/port/esp32/include/netif/openthreadif.h b/tools/sdk/esp32/include/lwip/port/esp32/include/netif/openthreadif.h new file mode 100644 index 00000000000..066e973ad24 --- /dev/null +++ b/tools/sdk/esp32/include/lwip/port/esp32/include/netif/openthreadif.h @@ -0,0 +1,52 @@ +// Copyright 2021 Espressif Systems (Shanghai) CO LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#ifndef _OPENTHREAD_LWIP_IF_H_ +#define _OPENTHREAD_LWIP_IF_H_ + +#include "lwip/netif.h" +#include "lwip/err.h" +#include "lwip/ip6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief This function initializes the OpenThread lwIP network interface. + * + * @param[in] netif The lwIP interface to initialize + * + * @return + * - ERR_OK + * + */ +err_t openthread_netif_init(struct netif *netif); + +/** + * @brief This function sends the buffer to the lwIP network interface + * + * @param[in] netif The lwIP interface to send to. + * @param[in] buffer The packet to send. + * @param[in] len The length of the buffer. + * @param[in] eb Unused. + * + */ +void openthread_netif_input(void *netif, void *buffer, size_t len, void *eb); + +#ifdef __cplusplus +} +#endif + +#endif /* _OPENTHREAD_LWIP_IF_H_ */ diff --git a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h index 4fd86327061..1ecedd65570 100644 --- a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h +++ b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h @@ -102,6 +102,8 @@ #define SOC_CPU_WATCHPOINT_SIZE 64 // bytes +#define SOC_CPU_HAS_FPU 1 + /*-------------------------- DAC CAPS ----------------------------------------*/ #define SOC_DAC_PERIPH_NUM 2 #define SOC_DAC_RESOLUTION 8 // DAC resolution ratio 8 bit @@ -282,3 +284,11 @@ # define CAN_BRP_DIV_SUPPORTED SOC_TWAI_BRP_DIV_SUPPORTED # define CAN_BRP_DIV_THRESH SOC_TWAI_BRP_DIV_THRESH #endif + +/*-------------------------- SDMMC CAPS -----------------------------------------*/ + +/* On ESP32, clock/cmd/data pins use IO MUX. + * Card detect, write protect, interrupt use GPIO Matrix on all chips. + */ +#define SOC_SDMMC_USE_IOMUX 1 +#define SOC_SDMMC_NUM_SLOTS 2 diff --git a/tools/sdk/esp32/include/soc/include/soc/lldesc.h b/tools/sdk/esp32/include/soc/include/soc/lldesc.h index 31e02125c40..ef74ce7aa4b 100644 --- a/tools/sdk/esp32/include/soc/include/soc/lldesc.h +++ b/tools/sdk/esp32/include/soc/include/soc/lldesc.h @@ -31,6 +31,24 @@ /** Maximum size of data in the buffer that a DMA descriptor can hold. */ #define LLDESC_MAX_NUM_PER_DESC (4096-4) +// Some DMA operations might impose certain alignment restrictions on the length +#define LLDESC_MAX_NUM_PER_DESC_16B_ALIGNED (4096 - 16) +#define LLDESC_MAX_NUM_PER_DESC_32B_ALIGNED (4096 - 32) + +/** + * Generate a linked list pointing to a (huge) buffer in an descriptor array. + * + * The caller should ensure there is enough size to hold the array, by calling + * ``lldesc_get_required_num_constrained`` with the same max_desc_size argument. + * + * @param[out] out_desc_array Output of a descriptor array, the head should be fed to the DMA. + * @param buffer Buffer for the descriptors to point to. + * @param size Size (or length for TX) of the buffer + * @param max_desc_size Maximum length of each descriptor + * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. + */ +void lldesc_setup_link_constrained(lldesc_t *out_desc_array, const void *buffer, int size, int max_desc_size, bool isrx); + /** * Generate a linked list pointing to a (huge) buffer in an descriptor array. * @@ -42,7 +60,7 @@ * @param size Size (or length for TX) of the buffer * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. */ -void lldesc_setup_link(lldesc_t *out_desc_array, const void *buffer, int size, bool isrx); +#define lldesc_setup_link(out_desc_array, buffer, size, isrx) lldesc_setup_link_constrained(out_desc_array, buffer, size, LLDESC_MAX_NUM_PER_DESC, isrx) /** * @brief Get the received length of a linked list, until end of the link or eof. @@ -61,7 +79,16 @@ int lldesc_get_received_len(lldesc_t* head, lldesc_t** out_next); * * @return Numbers required. */ -static inline int lldesc_get_required_num(int data_size) +static inline int lldesc_get_required_num_constrained(int data_size, int max_desc_size) { - return (data_size + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; + return (data_size + max_desc_size - 1) / max_desc_size; } + +/** + * Get the number of descriptors required for a given buffer size. + * + * @param data_size Size to check descriptor num. + * @param max_desc_size Maximum length of each descriptor + * @return Numbers required. + */ +#define lldesc_get_required_num(data_size) lldesc_get_required_num_constrained(data_size, LLDESC_MAX_NUM_PER_DESC) diff --git a/tools/sdk/esp32/include/soc/include/soc/sdmmc_periph.h b/tools/sdk/esp32/include/soc/include/soc/sdmmc_periph.h index 7a64f4c5fe8..c1d38fa29b8 100644 --- a/tools/sdk/esp32/include/soc/include/soc/sdmmc_periph.h +++ b/tools/sdk/esp32/include/soc/include/soc/sdmmc_periph.h @@ -15,6 +15,7 @@ #pragma once #include //include soc related (generated) definitions +#include "soc/soc_caps.h" #include "soc/soc_pins.h" #include "soc/sdmmc_reg.h" #include "soc/sdmmc_struct.h" @@ -24,25 +25,50 @@ extern "C" { #endif +/** + * Common SDMMC slot info, doesn't depend on SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} + */ typedef struct { - uint8_t clk_gpio; - uint8_t cmd_gpio; - uint8_t d0_gpio; - uint8_t d1_gpio; - uint8_t d2_gpio; - uint8_t d3_gpio; - uint8_t d4_gpio; - uint8_t d5_gpio; - uint8_t d6_gpio; - uint8_t d7_gpio; - uint8_t card_detect; - uint8_t write_protect; - uint8_t card_int; - uint8_t width; + uint8_t width; /*!< Maximum supported slot width (1, 4, 8) */ + uint8_t card_detect; /*!< Card detect signal in GPIO Matrix */ + uint8_t write_protect; /*!< Write protect signal in GPIO Matrix */ + uint8_t card_int; /*!< Card interrupt signal in GPIO Matrix */ } sdmmc_slot_info_t; -/** pin and signal information of each slot */ -extern const sdmmc_slot_info_t sdmmc_slot_info[]; +/** Width and GPIO matrix signal numbers for auxillary SD host signals, one structure per slot */ +extern const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS]; + +/** + * This structure lists pin numbers (if SOC_SDMMC_USE_IOMUX is set) + * or GPIO Matrix signal numbers (if SOC_SDMMC_USE_GPIO_MATRIX is set) + * for the SD bus signals. Field names match SD bus signal names. + */ +typedef struct { + uint8_t clk; + uint8_t cmd; + uint8_t d0; + uint8_t d1; + uint8_t d2; + uint8_t d3; + uint8_t d4; + uint8_t d5; + uint8_t d6; + uint8_t d7; +} sdmmc_slot_io_info_t; + +/* Note: it is in theory possible to have both IOMUX and GPIO Matrix supported + * in the same SoC. However this is not used on any SoC at this point, and would + * complicate the driver. Hence only one of these options is supported at a time. + */ +#if SOC_SDMMC_USE_IOMUX +/** GPIO pin numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_num[SOC_SDMMC_NUM_SLOTS]; + +#elif SOC_SDMMC_USE_GPIO_MATRIX +/** GPIO matrix signal numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_sig[SOC_SDMMC_NUM_SLOTS]; + +#endif // SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} #ifdef __cplusplus } diff --git a/tools/sdk/esp32/include/spi_flash/include/esp_flash_spi_init.h b/tools/sdk/esp32/include/spi_flash/include/esp_flash_spi_init.h index 85334d3ea5a..e586a8778c6 100644 --- a/tools/sdk/esp32/include/spi_flash/include/esp_flash_spi_init.h +++ b/tools/sdk/esp32/include/spi_flash/include/esp_flash_spi_init.h @@ -34,6 +34,7 @@ typedef struct { * automatically assigned by the SPI bus lock. */ int cs_id; + uint32_t cs_setup; ///< (cycles-1) of prepare phase by spi clock } esp_flash_spi_device_config_t; /** diff --git a/tools/sdk/esp32/include/spiffs/include/spiffs_config.h b/tools/sdk/esp32/include/spiffs/include/spiffs_config.h index ca7f0cc6fb9..5cc3d78049c 100644 --- a/tools/sdk/esp32/include/spiffs/include/spiffs_config.h +++ b/tools/sdk/esp32/include/spiffs/include/spiffs_config.h @@ -19,6 +19,7 @@ #include #include #include +#include // compile time switches #define SPIFFS_TAG "SPIFFS" diff --git a/tools/sdk/esp32/ld/esp32.project.ld b/tools/sdk/esp32/ld/esp32.project.ld index 93f8b5e7b99..8771d4498c5 100644 --- a/tools/sdk/esp32/ld/esp32.project.ld +++ b/tools/sdk/esp32/ld/esp32.project.ld @@ -582,8 +582,8 @@ SECTIONS _bss_start = ABSOLUTE(.); *(.bss .bss.*) - *(.ext_ram.bss .ext_ram.bss.*) *(.dynbss .dynsbss .gnu.linkonce.b .gnu.linkonce.b.* .gnu.linkonce.sb .gnu.linkonce.sb.* .gnu.linkonce.sb2 .gnu.linkonce.sb2.* .sbss .sbss.* .sbss2 .sbss2.* .scommon .share.mem) + *(.ext_ram.bss .ext_ram.bss.*) *(COMMON) _bt_bss_start = ABSOLUTE(.); *libbt.a:(.bss .bss.* COMMON) @@ -686,7 +686,6 @@ SECTIONS _stext = .; _text_start = ABSOLUTE(.); - *(.phyiram .phyiram.*) *(EXCLUDE_FILE(*libesp_ringbuf.a *libfreertos.a *libgcov.a *librtc.a *libxt_hal.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libc.a:creat.* *libc.a:isatty.* *libc.a:lib_a-abs.* *libc.a:lib_a-asctime.* *libc.a:lib_a-asctime_r.* *libc.a:lib_a-atoi.* *libc.a:lib_a-atol.* *libc.a:lib_a-bzero.* *libc.a:lib_a-close.* *libc.a:lib_a-creat.* *libc.a:lib_a-ctime.* *libc.a:lib_a-ctime_r.* *libc.a:lib_a-ctype_.* *libc.a:lib_a-div.* *libc.a:lib_a-environ.* *libc.a:lib_a-envlock.* *libc.a:lib_a-fclose.* *libc.a:lib_a-fflush.* *libc.a:lib_a-findfp.* *libc.a:lib_a-fputwc.* *libc.a:lib_a-fvwrite.* *libc.a:lib_a-fwalk.* *libc.a:lib_a-getenv_r.* *libc.a:lib_a-gettzinfo.* *libc.a:lib_a-gmtime.* *libc.a:lib_a-gmtime_r.* *libc.a:lib_a-impure.* *libc.a:lib_a-isalnum.* *libc.a:lib_a-isalpha.* *libc.a:lib_a-isascii.* *libc.a:lib_a-isblank.* *libc.a:lib_a-iscntrl.* *libc.a:lib_a-isdigit.* *libc.a:lib_a-isgraph.* *libc.a:lib_a-islower.* *libc.a:lib_a-isprint.* *libc.a:lib_a-ispunct.* *libc.a:lib_a-isspace.* *libc.a:lib_a-isupper.* *libc.a:lib_a-itoa.* *libc.a:lib_a-labs.* *libc.a:lib_a-lcltime.* *libc.a:lib_a-lcltime_r.* *libc.a:lib_a-ldiv.* *libc.a:lib_a-longjmp.* *libc.a:lib_a-makebuf.* *libc.a:lib_a-memccpy.* *libc.a:lib_a-memchr.* *libc.a:lib_a-memcmp.* *libc.a:lib_a-memcpy.* *libc.a:lib_a-memmove.* *libc.a:lib_a-memrchr.* *libc.a:lib_a-memset.* *libc.a:lib_a-mktime.* *libc.a:lib_a-month_lengths.* *libc.a:lib_a-open.* *libc.a:lib_a-quorem.* *libc.a:lib_a-raise.* *libc.a:lib_a-rand.* *libc.a:lib_a-rand_r.* *libc.a:lib_a-read.* *libc.a:lib_a-refill.* *libc.a:lib_a-rshift.* *libc.a:lib_a-s_fpclassify.* *libc.a:lib_a-sbrk.* *libc.a:lib_a-sccl.* *libc.a:lib_a-setjmp.* *libc.a:lib_a-sf_nan.* *libc.a:lib_a-srand.* *libc.a:lib_a-stdio.* *libc.a:lib_a-strcasecmp.* *libc.a:lib_a-strcasestr.* *libc.a:lib_a-strcat.* *libc.a:lib_a-strchr.* *libc.a:lib_a-strcmp.* *libc.a:lib_a-strcoll.* *libc.a:lib_a-strcpy.* *libc.a:lib_a-strcspn.* *libc.a:lib_a-strdup.* *libc.a:lib_a-strdup_r.* *libc.a:lib_a-strftime.* *libc.a:lib_a-strlcat.* *libc.a:lib_a-strlcpy.* *libc.a:lib_a-strlen.* *libc.a:lib_a-strlwr.* *libc.a:lib_a-strncasecmp.* *libc.a:lib_a-strncat.* *libc.a:lib_a-strncmp.* *libc.a:lib_a-strncpy.* *libc.a:lib_a-strndup.* *libc.a:lib_a-strndup_r.* *libc.a:lib_a-strnlen.* *libc.a:lib_a-strptime.* *libc.a:lib_a-strrchr.* *libc.a:lib_a-strsep.* *libc.a:lib_a-strspn.* *libc.a:lib_a-strstr.* *libc.a:lib_a-strtok_r.* *libc.a:lib_a-strtol.* *libc.a:lib_a-strtoul.* *libc.a:lib_a-strupr.* *libc.a:lib_a-sysclose.* *libc.a:lib_a-sysopen.* *libc.a:lib_a-sysread.* *libc.a:lib_a-syssbrk.* *libc.a:lib_a-system.* *libc.a:lib_a-systimes.* *libc.a:lib_a-syswrite.* *libc.a:lib_a-time.* *libc.a:lib_a-timelocal.* *libc.a:lib_a-toascii.* *libc.a:lib_a-tolower.* *libc.a:lib_a-toupper.* *libc.a:lib_a-tzcalc_limits.* *libc.a:lib_a-tzlock.* *libc.a:lib_a-tzset.* *libc.a:lib_a-tzset_r.* *libc.a:lib_a-tzvars.* *libc.a:lib_a-ungetc.* *libc.a:lib_a-utoa.* *libc.a:lib_a-wbuf.* *libc.a:lib_a-wcrtomb.* *libc.a:lib_a-wctomb_r.* *libc.a:lib_a-wsetup.* *libc.a:lock.* *libesp_event.a:default_event_loop.* *libesp_event.a:esp_event.* *libesp_hw_support.a:cpu_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:rtc_init.* *libesp_hw_support.a:rtc_pm.* *libesp_hw_support.a:rtc_sleep.* *libesp_hw_support.a:rtc_time.* *libesp_hw_support.a:rtc_wdt.* *libesp_system.a:esp_err.* *libesp_system.a:esp_system.* *libesp_system.a:ubsan.* *libgcc.a:lib2funcs.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *liblog.a:log.* *liblog.a:log_freertos.* *libnewlib.a:abort.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libxtensa.a:eri.* *libxtensa.a:xtensa_intr_asm.*) .literal EXCLUDE_FILE(*libesp_ringbuf.a *libfreertos.a *libgcov.a *librtc.a *libxt_hal.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libc.a:creat.* *libc.a:isatty.* *libc.a:lib_a-abs.* *libc.a:lib_a-asctime.* *libc.a:lib_a-asctime_r.* *libc.a:lib_a-atoi.* *libc.a:lib_a-atol.* *libc.a:lib_a-bzero.* *libc.a:lib_a-close.* *libc.a:lib_a-creat.* *libc.a:lib_a-ctime.* *libc.a:lib_a-ctime_r.* *libc.a:lib_a-ctype_.* *libc.a:lib_a-div.* *libc.a:lib_a-environ.* *libc.a:lib_a-envlock.* *libc.a:lib_a-fclose.* *libc.a:lib_a-fflush.* *libc.a:lib_a-findfp.* *libc.a:lib_a-fputwc.* *libc.a:lib_a-fvwrite.* *libc.a:lib_a-fwalk.* *libc.a:lib_a-getenv_r.* *libc.a:lib_a-gettzinfo.* *libc.a:lib_a-gmtime.* *libc.a:lib_a-gmtime_r.* *libc.a:lib_a-impure.* *libc.a:lib_a-isalnum.* *libc.a:lib_a-isalpha.* *libc.a:lib_a-isascii.* *libc.a:lib_a-isblank.* *libc.a:lib_a-iscntrl.* *libc.a:lib_a-isdigit.* *libc.a:lib_a-isgraph.* *libc.a:lib_a-islower.* *libc.a:lib_a-isprint.* *libc.a:lib_a-ispunct.* *libc.a:lib_a-isspace.* *libc.a:lib_a-isupper.* *libc.a:lib_a-itoa.* *libc.a:lib_a-labs.* *libc.a:lib_a-lcltime.* *libc.a:lib_a-lcltime_r.* *libc.a:lib_a-ldiv.* *libc.a:lib_a-longjmp.* *libc.a:lib_a-makebuf.* *libc.a:lib_a-memccpy.* *libc.a:lib_a-memchr.* *libc.a:lib_a-memcmp.* *libc.a:lib_a-memcpy.* *libc.a:lib_a-memmove.* *libc.a:lib_a-memrchr.* *libc.a:lib_a-memset.* *libc.a:lib_a-mktime.* *libc.a:lib_a-month_lengths.* *libc.a:lib_a-open.* *libc.a:lib_a-quorem.* *libc.a:lib_a-raise.* *libc.a:lib_a-rand.* *libc.a:lib_a-rand_r.* *libc.a:lib_a-read.* *libc.a:lib_a-refill.* *libc.a:lib_a-rshift.* *libc.a:lib_a-s_fpclassify.* *libc.a:lib_a-sbrk.* *libc.a:lib_a-sccl.* *libc.a:lib_a-setjmp.* *libc.a:lib_a-sf_nan.* *libc.a:lib_a-srand.* *libc.a:lib_a-stdio.* *libc.a:lib_a-strcasecmp.* *libc.a:lib_a-strcasestr.* *libc.a:lib_a-strcat.* *libc.a:lib_a-strchr.* *libc.a:lib_a-strcmp.* *libc.a:lib_a-strcoll.* *libc.a:lib_a-strcpy.* *libc.a:lib_a-strcspn.* *libc.a:lib_a-strdup.* *libc.a:lib_a-strdup_r.* *libc.a:lib_a-strftime.* *libc.a:lib_a-strlcat.* *libc.a:lib_a-strlcpy.* *libc.a:lib_a-strlen.* *libc.a:lib_a-strlwr.* *libc.a:lib_a-strncasecmp.* *libc.a:lib_a-strncat.* *libc.a:lib_a-strncmp.* *libc.a:lib_a-strncpy.* *libc.a:lib_a-strndup.* *libc.a:lib_a-strndup_r.* *libc.a:lib_a-strnlen.* *libc.a:lib_a-strptime.* *libc.a:lib_a-strrchr.* *libc.a:lib_a-strsep.* *libc.a:lib_a-strspn.* *libc.a:lib_a-strstr.* *libc.a:lib_a-strtok_r.* *libc.a:lib_a-strtol.* *libc.a:lib_a-strtoul.* *libc.a:lib_a-strupr.* *libc.a:lib_a-sysclose.* *libc.a:lib_a-sysopen.* *libc.a:lib_a-sysread.* *libc.a:lib_a-syssbrk.* *libc.a:lib_a-system.* *libc.a:lib_a-systimes.* *libc.a:lib_a-syswrite.* *libc.a:lib_a-time.* *libc.a:lib_a-timelocal.* *libc.a:lib_a-toascii.* *libc.a:lib_a-tolower.* *libc.a:lib_a-toupper.* *libc.a:lib_a-tzcalc_limits.* *libc.a:lib_a-tzlock.* *libc.a:lib_a-tzset.* *libc.a:lib_a-tzset_r.* *libc.a:lib_a-tzvars.* *libc.a:lib_a-ungetc.* *libc.a:lib_a-utoa.* *libc.a:lib_a-wbuf.* *libc.a:lib_a-wcrtomb.* *libc.a:lib_a-wctomb_r.* *libc.a:lib_a-wsetup.* *libc.a:lock.* *libesp_event.a:default_event_loop.* *libesp_event.a:esp_event.* *libesp_hw_support.a:cpu_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:rtc_init.* *libesp_hw_support.a:rtc_pm.* *libesp_hw_support.a:rtc_sleep.* *libesp_hw_support.a:rtc_time.* *libesp_hw_support.a:rtc_wdt.* *libesp_system.a:esp_err.* *libesp_system.a:esp_system.* *libesp_system.a:ubsan.* *libgcc.a:lib2funcs.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *liblog.a:log.* *liblog.a:log_freertos.* *libnewlib.a:abort.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libxtensa.a:eri.* *libxtensa.a:xtensa_intr_asm.*) .literal.* EXCLUDE_FILE(*libesp_ringbuf.a *libfreertos.a *libgcov.a *librtc.a *libxt_hal.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libc.a:creat.* *libc.a:isatty.* *libc.a:lib_a-abs.* *libc.a:lib_a-asctime.* *libc.a:lib_a-asctime_r.* *libc.a:lib_a-atoi.* *libc.a:lib_a-atol.* *libc.a:lib_a-bzero.* *libc.a:lib_a-close.* *libc.a:lib_a-creat.* *libc.a:lib_a-ctime.* *libc.a:lib_a-ctime_r.* *libc.a:lib_a-ctype_.* *libc.a:lib_a-div.* *libc.a:lib_a-environ.* *libc.a:lib_a-envlock.* *libc.a:lib_a-fclose.* *libc.a:lib_a-fflush.* *libc.a:lib_a-findfp.* *libc.a:lib_a-fputwc.* *libc.a:lib_a-fvwrite.* *libc.a:lib_a-fwalk.* *libc.a:lib_a-getenv_r.* *libc.a:lib_a-gettzinfo.* *libc.a:lib_a-gmtime.* *libc.a:lib_a-gmtime_r.* *libc.a:lib_a-impure.* *libc.a:lib_a-isalnum.* *libc.a:lib_a-isalpha.* *libc.a:lib_a-isascii.* *libc.a:lib_a-isblank.* *libc.a:lib_a-iscntrl.* *libc.a:lib_a-isdigit.* *libc.a:lib_a-isgraph.* *libc.a:lib_a-islower.* *libc.a:lib_a-isprint.* *libc.a:lib_a-ispunct.* *libc.a:lib_a-isspace.* *libc.a:lib_a-isupper.* *libc.a:lib_a-itoa.* *libc.a:lib_a-labs.* *libc.a:lib_a-lcltime.* *libc.a:lib_a-lcltime_r.* *libc.a:lib_a-ldiv.* *libc.a:lib_a-longjmp.* *libc.a:lib_a-makebuf.* *libc.a:lib_a-memccpy.* *libc.a:lib_a-memchr.* *libc.a:lib_a-memcmp.* *libc.a:lib_a-memcpy.* *libc.a:lib_a-memmove.* *libc.a:lib_a-memrchr.* *libc.a:lib_a-memset.* *libc.a:lib_a-mktime.* *libc.a:lib_a-month_lengths.* *libc.a:lib_a-open.* *libc.a:lib_a-quorem.* *libc.a:lib_a-raise.* *libc.a:lib_a-rand.* *libc.a:lib_a-rand_r.* *libc.a:lib_a-read.* *libc.a:lib_a-refill.* *libc.a:lib_a-rshift.* *libc.a:lib_a-s_fpclassify.* *libc.a:lib_a-sbrk.* *libc.a:lib_a-sccl.* *libc.a:lib_a-setjmp.* *libc.a:lib_a-sf_nan.* *libc.a:lib_a-srand.* *libc.a:lib_a-stdio.* *libc.a:lib_a-strcasecmp.* *libc.a:lib_a-strcasestr.* *libc.a:lib_a-strcat.* *libc.a:lib_a-strchr.* *libc.a:lib_a-strcmp.* *libc.a:lib_a-strcoll.* *libc.a:lib_a-strcpy.* *libc.a:lib_a-strcspn.* *libc.a:lib_a-strdup.* *libc.a:lib_a-strdup_r.* *libc.a:lib_a-strftime.* *libc.a:lib_a-strlcat.* *libc.a:lib_a-strlcpy.* *libc.a:lib_a-strlen.* *libc.a:lib_a-strlwr.* *libc.a:lib_a-strncasecmp.* *libc.a:lib_a-strncat.* *libc.a:lib_a-strncmp.* *libc.a:lib_a-strncpy.* *libc.a:lib_a-strndup.* *libc.a:lib_a-strndup_r.* *libc.a:lib_a-strnlen.* *libc.a:lib_a-strptime.* *libc.a:lib_a-strrchr.* *libc.a:lib_a-strsep.* *libc.a:lib_a-strspn.* *libc.a:lib_a-strstr.* *libc.a:lib_a-strtok_r.* *libc.a:lib_a-strtol.* *libc.a:lib_a-strtoul.* *libc.a:lib_a-strupr.* *libc.a:lib_a-sysclose.* *libc.a:lib_a-sysopen.* *libc.a:lib_a-sysread.* *libc.a:lib_a-syssbrk.* *libc.a:lib_a-system.* *libc.a:lib_a-systimes.* *libc.a:lib_a-syswrite.* *libc.a:lib_a-time.* *libc.a:lib_a-timelocal.* *libc.a:lib_a-toascii.* *libc.a:lib_a-tolower.* *libc.a:lib_a-toupper.* *libc.a:lib_a-tzcalc_limits.* *libc.a:lib_a-tzlock.* *libc.a:lib_a-tzset.* *libc.a:lib_a-tzset_r.* *libc.a:lib_a-tzvars.* *libc.a:lib_a-ungetc.* *libc.a:lib_a-utoa.* *libc.a:lib_a-wbuf.* *libc.a:lib_a-wcrtomb.* *libc.a:lib_a-wctomb_r.* *libc.a:lib_a-wsetup.* *libc.a:lock.* *libesp_event.a:default_event_loop.* *libesp_event.a:esp_event.* *libesp_hw_support.a:cpu_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:rtc_init.* *libesp_hw_support.a:rtc_pm.* *libesp_hw_support.a:rtc_sleep.* *libesp_hw_support.a:rtc_time.* *libesp_hw_support.a:rtc_wdt.* *libesp_system.a:esp_err.* *libesp_system.a:esp_system.* *libesp_system.a:ubsan.* *libgcc.a:lib2funcs.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *liblog.a:log.* *liblog.a:log_freertos.* *libnewlib.a:abort.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libxtensa.a:eri.* *libxtensa.a:xtensa_intr_asm.*) .text EXCLUDE_FILE(*libesp_ringbuf.a *libfreertos.a *libgcov.a *librtc.a *libxt_hal.a *libapp_trace.a:app_trace.* *libapp_trace.a:app_trace_util.* *libc.a:creat.* *libc.a:isatty.* *libc.a:lib_a-abs.* *libc.a:lib_a-asctime.* *libc.a:lib_a-asctime_r.* *libc.a:lib_a-atoi.* *libc.a:lib_a-atol.* *libc.a:lib_a-bzero.* *libc.a:lib_a-close.* *libc.a:lib_a-creat.* *libc.a:lib_a-ctime.* *libc.a:lib_a-ctime_r.* *libc.a:lib_a-ctype_.* *libc.a:lib_a-div.* *libc.a:lib_a-environ.* *libc.a:lib_a-envlock.* *libc.a:lib_a-fclose.* *libc.a:lib_a-fflush.* *libc.a:lib_a-findfp.* *libc.a:lib_a-fputwc.* *libc.a:lib_a-fvwrite.* *libc.a:lib_a-fwalk.* *libc.a:lib_a-getenv_r.* *libc.a:lib_a-gettzinfo.* *libc.a:lib_a-gmtime.* *libc.a:lib_a-gmtime_r.* *libc.a:lib_a-impure.* *libc.a:lib_a-isalnum.* *libc.a:lib_a-isalpha.* *libc.a:lib_a-isascii.* *libc.a:lib_a-isblank.* *libc.a:lib_a-iscntrl.* *libc.a:lib_a-isdigit.* *libc.a:lib_a-isgraph.* *libc.a:lib_a-islower.* *libc.a:lib_a-isprint.* *libc.a:lib_a-ispunct.* *libc.a:lib_a-isspace.* *libc.a:lib_a-isupper.* *libc.a:lib_a-itoa.* *libc.a:lib_a-labs.* *libc.a:lib_a-lcltime.* *libc.a:lib_a-lcltime_r.* *libc.a:lib_a-ldiv.* *libc.a:lib_a-longjmp.* *libc.a:lib_a-makebuf.* *libc.a:lib_a-memccpy.* *libc.a:lib_a-memchr.* *libc.a:lib_a-memcmp.* *libc.a:lib_a-memcpy.* *libc.a:lib_a-memmove.* *libc.a:lib_a-memrchr.* *libc.a:lib_a-memset.* *libc.a:lib_a-mktime.* *libc.a:lib_a-month_lengths.* *libc.a:lib_a-open.* *libc.a:lib_a-quorem.* *libc.a:lib_a-raise.* *libc.a:lib_a-rand.* *libc.a:lib_a-rand_r.* *libc.a:lib_a-read.* *libc.a:lib_a-refill.* *libc.a:lib_a-rshift.* *libc.a:lib_a-s_fpclassify.* *libc.a:lib_a-sbrk.* *libc.a:lib_a-sccl.* *libc.a:lib_a-setjmp.* *libc.a:lib_a-sf_nan.* *libc.a:lib_a-srand.* *libc.a:lib_a-stdio.* *libc.a:lib_a-strcasecmp.* *libc.a:lib_a-strcasestr.* *libc.a:lib_a-strcat.* *libc.a:lib_a-strchr.* *libc.a:lib_a-strcmp.* *libc.a:lib_a-strcoll.* *libc.a:lib_a-strcpy.* *libc.a:lib_a-strcspn.* *libc.a:lib_a-strdup.* *libc.a:lib_a-strdup_r.* *libc.a:lib_a-strftime.* *libc.a:lib_a-strlcat.* *libc.a:lib_a-strlcpy.* *libc.a:lib_a-strlen.* *libc.a:lib_a-strlwr.* *libc.a:lib_a-strncasecmp.* *libc.a:lib_a-strncat.* *libc.a:lib_a-strncmp.* *libc.a:lib_a-strncpy.* *libc.a:lib_a-strndup.* *libc.a:lib_a-strndup_r.* *libc.a:lib_a-strnlen.* *libc.a:lib_a-strptime.* *libc.a:lib_a-strrchr.* *libc.a:lib_a-strsep.* *libc.a:lib_a-strspn.* *libc.a:lib_a-strstr.* *libc.a:lib_a-strtok_r.* *libc.a:lib_a-strtol.* *libc.a:lib_a-strtoul.* *libc.a:lib_a-strupr.* *libc.a:lib_a-sysclose.* *libc.a:lib_a-sysopen.* *libc.a:lib_a-sysread.* *libc.a:lib_a-syssbrk.* *libc.a:lib_a-system.* *libc.a:lib_a-systimes.* *libc.a:lib_a-syswrite.* *libc.a:lib_a-time.* *libc.a:lib_a-timelocal.* *libc.a:lib_a-toascii.* *libc.a:lib_a-tolower.* *libc.a:lib_a-toupper.* *libc.a:lib_a-tzcalc_limits.* *libc.a:lib_a-tzlock.* *libc.a:lib_a-tzset.* *libc.a:lib_a-tzset_r.* *libc.a:lib_a-tzvars.* *libc.a:lib_a-ungetc.* *libc.a:lib_a-utoa.* *libc.a:lib_a-wbuf.* *libc.a:lib_a-wcrtomb.* *libc.a:lib_a-wctomb_r.* *libc.a:lib_a-wsetup.* *libc.a:lock.* *libesp_event.a:default_event_loop.* *libesp_event.a:esp_event.* *libesp_hw_support.a:cpu_util.* *libesp_hw_support.a:rtc_clk.* *libesp_hw_support.a:rtc_init.* *libesp_hw_support.a:rtc_pm.* *libesp_hw_support.a:rtc_sleep.* *libesp_hw_support.a:rtc_time.* *libesp_hw_support.a:rtc_wdt.* *libesp_system.a:esp_err.* *libesp_system.a:esp_system.* *libesp_system.a:ubsan.* *libgcc.a:lib2funcs.* *libhal.a:cpu_hal.* *libhal.a:i2c_hal_iram.* *libhal.a:ledc_hal_iram.* *libhal.a:soc_hal.* *libhal.a:spi_flash_encrypt_hal_iram.* *libhal.a:spi_flash_hal_iram.* *libhal.a:spi_hal_iram.* *libhal.a:spi_slave_hal_iram.* *libhal.a:wdt_hal_iram.* *libheap.a:heap_tlsf.* *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.* *liblog.a:log.* *liblog.a:log_freertos.* *libnewlib.a:abort.* *libnewlib.a:heap.* *libnewlib.a:stdatomic.* *libsoc.a:lldesc.* *libspi_flash.a:memspi_host_driver.* *libspi_flash.a:spi_flash_chip_gd.* *libspi_flash.a:spi_flash_chip_generic.* *libspi_flash.a:spi_flash_chip_issi.* *libspi_flash.a:spi_flash_chip_mxic.* *libspi_flash.a:spi_flash_chip_winbond.* *libspi_flash.a:spi_flash_rom_patch.* *libxtensa.a:eri.* *libxtensa.a:xtensa_intr_asm.*) .text.*) *(.wifi0iram .wifi0iram.*) *(.wifiorslpiram .wifiorslpiram.*) diff --git a/tools/sdk/esp32/ld/esp32.rom.ld b/tools/sdk/esp32/ld/esp32.rom.ld index e4eb517ef38..d433cc5a547 100644 --- a/tools/sdk/esp32/ld/esp32.rom.ld +++ b/tools/sdk/esp32/ld/esp32.rom.ld @@ -113,6 +113,7 @@ PROVIDE ( jd_prepare = 0x40060fa8 ); PROVIDE ( ke_env = 0x3ffb93cc ); PROVIDE ( ke_handler_search = 0x4001a430 ); PROVIDE ( ke_task_env = 0x3ffb81d4 ); +PROVIDE ( ke_event_env = 0x3ffb81a4 ); PROVIDE ( lb_default_handler = 0x3ff982b8 ); PROVIDE ( lb_default_state_tab_p_get = 0x4001c198 ); PROVIDE ( lb_env = 0x3ffb9424 ); @@ -1602,4 +1603,22 @@ PROVIDE ( prbs_64bytes = 0x3ff98992 ); PROVIDE ( nvds_env = 0x3ffb8364 ); PROVIDE ( nvds_magic_number = 0x3ff9912a ); PROVIDE ( TASK_DESC_LLD = 0x3ff98b58 ); + +PROVIDE ( ld_acl_clk_isr = 0x40030cf8 ); +PROVIDE ( ld_acl_evt_canceled_cbk = 0x40033944 ); +PROVIDE ( ld_acl_evt_stop_cbk = 0x40033870 ); +PROVIDE ( ld_acl_evt_start_cbk = 0x40030ab0 ); +PROVIDE ( ld_acl_test_mode_update = 0x40032050 ); +PROVIDE ( ld_acl_resched = 0x40033814 ); +PROVIDE ( ld_acl_rx_isr = 0x40033aa8 ); +PROVIDE ( lc_acl_disc_ind_handler = 0x4002f270 ); +PROVIDE ( lc_pca_sscan_start_req_handler = 0x40029b34 ); +PROVIDE ( lmp_feats_req_ext_handler = 0x4002ccb0 ); +PROVIDE ( ld_pscan_em_init = 0x4003e5e8 ); +PROVIDE ( ld_acl_rsw_start = 0x40032e90 ); +PROVIDE ( ld_acl_sniff_enter = 0x40031244 ); +PROVIDE ( ld_acl_sniff_trans_sched = 0x40033734 ); +PROVIDE ( lc_pwr_decr_ind_handler = 0x4002859c ); +PROVIDE ( lc_pwr_incr_ind_handler = 0x400284a8 ); +PROVIDE ( lc_pwr_max_ind_handler = 0x40028690 ); /* Above are static data, but can be used, not generated by script >>>>> btdm data */ diff --git a/tools/sdk/esp32/ld/libbtdm_app.a b/tools/sdk/esp32/ld/libbtdm_app.a index f69c4134488..9ab5fe61146 100644 Binary files a/tools/sdk/esp32/ld/libbtdm_app.a and b/tools/sdk/esp32/ld/libbtdm_app.a differ diff --git a/tools/sdk/esp32/lib/libphy.a b/tools/sdk/esp32/ld/libphy.a similarity index 100% rename from tools/sdk/esp32/lib/libphy.a rename to tools/sdk/esp32/ld/libphy.a diff --git a/tools/sdk/esp32/lib/librtc.a b/tools/sdk/esp32/ld/librtc.a similarity index 100% rename from tools/sdk/esp32/lib/librtc.a rename to tools/sdk/esp32/ld/librtc.a diff --git a/tools/sdk/esp32/lib/libapp_trace.a b/tools/sdk/esp32/lib/libapp_trace.a index 86bc3e462a3..d4d4699735d 100644 Binary files a/tools/sdk/esp32/lib/libapp_trace.a and b/tools/sdk/esp32/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32/lib/libapp_update.a b/tools/sdk/esp32/lib/libapp_update.a index 37cd7384a42..000e46935b6 100644 Binary files a/tools/sdk/esp32/lib/libapp_update.a and b/tools/sdk/esp32/lib/libapp_update.a differ diff --git a/tools/sdk/esp32/lib/libasio.a b/tools/sdk/esp32/lib/libasio.a index 1597d19f02a..04f5f246780 100644 Binary files a/tools/sdk/esp32/lib/libasio.a and b/tools/sdk/esp32/lib/libasio.a differ diff --git a/tools/sdk/esp32/lib/libbootloader_support.a b/tools/sdk/esp32/lib/libbootloader_support.a index 44d3f5137fe..2af59a1c028 100644 Binary files a/tools/sdk/esp32/lib/libbootloader_support.a and b/tools/sdk/esp32/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32/lib/libbt.a b/tools/sdk/esp32/lib/libbt.a index 5f8f99c9b27..85de2b7e9a2 100644 Binary files a/tools/sdk/esp32/lib/libbt.a and b/tools/sdk/esp32/lib/libbt.a differ diff --git a/tools/sdk/esp32/lib/libbutton.a b/tools/sdk/esp32/lib/libbutton.a index 879b29aa53e..33be09b335d 100644 Binary files a/tools/sdk/esp32/lib/libbutton.a and b/tools/sdk/esp32/lib/libbutton.a differ diff --git a/tools/sdk/esp32/lib/libcbor.a b/tools/sdk/esp32/lib/libcbor.a index 17ac1943487..26898668da1 100644 Binary files a/tools/sdk/esp32/lib/libcbor.a and b/tools/sdk/esp32/lib/libcbor.a differ diff --git a/tools/sdk/esp32/lib/libcmock.a b/tools/sdk/esp32/lib/libcmock.a index 4e48618c925..6c55fa23b4c 100644 Binary files a/tools/sdk/esp32/lib/libcmock.a and b/tools/sdk/esp32/lib/libcmock.a differ diff --git a/tools/sdk/esp32/lib/libcoap.a b/tools/sdk/esp32/lib/libcoap.a index ec830bdccb5..a9b763d2dc9 100644 Binary files a/tools/sdk/esp32/lib/libcoap.a and b/tools/sdk/esp32/lib/libcoap.a differ diff --git a/tools/sdk/esp32/lib/libconsole.a b/tools/sdk/esp32/lib/libconsole.a index f8b08a601e1..633cee0a0cb 100644 Binary files a/tools/sdk/esp32/lib/libconsole.a and b/tools/sdk/esp32/lib/libconsole.a differ diff --git a/tools/sdk/esp32/lib/libcxx.a b/tools/sdk/esp32/lib/libcxx.a index 002e8d35b55..f6fe2426b99 100644 Binary files a/tools/sdk/esp32/lib/libcxx.a and b/tools/sdk/esp32/lib/libcxx.a differ diff --git a/tools/sdk/esp32/lib/libdriver.a b/tools/sdk/esp32/lib/libdriver.a index 4005cf09e10..d81339c4cbe 100644 Binary files a/tools/sdk/esp32/lib/libdriver.a and b/tools/sdk/esp32/lib/libdriver.a differ diff --git a/tools/sdk/esp32/lib/libefuse.a b/tools/sdk/esp32/lib/libefuse.a index b4ac1518784..0df9d89a09a 100644 Binary files a/tools/sdk/esp32/lib/libefuse.a and b/tools/sdk/esp32/lib/libefuse.a differ diff --git a/tools/sdk/esp32/lib/libesp-dsp.a b/tools/sdk/esp32/lib/libesp-dsp.a index 418bfaed039..df046849546 100644 Binary files a/tools/sdk/esp32/lib/libesp-dsp.a and b/tools/sdk/esp32/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32/lib/libesp-face.a b/tools/sdk/esp32/lib/libesp-face.a index f12812ce01e..943f4fe75ba 100644 Binary files a/tools/sdk/esp32/lib/libesp-face.a and b/tools/sdk/esp32/lib/libesp-face.a differ diff --git a/tools/sdk/esp32/lib/libesp-tls.a b/tools/sdk/esp32/lib/libesp-tls.a index e288b656387..e456e71cf90 100644 Binary files a/tools/sdk/esp32/lib/libesp-tls.a and b/tools/sdk/esp32/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32/lib/libesp32-camera.a b/tools/sdk/esp32/lib/libesp32-camera.a index 8acd662183a..55e9850bf90 100644 Binary files a/tools/sdk/esp32/lib/libesp32-camera.a and b/tools/sdk/esp32/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32/lib/libesp32.a b/tools/sdk/esp32/lib/libesp32.a index 6d95c98cc67..726cbcba65b 100644 Binary files a/tools/sdk/esp32/lib/libesp32.a and b/tools/sdk/esp32/lib/libesp32.a differ diff --git a/tools/sdk/esp32/lib/libesp_adc_cal.a b/tools/sdk/esp32/lib/libesp_adc_cal.a index e084ec33463..c58a5eddafc 100644 Binary files a/tools/sdk/esp32/lib/libesp_adc_cal.a and b/tools/sdk/esp32/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32/lib/libesp_common.a b/tools/sdk/esp32/lib/libesp_common.a index db239b2b204..06f859a6629 100644 Binary files a/tools/sdk/esp32/lib/libesp_common.a and b/tools/sdk/esp32/lib/libesp_common.a differ diff --git a/tools/sdk/esp32/lib/libesp_eth.a b/tools/sdk/esp32/lib/libesp_eth.a index 6131e4fb555..83c65bc3030 100644 Binary files a/tools/sdk/esp32/lib/libesp_eth.a and b/tools/sdk/esp32/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32/lib/libesp_event.a b/tools/sdk/esp32/lib/libesp_event.a index 77179c16ab5..527b2beb54e 100644 Binary files a/tools/sdk/esp32/lib/libesp_event.a and b/tools/sdk/esp32/lib/libesp_event.a differ diff --git a/tools/sdk/esp32/lib/libesp_gdbstub.a b/tools/sdk/esp32/lib/libesp_gdbstub.a index 47cc246f782..5ecbd440db8 100644 Binary files a/tools/sdk/esp32/lib/libesp_gdbstub.a and b/tools/sdk/esp32/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32/lib/libesp_hid.a b/tools/sdk/esp32/lib/libesp_hid.a index 4c0b34646b0..d316a61ec46 100644 Binary files a/tools/sdk/esp32/lib/libesp_hid.a and b/tools/sdk/esp32/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_client.a b/tools/sdk/esp32/lib/libesp_http_client.a index 0166192cbef..bfb1ca79e81 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_client.a and b/tools/sdk/esp32/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_server.a b/tools/sdk/esp32/lib/libesp_http_server.a index c6d3f196fd2..36fafb5b070 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_server.a and b/tools/sdk/esp32/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32/lib/libesp_https_ota.a b/tools/sdk/esp32/lib/libesp_https_ota.a index 38229af7c8e..e1ea0bf0445 100644 Binary files a/tools/sdk/esp32/lib/libesp_https_ota.a and b/tools/sdk/esp32/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32/lib/libesp_hw_support.a b/tools/sdk/esp32/lib/libesp_hw_support.a index 51c00952523..dce0eb4a2d6 100644 Binary files a/tools/sdk/esp32/lib/libesp_hw_support.a and b/tools/sdk/esp32/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32/lib/libesp_ipc.a b/tools/sdk/esp32/lib/libesp_ipc.a index 1f5a59789a1..cc050cc7f4e 100644 Binary files a/tools/sdk/esp32/lib/libesp_ipc.a and b/tools/sdk/esp32/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32/lib/libesp_lcd.a b/tools/sdk/esp32/lib/libesp_lcd.a index e51fa713950..0923a221656 100644 Binary files a/tools/sdk/esp32/lib/libesp_lcd.a and b/tools/sdk/esp32/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32/lib/libesp_littlefs.a b/tools/sdk/esp32/lib/libesp_littlefs.a index b5d4a18ef11..c0001bd691a 100644 Binary files a/tools/sdk/esp32/lib/libesp_littlefs.a and b/tools/sdk/esp32/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32/lib/libesp_local_ctrl.a b/tools/sdk/esp32/lib/libesp_local_ctrl.a index 6cc34341f5b..27030fbe36a 100644 Binary files a/tools/sdk/esp32/lib/libesp_local_ctrl.a and b/tools/sdk/esp32/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32/lib/libesp_netif.a b/tools/sdk/esp32/lib/libesp_netif.a index b295634b1e5..31f55cf9eec 100644 Binary files a/tools/sdk/esp32/lib/libesp_netif.a and b/tools/sdk/esp32/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32/lib/libesp_phy.a b/tools/sdk/esp32/lib/libesp_phy.a new file mode 100644 index 00000000000..e7969e0eca8 Binary files /dev/null and b/tools/sdk/esp32/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32/lib/libesp_pm.a b/tools/sdk/esp32/lib/libesp_pm.a index 6295899d935..97f4500e5f7 100644 Binary files a/tools/sdk/esp32/lib/libesp_pm.a and b/tools/sdk/esp32/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32/lib/libesp_rainmaker.a b/tools/sdk/esp32/lib/libesp_rainmaker.a index 242293e182f..df9e2b3cc68 100644 Binary files a/tools/sdk/esp32/lib/libesp_rainmaker.a and b/tools/sdk/esp32/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32/lib/libesp_ringbuf.a b/tools/sdk/esp32/lib/libesp_ringbuf.a index f89d0d882d6..6e3e0d9ab71 100644 Binary files a/tools/sdk/esp32/lib/libesp_ringbuf.a and b/tools/sdk/esp32/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32/lib/libesp_rom.a b/tools/sdk/esp32/lib/libesp_rom.a index ac1909df2e9..e8ffe9442cf 100644 Binary files a/tools/sdk/esp32/lib/libesp_rom.a and b/tools/sdk/esp32/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32/lib/libesp_schedule.a b/tools/sdk/esp32/lib/libesp_schedule.a index 30e81507bef..16f0c2a7e25 100644 Binary files a/tools/sdk/esp32/lib/libesp_schedule.a and b/tools/sdk/esp32/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32/lib/libesp_serial_slave_link.a b/tools/sdk/esp32/lib/libesp_serial_slave_link.a index a9a7207f13e..36c67e7ed5f 100644 Binary files a/tools/sdk/esp32/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32/lib/libesp_system.a b/tools/sdk/esp32/lib/libesp_system.a index 96f6cb8ae86..3270aca2a9d 100644 Binary files a/tools/sdk/esp32/lib/libesp_system.a and b/tools/sdk/esp32/lib/libesp_system.a differ diff --git a/tools/sdk/esp32/lib/libesp_timer.a b/tools/sdk/esp32/lib/libesp_timer.a index 419b2269377..778f4c6a891 100644 Binary files a/tools/sdk/esp32/lib/libesp_timer.a and b/tools/sdk/esp32/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32/lib/libesp_websocket_client.a b/tools/sdk/esp32/lib/libesp_websocket_client.a index 9b4ae909b2e..3b25917f842 100644 Binary files a/tools/sdk/esp32/lib/libesp_websocket_client.a and b/tools/sdk/esp32/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_wifi.a b/tools/sdk/esp32/lib/libesp_wifi.a index d644978dd97..5426a645cb6 100644 Binary files a/tools/sdk/esp32/lib/libesp_wifi.a and b/tools/sdk/esp32/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32/lib/libespcoredump.a b/tools/sdk/esp32/lib/libespcoredump.a index 74cce15d2b8..21df0b90112 100644 Binary files a/tools/sdk/esp32/lib/libespcoredump.a and b/tools/sdk/esp32/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32/lib/libexpat.a b/tools/sdk/esp32/lib/libexpat.a index 6cafdde39ff..0a176951b34 100644 Binary files a/tools/sdk/esp32/lib/libexpat.a and b/tools/sdk/esp32/lib/libexpat.a differ diff --git a/tools/sdk/esp32/lib/libfatfs.a b/tools/sdk/esp32/lib/libfatfs.a index 1ede78db6b5..d550df74fc5 100644 Binary files a/tools/sdk/esp32/lib/libfatfs.a and b/tools/sdk/esp32/lib/libfatfs.a differ diff --git a/tools/sdk/esp32/lib/libfb_gfx.a b/tools/sdk/esp32/lib/libfb_gfx.a index 772598793aa..312d9e0eda7 100644 Binary files a/tools/sdk/esp32/lib/libfb_gfx.a and b/tools/sdk/esp32/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32/lib/libfreemodbus.a b/tools/sdk/esp32/lib/libfreemodbus.a index 7d2801f9029..e664f47fdae 100644 Binary files a/tools/sdk/esp32/lib/libfreemodbus.a and b/tools/sdk/esp32/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32/lib/libfreertos.a b/tools/sdk/esp32/lib/libfreertos.a index 389c91572be..f9749ccc358 100644 Binary files a/tools/sdk/esp32/lib/libfreertos.a and b/tools/sdk/esp32/lib/libfreertos.a differ diff --git a/tools/sdk/esp32/lib/libhal.a b/tools/sdk/esp32/lib/libhal.a index b429e5b362c..0e00410e927 100644 Binary files a/tools/sdk/esp32/lib/libhal.a and b/tools/sdk/esp32/lib/libhal.a differ diff --git a/tools/sdk/esp32/lib/libheap.a b/tools/sdk/esp32/lib/libheap.a index 862773d8818..0da0f7e4cc3 100644 Binary files a/tools/sdk/esp32/lib/libheap.a and b/tools/sdk/esp32/lib/libheap.a differ diff --git a/tools/sdk/esp32/lib/libjsmn.a b/tools/sdk/esp32/lib/libjsmn.a index 27f00e9adaf..a6509ab8b8e 100644 Binary files a/tools/sdk/esp32/lib/libjsmn.a and b/tools/sdk/esp32/lib/libjsmn.a differ diff --git a/tools/sdk/esp32/lib/libjson.a b/tools/sdk/esp32/lib/libjson.a index 69c26e785a0..b3a4873de1a 100644 Binary files a/tools/sdk/esp32/lib/libjson.a and b/tools/sdk/esp32/lib/libjson.a differ diff --git a/tools/sdk/esp32/lib/libjson_generator.a b/tools/sdk/esp32/lib/libjson_generator.a index bfdbd94b366..76f218588d4 100644 Binary files a/tools/sdk/esp32/lib/libjson_generator.a and b/tools/sdk/esp32/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32/lib/libjson_parser.a b/tools/sdk/esp32/lib/libjson_parser.a index fe7a851045c..b2eb438b107 100644 Binary files a/tools/sdk/esp32/lib/libjson_parser.a and b/tools/sdk/esp32/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32/lib/liblibsodium.a b/tools/sdk/esp32/lib/liblibsodium.a index 085b4d17e31..3392d15a524 100644 Binary files a/tools/sdk/esp32/lib/liblibsodium.a and b/tools/sdk/esp32/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32/lib/liblog.a b/tools/sdk/esp32/lib/liblog.a index 2f43504becf..3a6822a1342 100644 Binary files a/tools/sdk/esp32/lib/liblog.a and b/tools/sdk/esp32/lib/liblog.a differ diff --git a/tools/sdk/esp32/lib/liblwip.a b/tools/sdk/esp32/lib/liblwip.a index dbbaeb4c1f1..c0a2e25de94 100644 Binary files a/tools/sdk/esp32/lib/liblwip.a and b/tools/sdk/esp32/lib/liblwip.a differ diff --git a/tools/sdk/esp32/lib/libmbedcrypto.a b/tools/sdk/esp32/lib/libmbedcrypto.a index 6df8dd9f9b5..96c283d83ce 100644 Binary files a/tools/sdk/esp32/lib/libmbedcrypto.a and b/tools/sdk/esp32/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32/lib/libmbedtls.a b/tools/sdk/esp32/lib/libmbedtls.a index 3794e691d3f..547d0b287d9 100644 Binary files a/tools/sdk/esp32/lib/libmbedtls.a and b/tools/sdk/esp32/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32/lib/libmbedx509.a b/tools/sdk/esp32/lib/libmbedx509.a index 40fb853c694..4ee780f422c 100644 Binary files a/tools/sdk/esp32/lib/libmbedx509.a and b/tools/sdk/esp32/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32/lib/libmdns.a b/tools/sdk/esp32/lib/libmdns.a index 5c5733c1005..c86f44c8890 100644 Binary files a/tools/sdk/esp32/lib/libmdns.a and b/tools/sdk/esp32/lib/libmdns.a differ diff --git a/tools/sdk/esp32/lib/libmqtt.a b/tools/sdk/esp32/lib/libmqtt.a index 88ba89282c2..901f5188ef8 100644 Binary files a/tools/sdk/esp32/lib/libmqtt.a and b/tools/sdk/esp32/lib/libmqtt.a differ diff --git a/tools/sdk/esp32/lib/libnewlib.a b/tools/sdk/esp32/lib/libnewlib.a index 060438303f7..7400ed41d3a 100644 Binary files a/tools/sdk/esp32/lib/libnewlib.a and b/tools/sdk/esp32/lib/libnewlib.a differ diff --git a/tools/sdk/esp32/lib/libnghttp.a b/tools/sdk/esp32/lib/libnghttp.a index 6923096adb4..f621ad2ac1a 100644 Binary files a/tools/sdk/esp32/lib/libnghttp.a and b/tools/sdk/esp32/lib/libnghttp.a differ diff --git a/tools/sdk/esp32/lib/libnvs_flash.a b/tools/sdk/esp32/lib/libnvs_flash.a index 954a4154376..cb89b9f3f5f 100644 Binary files a/tools/sdk/esp32/lib/libnvs_flash.a and b/tools/sdk/esp32/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32/lib/libopenssl.a b/tools/sdk/esp32/lib/libopenssl.a index 10a89bcb4d8..ccda9ad0c26 100644 Binary files a/tools/sdk/esp32/lib/libopenssl.a and b/tools/sdk/esp32/lib/libopenssl.a differ diff --git a/tools/sdk/esp32/lib/libperfmon.a b/tools/sdk/esp32/lib/libperfmon.a index b18a81f0796..170627528da 100644 Binary files a/tools/sdk/esp32/lib/libperfmon.a and b/tools/sdk/esp32/lib/libperfmon.a differ diff --git a/tools/sdk/esp32/lib/libprotobuf-c.a b/tools/sdk/esp32/lib/libprotobuf-c.a index 10bd9d798fd..714ec747e43 100644 Binary files a/tools/sdk/esp32/lib/libprotobuf-c.a and b/tools/sdk/esp32/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32/lib/libprotocomm.a b/tools/sdk/esp32/lib/libprotocomm.a index 2c60bbf5d28..d00ca4bdf6b 100644 Binary files a/tools/sdk/esp32/lib/libprotocomm.a and b/tools/sdk/esp32/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32/lib/libpthread.a b/tools/sdk/esp32/lib/libpthread.a index 6820001b4a6..d650405e7ed 100644 Binary files a/tools/sdk/esp32/lib/libpthread.a and b/tools/sdk/esp32/lib/libpthread.a differ diff --git a/tools/sdk/esp32/lib/libqrcode.a b/tools/sdk/esp32/lib/libqrcode.a index c807dcdc626..d1d7f02bea6 100644 Binary files a/tools/sdk/esp32/lib/libqrcode.a and b/tools/sdk/esp32/lib/libqrcode.a differ diff --git a/tools/sdk/esp32/lib/libsdmmc.a b/tools/sdk/esp32/lib/libsdmmc.a index ae4dc5e145c..3324465e094 100644 Binary files a/tools/sdk/esp32/lib/libsdmmc.a and b/tools/sdk/esp32/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32/lib/libsoc.a b/tools/sdk/esp32/lib/libsoc.a index c34bcc79c01..590a2741ff4 100644 Binary files a/tools/sdk/esp32/lib/libsoc.a and b/tools/sdk/esp32/lib/libsoc.a differ diff --git a/tools/sdk/esp32/lib/libspi_flash.a b/tools/sdk/esp32/lib/libspi_flash.a index af59323f6b4..4d3a2870b01 100644 Binary files a/tools/sdk/esp32/lib/libspi_flash.a and b/tools/sdk/esp32/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32/lib/libspiffs.a b/tools/sdk/esp32/lib/libspiffs.a index bf85b73f676..2c076a1faa9 100644 Binary files a/tools/sdk/esp32/lib/libspiffs.a and b/tools/sdk/esp32/lib/libspiffs.a differ diff --git a/tools/sdk/esp32/lib/libtcp_transport.a b/tools/sdk/esp32/lib/libtcp_transport.a index 85ddde6be1a..94734fd61db 100644 Binary files a/tools/sdk/esp32/lib/libtcp_transport.a and b/tools/sdk/esp32/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32/lib/libtcpip_adapter.a b/tools/sdk/esp32/lib/libtcpip_adapter.a index f7b58bfd987..d8d85191987 100644 Binary files a/tools/sdk/esp32/lib/libtcpip_adapter.a and b/tools/sdk/esp32/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32/lib/libulp.a b/tools/sdk/esp32/lib/libulp.a index e34e2d82bca..3ae1b1d7236 100644 Binary files a/tools/sdk/esp32/lib/libulp.a and b/tools/sdk/esp32/lib/libulp.a differ diff --git a/tools/sdk/esp32/lib/libunity.a b/tools/sdk/esp32/lib/libunity.a index fd7add9ceb4..128b6bff2a9 100644 Binary files a/tools/sdk/esp32/lib/libunity.a and b/tools/sdk/esp32/lib/libunity.a differ diff --git a/tools/sdk/esp32/lib/libvfs.a b/tools/sdk/esp32/lib/libvfs.a index 9fd4a3bbfe1..8c67e48381f 100644 Binary files a/tools/sdk/esp32/lib/libvfs.a and b/tools/sdk/esp32/lib/libvfs.a differ diff --git a/tools/sdk/esp32/lib/libwear_levelling.a b/tools/sdk/esp32/lib/libwear_levelling.a index 0174bf52dd7..446b342c1a8 100644 Binary files a/tools/sdk/esp32/lib/libwear_levelling.a and b/tools/sdk/esp32/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32/lib/libwifi_provisioning.a b/tools/sdk/esp32/lib/libwifi_provisioning.a index e49b49f5005..060bd899af6 100644 Binary files a/tools/sdk/esp32/lib/libwifi_provisioning.a and b/tools/sdk/esp32/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32/lib/libwpa_supplicant.a b/tools/sdk/esp32/lib/libwpa_supplicant.a index 4138ef7c7db..cad6cac0378 100644 Binary files a/tools/sdk/esp32/lib/libwpa_supplicant.a and b/tools/sdk/esp32/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32/lib/libws2812_led.a b/tools/sdk/esp32/lib/libws2812_led.a index 955423b65d9..587927e2001 100644 Binary files a/tools/sdk/esp32/lib/libws2812_led.a and b/tools/sdk/esp32/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32/lib/libxtensa.a b/tools/sdk/esp32/lib/libxtensa.a index 8eb391f1d7b..35fd0f12888 100644 Binary files a/tools/sdk/esp32/lib/libxtensa.a and b/tools/sdk/esp32/lib/libxtensa.a differ diff --git a/tools/sdk/esp32/sdkconfig b/tools/sdk/esp32/sdkconfig index e3b21703335..7f815ed1649 100644 --- a/tools/sdk/esp32/sdkconfig +++ b/tools/sdk/esp32/sdkconfig @@ -317,8 +317,6 @@ CONFIG_BTDM_CTRL_FULL_SCAN_SUPPORTED=y CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_SUPP=y CONFIG_BTDM_BLE_ADV_REPORT_FLOW_CTRL_NUM=100 CONFIG_BTDM_BLE_ADV_REPORT_DISCARD_THRSHOLD=20 -CONFIG_BTDM_COEX_BT_OPTIONS=y -CONFIG_BTDM_COEX_BLE_ADV_HIGH_PRIORITY=y # end of Bluetooth controller(ESP32 Dual Mode Bluetooth) CONFIG_BT_CTRL_MODE_EFF=1 @@ -586,6 +584,7 @@ CONFIG_ESP32_XTAL_FREQ_AUTO=y CONFIG_ESP32_XTAL_FREQ=0 # CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set # CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set # CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set CONFIG_ESP32_DPORT_DIS_INTERRUPT_LVL=5 # end of ESP32-specific @@ -704,6 +703,16 @@ CONFIG_ESP_NETIF_TCPIP_LWIP=y CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y # end of ESP NETIF Adapter +# +# PHY +# +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +CONFIG_ESP32_REDUCE_PHY_TX_POWER=y +# end of PHY + # # Power Management # @@ -717,6 +726,7 @@ CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set # # Memory protection @@ -793,16 +803,6 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # end of Wi-Fi -# -# PHY -# -CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -CONFIG_ESP32_REDUCE_PHY_TX_POWER=y -# end of PHY - # # Core dump # @@ -1652,6 +1652,7 @@ CONFIG_POST_EVENTS_FROM_IRAM_ISR=y # CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +CONFIG_REDUCE_PHY_TX_POWER=y # CONFIG_ESP32S2_PANIC_PRINT_HALT is not set CONFIG_ESP32S2_PANIC_PRINT_REBOOT=y # CONFIG_ESP32S2_PANIC_SILENT_REBOOT is not set @@ -1676,7 +1677,6 @@ CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y CONFIG_IPC_TASK_STACK_SIZE=1024 CONFIG_TIMER_TASK_STACK_SIZE=4096 CONFIG_SW_COEXIST_ENABLE=y -CONFIG_REDUCE_PHY_TX_POWER=y # CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set # CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin index bf6e5901b28..f9b3bb1769f 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin index c381d44661e..31afc003e74 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin index c91659fb06f..df16831a5d3 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin index 11b427f4642..80517f83a57 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin index 483f7c8bef8..ae89a51d5ad 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin index 9c35665d235..2cdb6f2c5f3 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin index 0a1a639e46e..7e4fdbd45ca 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin index 134aabdcc92..83c19d2c864 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32c3/include/asio/port/include/esp_asio_config.h b/tools/sdk/esp32c3/include/asio/port/include/esp_asio_config.h index bcf8c38d40e..cba316527e6 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/esp_asio_config.h +++ b/tools/sdk/esp32c3/include/asio/port/include/esp_asio_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_CONFIG_H_ #define _ESP_ASIO_CONFIG_H_ diff --git a/tools/sdk/esp32c3/include/asio/port/include/esp_exception.h b/tools/sdk/esp32c3/include/asio/port/include/esp_exception.h index cbf20d7a639..6f88866a4ea 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/esp_exception.h +++ b/tools/sdk/esp32c3/include/asio/port/include/esp_exception.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_EXCEPTION_H_ #define _ESP_EXCEPTION_H_ diff --git a/tools/sdk/esp32c3/include/asio/port/include/openssl/conf.h b/tools/sdk/esp32c3/include/asio/port/include/openssl/conf.h index f125c3e6cf7..1ed025d93c1 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/openssl/conf.h +++ b/tools/sdk/esp32c3/include/asio/port/include/openssl/conf.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_CONF_H #define _ESP_ASIO_OPENSSL_CONF_H diff --git a/tools/sdk/esp32c3/include/asio/port/include/openssl/dh.h b/tools/sdk/esp32c3/include/asio/port/include/openssl/dh.h index def713cfd3d..af72e083aa7 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/openssl/dh.h +++ b/tools/sdk/esp32c3/include/asio/port/include/openssl/dh.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_DH_STUB_H #define _ESP_ASIO_OPENSSL_DH_STUB_H diff --git a/tools/sdk/esp32c3/include/asio/port/include/openssl/esp_asio_openssl_stubs.h b/tools/sdk/esp32c3/include/asio/port/include/openssl/esp_asio_openssl_stubs.h index fde5231722b..50627741079 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/openssl/esp_asio_openssl_stubs.h +++ b/tools/sdk/esp32c3/include/asio/port/include/openssl/esp_asio_openssl_stubs.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_STUBS_H #define _ESP_ASIO_OPENSSL_STUBS_H diff --git a/tools/sdk/esp32c3/include/asio/port/include/openssl/rsa.h b/tools/sdk/esp32c3/include/asio/port/include/openssl/rsa.h index 5d9d10e82be..53018a33a8f 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/openssl/rsa.h +++ b/tools/sdk/esp32c3/include/asio/port/include/openssl/rsa.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_RSA_STUB_H #define _ESP_ASIO_OPENSSL_RSA_STUB_H diff --git a/tools/sdk/esp32c3/include/asio/port/include/openssl/x509v3.h b/tools/sdk/esp32c3/include/asio/port/include/openssl/x509v3.h index 5ae8e784352..dad7475424a 100644 --- a/tools/sdk/esp32c3/include/asio/port/include/openssl/x509v3.h +++ b/tools/sdk/esp32c3/include/asio/port/include/openssl/x509v3.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_X509V3_STUB_H #define _ESP_ASIO_OPENSSL_X509V3_STUB_H diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_clock.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_clock.h index 98546e8290a..6b71f68f380 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_clock.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_clock.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h index 0723d195124..4d50649e019 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_common.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash.h index 8bf74852523..73aa48923d0 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash_config.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash_config.h index 6074faca2bc..8b802211325 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash_config.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_flash_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_mem.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_mem.h index bc54833ff3f..21c7114ce4c 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_mem.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_mem.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_random.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_random.h index 0c7b61eb9bc..44e988b0b25 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_random.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_random.h @@ -1,16 +1,8 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,33 +13,38 @@ extern "C" { #endif /** - * @brief Enable early entropy source for RNG + * @brief Enable an entropy source for RNG if RF is disabled * - * Uses the SAR ADC to feed entropy into the HWRNG. The ADC is put - * into a test mode that reads an internal reference voltage and - * constantly feeds the LSB of data into the HWRNG. Consult the - * SoC Technical Reference Manual for more information. + * The exact internal entropy source mechanism depends on the chip in use but + * all SoCs use the SAR ADC to continuously mix random bits (an internal + * noise reading) into the HWRNG. Consult the SoC Technical Reference + * Manual for more information. * * Can also be used from app code early during operation, if true - * random numbers are required before WiFi stack is initialised. - * Call this function from app code only if WiFi/BT are not yet - * enabled and I2S and ADC are not in use. - * - * Call bootloader_random_disable() when done. + * random numbers are required before RF is initialised. Consult + * ESP-IDF Programming Guide "Random Number Generation" section for + * details. */ void bootloader_random_enable(void); /** - * @brief Disable early entropy source for RNG + * @brief Disable entropy source for RNG * - * Disables SAR ADC source and resets the I2S hardware. + * Disables internal entropy source. Must be called after + * bootloader_random_enable() and before RF features, ADC, or + * I2S (ESP32 only) are initialized. * + * Consult the ESP-IDF Programming Guide "Random Number Generation" + * section for details. */ void bootloader_random_disable(void); /** * @brief Fill buffer with 'length' random bytes * + * @note If this function is being called from app code only, and never + * from the bootloader, then it's better to call esp_fill_random(). + * * @param buffer Pointer to buffer * @param length This many bytes of random data will be copied to buffer */ diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_util.h b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_util.h index a1b8d89c95a..c44c80619c2 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_util.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/bootloader_util.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_app_format.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_app_format.h index 20237728dae..9be8784d3b2 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_app_format.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_app_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_data_types.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_data_types.h index fda6d5c645e..7b4171fdd32 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_data_types.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_data_types.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning esp_flash_data_types.h has been merged into esp_flash_partitions.h, please include esp_flash_partitions.h instead #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_encrypt.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_encrypt.h index 33e6aabed24..1fecd33bc74 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_encrypt.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_encrypt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_partitions.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_partitions.h index 1fc9d4f6c1b..b1a83640ce1 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_partitions.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_flash_partitions.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_err.h" @@ -42,6 +34,9 @@ extern "C" { #define PART_FLAG_ENCRYPTED (1<<0) +/* The md5sum value is found this many bytes after the ESP_PARTITION_MAGIC_MD5 offset */ +#define ESP_PARTITION_MD5_OFFSET 16 + /* Pre-partition table fixed flash offsets */ #define ESP_BOOTLOADER_DIGEST_OFFSET 0x0 #define ESP_BOOTLOADER_OFFSET CONFIG_BOOTLOADER_OFFSET_IN_FLASH /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_image_format.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_image_format.h index 7e7e6a28e17..1db62442537 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_image_format.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_image_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32c3/include/bootloader_support/include/esp_secure_boot.h b/tools/sdk/esp32c3/include/bootloader_support/include/esp_secure_boot.h index 94118c327c9..b9436a43448 100644 --- a/tools/sdk/esp32c3/include/bootloader_support/include/esp_secure_boot.h +++ b/tools/sdk/esp32c3/include/bootloader_support/include/esp_secure_boot.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32c3/include/config/sdkconfig.h b/tools/sdk/esp32c3/include/config/sdkconfig.h index 789744cadc9..a4f8f693c39 100644 --- a/tools/sdk/esp32c3/include/config/sdkconfig.h +++ b/tools/sdk/esp32c3/include/config/sdkconfig.h @@ -214,6 +214,9 @@ #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 #define CONFIG_ESP_NETIF_TCPIP_LWIP 1 #define CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER 1 +#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 +#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 +#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 #define CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP 1 #define CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT 1 #define CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE 1 @@ -256,8 +259,9 @@ #define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 #define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 #define CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE 1 -#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 -#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 +#define CONFIG_ESP_WIFI_FTM_ENABLE 1 +#define CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT 1 +#define CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_437 1 #define CONFIG_FATFS_CODEPAGE 437 @@ -374,6 +378,7 @@ #define CONFIG_MBEDTLS_CERTIFICATE_BUNDLE 1 #define CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL 1 #define CONFIG_MBEDTLS_HARDWARE_AES 1 +#define CONFIG_MBEDTLS_AES_USE_INTERRUPT 1 #define CONFIG_MBEDTLS_HARDWARE_MPI 1 #define CONFIG_MBEDTLS_HARDWARE_SHA 1 #define CONFIG_MBEDTLS_ROM_MD5 1 @@ -605,5 +610,5 @@ #define CONFIG_TIMER_TASK_STACK_SIZE CONFIG_ESP_TIMER_TASK_STACK_SIZE #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE -#define CONFIG_ARDUINO_IDF_COMMIT "c13afea63" +#define CONFIG_ARDUINO_IDF_COMMIT "1d7068e4b" #define CONFIG_ARDUINO_IDF_BRANCH "master" diff --git a/tools/sdk/esp32c3/include/console/esp_console.h b/tools/sdk/esp32c3/include/console/esp_console.h index 29aab8b4fb7..a0b7cbf1783 100644 --- a/tools/sdk/esp32c3/include/console/esp_console.h +++ b/tools/sdk/esp32c3/include/console/esp_console.h @@ -1,16 +1,8 @@ -// Copyright 2016-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/adc.h b/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/adc.h index 2678a9e61e1..7567c7b2a1d 100644 --- a/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/adc.h +++ b/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/adc.h @@ -1,15 +1,8 @@ -// Copyright 2019-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/temp_sensor.h b/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/temp_sensor.h index 2eccefcf0f8..9e227c71d6a 100644 --- a/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/temp_sensor.h +++ b/tools/sdk/esp32c3/include/driver/esp32c3/include/driver/temp_sensor.h @@ -1,16 +1,8 @@ -// Copyright 2010-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/adc2_wifi_private.h b/tools/sdk/esp32c3/include/driver/include/driver/adc2_wifi_private.h index c4f622658d4..71481213a31 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/adc2_wifi_private.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/adc2_wifi_private.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/adc_common.h b/tools/sdk/esp32c3/include/driver/include/driver/adc_common.h index f083b32d24f..3fa15d7143d 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/adc_common.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/adc_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/can.h b/tools/sdk/esp32c3/include/driver/include/driver/can.h index e28a9c443f1..ec4c0e15dfe 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/can.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/can.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/dac_common.h b/tools/sdk/esp32c3/include/driver/include/driver/dac_common.h index b1aefc9539f..f0f2ecadaea 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/dac_common.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/dac_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/dedic_gpio.h b/tools/sdk/esp32c3/include/driver/include/driver/dedic_gpio.h index f381e2c64b0..0a40c179b89 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/dedic_gpio.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/dedic_gpio.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/gpio.h b/tools/sdk/esp32c3/include/driver/include/driver/gpio.h index 3e497e04b2c..0912c831b53 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/gpio.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "sdkconfig.h" diff --git a/tools/sdk/esp32c3/include/driver/include/driver/i2c.h b/tools/sdk/esp32c3/include/driver/include/driver/i2c.h index a2076cc459d..bbff4aad2f7 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/i2c.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/i2c.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_I2C_H_ #define _DRIVER_I2C_H_ @@ -97,6 +89,9 @@ esp_err_t i2c_driver_install(i2c_port_t i2c_num, i2c_mode_t mode, size_t slv_rx_ /** * @brief I2C driver delete * + * @note This function does not guarantee thread safety. + * Please make sure that no thread will continuously hold semaphores before calling the delete function. + * * @param i2c_num I2C port number * * @return diff --git a/tools/sdk/esp32c3/include/driver/include/driver/i2s.h b/tools/sdk/esp32c3/include/driver/include/driver/i2s.h index 6b53db68a2a..4ee73b594d7 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/i2s.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/ledc.h b/tools/sdk/esp32c3/include/driver/include/driver/ledc.h index 69660f3dda0..c1dc6d4d8c7 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/ledc.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/ledc.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h index c19b80e4f18..8774941e482 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/pcnt.h b/tools/sdk/esp32c3/include/driver/include/driver/pcnt.h index 6236e5407c1..1e5af9c1efd 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/pcnt.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/pcnt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/periph_ctrl.h b/tools/sdk/esp32c3/include/driver/include/driver/periph_ctrl.h index 3c6ff8503c7..adba0533cfb 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/periph_ctrl.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/periph_ctrl.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_PERIPH_CTRL_H_ #define _DRIVER_PERIPH_CTRL_H_ diff --git a/tools/sdk/esp32c3/include/driver/include/driver/rmt.h b/tools/sdk/esp32c3/include/driver/include/driver/rmt.h index ef9d58107d8..a7e2aad5f24 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/rmt.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/rmt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/rtc_cntl.h b/tools/sdk/esp32c3/include/driver/include/driver/rtc_cntl.h index 44fd015096b..2a0f5916c08 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/rtc_cntl.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/rtc_cntl.h @@ -1,16 +1,8 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/rtc_io.h b/tools/sdk/esp32c3/include/driver/include/driver/rtc_io.h index 4cdcf74ba48..cbf32c4fc04 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/rtc_io.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/rtc_io.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_RTC_GPIO_H_ #define _DRIVER_RTC_GPIO_H_ diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sdio_slave.h b/tools/sdk/esp32c3/include/driver/include/driver/sdio_slave.h index c1bc1fb7a5e..8adee65dfff 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sdio_slave.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sdio_slave.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SDIO_SLAVE_H_ #define _DRIVER_SDIO_SLAVE_H_ diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_defs.h b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_defs.h index 4f1e6ddc6b7..54e051f354e 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_defs.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_defs.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_host.h b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_host.h index e9da4ae1904..ff5ae71d011 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_host.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -59,8 +51,26 @@ extern "C" { * Extra configuration for SDMMC peripheral slot */ typedef struct { - gpio_num_t gpio_cd; ///< GPIO number of card detect signal - gpio_num_t gpio_wp; ///< GPIO number of write protect signal +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + gpio_num_t clk; ///< GPIO number of CLK signal. + gpio_num_t cmd; ///< GPIO number of CMD signal. + gpio_num_t d0; ///< GPIO number of D0 signal. + gpio_num_t d1; ///< GPIO number of D1 signal. + gpio_num_t d2; ///< GPIO number of D2 signal. + gpio_num_t d3; ///< GPIO number of D3 signal. + gpio_num_t d4; ///< GPIO number of D4 signal. Ignored in 1- or 4- line mode. + gpio_num_t d5; ///< GPIO number of D5 signal. Ignored in 1- or 4- line mode. + gpio_num_t d6; ///< GPIO number of D6 signal. Ignored in 1- or 4- line mode. + gpio_num_t d7; ///< GPIO number of D7 signal. Ignored in 1- or 4- line mode. +#endif // SOC_SDMMC_USE_GPIO_MATRIX + union { + gpio_num_t gpio_cd; ///< GPIO number of card detect signal + gpio_num_t cd; ///< GPIO number of card detect signal; shorter name. + }; + union { + gpio_num_t gpio_wp; ///< GPIO number of write protect signal + gpio_num_t wp; ///< GPIO number of write protect signal; shorter name. + }; uint8_t width; ///< Bus width used by the slot (might be less than the max width supported) uint32_t flags; ///< Features used by this slot #define SDMMC_SLOT_FLAG_INTERNAL_PULLUP BIT(0) @@ -72,18 +82,44 @@ typedef struct { #define SDMMC_SLOT_NO_CD GPIO_NUM_NC ///< indicates that card detect line is not used #define SDMMC_SLOT_NO_WP GPIO_NUM_NC ///< indicates that write protect line is not used -#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the default width for the slot (8 for slot 0, 4 for slot 1) +#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the maximum possible width for the slot + +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + +/** + * Macro defining default configuration of SDMMC host slot + */ +#define SDMMC_SLOT_CONFIG_DEFAULT() {\ + .clk = GPIO_NUM_14, \ + .cmd = GPIO_NUM_15, \ + .d0 = GPIO_NUM_2, \ + .d1 = GPIO_NUM_4, \ + .d2 = GPIO_NUM_12, \ + .d3 = GPIO_NUM_13, \ + .d4 = GPIO_NUM_33, \ + .d5 = GPIO_NUM_34, \ + .d6 = GPIO_NUM_35, \ + .d7 = GPIO_NUM_36, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ + .width = SDMMC_SLOT_WIDTH_DEFAULT, \ + .flags = 0, \ +} + +#else // SOC_SDMMC_USE_GPIO_MATRIX /** * Macro defining default configuration of SDMMC host slot */ #define SDMMC_SLOT_CONFIG_DEFAULT() {\ - .gpio_cd = SDMMC_SLOT_NO_CD, \ - .gpio_wp = SDMMC_SLOT_NO_WP, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ .width = SDMMC_SLOT_WIDTH_DEFAULT, \ .flags = 0, \ } +#endif // SOC_SDMMC_USE_GPIO_MATRIX + /** * @brief Initialize SDMMC host peripheral * @@ -226,6 +262,9 @@ esp_err_t sdmmc_host_deinit(void); /** * @brief Enable the pull-ups of sd pins. * + * This function is deprecated. Please set SDMMC_SLOT_FLAG_INTERNAL_PULLUP flag in + * sdmmc_slot_config_t::flags instead. + * * @note You should always place actual pullups on the lines instead of using * this function. Internal pullup resistance are high and not sufficient, may * cause instability in products. This is for debug or examples only. @@ -238,7 +277,7 @@ esp_err_t sdmmc_host_deinit(void); * - ESP_ERR_INVALID_ARG: if configured width larger than maximum the slot can * support */ -esp_err_t sdmmc_host_pullup_en(int slot, int width); +esp_err_t sdmmc_host_pullup_en(int slot, int width) __attribute__((deprecated)); #ifdef __cplusplus } diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_types.h b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_types.h index 25310830261..cbb796fdbb3 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_types.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sdmmc_types.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sdspi_host.h b/tools/sdk/esp32c3/include/driver/include/driver/sdspi_host.h index 860ba1bfed4..abb690c39bc 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sdspi_host.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sdspi_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/sigmadelta.h b/tools/sdk/esp32c3/include/driver/include/driver/sigmadelta.h index d7e7eef122c..17f86b308e7 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/sigmadelta.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/sigmadelta.h @@ -1,15 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/spi_common.h b/tools/sdk/esp32c3/include/driver/include/driver/spi_common.h index 5fee265c0ad..a36f55a87f9 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/spi_common.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/spi_common.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/spi_common_internal.h b/tools/sdk/esp32c3/include/driver/include/driver/spi_common_internal.h index b490efeb7e0..31baaa75d70 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/spi_common_internal.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/spi_common_internal.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header, don't use it in the user code diff --git a/tools/sdk/esp32c3/include/driver/include/driver/spi_master.h b/tools/sdk/esp32c3/include/driver/include/driver/spi_master.h index e6ed8c5a0af..da5f5b52144 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/spi_master.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/spi_master.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/spi_slave.h b/tools/sdk/esp32c3/include/driver/include/driver/spi_slave.h index f03104bbc4d..92fa6004860 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/spi_slave.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/spi_slave.h @@ -1,16 +1,8 @@ -// Copyright 2010-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SPI_SLAVE_H_ diff --git a/tools/sdk/esp32c3/include/driver/include/driver/spi_slave_hd.h b/tools/sdk/esp32c3/include/driver/include/driver/spi_slave_hd.h index b99d6feae23..5d6ff4c2b9e 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/spi_slave_hd.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/spi_slave_hd.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/timer.h b/tools/sdk/esp32c3/include/driver/include/driver/timer.h index 609d1006add..204fc9db27d 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/timer.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/timer.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/touch_pad.h b/tools/sdk/esp32c3/include/driver/include/driver/touch_pad.h index 4b7a021f558..0c2feebd8af 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/touch_pad.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/touch_pad.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/touch_sensor_common.h b/tools/sdk/esp32c3/include/driver/include/driver/touch_sensor_common.h index f9855bc9dc3..e49c7d5de72 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/touch_sensor_common.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/touch_sensor_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/twai.h b/tools/sdk/esp32c3/include/driver/include/driver/twai.h index 0cb744008ab..ce616fe1251 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/twai.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/twai.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/uart.h b/tools/sdk/esp32c3/include/driver/include/driver/uart.h index 7269b3fa144..311f21a8334 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/uart.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/uart.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/driver/include/driver/uart_select.h b/tools/sdk/esp32c3/include/driver/include/driver/uart_select.h index f7a21a315b6..578f8c9d901 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/uart_select.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/uart_select.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _UART_SELECT_H_ #define _UART_SELECT_H_ diff --git a/tools/sdk/esp32c3/include/driver/include/esp_private/adc_cali.h b/tools/sdk/esp32c3/include/driver/include/esp_private/adc_cali.h index ab577a3121e..9c8a58d6d88 100644 --- a/tools/sdk/esp32c3/include/driver/include/esp_private/adc_cali.h +++ b/tools/sdk/esp32c3/include/driver/include/esp_private/adc_cali.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header for calibration, don't use in app diff --git a/tools/sdk/esp32c3/include/driver/include/esp_private/gdma.h b/tools/sdk/esp32c3/include/driver/include/esp_private/gdma.h index 2614a2d0fb3..5b548e0868e 100644 --- a/tools/sdk/esp32c3/include/driver/include/esp_private/gdma.h +++ b/tools/sdk/esp32c3/include/driver/include/esp_private/gdma.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // DO NOT USE THESE APIS IN ANY APPLICATIONS // GDMA driver is not public for end users, but for ESP-IDF developpers. diff --git a/tools/sdk/esp32c3/include/driver/include/esp_private/gpio.h b/tools/sdk/esp32c3/include/driver/include/esp_private/gpio.h index 1c4811393c0..c4227dc8c4f 100644 --- a/tools/sdk/esp32c3/include/driver/include/esp_private/gpio.h +++ b/tools/sdk/esp32c3/include/driver/include/esp_private/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse.h b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse.h index 9ae3ab08df9..9a07a7e0512 100644 --- a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse.h +++ b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_rtc_calib.h b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_rtc_calib.h index 5dc007f8c5f..0e059c4f3f1 100644 --- a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_rtc_calib.h +++ b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_rtc_calib.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at", -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #include #include diff --git a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_table.h b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_table.h index a6d4ca27f0b..465d5c29f8a 100644 --- a/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_table.h +++ b/tools/sdk/esp32c3/include/efuse/esp32c3/include/esp_efuse_table.h @@ -1,29 +1,22 @@ -// Copyright 2017-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at", -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifdef __cplusplus extern "C" { #endif -// md5_digest_table 61baa79d296df996c838bc2adc1837e5 +// md5_digest_table 9e42b2f9dd879191ca75ad0cf50841a1 // This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY. // If you want to change some fields, you need to change esp_efuse_table.csv file // then run `efuse_common_table` or `efuse_custom_table` command it will generate this file. // To show efuse_table run the command 'show_efuse_table'. +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_GROUP_1[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_GROUP_2[]; @@ -50,6 +43,7 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY3[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY4[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY5[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SYS_DATA_PART2[]; +extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY0[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY1[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY2[]; diff --git a/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h b/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h index 019657938ac..e84975e587d 100644 --- a/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h b/tools/sdk/esp32c3/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h index 2336a9cebc2..803023ecdd8 100644 --- a/tools/sdk/esp32c3/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h +++ b/tools/sdk/esp32c3/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_CRYPTO_H #define _ESP_TLS_CRYPTO_H diff --git a/tools/sdk/esp32c3/include/esp-tls/esp_tls.h b/tools/sdk/esp32c3/include/esp-tls/esp_tls.h index 72a78c5e7d9..9330f9dd699 100644 --- a/tools/sdk/esp32c3/include/esp-tls/esp_tls.h +++ b/tools/sdk/esp32c3/include/esp-tls/esp_tls.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_H_ #define _ESP_TLS_H_ @@ -171,7 +163,10 @@ typedef struct esp_tls_cfg { void *ds_data; /*!< Pointer for digital signature peripheral context */ bool is_plain_tcp; /*!< Use non-TLS connection: When set to true, the esp-tls uses - plain TCP transport rather then TLS/SSL connection */ + plain TCP transport rather then TLS/SSL connection. + Note, that it is possible to connect using a plain tcp transport + directly with esp_tls_plain_tcp_connect() API */ + struct ifreq *if_name; /*!< The name of interface for data to go through. Use the default interface without setting */ } esp_tls_cfg_t; @@ -599,6 +594,21 @@ int esp_tls_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp_tls void esp_tls_server_session_delete(esp_tls_t *tls); #endif /* ! CONFIG_ESP_TLS_SERVER */ +/** + * @brief Creates a plain TCP connection, returning a valid socket fd on success or an error handle + * + * @param[in] host Hostname of the host. + * @param[in] hostlen Length of hostname. + * @param[in] port Port number of the host. + * @param[in] cfg ESP-TLS configuration as esp_tls_cfg_t. + * @param[out] error_handle ESP-TLS error handle holding potential errors occurred during connection + * @param[out] sockfd Socket descriptor if successfully connected on TCP layer + * @return ESP_OK on success + * ESP_ERR_INVALID_ARG if invalid output parameters + * ESP-TLS based error codes on failure + */ +esp_err_t esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_error_handle_t error_handle, int *sockfd); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/esp-tls/esp_tls_errors.h b/tools/sdk/esp32c3/include/esp-tls/esp_tls_errors.h index bb281b0daea..5dfe74791c5 100644 --- a/tools/sdk/esp32c3/include/esp-tls/esp_tls_errors.h +++ b/tools/sdk/esp32c3/include/esp-tls/esp_tls_errors.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_ERRORS_H_ #define _ESP_TLS_ERRORS_H_ diff --git a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_error_capture_internal.h b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_error_capture_internal.h index fd065b2be4f..a59a3b7b344 100644 --- a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_error_capture_internal.h +++ b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_error_capture_internal.h @@ -1,16 +1,8 @@ -// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ #define __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ diff --git a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_mbedtls.h b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_mbedtls.h index 7440f0c3c74..78694fc858e 100644 --- a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_mbedtls.h +++ b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_mbedtls.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_wolfssl.h b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_wolfssl.h index f29e9332f86..a0c86730b7d 100644 --- a/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_wolfssl.h +++ b/tools/sdk/esp32c3/include/esp-tls/private_include/esp_tls_wolfssl.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32c3/include/esp_gdbstub/include/esp_gdbstub.h b/tools/sdk/esp32c3/include/esp_gdbstub/include/esp_gdbstub.h index 02fda63e58a..f1e7921de6b 100644 --- a/tools/sdk/esp32c3/include/esp_gdbstub/include/esp_gdbstub.h +++ b/tools/sdk/esp32c3/include/esp_gdbstub/include/esp_gdbstub.h @@ -14,13 +14,12 @@ #pragma once -#include "esp_gdbstub_arch.h" - #ifdef __cplusplus extern "C" { #endif -void esp_gdbstub_panic_handler(esp_gdbstub_frame_t *frame) __attribute__((noreturn)); +void esp_gdbstub_init(void); +void esp_gdbstub_panic_handler(void *frame); #ifdef __cplusplus } diff --git a/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h index 0f89972ff40..f6ef1da340e 100644 --- a/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_CLIENT_H #define _ESP_HTTP_CLIENT_H @@ -158,6 +150,7 @@ typedef enum { HttpStatus_TemporaryRedirect = 307, /* 4xx - Client Error */ + HttpStatus_BadRequest = 400, HttpStatus_Unauthorized = 401, HttpStatus_Forbidden = 403, HttpStatus_NotFound = 404, diff --git a/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h index 445d0c0c274..d14a943c108 100644 --- a/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32c3/include/esp_http_server/include/esp_http_server.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_SERVER_H_ #define _ESP_HTTP_SERVER_H_ diff --git a/tools/sdk/esp32c3/include/esp_http_server/include/http_server.h b/tools/sdk/esp32c3/include/esp_http_server/include/http_server.h index 56f73c5b74c..e28eb0af68d 100644 --- a/tools/sdk/esp32c3/include/esp_http_server/include/http_server.h +++ b/tools/sdk/esp32c3/include/esp_http_server/include/http_server.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning http_server.h has been renamed to esp_http_server.h, please update include directives #include "esp_http_server.h" diff --git a/tools/sdk/esp32c3/include/esp_https_server/include/esp_https_server.h b/tools/sdk/esp32c3/include/esp_https_server/include/esp_https_server.h index 968e74c632f..52f9dc2132a 100644 --- a/tools/sdk/esp32c3/include/esp_https_server/include/esp_https_server.h +++ b/tools/sdk/esp32c3/include/esp_https_server/include/esp_https_server.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTPS_SERVER_H_ #define _ESP_HTTPS_SERVER_H_ diff --git a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_random.h b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_random.h index 7064fa8115c..cf4f408b513 100644 --- a/tools/sdk/esp32c3/include/esp_hw_support/include/esp_random.h +++ b/tools/sdk/esp32c3/include/esp_hw_support/include/esp_random.h @@ -24,27 +24,13 @@ extern "C" { /** * @brief Get one random 32-bit word from hardware RNG * - * The hardware RNG produces true random numbers under any of the following conditions: - * - * - An RF subsystem is running (i.e. Bluetooth or WiFi is enabled) - * - An internal entropy source has been enabled by calling bootloader_random_enable() - * and not yet disabled by calling bootloader_random_disable() - * - While the ESP-IDF bootloader is running (due to the internal entropy source being enabled - * for the duration of bootloader execution). - * - * If none of the above conditions are true, the hardware RNG will produce pseudo-random numbers only. - * - * When the hardware RNG is producing true random numbers, external entropy (noise samples) are - * continuously mixed into the internal hardware RNG state. Consult the SoC Technical Reference Manual - * for more details. + * If Wi-Fi or Bluetooth are enabled, this function returns true random numbers. In other + * situations, if true random numbers are required then consult the ESP-IDF Programming + * Guide "Random Number Generation" section for necessary prerequisites. * * This function automatically busy-waits to ensure enough external entropy has been - * introduced into the hardware RNG state, before returning a new random number. - * - * If generating random numbers from an app which has not yet enabled Bluetooth or Wi-Fi, call the - * API function bootloader_random_enable() before generating random numbers and then call - * bootloader_random_disable() before using any APIs for Bluetooth, Wi-Fi, ADC, or I2S. Consult the - * bootloader_random.h header for more details. + * introduced into the hardware RNG state, before returning a new random number. This delay + * is very short (always less than 100 CPU cycles). * * @return Random value between 0 and UINT32_MAX */ @@ -53,7 +39,8 @@ uint32_t esp_random(void); /** * @brief Fill a buffer with random bytes from hardware RNG * - * @note This function has the same restrictions regarding available entropy as esp_random() + * @note This function is implemented via calls to esp_random(), so the same + * constraints apply. * * @param buf Pointer to buffer to fill with random numbers. * @param len Length of buffer in bytes diff --git a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif.h b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif.h index 20f468739b6..92c937c1294 100644 --- a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif.h +++ b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif.h @@ -237,6 +237,54 @@ void esp_netif_action_disconnected(void *esp_netif, esp_event_base_t base, int32 */ void esp_netif_action_got_ip(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); +/** + * @brief Default building block for network interface action upon IPv6 multicast group join + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_join_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 multicast group leave + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_leave_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address added by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_add_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address removed by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_remove_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + /** * @} */ diff --git a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h index 903a678e008..da01500db1c 100644 --- a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h @@ -73,6 +73,18 @@ extern "C" { .route_prio = 20 \ }; +#define ESP_NETIF_INHERENT_DEFAULT_OPENTHREAD() \ + { \ + .flags = 0, \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(ip_info) \ + .get_ip_event = 0, \ + .lost_ip_event = 0, \ + .if_key = "OT_DEF", \ + .if_desc = "openthread", \ + .route_prio = 15 \ +}; + #define ESP_NETIF_INHERENT_DEFAULT_SLIP() \ { \ .flags = ESP_NETIF_FLAG_IS_SLIP, \ @@ -85,6 +97,7 @@ extern "C" { .route_prio = 16 \ }; + /** * @brief Default configuration reference of ethernet interface */ @@ -162,12 +175,12 @@ extern "C" { #define ESP_NETIF_BASE_DEFAULT_SLIP &_g_esp_netif_inherent_slip_config - #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip +#define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread // // Include default network stacks configs @@ -194,6 +207,27 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#if CONFIG_OPENTHREAD_ENABLED +/** +* @brief Default configuration reference of SLIP client +*/ +#define ESP_NETIF_DEFAULT_OPENTHREAD() \ + { \ + .base = ESP_NETIF_BASE_DEFAULT_OPENTHREAD, \ + .driver = NULL, \ + .stack = ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD, \ + } + +/** + * @brief Default base config (esp-netif inherent) of openthread interface + */ +#define ESP_NETIF_BASE_DEFAULT_OPENTHREAD &_g_esp_netif_inherent_openthread_config + +extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_openthread; +extern const esp_netif_inherent_config_t _g_esp_netif_inherent_openthread_config; + +#endif // CONFIG_OPENTHREAD_ENABLED + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h index 7c68c7172ab..c6a7f3d6236 100644 --- a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h @@ -33,6 +33,8 @@ extern "C" { #define ESP_ERR_ESP_NETIF_DRIVER_ATTACH_FAILED ESP_ERR_ESP_NETIF_BASE + 0x08 #define ESP_ERR_ESP_NETIF_INIT_FAILED ESP_ERR_ESP_NETIF_BASE + 0x09 #define ESP_ERR_ESP_NETIF_DNS_NOT_CONFIGURED ESP_ERR_ESP_NETIF_BASE + 0x0A +#define ESP_ERR_ESP_NETIF_MLD6_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0B +#define ESP_ERR_ESP_NETIF_IP6_ADDR_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0C /** @brief Type of esp_netif_object server */ @@ -125,6 +127,12 @@ typedef struct { int ip_index; /*!< IPv6 address index */ } ip_event_got_ip6_t; +/** Event structure for ADD_IP6 event */ +typedef struct { + esp_ip6_addr_t addr; /*!< The address to be added to the interface */ + bool preferred; /*!< The default preference of the address */ +} ip_event_add_ip6_t; + /** Event structure for IP_EVENT_AP_STAIPASSIGNED event */ typedef struct { esp_ip4_addr_t ip; /*!< IP address which was assigned to the station */ diff --git a/tools/sdk/esp32c3/include/esp_wifi/esp32c3/include/phy_init_data.h b/tools/sdk/esp32c3/include/esp_phy/esp32c3/include/phy_init_data.h similarity index 100% rename from tools/sdk/esp32c3/include/esp_wifi/esp32c3/include/phy_init_data.h rename to tools/sdk/esp32c3/include/esp_phy/esp32c3/include/phy_init_data.h diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_phy_init.h b/tools/sdk/esp32c3/include/esp_phy/include/esp_phy_init.h similarity index 100% rename from tools/sdk/esp32c3/include/esp_wifi/include/esp_phy_init.h rename to tools/sdk/esp32c3/include/esp_phy/include/esp_phy_init.h diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/phy.h b/tools/sdk/esp32c3/include/esp_phy/include/phy.h similarity index 100% rename from tools/sdk/esp32c3/include/esp_wifi/include/phy.h rename to tools/sdk/esp32c3/include/esp_phy/include/phy.h diff --git a/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_md5.h b/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_md5.h index 5bb71f3eb97..0deaca47148 100644 --- a/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_md5.h +++ b/tools/sdk/esp32c3/include/esp_rom/include/esp_rom_md5.h @@ -34,6 +34,8 @@ typedef struct MD5Context { uint8_t in[64]; } md5_context_t; +#define ESP_ROM_MD5_DIGEST_LEN 16 + /** * @brief Initialize the MD5 context * @@ -46,9 +48,9 @@ void esp_rom_md5_init(md5_context_t *context); * * @param context MD5 context which has been initialized by `MD5Init` * @param buf Input buffer - * @param len Buffer length + * @param len Buffer length in bytes */ -void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len); +void esp_rom_md5_update(md5_context_t *context, const void *buf, uint32_t len); /** * @brief Extract the MD5 result, and erase the context @@ -56,7 +58,7 @@ void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len * @param digest Where to store the 128-bit digest value * @param context MD5 context */ -void esp_rom_md5_final(uint8_t digest[16], md5_context_t *context); +void esp_rom_md5_final(uint8_t *digest, md5_context_t *context); #ifdef __cplusplus } diff --git a/tools/sdk/esp32c3/include/esp_system/include/esp_task.h b/tools/sdk/esp32c3/include/esp_system/include/esp_task.h index 105de5994cc..37d78bca6e8 100644 --- a/tools/sdk/esp32c3/include/esp_system/include/esp_task.h +++ b/tools/sdk/esp32c3/include/esp_system/include/esp_task.h @@ -21,6 +21,8 @@ * 4. If the configMAX_PRIORITIES is modified, please make all priority are * greater than 0 * 5. Make sure esp_task.h is consistent between wifi lib and idf + * 6. If changing system task priorities, please check the values documented in /api-guides/performance/speed.rst + * are up to date */ #ifndef _ESP_TASK_H_ diff --git a/tools/sdk/esp32c3/include/espcoredump/include/esp_core_dump.h b/tools/sdk/esp32c3/include/espcoredump/include/esp_core_dump.h index 7d41b97e57f..40fd90d8b26 100644 --- a/tools/sdk/esp32c3/include/espcoredump/include/esp_core_dump.h +++ b/tools/sdk/esp32c3/include/espcoredump/include/esp_core_dump.h @@ -14,10 +14,11 @@ #ifndef ESP_CORE_DUMP_H_ #define ESP_CORE_DUMP_H_ +#include "sdkconfig.h" #include #include "esp_err.h" #include "esp_private/panic_internal.h" -#include "esp_core_dump_summary_extra_info.h" +#include "esp_core_dump_summary_port.h" #ifdef __cplusplus extern "C" { @@ -25,14 +26,7 @@ extern "C" { #define APP_ELF_SHA256_SZ (CONFIG_APP_RETRIEVE_LEN_ELF_SHA + 1) -/** - * @brief Backtrace information - */ -typedef struct { - uint32_t bt[16]; /*!< Backtrace (array of PC) */ - uint32_t depth; /*!< Number of backtrace entries */ - bool corrupted; /*!< Status flag for backtrace is corrupt or not */ -} esp_core_dump_bt_info_t; +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF /** * @brief Core dump summary, Most meaningful contents of the core dump @@ -48,6 +42,8 @@ typedef struct { esp_core_dump_summary_extra_info_t ex_info; /*!< Architecture specific extra data */ } esp_core_dump_summary_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + /**************************************************************************************/ /******************************** EXCEPTION MODE API **********************************/ /**************************************************************************************/ @@ -137,15 +133,32 @@ esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size); */ esp_err_t esp_core_dump_image_erase(void); +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + /** - * @brief Get the summary of a core dump. This function works only with ELF format core dumps. + * @brief Get the summary of a core dump. * * @param summary Summary of the core dump * * @return ESP_OK on success, otherwise \see esp_err_t + * + * @note This function works only if coredump is stored in flash and in ELF format + * + * Example usage: + * @code{c} + * esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t)); + * if (summary) { + * if (esp_core_dump_get_summary(summary) == ESP_OK) { + * // Do stuff + * } + * } + * free(summary); + * @endcode */ esp_err_t esp_core_dump_get_summary(esp_core_dump_summary_t *summary); +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h similarity index 51% rename from tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h index 510fdc06afe..f2b5d0d9e61 100644 --- a/tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #ifdef __cplusplus @@ -19,6 +20,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + +/** + * @brief Backtrace information + * + * For RISCV, backtrace cannot be generated on device without including and parsing + * DWARF sections. Including these sections would increase the binary size so provide + * the stackdump that can be later used to generate backtrace with the help of GDB or by parsing the ELF file + * on the host machine + */ +typedef struct { + uint8_t stackdump[CONFIG_ESP_COREDUMP_SUMMARY_STACKDUMP_SIZE]; /*!< Stack dump of the crashing task. */ + uint32_t dump_size; /*!< Size (in bytes) of the stack dump */ +} esp_core_dump_bt_info_t; + /** * @brief RISC-V architecture specific extra information */ @@ -27,9 +43,13 @@ typedef struct { uint32_t mtvec; /* Machine Trap-Vector Base Address */ uint32_t mcause; /* Machine Trap Cause */ uint32_t mtval; /* Machine Trap Value */ - uint32_t exc_a[8]; /*!< a register set when the exception caused */ + uint32_t ra; /* Return Address */ + uint32_t sp; /* Stack pointer */ + uint32_t exc_a[8]; /* A0-A7 registers when the exception caused */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h similarity index 70% rename from tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h index 3db7a70be82..815c1fff702 100644 --- a/tools/sdk/esp32/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #include @@ -20,8 +21,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + #define EPCx_REGISTER_COUNT XCHAL_NUM_INTLEVELS +/** + * @brief Backtrace information. + * + * For Xtensa, backtrace can be generated on device due to windowed register ABI. + */ +typedef struct { + uint32_t bt[16]; /*!< Backtrace (array of PC) */ + uint32_t depth; /*!< Number of backtrace entries */ + bool corrupted; /*!< Status flag for backtrace is corrupt or not */ +} esp_core_dump_bt_info_t; + /** * @brief Xtensa architecture specific extra information */ @@ -33,6 +47,8 @@ typedef struct { uint8_t epcx_reg_bits; /*!< Bit mask of available EPCx registers */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/freertos/include/freertos/FreeRTOSConfig.h b/tools/sdk/esp32c3/include/freertos/include/freertos/FreeRTOSConfig.h index 1796f1886ad..c64cb980d85 100644 --- a/tools/sdk/esp32c3/include/freertos/include/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32c3/include/freertos/include/freertos/FreeRTOSConfig.h @@ -136,11 +136,7 @@ #define configTICK_RATE_HZ ( CONFIG_FREERTOS_HZ ) /* This has impact on speed of search for highest priority */ -#ifdef SMALL_TEST -#define configMAX_PRIORITIES ( 7 ) -#else #define configMAX_PRIORITIES ( 25 ) -#endif /* Various things that impact minimum stack sizes */ diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpspi_flash_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpspi_flash_ll.h index d1911c4a327..f80fc83b260 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpspi_flash_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/gpspi_flash_ll.h @@ -383,6 +383,12 @@ static inline void gpspi_flash_ll_set_hold(spi_dev_t *dev, uint32_t hold_n) dev->user.cs_hold = (hold_n > 0? 1: 0); } +static inline void gpspi_flash_ll_set_cs_setup(spi_dev_t *dev, uint32_t cs_setup_time) +{ + dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0); + dev->user1.cs_setup_time = cs_setup_time - 1; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_flash_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_flash_ll.h index ab787644a4c..5508d161e06 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_flash_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_flash_ll.h @@ -75,6 +75,7 @@ typedef union { #define spi_flash_ll_set_dummy(dev, dummy) gpspi_flash_ll_set_dummy((spi_dev_t*)dev, dummy) #define spi_flash_ll_set_dummy_out(dev, en, lev) gpspi_flash_ll_set_dummy_out((spi_dev_t*)dev, en, lev) #define spi_flash_ll_set_hold(dev, hold_n) gpspi_flash_ll_set_hold((spi_dev_t*)dev, hold_n) +#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) gpspi_flash_ll_set_cs_setup((spi_dev_t*)dev, cs_setup_time) #else #define spi_flash_ll_reset(dev) spimem_flash_ll_reset((spi_mem_dev_t*)dev) #define spi_flash_ll_cmd_is_done(dev) spimem_flash_ll_cmd_is_done((spi_mem_dev_t*)dev) @@ -101,6 +102,7 @@ typedef union { #define spi_flash_ll_set_dummy(dev, dummy) spimem_flash_ll_set_dummy((spi_mem_dev_t*)dev, dummy) #define spi_flash_ll_set_dummy_out(dev, en, lev) spimem_flash_ll_set_dummy_out((spi_mem_dev_t*)dev, en, lev) #define spi_flash_ll_set_hold(dev, hold_n) spimem_flash_ll_set_hold((spi_mem_dev_t*)dev, hold_n) +#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) spimem_flash_ll_set_cs_setup((spi_mem_dev_t*)dev, cs_setup_time) #endif diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h index 013238142b9..6719905e09f 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spi_ll.h @@ -138,7 +138,7 @@ static inline void spi_ll_slave_init(spi_dev_t *hw) hw->dma_conf.dma_seg_trans_en = 0; //Disable unneeded ints - hw->slave.val &= ~SPI_LL_UNUSED_INT_MASK; + hw->dma_int_ena.val &= ~SPI_LL_UNUSED_INT_MASK; } /** diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spimem_flash_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spimem_flash_ll.h index e2db0800449..7641c3d723c 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spimem_flash_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/spimem_flash_ll.h @@ -549,6 +549,12 @@ static inline void spimem_flash_ll_set_hold(spi_mem_dev_t *dev, uint32_t hold_n) dev->user.cs_hold = (hold_n > 0? 1: 0); } +static inline void spimem_flash_ll_set_cs_setup(spi_mem_dev_t *dev, uint32_t cs_setup_time) +{ + dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0); + dev->ctrl2.cs_setup_time = cs_setup_time - 1; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h b/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h index be0f3c67c80..b70d0948b3b 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/adc_types.h @@ -56,9 +56,9 @@ typedef enum { */ typedef enum { ADC_ATTEN_DB_0 = 0, /*! +#include +#include "soc/usbh_struct.h" +#include "soc/usb_wrap_struct.h" +#include "hal/usbh_ll.h" +#include "hal/usb_types_private.h" + +// ------------------------------------------------ Macros and Types --------------------------------------------------- + +// ------------------ Constants/Configs -------------------- + +#define USBH_HAL_DMA_MEM_ALIGN 512 +#define USBH_HAL_FRAME_LIST_MEM_ALIGN 512 //The frame list needs to be 512 bytes aligned (contrary to the databook) +#define USBH_HAL_NUM_CHAN 8 +#define USBH_HAL_XFER_DESC_SIZE (sizeof(usbh_ll_dma_qtd_t)) +#define USBH_HAL_FIFO_TOTAL_USABLE_LINES 200 //Although we have a 256 lines, only 200 lines are usuable due to EPINFO_CTL + +/** + * @brief FIFO size configuration structure + */ +typedef struct { + uint32_t rx_fifo_lines; /**< Size of the RX FIFO in terms the number of FIFO lines */ + uint32_t nptx_fifo_lines; /**< Size of the Non-periodic FIFO in terms the number of FIFO lines */ + uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ +} usbh_hal_fifo_config_t; + +// --------------------- HAL States ------------------------ + +/** + * @brief Channel states + */ +typedef enum { + USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ + USBH_HAL_CHAN_STATE_ACTIVE, /**< The channel is active. A transfer descriptor list is being executed */ + USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ +} usbh_hal_chan_state_t; + +// --------------------- HAL Events ------------------------ + +/** + * @brief Host port HAL events + */ +typedef enum { + USBH_HAL_PORT_EVENT_NONE, /**< No event occurred, or could not decode interrupt */ + USBH_HAL_PORT_EVENT_CHAN, /**< A channel event has occurred. Call the the channel event handler instead */ + USBH_HAL_PORT_EVENT_CONN, /**< The host port has detected a connection */ + USBH_HAL_PORT_EVENT_DISCONN, /**< The host port has been disconnected */ + USBH_HAL_PORT_EVENT_ENABLED, /**< The host port has been enabled (i.e., connected to a device that has been reset. Started sending SOFs) */ + USBH_HAL_PORT_EVENT_DISABLED, /**< The host port has been disabled (no more SOFs). Could be due to disable/reset request, or a port error (e.g. port babble condition. See 11.8.1 of USB2.0 spec) */ + USBH_HAL_PORT_EVENT_OVRCUR, /**< The host port has encountered an overcurrent condition */ + USBH_HAL_PORT_EVENT_OVRCUR_CLR, /**< The host port has been cleared of the overcurrent condition */ +} usbh_hal_port_event_t; + +/** + * @brief Channel events + */ +typedef enum { + USBH_HAL_CHAN_EVENT_CPLT, /**< The channel has completed execution of a transfer descriptor that had the USBH_HAL_XFER_DESC_FLAG_HOC flag set. Channel is now halted */ + USBH_HAL_CHAN_EVENT_ERROR, /**< The channel has encountered an error. Channel is now halted. */ + USBH_HAL_CHAN_EVENT_HALT_REQ, /**< The channel has been successfully halted as requested */ + USBH_HAL_CHAN_EVENT_NONE, /**< No event (interrupt ran for internal processing) */ +} usbh_hal_chan_event_t; + +// --------------------- HAL Errors ------------------------ + +/** + * @brief Channel errors + */ +typedef enum { + USBH_HAL_CHAN_ERROR_XCS_XACT = 0, /**< Excessive (three consecutive) transaction errors (e.g., no response, bad CRC etc */ + USBH_HAL_CHAN_ERROR_BNA, /**< Buffer Not Available error (i.e., An inactive transfer descriptor was fetched by the channel) */ + USBH_HAL_CHAN_ERROR_PKT_BBL, /**< Packet babbler error (packet exceeded MPS) */ + USBH_HAL_CHAN_ERROR_STALL, /**< STALL response received */ +} usbh_hal_chan_error_t; + +// ------------- Transfer Descriptor Related --------------- + +/** + * @brief Flags used to describe the type of transfer descriptor to fill + */ +#define USBH_HAL_XFER_DESC_FLAG_IN 0x01 /**< Indicates this transfer descriptor is of the IN direction */ +#define USBH_HAL_XFER_DESC_FLAG_SETUP 0x02 /**< Indicates this transfer descriptor is an OUT setup */ +#define USBH_HAL_XFER_DESC_FLAG_HOC 0x04 /**< Indicates that the channel will be halted after this transfer descriptor completes */ + +/** + * @brief Status value of a transfer descriptor + * + * A transfer descriptor's status remains unexecuted until the entire transfer descriptor completes (either successfully + * or an error). Therefore, if a channel halt is requested before a transfer descriptor completes, the transfer + * descriptor remains unexecuted. + */ +#define USBH_HAL_XFER_DESC_STS_SUCCESS USBH_LL_QTD_STATUS_SUCCESS +#define USBH_HAL_XFER_DESC_STS_PKTERR USBH_LL_QTD_STATUS_PKTERR +#define USBH_HAL_XFER_DESC_STS_BUFFER_ERR USBH_LL_QTD_STATUS_BUFFER +#define USBH_HAL_XFER_DESC_STS_NOT_EXECUTED USBH_LL_QTD_STATUS_NOT_EXECUTED + +// -------------------- Object Types ----------------------- + +/** + * @brief Endpoint characteristics structure + */ +typedef struct { + union { + struct { + usb_priv_xfer_type_t type: 2; /**< The type of endpoint */ + uint32_t bEndpointAddress: 8; /**< Endpoint address (containing endpoint number and direction) */ + uint32_t mps: 11; /**< Maximum Packet Size */ + uint32_t dev_addr: 8; /**< Device Address */ + uint32_t ls_via_fs_hub: 1; /**< The endpoint is on a LS device that is routed through an FS hub. + Setting this bit will lead to the addition of the PREamble packet */ + uint32_t reserved2: 2; + }; + uint32_t val; + }; + struct { + usb_hal_interval_t interval; /**< The interval of the endpoint */ + uint32_t phase_offset_frames; /**< Phase offset in number of frames */ + } periodic; /**< Characteristic for periodic (interrupt/isochronous) endpoints only */ +} usbh_hal_ep_char_t; + +/** + * @brief Channel object + */ +typedef struct { + //Channel control, status, and information + union { + struct { + uint32_t active: 1; /**< The channel is enabled */ + uint32_t halt_requested: 1; /**< A halt has been requested */ + uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ + uint32_t reserved: 1; + uint32_t chan_idx: 4; /**< The index number of the channel */ + uint32_t reserved24: 24; + }; + uint32_t val; + } flags; /**< Flags regarding channel's status and information */ + usb_host_chan_regs_t *regs; /**< Pointer to the channel's register set */ + usbh_hal_chan_error_t error; /**< The last error that occurred on the channel */ + usb_priv_xfer_type_t type; /**< The transfer type of the channel */ + void *chan_ctx; /**< Context variable for the owner of the channel */ +} usbh_hal_chan_t; + +/** + * @brief HAL context structure + */ +typedef struct { + //Context + usbh_dev_t *dev; /**< Pointer to base address of DWC_OTG registers */ + usb_wrap_dev_t *wrap_dev; /**< Pointer to base address of USB Wrapper registers */ + //Host Port related + uint32_t *periodic_frame_list; /**< Pointer to scheduling frame list */ + usb_hal_frame_list_len_t frame_list_len; /**< Length of the periodic scheduling frame list */ + union { + struct { + uint32_t dbnc_lock_enabled: 1; /**< Debounce lock enabled */ + uint32_t fifo_sizes_set: 1; /**< Whether the FIFO sizes have been set or not */ + uint32_t periodic_sched_enabled: 1; /**< Periodic scheduling (for interrupt and isochronous transfers) is enabled */ + uint32_t reserved: 5; + uint32_t reserved24: 24; + }; + uint32_t val; + } flags; + //Channel related + struct { + int num_allocd; /**< Number of channels currently allocated */ + uint32_t chan_pend_intrs_msk; /**< Bit mask of channels with pending interrupts */ + usbh_hal_chan_t *hdls[USBH_HAL_NUM_CHAN]; /**< Handles of each channel. Set to NULL if channel has not been allocated */ + } channels; +} usbh_hal_context_t; + +// -------------------------------------------------- Core (Global) ---------------------------------------------------- + +/** + * @brief Initialize the HAL context and check if DWC_OTG is alive + * + * Entry: + * - The peripheral must have been reset and clock un-gated + * - GPIO pins configured + * - Interrupt allocated but DISABLED (in case of an unknown interupt state) + * Exit: + * - Checks to see if DWC_OTG is alive, and if HW version/config is correct + * - HAl context initialized + * - Sets default values to some global and OTG registers (GAHBCFG and GUSBCFG) + * - Umask global interrupt signal + * - Put DWC_OTG into host mode. Require 25ms delay before this takes effect. + * - State -> USBH_HAL_PORT_STATE_OTG + * - Interrupts cleared. Users can now enable their ISR + * + * @param[inout] hal Context of the HAL layer + */ +void usbh_hal_init(usbh_hal_context_t *hal); + +/** + * @brief Deinitialize the HAL context + * + * Entry: + * - All channels must be properly disabled, and any pending events handled + * Exit: + * - DWC_OTG global interrupt disabled + * - HAL context deinitialized + * + * @param hal Context of the HAL layer + */ +void usbh_hal_deinit(usbh_hal_context_t *hal); + +/** + * @brief Issue a soft reset to the controller + * + * This should be called when the host port encounters an error event or has been disconnected. Before calling this, + * users are responsible for safely freeing all channels as a soft reset will wipe all host port and channel registers. + * This function will result in the host port being put back into same state as after calling usbh_hal_init(). + * + * @note This has nothing to do with a USB bus reset. It simply resets the peripheral + * + * @param hal Context of the HAL layer + */ +void usbh_hal_core_soft_reset(usbh_hal_context_t *hal); + +/** + * @brief Set FIFO sizes + * + * This function will set the sizes of each of the FIFOs (RX FIFO, Non-periodic TX FIFO, Periodic TX FIFO) and must be + * called at least once before allocating the channel. Based on the type of endpoints (and the endpionts' MPS), there + * may be situations where this function may need to be called again to resize the FIFOs. If resizing FIFOs dynamically, + * it is the user's responsibility to ensure there are no active channels when this function is called. + * + * @note The totol size of all the FIFOs must be less than or equal to USBH_HAL_FIFO_TOTAL_USABLE_LINES + * @note After a port reset, the FIFO size registers will reset to their default values, so this function must be called + * again post reset. + * + * @param hal Context of the HAL layer + * @param fifo_config FIFO configuration + */ +void usbh_hal_set_fifo_size(usbh_hal_context_t *hal, const usbh_hal_fifo_config_t *fifo_config); + +// ---------------------------------------------------- Host Port ------------------------------------------------------ + +// ------------------ Host Port Control -------------------- + +/** + * @brief Initialize the host port + * + * - Will enable the host port's interrupts allowing port and channel events to occur + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_init(usbh_hal_context_t *hal) +{ + //Configure Host related interrupts + usbh_ll_haintmsk_dis_chan_intr(hal->dev, 0xFFFFFFFF); //Disable interrupts for all channels + usb_ll_en_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_HCHINT); +} + +/** + * @brief Deinitialize the host port + * + * - Will disable the host port's interrupts preventing further port aand channel events from ocurring + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_deinit(usbh_hal_context_t *hal) +{ + //Disable Host port and channel interrupts + usb_ll_dis_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_HCHINT); +} + +/** + * @brief Toggle the host port's power + * + * @param hal Context of the HAL layer + * @param power_on Whether to power ON or OFF the port + */ +static inline void usbh_hal_port_toggle_power(usbh_hal_context_t *hal, bool power_on) +{ + if (power_on) { + usbh_ll_hprt_en_pwr(hal->dev); + } else { + usbh_ll_hprt_dis_pwr(hal->dev); + } +} + +/** + * @brief Toggle reset signal on the bus + * + * The reset signal should be held for at least 10ms + * Entry: + * - Host port detects a device connection or Host port is already enabled + * Exit: + * - On release of the reset signal, a USBH_HAL_PORT_EVENT_ENABLED will be generated + * + * @note If the host port is already enabled, then issuing a reset will cause it be disabled and generate a + * USBH_HAL_PORT_EVENT_DISABLED event. The host port will not be enabled until the reset signal is released (thus + * generating the USBH_HAL_PORT_EVENT_ENABLED event) + * + * @param hal Context of the HAL layer + * @param enable Enable/disable reset signal + */ +static inline void usbh_hal_port_toggle_reset(usbh_hal_context_t *hal, bool enable) +{ + assert(hal->channels.num_allocd == 0); //Cannot reset if there are still allocated channels + usbh_ll_hprt_set_port_reset(hal->dev, enable); +} + +/** + * @brief Enable the host port + * + * Entry: + * - Host port enabled event triggered following a reset + * Exit: + * - Host port enabled to operate in scatter/gather DMA mode + * - DMA fifo sizes configured + * + * @param hal Context of the HAL layer + */ +void usbh_hal_port_enable(usbh_hal_context_t *hal); + +/** + * @brief Disable the host port + * + * Exit: + * - Host port disabled event triggered + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_disable(usbh_hal_context_t *hal) +{ + usbh_ll_hprt_port_dis(hal->dev); +} + +/** + * @brief Suspend the host port + * + * @param hal Context of the HAL layers + */ +static inline void usbh_hal_port_suspend(usbh_hal_context_t *hal) +{ + usbh_ll_hprt_set_port_suspend(hal->dev); +} + +/** + * @brief Toggle resume signal on the bus + * + * Hosts should hold the resume signal for at least 20ms + * + * @note If a remote wakeup event occurs, the resume signal is driven and cleared automatically. + * + * @param hal Context of the HAL layer + * @param enable Enable/disable resume signal + */ +static inline void usbh_hal_port_toggle_resume(usbh_hal_context_t *hal, bool enable) +{ + if (enable) { + usbh_ll_hprt_set_port_resume(hal->dev); + } else { + usbh_ll_hprt_clr_port_resume(hal->dev); + } +} + +/** + * @brief Check whether the resume signal is being driven + * + * If a remote wakeup event occurs, the core will automatically drive and clear the resume signal for the required + * amount of time. Call this function to check whether the resume signal has completed. + * + * @param hal Context of the HAL layer + * @return true Resume signal is still being driven + * @return false Resume signal is no longer driven + */ +static inline bool usbh_hal_port_check_resume(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_port_resume(hal->dev); +} + +// ---------------- Host Port Scheduling ------------------- + +/** + * @brief Sets the periodic scheduling frame list + * + * @note This function must be called before attempting configuring any channels to be period via + * usbh_hal_chan_set_ep_char() + * + * @param hal Context of the HAL layer + * @param frame_list Base address of the frame list + * @param frame_list_len Number of entries in the frame list (can only be 8, 16, 32, 64) + */ +static inline void usbh_hal_port_set_frame_list(usbh_hal_context_t *hal, uint32_t *frame_list, usb_hal_frame_list_len_t len) +{ + assert(!hal->flags.periodic_sched_enabled); + //Clear and save frame list + hal->periodic_frame_list = frame_list; + hal->frame_list_len = len; +} + +/** + * @brief Get the pointer to the periodic scheduling frame list + * + * @param hal Context of the HAL layer + * @return uint32_t* Base address of the periodic scheduling frame list + */ +static inline uint32_t *usbh_hal_port_get_frame_list(usbh_hal_context_t *hal) +{ + return hal->periodic_frame_list; +} + +/** + * @brief Enable periodic scheduling + * + * @note The periodic frame list must be set via usbh_hal_port_set_frame_list() should be set before calling this + * function + * @note This function must be called before activating any periodic channels + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_enable(usbh_hal_context_t *hal) +{ + assert(hal->periodic_frame_list != NULL && !hal->flags.periodic_sched_enabled); + usbh_ll_set_frame_list_base_addr(hal->dev, (uint32_t)hal->periodic_frame_list); + usbh_ll_hcfg_set_num_frame_list_entries(hal->dev, hal->frame_list_len); + usbh_ll_hcfg_en_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 1; +} + +/** + * @brief Disable periodic scheduling + * + * Disabling periodic scheduling will save a bit of DMA bandwith (as the controller will no longer fetch the schedule + * from the frame list). + * + * @note Before disabling periodic scheduling, it is the user's responsibility to ensure that all periodic channels have + * halted safely. + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_disable(usbh_hal_context_t *hal) +{ + assert(hal->flags.periodic_sched_enabled); + usbh_ll_hcfg_dis_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 0; +} + +static inline uint32_t usbh_hal_port_get_cur_frame_num(usbh_hal_context_t *hal) +{ + return usbh_ll_get_frm_num(hal->dev); +} + +// --------------- Host Port Status/State ------------------ + +/** + * @brief Check if a device is currently connected to the host port + * + * This function is intended to be called after one of the following events followed by an adequate debounce delay + * - USBH_HAL_PORT_EVENT_CONN + * - USBH_HAL_PORT_EVENT_DISCONN + * + * @note No other connection/disconnection event will occur again until the debounce lock is disabled via + * usbh_hal_disable_debounce_lock() + * + * @param hal Context of the HAL layer + * @return true A device is connected to the host port + * @return false A device is not connected to the host port + */ +static inline bool usbh_hal_port_check_if_connected(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_conn_status(hal->dev); +} + +/** + * @brief Check the speed (LS/FS) of the device connected to the host port + * + * @note This function should only be called after confirming that a device is connected to the host port + * + * @param hal Context of the HAL layer + * @return usb_priv_speed_t Speed of the connected device (FS or LS only on the esp32-s2 and esp32-s3) + */ +static inline usb_priv_speed_t usbh_hal_port_get_conn_speed(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_speed(hal->dev); +} + +/** + * @brief Disable the debounce lock + * + * This function must be called after calling usbh_hal_port_check_if_connected() and will allow connection/disconnection + * events to occur again. Any pending connection or disconenction interrupts are cleared. + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_disable_debounce_lock(usbh_hal_context_t *hal) +{ + hal->flags.dbnc_lock_enabled = 0; + //Clear Conenction and disconenction interrupt in case it triggered again + usb_ll_intr_clear(hal->dev, USB_LL_INTR_CORE_DISCONNINT); + usbh_ll_hprt_intr_clear(hal->dev, USBH_LL_INTR_HPRT_PRTENCHNG); + //Reenable the hprt (connection) and disconnection interrupts + usb_ll_en_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_DISCONNINT); +} + +// ----------------------------------------------------- Channel ------------------------------------------------------- + +// ----------------- Channel Allocation -------------------- + +/** + * @brief Allocate a channel + * + * @param[in] hal Context of the HAL layer + * @param[inout] chan_obj Empty channel object + * @param[in] chan_ctx Context variable for the allocator of the channel + * @return true Channel successfully allocated + * @return false Failed to allocate channel + */ +bool usbh_hal_chan_alloc(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, void *chan_ctx); + +/** + * @brief Free a channel + * + * @param[in] hal Context of the HAL layer + * @param[in] chan_obj Channel object + */ +void usbh_hal_chan_free(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj); + +// ---------------- Channel Configuration ------------------ + +/** + * @brief Get the context variable of the channel + * + * @param[in] chan_obj Channel object + * @return void* The context variable of the channel + */ +static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) +{ + return chan_obj->chan_ctx; +} + +/** + * @brief Get the current state of a channel + * + * @param chan_obj Channel object + * @return usbh_hal_chan_state_t State of the channel + */ +static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *chan_obj) +{ + if (chan_obj->flags.error_pending) { + return USBH_HAL_CHAN_STATE_ERROR; + } else if (chan_obj->flags.active) { + return USBH_HAL_CHAN_STATE_ACTIVE; + } else { + return USBH_HAL_CHAN_STATE_HALTED; + } +} + +/** + * @brief Set the endpoint information for a particular channel + * + * This should be called when a channel switches target from one EP to another + * + * @note the channel must be in the disabled state in order to change its EP + * information + * + * @param hal Context of the HAL layer + * @param chan_obj Channel object + * @param ep_char Endpoint characteristics + */ +void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, usbh_hal_ep_char_t *ep_char); + +/** + * @brief Set the direction of the channel + * + * This is a convenience function to flip the direction of a channel without + * needing to reconfigure all of the channel's EP info. This is used primarily + * for control transfers. + * + * @note This function should only be called when the channel is halted + * + * @param chan_obj Channel object + * @param is_in Whether the direction is IN + */ +static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) +{ + //Cannot change direction whilst channel is still active or in error + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + usbh_ll_chan_set_dir(chan_obj->regs, is_in); +} + +/** + * @brief Set the next Packet ID of the channel (e.g., DATA0/DATA1) + * + * This should be called when a channel switches target from one EP to another + * or when change stages for a control transfer + * + * @note The channel should only be called when the channel is in the + * halted state. + * + * @param chan_obj Channel object + * @param pid PID of the next DATA packet (DATA0 or DATA1) + */ +static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) +{ + //Cannot change pid whilst channel is still active or in error + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + //Update channel object and set the register + usbh_ll_chan_set_pid(chan_obj->regs, pid); +} + +/** + * @brief Get the next PID of a channel + * + * Returns the next PID (DATA0 or DATA1) of the channel. This function should be + * used when the next PID of a pipe needs to be saved (e.g., when switching pipes + * on a channel) + * + * @param chan_obj Channel object + * @return uint32_t Starting PID of the next transfer (DATA0 or DATA1) + */ +static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) +{ + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + return usbh_ll_chan_get_pid(chan_obj->regs); +} + +// ------------------- Channel Control --------------------- + +/** + * @brief Activate a channel + * + * Activating a channel will cause the channel to start executing transfer descriptors. + * + * @note This function should only be called on channels that were previously halted + * @note An event will be generated when the channel is halted + * + * @param chan_obj Channel object + * @param xfer_desc_list A filled transfer descriptor list + * @param desc_list_len Transfer descriptor list length + * @param start_idx Index of the starting transfer descriptor in the list + */ +void usbh_hal_chan_activate(usbh_hal_chan_t *chan_obj, void *xfer_desc_list, int desc_list_len, int start_idx); + +/** + * @brief Get the index of the current transfer descriptor + * + * @param chan_obj Channel object + * @return int Descriptor index + */ +static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) +{ + return usbh_ll_chan_get_ctd(chan_obj->regs); +} + +/** + * @brief Request to halt a channel + * + * This function should be called in order to halt a channel. If the channel is already halted, this function will + * return true. If the channel is still active, this function will return false and users must wait for the + * USBH_HAL_CHAN_EVENT_HALT_REQ event before treating the channel as halted. + * + * @note When a transfer is in progress (i.e., the channel is active) and a halt is requested, the channel will halt + * after the next USB packet is completed. If the transfer has more pending packets, the transfer will just be + * marked as USBH_HAL_XFER_DESC_STS_NOT_EXECUTED. + * + * @param chan_obj Channel object + * @return true The channel is already halted + * @return false The halt was requested, wait for USBH_HAL_CHAN_EVENT_HALT_REQ + */ +bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); + +/** + * @brief Get a channel's error + * + * @param chan_obj Channel object + * @return usbh_hal_chan_error_t The type of error the channel has encountered + */ +static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) +{ + assert(chan_obj->flags.error_pending); + return chan_obj->error; +} + +/** + * @brief Clear a channel of it's error + * + * @param chan_obj Channel object + */ +static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) +{ + //Can only clear error when an error has occurred + assert(chan_obj->flags.error_pending); + chan_obj->flags.error_pending = 0; +} + +// -------------------------------------------- Transfer Descriptor List ----------------------------------------------- + +/** + * @brief Fill a single entry in a transfer descriptor list + * + * - Depending on the transfer type, a single transfer descriptor may corresponds + * - A stage of a transfer (for control transfers) + * - A frame of a transfer interval (for interrupt and isoc) + * - An entire transfer (for bulk transfers) + * - Check the various USBH_HAL_XFER_DESC_FLAG_ flags for filling a specific type of descriptor + * - For IN transfer entries, set the USBH_HAL_XFER_DESC_FLAG_IN. The transfer size must also be an integer multiple of + * the endpoint's MPS + * + * @note Critical section is not required for this function + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + * @param xfer_data_buff Transfer data buffer + * @param xfer_len Transfer length + * @param flags Transfer flags + */ +static inline void usbh_hal_xfer_desc_fill(void *desc_list, uint32_t desc_idx, uint8_t *xfer_data_buff, int xfer_len, uint32_t flags) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + if (flags & USBH_HAL_XFER_DESC_FLAG_IN) { + usbh_ll_set_qtd_in(&qtd_list[desc_idx], + xfer_data_buff, xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC); + } else { + usbh_ll_set_qtd_out(&qtd_list[desc_idx], + xfer_data_buff, + xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC, + flags & USBH_HAL_XFER_DESC_FLAG_SETUP); + } +} + +/** + * @brief Clear a transfer descriptor (sets all its fields to NULL) + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + */ +static inline void usbh_hal_xfer_desc_clear(void *desc_list, uint32_t desc_idx) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); +} + +/** + * @brief Parse a transfer decriptor's results + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + * @param[out] xfer_rem_len Remaining length of the transfer in bytes + * @param[out] xfer_status Status of the transfer + * + * @note Critical section is not required for this function + */ +static inline void usbh_hal_xfer_desc_parse(void *desc_list, uint32_t desc_idx, int *xfer_rem_len, int *xfer_status) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_get_qtd_status(&qtd_list[desc_idx], xfer_rem_len, xfer_status); + //Clear the QTD to prevent it from being read again + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); +} + +// ------------------------------------------------- Event Handling ---------------------------------------------------- + +/** + * @brief Decode global and host port interrupts + * + * - Reads and clears global and host port interrupt registers + * - Decodes the interrupt bits to determine what host port event occurred + * + * @note This should be the first interrupt decode function to be run + * + * @param hal Context of the HAL layer + * @return usbh_hal_port_event_t Host port event + */ +usbh_hal_port_event_t usbh_hal_decode_intr(usbh_hal_context_t *hal); + +/** + * @brief Gets the next channel with a pending interrupt + * + * If no channel is pending an interrupt, this function will return NULL. If one or more channels are pending an + * interrupt, this function returns one of the channel's objects. Call this function repeatedly until it returns NULL. + * + * @param hal Context of the HAL layer + * @return usbh_hal_chan_t* Channel object. NULL if no channel are pending an interrupt. + */ +usbh_hal_chan_t *usbh_hal_get_chan_pending_intr(usbh_hal_context_t *hal); + +/** + * @brief Decode a particular channel's interrupt + * + * - Reads and clears the interrupt register of the channel + * - Returns the corresponding event for that channel + * + * @param chan_obj Channel object + * @return usbh_hal_chan_event_t Channel event + */ +usbh_hal_chan_event_t usbh_hal_chan_decode_intr(usbh_hal_chan_t *chan_obj); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h b/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h new file mode 100644 index 00000000000..a6c03e302a4 --- /dev/null +++ b/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h @@ -0,0 +1,980 @@ +// Copyright 2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include "soc/usbh_struct.h" +#include "soc/usb_wrap_struct.h" +#include "hal/usb_types_private.h" + +/* ----------------------------------------------------------------------------- +------------------------------- Global Registers ------------------------------- +----------------------------------------------------------------------------- */ + +/* + * Interrupt bit masks of the GINTSTS and GINTMSK registers + */ +#define USB_LL_INTR_CORE_WKUPINT (1 << 31) +#define USB_LL_INTR_CORE_SESSREQINT (1 << 30) +#define USB_LL_INTR_CORE_DISCONNINT (1 << 29) +#define USB_LL_INTR_CORE_CONIDSTSCHNG (1 << 28) +#define USB_LL_INTR_CORE_PTXFEMP (1 << 26) +#define USB_LL_INTR_CORE_HCHINT (1 << 25) +#define USB_LL_INTR_CORE_PRTINT (1 << 24) +#define USB_LL_INTR_CORE_RESETDET (1 << 23) +#define USB_LL_INTR_CORE_FETSUSP (1 << 22) +#define USB_LL_INTR_CORE_INCOMPIP (1 << 21) +#define USB_LL_INTR_CORE_INCOMPISOIN (1 << 20) +#define USB_LL_INTR_CORE_OEPINT (1 << 19) +#define USB_LL_INTR_CORE_IEPINT (1 << 18) +#define USB_LL_INTR_CORE_EPMIS (1 << 17) +#define USB_LL_INTR_CORE_EOPF (1 << 15) +#define USB_LL_INTR_CORE_ISOOUTDROP (1 << 14) +#define USB_LL_INTR_CORE_ENUMDONE (1 << 13) +#define USB_LL_INTR_CORE_USBRST (1 << 12) +#define USB_LL_INTR_CORE_USBSUSP (1 << 11) +#define USB_LL_INTR_CORE_ERLYSUSP (1 << 10) +#define USB_LL_INTR_CORE_GOUTNAKEFF (1 << 7) +#define USB_LL_INTR_CORE_GINNAKEFF (1 << 6) +#define USB_LL_INTR_CORE_NPTXFEMP (1 << 5) +#define USB_LL_INTR_CORE_RXFLVL (1 << 4) +#define USB_LL_INTR_CORE_SOF (1 << 3) +#define USB_LL_INTR_CORE_OTGINT (1 << 2) +#define USB_LL_INTR_CORE_MODEMIS (1 << 1) +#define USB_LL_INTR_CORE_CURMOD (1 << 0) + +/* + * Bit mask of interrupt generating bits of the the HPRT register. These bits + * are ORd into the USB_LL_INTR_CORE_PRTINT interrupt. + * + * Note: Some fields of the HPRT are W1C (write 1 clear), this we cannot do a + * simple read and write-back to clear the HPRT interrupt bits. Instead we need + * a W1C mask the non-interrupt related bits + */ +#define USBH_LL_HPRT_W1C_MSK (0x2E) +#define USBH_LL_HPRT_ENA_MSK (0x04) +#define USBH_LL_INTR_HPRT_PRTOVRCURRCHNG (1 << 5) +#define USBH_LL_INTR_HPRT_PRTENCHNG (1 << 3) +#define USBH_LL_INTR_HPRT_PRTCONNDET (1 << 1) + +/* + * Bit mask of channel interrupts (HCINTi and HCINTMSKi registers) + * + * Note: Under Scatter/Gather DMA mode, only the following interrupts can be unmasked + * - DESC_LS_ROLL + * - XCS_XACT_ERR (always unmasked) + * - BNAINTR + * - CHHLTD + * - XFERCOMPL + * The remaining interrupt bits will still be set (when the corresponding event occurs) + * but will not generate an interrupt. Therefore we must proxy through the + * USBH_LL_INTR_CHAN_CHHLTD interrupt to check the other interrupt bits. + */ +#define USBH_LL_INTR_CHAN_DESC_LS_ROLL (1 << 13) +#define USBH_LL_INTR_CHAN_XCS_XACT_ERR (1 << 12) +#define USBH_LL_INTR_CHAN_BNAINTR (1 << 11) +#define USBH_LL_INTR_CHAN_DATATGLERR (1 << 10) +#define USBH_LL_INTR_CHAN_FRMOVRUN (1 << 9) +#define USBH_LL_INTR_CHAN_BBLEER (1 << 8) +#define USBH_LL_INTR_CHAN_XACTERR (1 << 7) +#define USBH_LL_INTR_CHAN_NYET (1 << 6) +#define USBH_LL_INTR_CHAN_ACK (1 << 5) +#define USBH_LL_INTR_CHAN_NAK (1 << 4) +#define USBH_LL_INTR_CHAN_STALL (1 << 3) +#define USBH_LL_INTR_CHAN_AHBERR (1 << 2) +#define USBH_LL_INTR_CHAN_CHHLTD (1 << 1) +#define USBH_LL_INTR_CHAN_XFERCOMPL (1 << 0) + +/* + * QTD (Queue Transfer Descriptor) structure used in Scatter/Gather DMA mode. + * Each QTD describes one transfer. Scatter gather mode will automatically split + * a transfer into multiple MPS packets. Each QTD is 64bits in size + * + * Note: The status information part of the QTD is interpreted differently depending + * on IN or OUT, and ISO or non-ISO + */ +typedef struct { + union { + struct { + uint32_t xfer_size: 17; + uint32_t aqtd_offset: 6; + uint32_t aqtd_valid: 1; + uint32_t reserved_24: 1; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t rx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } in_non_iso; + struct { + uint32_t xfer_size: 12; + uint32_t reserved_12_24: 13; + uint32_t intr_cplt: 1; + uint32_t reserved_26_27: 2; + uint32_t rx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } in_iso; + struct { + uint32_t xfer_size: 17; + uint32_t reserved_17_23: 7; + uint32_t is_setup: 1; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t tx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } out_non_iso; + struct { + uint32_t xfer_size: 12; + uint32_t reserved_12_24: 13; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t tx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } out_iso; + uint32_t buffer_status_val; + }; + uint8_t *buffer; +} usbh_ll_dma_qtd_t; + +/* ----------------------------------------------------------------------------- +------------------------------ USB Wrap Registers ------------------------------ +----------------------------------------------------------------------------- */ + +/** + * @brief Configures the internal PHY to operate as HOST + * + * @param hw Start address of the USB Wrap registers + */ +static inline void usbh_ll_internal_phy_conf(usb_wrap_dev_t *hw) +{ + //Enable internal PHY + hw->otg_conf.pad_enable = 1; + hw->otg_conf.phy_sel = 0; + //Set pulldowns on D+ and D- + hw->otg_conf.pad_pull_override = 1; + hw->otg_conf.dp_pulldown = 1; + hw->otg_conf.dm_pulldown = 1; +} + +/* ----------------------------------------------------------------------------- +------------------------------- Global Registers ------------------------------- +----------------------------------------------------------------------------- */ + +// --------------------------- GAHBCFG Register -------------------------------- + +static inline void usb_ll_en_dma_mode(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.dmaen = 1; +} + +static inline void usb_ll_en_slave_mode(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.dmaen = 0; +} + +static inline void usb_ll_set_hbstlen(usbh_dev_t *hw, uint32_t burst_len) +{ + hw->gahbcfg_reg.hbstlen = burst_len; +} + +static inline void usb_ll_en_global_intr(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.glbllntrmsk = 1; +} + +static inline void usb_ll_dis_global_intr(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.glbllntrmsk = 0; +} + +// --------------------------- GUSBCFG Register -------------------------------- + +static inline void usb_ll_set_host_mode(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.forcehstmode = 1; +} + +static inline void usb_ll_dis_hnp_cap(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.hnpcap = 0; +} + +static inline void usb_ll_dis_srp_cap(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.srpcap = 0; +} + +// --------------------------- GRSTCTL Register -------------------------------- + +static inline bool usb_ll_check_ahb_idle(usbh_dev_t *hw) +{ + return hw->grstctl_reg.ahbidle; +} + +static inline bool usb_ll_check_dma_req_in_progress(usbh_dev_t *hw) +{ + return hw->grstctl_reg.dmareq; +} + +static inline void usb_ll_flush_nptx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.txfnum = 0; //Set the TX FIFO number to 0 to select the non-periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //Flush the selected TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } +} + +static inline void usb_ll_flush_ptx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.txfnum = 1; //Set the TX FIFO number to 1 to select the periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //FLush the select TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } +} + +static inline void usb_ll_flush_rx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.rxfflsh = 1; + //Wait for the flushing to complete + while (hw->grstctl_reg.rxfflsh) { + ; + } +} + +static inline void usb_ll_reset_frame_counter(usbh_dev_t *hw) +{ + hw->grstctl_reg.frmcntrrst = 1; +} + +static inline void usb_ll_core_soft_reset(usbh_dev_t *hw) +{ + hw->grstctl_reg.csftrst = 1; +} + +static inline bool usb_ll_check_core_soft_reset(usbh_dev_t *hw) +{ + return hw->grstctl_reg.csftrst; +} + +// --------------------------- GINTSTS Register -------------------------------- + +/** + * @brief Reads and clears the global interrupt register + * + * @param hw Start address of the DWC_OTG registers + * @return uint32_t Mask of interrupts + */ +static inline uint32_t usb_ll_intr_read_and_clear(usbh_dev_t *hw) +{ + usb_gintsts_reg_t gintsts; + gintsts.val = hw->gintsts_reg.val; + hw->gintsts_reg.val = gintsts.val; //Write back to clear + return gintsts.val; +} + +/** + * @brief Clear specific interrupts + * + * @param hw Start address of the DWC_OTG registers + * @param intr_msk Mask of interrupts to clear + */ +static inline void usb_ll_intr_clear(usbh_dev_t *hw, uint32_t intr_msk) +{ + //All GINTSTS fields are either W1C or read only. So safe to write directly + hw->gintsts_reg.val = intr_msk; +} + +// --------------------------- GINTMSK Register -------------------------------- + +static inline void usb_ll_en_intrs(usbh_dev_t *hw, uint32_t intr_mask) +{ + hw->gintmsk_reg.val |= intr_mask; +} + +static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) +{ + hw->gintmsk_reg.val &= ~intr_mask; +} + +// --------------------------- GRXFSIZ Register -------------------------------- + +static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) +{ + //Set size in words + hw->grxfsiz_reg.rxfdep = num_lines; +} + +// -------------------------- GNPTXFSIZ Register ------------------------------- + +static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) +{ + usb_gnptxfsiz_reg_t gnptxfsiz; + gnptxfsiz.val = hw->gnptxfsiz_reg.val; + gnptxfsiz.nptxfstaddr = addr; + gnptxfsiz.nptxfdep = num_lines; + hw->gnptxfsiz_reg.val = gnptxfsiz.val; +} + +static inline uint32_t usb_ll_get_controller_core_id(usbh_dev_t *hw) +{ + return hw->gsnpsid_reg.val; +} + +/** + * @brief Get the hardware configuration regiters of the DWC_OTG controller + * + * The hardware configuraiton regitsers are read only and indicate the various + * features of the DWC_OTG core. + * + * @param hw Start address of the DWC_OTG registers + * @param[out] ghwcfg1 Hardware configuration registesr 1 + * @param[out] ghwcfg2 Hardware configuration registesr 2 + * @param[out] ghwcfg3 Hardware configuration registesr 3 + * @param[out] ghwcfg4 Hardware configuration registesr 4 + */ +static inline void usb_ll_get_hardware_config(usbh_dev_t *hw, uint32_t *ghwcfg1, uint32_t *ghwcfg2, uint32_t *ghwcfg3, uint32_t *ghwcfg4) +{ + *ghwcfg1 = hw->ghwcfg1_reg.val; + *ghwcfg2 = hw->ghwcfg2_reg.val; + *ghwcfg3 = hw->ghwcfg3_reg.val; + *ghwcfg4 = hw->ghwcfg4_reg.val; +} + +// --------------------------- HPTXFSIZ Register ------------------------------- + +static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) +{ + usb_hptxfsiz_reg_t hptxfsiz; + hptxfsiz.val = hw->hptxfsiz_reg.val; + hptxfsiz.ptxfstaddr = addr; + hptxfsiz.ptxfsize = num_lines; + hw->hptxfsiz_reg.val = hptxfsiz.val; +} + +/* ----------------------------------------------------------------------------- +-------------------------------- Host Registers -------------------------------- +----------------------------------------------------------------------------- */ + +// ----------------------------- HCFG Register --------------------------------- + +static inline void usbh_ll_hcfg_en_perio_sched(usbh_dev_t *hw) +{ + hw->hcfg_reg.perschedena = 1; +} + +static inline void usbh_ll_hcfg_dis_perio_sched(usbh_dev_t *hw) +{ + hw->hcfg_reg.perschedena = 0; +} + +/** + * Sets the length of the frame list + * + * @param num_entires Number of entires in the frame list + */ +static inline void usbh_ll_hcfg_set_num_frame_list_entries(usbh_dev_t *hw, usb_hal_frame_list_len_t num_entries) +{ + uint32_t frlisten; + switch (num_entries) { + case USB_HAL_FRAME_LIST_LEN_8: + frlisten = 0; + break; + case USB_HAL_FRAME_LIST_LEN_16: + frlisten = 1; + break; + case USB_HAL_FRAME_LIST_LEN_32: + frlisten = 2; + break; + default: //USB_HAL_FRAME_LIST_LEN_64 + frlisten = 3; + break; + } + hw->hcfg_reg.frlisten = frlisten; +} + +static inline void usbh_ll_hcfg_en_scatt_gatt_dma(usbh_dev_t *hw) +{ + hw->hcfg_reg.descdma = 1; +} + +static inline void usbh_ll_hcfg_set_fsls_supp_only(usbh_dev_t *hw) +{ + hw->hcfg_reg.fslssupp = 1; +} + +static inline void usbh_ll_hcfg_set_fsls_pclk_sel(usbh_dev_t *hw) +{ + hw->hcfg_reg.fslspclksel = 1; +} + +/** + * @brief Sets some default values to HCFG to operate in Host mode with scatter/gather DMA + * + * @param hw Start address of the USB Wrap registers + * @param speed Speed to initialize the host port at + */ +static inline void usbh_ll_hcfg_set_defaults(usbh_dev_t *hw, usb_priv_speed_t speed) +{ + hw->hcfg_reg.descdma = 1; //Enable scatt/gatt + hw->hcfg_reg.fslssupp = 1; //FS/LS support only + /* + Indicate to the OTG core what speed the PHY clock is at + Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, + so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. + */ + hw->hcfg_reg.fslspclksel = (speed == USB_PRIV_SPEED_FULL) ? 1 : 2; //PHY clock on esp32-sx for FS/LS-only + hw->hcfg_reg.perschedena = 0; //Disable perio sched +} + +// ----------------------------- HFIR Register --------------------------------- + +static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t speed) +{ + usb_hfir_reg_t hfir; + hfir.val = hw->hfir_reg.val; + hfir.hfirrldctrl = 0; //Disable dynamic loading + /* + Set frame interval to be equal to 1ms + Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, + so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. + */ + hfir.frint = (speed == USB_PRIV_SPEED_FULL) ? 48000 : 6000; //esp32-sx targets only support FS or LS + hw->hfir_reg.val = hfir.val; +} + +// ----------------------------- HFNUM Register -------------------------------- + +static inline uint32_t usbh_ll_get_frm_time_rem(usbh_dev_t *hw) +{ + return hw->hfnum_reg.frrem; +} + +static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) +{ + return hw->hfnum_reg.frnum; +} + +// ---------------------------- HPTXSTS Register ------------------------------- + +static inline uint32_t usbh_ll_get_p_tx_queue_top(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxqtop; +} + +static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxqspcavail; +} + +static inline uint32_t usbh_ll_get_p_tx_fifo_space_avail(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxfspcavail; +} + +// ----------------------------- HAINT Register -------------------------------- + +static inline uint32_t usbh_ll_get_chan_intrs_msk(usbh_dev_t *hw) +{ + return hw->haint_reg.haint; +} + +// --------------------------- HAINTMSK Register ------------------------------- + +static inline void usbh_ll_haintmsk_en_chan_intr(usbh_dev_t *hw, uint32_t mask) +{ + hw->haintmsk_reg.val |= mask; +} + +static inline void usbh_ll_haintmsk_dis_chan_intr(usbh_dev_t *hw, uint32_t mask) +{ + hw->haintmsk_reg.val &= ~mask; +} + +// --------------------------- HFLBAddr Register ------------------------------- + +/** + * @brief Set the base address of the scheduling frame list + * + * @note For some reason, this address must be 512 bytes aligned or else a bunch of frames will not be scheduled when + * the frame list rolls over. However, according to the databook, there is no mention of the HFLBAddr needing to + * be aligned. + * + * @param hw Start address of the DWC_OTG registers + * @param addr Base address of the scheduling frame list + */ +static inline void usbh_ll_set_frame_list_base_addr(usbh_dev_t *hw, uint32_t addr) +{ + hw->hflbaddr_reg.hflbaddr = addr; +} + +/** + * @brief Get the base address of the scheduling frame list + * + * @param hw Start address of the DWC_OTG registers + * @return uint32_t Base address of the scheduling frame list + */ +static inline uint32_t usbh_ll_get_frame_list_base_addr(usbh_dev_t *hw) +{ + return hw->hflbaddr_reg.hflbaddr; +} + +// ----------------------------- HPRT Register --------------------------------- + +static inline usb_priv_speed_t usbh_ll_hprt_get_speed(usbh_dev_t *hw) +{ + usb_priv_speed_t speed; + //esp32-s2 and esp32-s3 only support FS or LS + switch (hw->hprt_reg.prtspd) { + case 1: + speed = USB_PRIV_SPEED_FULL; + break; + default: + speed = USB_PRIV_SPEED_LOW; + break; + } + return speed; +} + +static inline uint32_t usbh_ll_hprt_get_test_ctl(usbh_dev_t *hw) +{ + return hw->hprt_reg.prttstctl; +} + +static inline void usbh_ll_hprt_set_test_ctl(usbh_dev_t *hw, uint32_t test_mode) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prttstctl = test_mode; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_en_pwr(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtpwr = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_dis_pwr(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtpwr = 0; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline uint32_t usbh_ll_hprt_get_pwr_line_status(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtlnsts; +} + +static inline void usbh_ll_hprt_set_port_reset(usbh_dev_t *hw, bool reset) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtrst = reset; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_reset(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtrst; +} + +static inline void usbh_ll_hprt_set_port_suspend(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtsusp = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_suspend(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtsusp; +} + +static inline void usbh_ll_hprt_set_port_resume(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtres = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_clr_port_resume(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtres = 0; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_resume(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtres; +} + +static inline bool usbh_ll_hprt_get_port_overcur(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtovrcurract; +} + +static inline bool usbh_ll_hprt_get_port_en(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtena; +} + +static inline void usbh_ll_hprt_port_dis(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtena = 1; //W1C to disable + //we want to W1C ENA but not W1C the interrupt bits + hw->hprt_reg.val = hprt.val & ((~USBH_LL_HPRT_W1C_MSK) | USBH_LL_HPRT_ENA_MSK); +} + +static inline bool usbh_ll_hprt_get_conn_status(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtconnsts; +} + +static inline uint32_t usbh_ll_hprt_intr_read_and_clear(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + //We want to W1C the interrupt bits but not that ENA + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_ENA_MSK); + //Return only the interrupt bits + return (hprt.val & (USBH_LL_HPRT_W1C_MSK & ~(USBH_LL_HPRT_ENA_MSK))); +} + +static inline void usbh_ll_hprt_intr_clear(usbh_dev_t *hw, uint32_t intr_mask) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hw->hprt_reg.val = ((hprt.val & ~USBH_LL_HPRT_ENA_MSK) & ~USBH_LL_HPRT_W1C_MSK) | intr_mask; +} + +//Per Channel registers + +// --------------------------- HCCHARi Register -------------------------------- + +static inline void usbh_ll_chan_start(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.chena = 1; +} + +static inline bool usbh_ll_chan_is_active(volatile usb_host_chan_regs_t *chan) +{ + return chan->hcchar_reg.chena; +} + +static inline void usbh_ll_chan_halt(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.chdis = 1; +} + +static inline void usbh_ll_chan_xfer_odd_frame(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.oddfrm = 1; +} + +static inline void usbh_ll_chan_xfer_even_frame(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.oddfrm = 0; +} + +static inline void usbh_ll_chan_set_dev_addr(volatile usb_host_chan_regs_t *chan, uint32_t addr) +{ + chan->hcchar_reg.devaddr = addr; +} + +static inline void usbh_ll_chan_set_ep_type(volatile usb_host_chan_regs_t *chan, usb_priv_xfer_type_t type) +{ + uint32_t ep_type; + switch (type) { + case USB_PRIV_XFER_TYPE_CTRL: + ep_type = 0; + break; + case USB_PRIV_XFER_TYPE_ISOCHRONOUS: + ep_type = 1; + break; + case USB_PRIV_XFER_TYPE_BULK: + ep_type = 2; + break; + default: //USB_PRIV_XFER_TYPE_INTR + ep_type = 3; + break; + } + chan->hcchar_reg.eptype = ep_type; +} + +//Indicates whether channel is commuunicating with a LS device connected via a FS hub. Setting this bit to 1 will cause +//each packet to be preceded by a PREamble packet +static inline void usbh_ll_chan_set_lspddev(volatile usb_host_chan_regs_t *chan, bool is_ls) +{ + chan->hcchar_reg.lspddev = is_ls; +} + +static inline void usbh_ll_chan_set_dir(volatile usb_host_chan_regs_t *chan, bool is_in) +{ + chan->hcchar_reg.epdir = is_in; +} + +static inline void usbh_ll_chan_set_ep_num(volatile usb_host_chan_regs_t *chan, uint32_t num) +{ + chan->hcchar_reg.epnum = num; +} + +static inline void usbh_ll_chan_set_mps(volatile usb_host_chan_regs_t *chan, uint32_t mps) +{ + chan->hcchar_reg.mps = mps; +} + +static inline void usbh_ll_chan_hcchar_init(volatile usb_host_chan_regs_t *chan, int dev_addr, int ep_num, int mps, usb_priv_xfer_type_t type, bool is_in, bool is_ls) +{ + //Sets all persistent fields of the channel over its lifetimez + usbh_ll_chan_set_dev_addr(chan, dev_addr); + usbh_ll_chan_set_ep_type(chan, type); + usbh_ll_chan_set_lspddev(chan, is_ls); + usbh_ll_chan_set_dir(chan, is_in); + usbh_ll_chan_set_ep_num(chan, ep_num); + usbh_ll_chan_set_mps(chan, mps); +} + +// ---------------------------- HCINTi Register -------------------------------- + +static inline uint32_t usbh_ll_chan_intr_read_and_clear(volatile usb_host_chan_regs_t *chan) +{ + usb_hcint_reg_t hcint; + hcint.val = chan->hcint_reg.val; + chan->hcint_reg.val = hcint.val; + return hcint.val; +} + +// --------------------------- HCINTMSKi Register ------------------------------ + +static inline void usbh_ll_chan_set_intr_mask(volatile usb_host_chan_regs_t *chan, uint32_t mask) +{ + chan->hcintmsk_reg.val = mask; +} + +// ---------------------- HCTSIZi and HCDMAi Registers ------------------------- + +static inline void usbh_ll_chan_set_pid(volatile usb_host_chan_regs_t *chan, uint32_t data_pid) +{ + if (data_pid == 0) { + chan->hctsiz_reg.pid = 0; + } else { + chan->hctsiz_reg.pid = 2; + } +} + +static inline uint32_t usbh_ll_chan_get_pid(volatile usb_host_chan_regs_t *chan) { + if (chan->hctsiz_reg.pid == 0) { + return 0; //DATA0 + } else { + return 1; //DATA1 + } +} + +static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs_t *chan, + void *dmaaddr, + uint32_t qtd_idx) +{ + //Set HCDMAi + chan->hcdma_reg.val = 0; + chan->hcdma_reg.non_iso.dmaaddr = (((uint32_t)dmaaddr) >> 9) & 0x7FFFFF; //MSB of 512 byte aligned address + chan->hcdma_reg.non_iso.ctd = qtd_idx; +} + +static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, + void *dmaaddr, + uint32_t ntd) +{ + int n; + if (ntd == 2) { + n = 4; + } else if (ntd == 4) { + n = 5; + } else if (ntd == 8) { + n = 6; + } else if (ntd == 16) { + n = 7; + } else if (ntd == 32) { + n = 8; + } else { //ntd == 64 + n = 9; + } + //Set HCTSIZi + chan->hctsiz_reg.ntd = ntd -1; + chan->hctsiz_reg.sched_info = 0xFF; //Always set to 0xFF for FS + //Set HCDMAi + chan->hcdma_reg.iso.dmaaddr_ctd = (((uint32_t)dmaaddr) & 0x1FF) << (n-3); //ctd is set to 0 +} + +static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) +{ + return chan->hcdma_reg.non_iso.ctd; +} + +static inline void usbh_ll_chan_hctsiz_init(volatile usb_host_chan_regs_t *chan) +{ + chan->hctsiz_reg.dopng = 0; //Don't do ping + chan->hctsiz_reg.sched_info = 0xFF; //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels +} + +static inline void usbh_ll_chan_set_qtd_list_len(volatile usb_host_chan_regs_t *chan, int qtd_list_len) +{ + chan->hctsiz_reg.ntd = qtd_list_len - 1; //Set the length of the descriptor list +} + +// ---------------------------- HCDMABi Register ------------------------------- + +static inline void *usbh_ll_chan_get_cur_buff_addr(volatile usb_host_chan_regs_t *chan) +{ + return (void *)chan->hcdmab_reg.hcdmab; +} + +/* ----------------------------------------------------------------------------- +---------------------------- Scatter/Gather DMA QTDs --------------------------- +----------------------------------------------------------------------------- */ + +// ---------------------------- Helper Functions ------------------------------- + +/** + * @brief Get the base address of a channel's register based on the channel's index + * + * @param dev Start address of the DWC_OTG registers + * @param chan_idx The channel's index + * @return usb_host_chan_regs_t* Pointer to channel's registers + */ +static inline usb_host_chan_regs_t *usbh_ll_get_chan_regs(usbh_dev_t *dev, int chan_idx) +{ + return &dev->host_chans[chan_idx]; +} + +// ------------------------------ QTD related ---------------------------------- + +#define USBH_LL_QTD_STATUS_SUCCESS 0x0 //If QTD was processed, it indicates the data was transmitted/received successfully +#define USBH_LL_QTD_STATUS_PKTERR 0x1 //Data trasnmitted/received with errors (CRC/Timeout/Stuff/False EOP/Excessive NAK). +//Note: 0x2 is reserved +#define USBH_LL_QTD_STATUS_BUFFER 0x3 //AHB error occurred. +#define USBH_LL_QTD_STATUS_NOT_EXECUTED 0x4 //QTD as never processed + +/** + * @brief Set a QTD for a non isochronous IN transfer + * + * @param qtd Pointer to the QTD + * @param data_buff Pointer to buffer containing the data to transfer + * @param xfer_len Number of bytes in transfer. Setting 0 will do a zero length IN transfer. + * Non zero length must be mulitple of the endpoint's MPS. + * @param hoc Halt on complete (will generate an interrupt and halt the channel) + */ +static inline void usbh_ll_set_qtd_in(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc) +{ + qtd->buffer = data_buff; //Set pointer to data buffer + qtd->buffer_status_val = 0; //Reset all flags to zero + qtd->in_non_iso.xfer_size = xfer_len; + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD + qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd + } + qtd->in_non_iso.active = 1; +} + +/** + * @brief Set a QTD for a non isochronous OUT transfer + * + * @param qtd Poitner to the QTD + * @param data_buff Pointer to buffer containing the data to transfer + * @param xfer_len Number of bytes to transfer. Setting 0 will do a zero length transfer. + * For ctrl setup packets, this should be set to 8. + * @param hoc Halt on complete (will generate an interrupt) + * @param is_setup Indicates whether this is a control transfer setup packet or a normal OUT Data transfer. + * (As per the USB protocol, setup packets cannot be STALLd or NAKd by the device) + */ +static inline void usbh_ll_set_qtd_out(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc, bool is_setup) +{ + qtd->buffer = data_buff; //Set pointer to data buffer + qtd->buffer_status_val = 0; //Reset all flags to zero + qtd->out_non_iso.xfer_size = xfer_len; + if (is_setup) { + qtd->out_non_iso.is_setup = 1; + } + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD + qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd + } + qtd->out_non_iso.active = 1; +} + +/** + * @brief Set a QTD as NULL + * + * This sets the QTD to a value of 0. This is only useful when you need to insert + * blank QTDs into a list of QTDs + * + * @param qtd Pointer to the QTD + */ +static inline void usbh_ll_set_qtd_null(usbh_ll_dma_qtd_t *qtd) +{ + qtd->buffer = NULL; + qtd->buffer_status_val = 0; //Disable qtd by clearing it to zero. Used by interrupt/isoc as an unscheudled frame +} + +/** + * @brief Get the status of a QTD + * + * When a channel get's halted, call this to check whether each QTD was executed successfully + * + * @param qtd Poitner to the QTD + * @param[out] rem_len Number of bytes ramining in the QTD + * @param[out] status Status of the QTD + */ +static inline void usbh_ll_get_qtd_status(usbh_ll_dma_qtd_t *qtd, int *rem_len, int *status) +{ + //Status is the same regardless of IN or OUT + if (qtd->in_non_iso.active) { + //QTD was never processed + *status = USBH_LL_QTD_STATUS_NOT_EXECUTED; + } else { + *status = qtd->in_non_iso.rx_status; + } + *rem_len = qtd->in_non_iso.xfer_size; + //Clear the QTD just for safety + qtd->buffer_status_val = 0; +} + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32c3/include/libsodium/port_include/sodium/version.h b/tools/sdk/esp32c3/include/libsodium/port_include/sodium/version.h index c0bf5869deb..820996409e2 100644 --- a/tools/sdk/esp32c3/include/libsodium/port_include/sodium/version.h +++ b/tools/sdk/esp32c3/include/libsodium/port_include/sodium/version.h @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef sodium_version_H #define sodium_version_H diff --git a/tools/sdk/esp32c3/include/log/include/esp_log.h b/tools/sdk/esp32c3/include/log/include/esp_log.h index c41a9d3c2f2..02f7d167fe7 100644 --- a/tools/sdk/esp32c3/include/log/include/esp_log.h +++ b/tools/sdk/esp32c3/include/log/include/esp_log.h @@ -9,8 +9,10 @@ #include #include -#include "esp_rom_sys.h" #include "sdkconfig.h" +#if !defined(CONFIG_IDF_TARGET_LINUX) +#include "esp_rom_sys.h" +#endif // !CONFIG_IDF_TARGET_LINUX #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/ets_sys.h" // will be removed in idf v5.0 #elif CONFIG_IDF_TARGET_ESP32S2 diff --git a/tools/sdk/esp32c3/include/lwip/port/esp32/include/netif/openthreadif.h b/tools/sdk/esp32c3/include/lwip/port/esp32/include/netif/openthreadif.h new file mode 100644 index 00000000000..066e973ad24 --- /dev/null +++ b/tools/sdk/esp32c3/include/lwip/port/esp32/include/netif/openthreadif.h @@ -0,0 +1,52 @@ +// Copyright 2021 Espressif Systems (Shanghai) CO LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#ifndef _OPENTHREAD_LWIP_IF_H_ +#define _OPENTHREAD_LWIP_IF_H_ + +#include "lwip/netif.h" +#include "lwip/err.h" +#include "lwip/ip6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief This function initializes the OpenThread lwIP network interface. + * + * @param[in] netif The lwIP interface to initialize + * + * @return + * - ERR_OK + * + */ +err_t openthread_netif_init(struct netif *netif); + +/** + * @brief This function sends the buffer to the lwIP network interface + * + * @param[in] netif The lwIP interface to send to. + * @param[in] buffer The packet to send. + * @param[in] len The length of the buffer. + * @param[in] eb Unused. + * + */ +void openthread_netif_input(void *netif, void *buffer, size_t len, void *eb); + +#ifdef __cplusplus +} +#endif + +#endif /* _OPENTHREAD_LWIP_IF_H_ */ diff --git a/tools/sdk/esp32c3/include/soc/include/soc/lldesc.h b/tools/sdk/esp32c3/include/soc/include/soc/lldesc.h index 31e02125c40..ef74ce7aa4b 100644 --- a/tools/sdk/esp32c3/include/soc/include/soc/lldesc.h +++ b/tools/sdk/esp32c3/include/soc/include/soc/lldesc.h @@ -31,6 +31,24 @@ /** Maximum size of data in the buffer that a DMA descriptor can hold. */ #define LLDESC_MAX_NUM_PER_DESC (4096-4) +// Some DMA operations might impose certain alignment restrictions on the length +#define LLDESC_MAX_NUM_PER_DESC_16B_ALIGNED (4096 - 16) +#define LLDESC_MAX_NUM_PER_DESC_32B_ALIGNED (4096 - 32) + +/** + * Generate a linked list pointing to a (huge) buffer in an descriptor array. + * + * The caller should ensure there is enough size to hold the array, by calling + * ``lldesc_get_required_num_constrained`` with the same max_desc_size argument. + * + * @param[out] out_desc_array Output of a descriptor array, the head should be fed to the DMA. + * @param buffer Buffer for the descriptors to point to. + * @param size Size (or length for TX) of the buffer + * @param max_desc_size Maximum length of each descriptor + * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. + */ +void lldesc_setup_link_constrained(lldesc_t *out_desc_array, const void *buffer, int size, int max_desc_size, bool isrx); + /** * Generate a linked list pointing to a (huge) buffer in an descriptor array. * @@ -42,7 +60,7 @@ * @param size Size (or length for TX) of the buffer * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. */ -void lldesc_setup_link(lldesc_t *out_desc_array, const void *buffer, int size, bool isrx); +#define lldesc_setup_link(out_desc_array, buffer, size, isrx) lldesc_setup_link_constrained(out_desc_array, buffer, size, LLDESC_MAX_NUM_PER_DESC, isrx) /** * @brief Get the received length of a linked list, until end of the link or eof. @@ -61,7 +79,16 @@ int lldesc_get_received_len(lldesc_t* head, lldesc_t** out_next); * * @return Numbers required. */ -static inline int lldesc_get_required_num(int data_size) +static inline int lldesc_get_required_num_constrained(int data_size, int max_desc_size) { - return (data_size + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; + return (data_size + max_desc_size - 1) / max_desc_size; } + +/** + * Get the number of descriptors required for a given buffer size. + * + * @param data_size Size to check descriptor num. + * @param max_desc_size Maximum length of each descriptor + * @return Numbers required. + */ +#define lldesc_get_required_num(data_size) lldesc_get_required_num_constrained(data_size, LLDESC_MAX_NUM_PER_DESC) diff --git a/tools/sdk/esp32c3/include/soc/include/soc/sdmmc_periph.h b/tools/sdk/esp32c3/include/soc/include/soc/sdmmc_periph.h index 7a64f4c5fe8..c1d38fa29b8 100644 --- a/tools/sdk/esp32c3/include/soc/include/soc/sdmmc_periph.h +++ b/tools/sdk/esp32c3/include/soc/include/soc/sdmmc_periph.h @@ -15,6 +15,7 @@ #pragma once #include //include soc related (generated) definitions +#include "soc/soc_caps.h" #include "soc/soc_pins.h" #include "soc/sdmmc_reg.h" #include "soc/sdmmc_struct.h" @@ -24,25 +25,50 @@ extern "C" { #endif +/** + * Common SDMMC slot info, doesn't depend on SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} + */ typedef struct { - uint8_t clk_gpio; - uint8_t cmd_gpio; - uint8_t d0_gpio; - uint8_t d1_gpio; - uint8_t d2_gpio; - uint8_t d3_gpio; - uint8_t d4_gpio; - uint8_t d5_gpio; - uint8_t d6_gpio; - uint8_t d7_gpio; - uint8_t card_detect; - uint8_t write_protect; - uint8_t card_int; - uint8_t width; + uint8_t width; /*!< Maximum supported slot width (1, 4, 8) */ + uint8_t card_detect; /*!< Card detect signal in GPIO Matrix */ + uint8_t write_protect; /*!< Write protect signal in GPIO Matrix */ + uint8_t card_int; /*!< Card interrupt signal in GPIO Matrix */ } sdmmc_slot_info_t; -/** pin and signal information of each slot */ -extern const sdmmc_slot_info_t sdmmc_slot_info[]; +/** Width and GPIO matrix signal numbers for auxillary SD host signals, one structure per slot */ +extern const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS]; + +/** + * This structure lists pin numbers (if SOC_SDMMC_USE_IOMUX is set) + * or GPIO Matrix signal numbers (if SOC_SDMMC_USE_GPIO_MATRIX is set) + * for the SD bus signals. Field names match SD bus signal names. + */ +typedef struct { + uint8_t clk; + uint8_t cmd; + uint8_t d0; + uint8_t d1; + uint8_t d2; + uint8_t d3; + uint8_t d4; + uint8_t d5; + uint8_t d6; + uint8_t d7; +} sdmmc_slot_io_info_t; + +/* Note: it is in theory possible to have both IOMUX and GPIO Matrix supported + * in the same SoC. However this is not used on any SoC at this point, and would + * complicate the driver. Hence only one of these options is supported at a time. + */ +#if SOC_SDMMC_USE_IOMUX +/** GPIO pin numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_num[SOC_SDMMC_NUM_SLOTS]; + +#elif SOC_SDMMC_USE_GPIO_MATRIX +/** GPIO matrix signal numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_sig[SOC_SDMMC_NUM_SLOTS]; + +#endif // SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} #ifdef __cplusplus } diff --git a/tools/sdk/esp32c3/include/spi_flash/include/esp_flash_spi_init.h b/tools/sdk/esp32c3/include/spi_flash/include/esp_flash_spi_init.h index 85334d3ea5a..e586a8778c6 100644 --- a/tools/sdk/esp32c3/include/spi_flash/include/esp_flash_spi_init.h +++ b/tools/sdk/esp32c3/include/spi_flash/include/esp_flash_spi_init.h @@ -34,6 +34,7 @@ typedef struct { * automatically assigned by the SPI bus lock. */ int cs_id; + uint32_t cs_setup; ///< (cycles-1) of prepare phase by spi clock } esp_flash_spi_device_config_t; /** diff --git a/tools/sdk/esp32c3/include/spiffs/include/spiffs_config.h b/tools/sdk/esp32c3/include/spiffs/include/spiffs_config.h index ca7f0cc6fb9..5cc3d78049c 100644 --- a/tools/sdk/esp32c3/include/spiffs/include/spiffs_config.h +++ b/tools/sdk/esp32c3/include/spiffs/include/spiffs_config.h @@ -19,6 +19,7 @@ #include #include #include +#include // compile time switches #define SPIFFS_TAG "SPIFFS" diff --git a/tools/sdk/esp32c3/lib/libphy.a b/tools/sdk/esp32c3/ld/libphy.a similarity index 100% rename from tools/sdk/esp32c3/lib/libphy.a rename to tools/sdk/esp32c3/ld/libphy.a diff --git a/tools/sdk/esp32c3/lib/libapp_update.a b/tools/sdk/esp32c3/lib/libapp_update.a index 7c75f11ec50..d065788848e 100644 Binary files a/tools/sdk/esp32c3/lib/libapp_update.a and b/tools/sdk/esp32c3/lib/libapp_update.a differ diff --git a/tools/sdk/esp32c3/lib/libasio.a b/tools/sdk/esp32c3/lib/libasio.a index dee67efa1e9..4bec747878f 100644 Binary files a/tools/sdk/esp32c3/lib/libasio.a and b/tools/sdk/esp32c3/lib/libasio.a differ diff --git a/tools/sdk/esp32c3/lib/libbootloader_support.a b/tools/sdk/esp32c3/lib/libbootloader_support.a index 49395c5ae77..836267aa7b3 100644 Binary files a/tools/sdk/esp32c3/lib/libbootloader_support.a and b/tools/sdk/esp32c3/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32c3/lib/libbt.a b/tools/sdk/esp32c3/lib/libbt.a index 5f84f6e07ba..3b995613d95 100644 Binary files a/tools/sdk/esp32c3/lib/libbt.a and b/tools/sdk/esp32c3/lib/libbt.a differ diff --git a/tools/sdk/esp32c3/lib/libconsole.a b/tools/sdk/esp32c3/lib/libconsole.a index 6f34db63c16..1c0904607a0 100644 Binary files a/tools/sdk/esp32c3/lib/libconsole.a and b/tools/sdk/esp32c3/lib/libconsole.a differ diff --git a/tools/sdk/esp32c3/lib/libcxx.a b/tools/sdk/esp32c3/lib/libcxx.a index 3bece1b7aeb..bbb85799443 100644 Binary files a/tools/sdk/esp32c3/lib/libcxx.a and b/tools/sdk/esp32c3/lib/libcxx.a differ diff --git a/tools/sdk/esp32c3/lib/libdriver.a b/tools/sdk/esp32c3/lib/libdriver.a index dab33de7158..89d00d59eaa 100644 Binary files a/tools/sdk/esp32c3/lib/libdriver.a and b/tools/sdk/esp32c3/lib/libdriver.a differ diff --git a/tools/sdk/esp32c3/lib/libefuse.a b/tools/sdk/esp32c3/lib/libefuse.a index 1b08e1699bb..bb0cee4c3e0 100644 Binary files a/tools/sdk/esp32c3/lib/libefuse.a and b/tools/sdk/esp32c3/lib/libefuse.a differ diff --git a/tools/sdk/esp32c3/lib/libesp-tls.a b/tools/sdk/esp32c3/lib/libesp-tls.a index a0279dbb57f..78e528bfb64 100644 Binary files a/tools/sdk/esp32c3/lib/libesp-tls.a and b/tools/sdk/esp32c3/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32c3/lib/libesp32c3.a b/tools/sdk/esp32c3/lib/libesp32c3.a index f2e08f2be76..9c2a2e08a24 100644 Binary files a/tools/sdk/esp32c3/lib/libesp32c3.a and b/tools/sdk/esp32c3/lib/libesp32c3.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_adc_cal.a b/tools/sdk/esp32c3/lib/libesp_adc_cal.a index fd6f9177966..799233d6395 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_adc_cal.a and b/tools/sdk/esp32c3/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_common.a b/tools/sdk/esp32c3/lib/libesp_common.a index 5f527436108..99b25cfaa84 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_common.a and b/tools/sdk/esp32c3/lib/libesp_common.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_eth.a b/tools/sdk/esp32c3/lib/libesp_eth.a index 55bac574220..5e7682b471d 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_eth.a and b/tools/sdk/esp32c3/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_event.a b/tools/sdk/esp32c3/lib/libesp_event.a index 945b197276f..38be15a905e 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_event.a and b/tools/sdk/esp32c3/lib/libesp_event.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_gdbstub.a b/tools/sdk/esp32c3/lib/libesp_gdbstub.a index ba0df2585fd..4f009ee05aa 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_gdbstub.a and b/tools/sdk/esp32c3/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hid.a b/tools/sdk/esp32c3/lib/libesp_hid.a index d6ac1eb552b..6178856541c 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hid.a and b/tools/sdk/esp32c3/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_client.a b/tools/sdk/esp32c3/lib/libesp_http_client.a index 6ac4a4bf11d..6cbfb65330b 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_client.a and b/tools/sdk/esp32c3/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_server.a b/tools/sdk/esp32c3/lib/libesp_http_server.a index 0c019615c6d..bef35a4db8f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_server.a and b/tools/sdk/esp32c3/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_ota.a b/tools/sdk/esp32c3/lib/libesp_https_ota.a index a8ea2ed71d8..88f2b7c0f5d 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_ota.a and b/tools/sdk/esp32c3/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_server.a b/tools/sdk/esp32c3/lib/libesp_https_server.a index 942aa7b2ac4..454dff72f59 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_server.a and b/tools/sdk/esp32c3/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hw_support.a b/tools/sdk/esp32c3/lib/libesp_hw_support.a index 2392f7e9508..ef0dabbd524 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hw_support.a and b/tools/sdk/esp32c3/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_lcd.a b/tools/sdk/esp32c3/lib/libesp_lcd.a index 3a8dde40cee..7f003db9b57 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_lcd.a and b/tools/sdk/esp32c3/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_littlefs.a b/tools/sdk/esp32c3/lib/libesp_littlefs.a index afd9320c8a6..2f96cfa2a98 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_littlefs.a and b/tools/sdk/esp32c3/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a index c782763b7ca..e085c64e407 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a and b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_netif.a b/tools/sdk/esp32c3/lib/libesp_netif.a index e9ec0c7942d..1d9ba2f9413 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_netif.a and b/tools/sdk/esp32c3/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_phy.a b/tools/sdk/esp32c3/lib/libesp_phy.a new file mode 100644 index 00000000000..fc732e13b7d Binary files /dev/null and b/tools/sdk/esp32c3/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_pm.a b/tools/sdk/esp32c3/lib/libesp_pm.a index 57c8c6fda2d..809224d1e40 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_pm.a and b/tools/sdk/esp32c3/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a index 856535152a9..928aa699b5d 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_system.a b/tools/sdk/esp32c3/lib/libesp_system.a index eba90bf45cd..4ef30a6d7c6 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_system.a and b/tools/sdk/esp32c3/lib/libesp_system.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_timer.a b/tools/sdk/esp32c3/lib/libesp_timer.a index 013bb9d8192..f0ba91e62c7 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_timer.a and b/tools/sdk/esp32c3/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_websocket_client.a b/tools/sdk/esp32c3/lib/libesp_websocket_client.a index 6648e4e85b2..8dfbaa330d9 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_websocket_client.a and b/tools/sdk/esp32c3/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_wifi.a b/tools/sdk/esp32c3/lib/libesp_wifi.a index 7876e176a40..815028146a0 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_wifi.a and b/tools/sdk/esp32c3/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32c3/lib/libespcoredump.a b/tools/sdk/esp32c3/lib/libespcoredump.a index 9de5fb3f4ad..83c99caa324 100644 Binary files a/tools/sdk/esp32c3/lib/libespcoredump.a and b/tools/sdk/esp32c3/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32c3/lib/libfatfs.a b/tools/sdk/esp32c3/lib/libfatfs.a index 9bc685643a4..4247cd06e03 100644 Binary files a/tools/sdk/esp32c3/lib/libfatfs.a and b/tools/sdk/esp32c3/lib/libfatfs.a differ diff --git a/tools/sdk/esp32c3/lib/libfreemodbus.a b/tools/sdk/esp32c3/lib/libfreemodbus.a index fcc87075e01..8ad2b3a4482 100644 Binary files a/tools/sdk/esp32c3/lib/libfreemodbus.a and b/tools/sdk/esp32c3/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32c3/lib/libfreertos.a b/tools/sdk/esp32c3/lib/libfreertos.a index c4b4e8d1e13..a143875104a 100644 Binary files a/tools/sdk/esp32c3/lib/libfreertos.a and b/tools/sdk/esp32c3/lib/libfreertos.a differ diff --git a/tools/sdk/esp32c3/lib/libhal.a b/tools/sdk/esp32c3/lib/libhal.a index 8d8ec17ff85..118485fe649 100644 Binary files a/tools/sdk/esp32c3/lib/libhal.a and b/tools/sdk/esp32c3/lib/libhal.a differ diff --git a/tools/sdk/esp32c3/lib/libheap.a b/tools/sdk/esp32c3/lib/libheap.a index 9c7c3466029..0a60da3b299 100644 Binary files a/tools/sdk/esp32c3/lib/libheap.a and b/tools/sdk/esp32c3/lib/libheap.a differ diff --git a/tools/sdk/esp32c3/lib/liblibsodium.a b/tools/sdk/esp32c3/lib/liblibsodium.a index 4c080308911..643e7f4f05e 100644 Binary files a/tools/sdk/esp32c3/lib/liblibsodium.a and b/tools/sdk/esp32c3/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32c3/lib/liblog.a b/tools/sdk/esp32c3/lib/liblog.a index 937ab3cc1ce..5debc9d3da1 100644 Binary files a/tools/sdk/esp32c3/lib/liblog.a and b/tools/sdk/esp32c3/lib/liblog.a differ diff --git a/tools/sdk/esp32c3/lib/liblwip.a b/tools/sdk/esp32c3/lib/liblwip.a index 527eb87086c..f8fead0faff 100644 Binary files a/tools/sdk/esp32c3/lib/liblwip.a and b/tools/sdk/esp32c3/lib/liblwip.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedcrypto.a b/tools/sdk/esp32c3/lib/libmbedcrypto.a index 1bd7e5867d5..c1001cd84c0 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedcrypto.a and b/tools/sdk/esp32c3/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedtls.a b/tools/sdk/esp32c3/lib/libmbedtls.a index 719b090f937..92705864452 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedtls.a and b/tools/sdk/esp32c3/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32c3/lib/libmdns.a b/tools/sdk/esp32c3/lib/libmdns.a index 71195d91644..b89a3ad30cf 100644 Binary files a/tools/sdk/esp32c3/lib/libmdns.a and b/tools/sdk/esp32c3/lib/libmdns.a differ diff --git a/tools/sdk/esp32c3/lib/libmqtt.a b/tools/sdk/esp32c3/lib/libmqtt.a index ff3cab10ecb..d6344369088 100644 Binary files a/tools/sdk/esp32c3/lib/libmqtt.a and b/tools/sdk/esp32c3/lib/libmqtt.a differ diff --git a/tools/sdk/esp32c3/lib/libnewlib.a b/tools/sdk/esp32c3/lib/libnewlib.a index a3d2a5f484b..204894ead3d 100644 Binary files a/tools/sdk/esp32c3/lib/libnewlib.a and b/tools/sdk/esp32c3/lib/libnewlib.a differ diff --git a/tools/sdk/esp32c3/lib/libnvs_flash.a b/tools/sdk/esp32c3/lib/libnvs_flash.a index 17846597ed8..240d9bedd41 100644 Binary files a/tools/sdk/esp32c3/lib/libnvs_flash.a and b/tools/sdk/esp32c3/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32c3/lib/libopenssl.a b/tools/sdk/esp32c3/lib/libopenssl.a index df5458005e3..8d081a2d070 100644 Binary files a/tools/sdk/esp32c3/lib/libopenssl.a and b/tools/sdk/esp32c3/lib/libopenssl.a differ diff --git a/tools/sdk/esp32c3/lib/libprotocomm.a b/tools/sdk/esp32c3/lib/libprotocomm.a index 0d71f456043..92231ccb442 100644 Binary files a/tools/sdk/esp32c3/lib/libprotocomm.a and b/tools/sdk/esp32c3/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32c3/lib/libpthread.a b/tools/sdk/esp32c3/lib/libpthread.a index bf822a8501c..4054dde0e5f 100644 Binary files a/tools/sdk/esp32c3/lib/libpthread.a and b/tools/sdk/esp32c3/lib/libpthread.a differ diff --git a/tools/sdk/esp32c3/lib/libsdmmc.a b/tools/sdk/esp32c3/lib/libsdmmc.a index 9c11cde09d9..15e5c1b2e19 100644 Binary files a/tools/sdk/esp32c3/lib/libsdmmc.a and b/tools/sdk/esp32c3/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32c3/lib/libsoc.a b/tools/sdk/esp32c3/lib/libsoc.a index b6fdb814242..5f91f233ff9 100644 Binary files a/tools/sdk/esp32c3/lib/libsoc.a and b/tools/sdk/esp32c3/lib/libsoc.a differ diff --git a/tools/sdk/esp32c3/lib/libspi_flash.a b/tools/sdk/esp32c3/lib/libspi_flash.a index 432f004bd19..89a83931303 100644 Binary files a/tools/sdk/esp32c3/lib/libspi_flash.a and b/tools/sdk/esp32c3/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/lib/libspiffs.a b/tools/sdk/esp32c3/lib/libspiffs.a index 33450a38931..8aa7929a7a1 100644 Binary files a/tools/sdk/esp32c3/lib/libspiffs.a and b/tools/sdk/esp32c3/lib/libspiffs.a differ diff --git a/tools/sdk/esp32c3/lib/libtcp_transport.a b/tools/sdk/esp32c3/lib/libtcp_transport.a index d9c5dcccf0e..29b99b3bfc2 100644 Binary files a/tools/sdk/esp32c3/lib/libtcp_transport.a and b/tools/sdk/esp32c3/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32c3/lib/libtcpip_adapter.a b/tools/sdk/esp32c3/lib/libtcpip_adapter.a index fb16a0aab12..5b234e76d8d 100644 Binary files a/tools/sdk/esp32c3/lib/libtcpip_adapter.a and b/tools/sdk/esp32c3/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32c3/lib/libvfs.a b/tools/sdk/esp32c3/lib/libvfs.a index cad692e46f3..5a8564e7851 100644 Binary files a/tools/sdk/esp32c3/lib/libvfs.a and b/tools/sdk/esp32c3/lib/libvfs.a differ diff --git a/tools/sdk/esp32c3/lib/libwear_levelling.a b/tools/sdk/esp32c3/lib/libwear_levelling.a index 43fd2a2012a..5fb4575be10 100644 Binary files a/tools/sdk/esp32c3/lib/libwear_levelling.a and b/tools/sdk/esp32c3/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32c3/lib/libwifi_provisioning.a b/tools/sdk/esp32c3/lib/libwifi_provisioning.a index 12a48b39ed8..720ee227b61 100644 Binary files a/tools/sdk/esp32c3/lib/libwifi_provisioning.a and b/tools/sdk/esp32c3/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32c3/lib/libwpa_supplicant.a b/tools/sdk/esp32c3/lib/libwpa_supplicant.a index dc5fcb93d96..41f3dd33781 100644 Binary files a/tools/sdk/esp32c3/lib/libwpa_supplicant.a and b/tools/sdk/esp32c3/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32c3/sdkconfig b/tools/sdk/esp32c3/sdkconfig index fd5f4adf524..dc20dd36237 100644 --- a/tools/sdk/esp32c3/sdkconfig +++ b/tools/sdk/esp32c3/sdkconfig @@ -726,6 +726,15 @@ CONFIG_ESP_NETIF_TCPIP_LWIP=y CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y # end of ESP NETIF Adapter +# +# PHY +# +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# end of PHY + # # Power Management # @@ -740,6 +749,7 @@ CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y @@ -810,18 +820,12 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set +CONFIG_ESP_WIFI_FTM_ENABLE=y +CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT=y +CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # end of Wi-Fi -# -# PHY -# -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# end of PHY - # # Core dump # @@ -1141,6 +1145,7 @@ CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y # CONFIG_MBEDTLS_ECP_RESTARTABLE is not set # CONFIG_MBEDTLS_CMAC_C is not set CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_HARDWARE_MPI=y CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin index b4c3144d964..cefd3ecd37f 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin index 7733796a0e4..cfd2b60a201 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin index 07271b41449..835c840fd73 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin index a6a6f0ac03c..2ec79cda30f 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin index d5d586d741a..8bbfe324a63 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin index fbd646fe222..d731f48abf2 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin index 6a6ff275157..6f8d1f15b03 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin index 4bf3a242d60..47c64065dba 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/audio/audio_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/audio/audio_device.h index b8e6ef9c09f..5a469523c9f 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/audio/audio_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/audio/audio_device.h @@ -28,10 +28,6 @@ #ifndef _TUSB_AUDIO_DEVICE_H_ #define _TUSB_AUDIO_DEVICE_H_ -#include "assert.h" -#include "common/tusb_common.h" -#include "device/usbd.h" - #include "audio.h" //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_device.h index 986585c5be2..7ff757addd6 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_device.h @@ -28,7 +28,6 @@ #define _TUSB_CDC_DEVICE_H_ #include "common/tusb_common.h" -#include "device/usbd.h" #include "cdc.h" //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_host.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_host.h index 66c2f0727cd..6ff39270963 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_host.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/cdc/cdc_host.h @@ -27,8 +27,6 @@ #ifndef _TUSB_CDC_HOST_H_ #define _TUSB_CDC_HOST_H_ -#include "common/tusb_common.h" -#include "host/usbh.h" #include "cdc.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_device.h index c45c436c551..9a09a46b1b3 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_device.h @@ -27,8 +27,6 @@ #ifndef _TUSB_DFU_DEVICE_H_ #define _TUSB_DFU_DEVICE_H_ -#include "common/tusb_common.h" -#include "device/usbd.h" #include "dfu.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_rt_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_rt_device.h index 0e5fd005ac2..babaa8214d7 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_rt_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/dfu/dfu_rt_device.h @@ -27,8 +27,6 @@ #ifndef _TUSB_DFU_RT_DEVICE_H_ #define _TUSB_DFU_RT_DEVICE_H_ -#include "common/tusb_common.h" -#include "device/usbd.h" #include "dfu.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h index 61274be4d12..beb755888d2 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h @@ -27,8 +27,6 @@ #ifndef _TUSB_HID_DEVICE_H_ #define _TUSB_HID_DEVICE_H_ -#include "common/tusb_common.h" -#include "device/usbd.h" #include "hid.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_host.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_host.h index ea693df6990..2e4cce600b6 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_host.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_host.h @@ -24,14 +24,9 @@ * This file is part of the TinyUSB stack. */ -/** \addtogroup ClassDriver_HID - * @{ */ - #ifndef _TUSB_HID_HOST_H_ #define _TUSB_HID_HOST_H_ -#include "common/tusb_common.h" -#include "host/usbh.h" #include "hid.h" #ifdef __cplusplus @@ -134,5 +129,3 @@ void hidh_close(uint8_t dev_addr); #endif #endif /* _TUSB_HID_HOST_H_ */ - -/** @} */ // ClassDriver_HID diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/midi/midi_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/midi/midi_device.h index 67f03930cef..211edc8d1c4 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/midi/midi_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/midi/midi_device.h @@ -27,9 +27,6 @@ #ifndef _TUSB_MIDI_DEVICE_H_ #define _TUSB_MIDI_DEVICE_H_ -#include "common/tusb_common.h" -#include "device/usbd.h" - #include "class/audio/audio.h" #include "midi.h" diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc.h index 0bdc00692a3..84b6e4d799e 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc.h @@ -24,13 +24,6 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup group_class - * \defgroup ClassDriver_MSC MassStorage (MSC) - * @{ */ - -/** \defgroup ClassDriver_MSC_Common Common Definitions - * @{ */ - #ifndef _TUSB_MSC_H_ #define _TUSB_MSC_H_ @@ -387,6 +380,3 @@ TU_VERIFY_STATIC(sizeof(scsi_write10_t) == 10, "size is not correct"); #endif #endif /* _TUSB_MSC_H_ */ - -/// @} -/// @} diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_device.h index 469f2f2f709..8f90ef4ad59 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_device.h @@ -28,7 +28,6 @@ #define _TUSB_MSC_DEVICE_H_ #include "common/tusb_common.h" -#include "device/usbd.h" #include "msc.h" #ifdef __cplusplus @@ -51,53 +50,45 @@ TU_VERIFY_STATIC(CFG_TUD_MSC_EP_BUFSIZE < UINT16_MAX, "Size is not correct"); -/** \addtogroup ClassDriver_MSC - * @{ - * \defgroup MSC_Device Device - * @{ */ +//--------------------------------------------------------------------+ +// Application API +//--------------------------------------------------------------------+ +// Set SCSI sense response bool tud_msc_set_sense(uint8_t lun, uint8_t sense_key, uint8_t add_sense_code, uint8_t add_sense_qualifier); //--------------------------------------------------------------------+ // Application Callbacks (WEAK is optional) //--------------------------------------------------------------------+ -/** - * Invoked when received \ref SCSI_CMD_READ_10 command - * \param[in] lun Logical unit number - * \param[in] lba Logical Block Address to be read - * \param[in] offset Byte offset from LBA - * \param[out] buffer Buffer which application need to update with the response data. - * \param[in] bufsize Requested bytes - * - * \return Number of byte read, if it is less than requested bytes by \a \b bufsize. Tinyusb will transfer - * this amount first and invoked this again for remaining data. - * - * \retval zero Indicate application is not ready yet to response e.g disk I/O is not complete. - * tinyusb will invoke this callback with the same parameters again some time later. - * - * \retval negative Indicate error e.g reading disk I/O. tinyusb will \b STALL the corresponding - * endpoint and return failed status in command status wrapper phase. - */ +// Invoked when received SCSI READ10 command +// - Address = lba * BLOCK_SIZE + offset +// - offset is only needed if CFG_TUD_MSC_EP_BUFSIZE is smaller than BLOCK_SIZE. +// +// - Application fill the buffer (up to bufsize) with address contents and return number of read byte. If +// - read < bufsize : These bytes are transferred first and callback invoked again for remaining data. +// +// - read == 0 : Indicate application is not ready yet e.g disk I/O busy. +// Callback invoked again with the same parameters later on. +// +// - read < 0 : Indicate application error e.g invalid address. This request will be STALLed +// and return failed status in command status wrapper phase. int32_t tud_msc_read10_cb (uint8_t lun, uint32_t lba, uint32_t offset, void* buffer, uint32_t bufsize); -/** - * Invoked when received \ref SCSI_CMD_WRITE_10 command - * \param[in] lun Logical unit number - * \param[in] lba Logical Block Address to be write - * \param[in] offset Byte offset from LBA - * \param[out] buffer Buffer which holds written data. - * \param[in] bufsize Requested bytes - * - * \return Number of byte written, if it is less than requested bytes by \a \b bufsize. Tinyusb will proceed with - * other work and invoked this again with adjusted parameters. - * - * \retval zero Indicate application is not ready yet e.g disk I/O is not complete. - * Tinyusb will invoke this callback with the same parameters again some time later. - * - * \retval negative Indicate error writing disk I/O. Tinyusb will \b STALL the corresponding - * endpoint and return failed status in command status wrapper phase. - */ +// Invoked when received SCSI WRITE10 command +// - Address = lba * BLOCK_SIZE + offset +// - offset is only needed if CFG_TUD_MSC_EP_BUFSIZE is smaller than BLOCK_SIZE. +// +// - Application write data from buffer to address contents (up to bufsize) and return number of written byte. If +// - write < bufsize : callback invoked again with remaining data later on. +// +// - write == 0 : Indicate application is not ready yet e.g disk I/O busy. +// Callback invoked again with the same parameters later on. +// +// - write < 0 : Indicate application error e.g invalid address. This request will be STALLed +// and return failed status in command status wrapper phase. +// +// TODO change buffer to const uint8_t* int32_t tud_msc_write10_cb (uint8_t lun, uint32_t lba, uint32_t offset, uint8_t* buffer, uint32_t bufsize); // Invoked when received SCSI_CMD_INQUIRY @@ -152,9 +143,6 @@ TU_ATTR_WEAK void tud_msc_scsi_complete_cb(uint8_t lun, uint8_t const scsi_cmd[1 // Hook to make a mass storage device read-only. TODO remove TU_ATTR_WEAK bool tud_msc_is_writable_cb(uint8_t lun); -/** @} */ -/** @} */ - //--------------------------------------------------------------------+ // Internal Class Driver API //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_host.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_host.h index b5ffcd401ef..ce4fe64dc97 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_host.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/msc/msc_host.h @@ -27,8 +27,6 @@ #ifndef _TUSB_MSC_HOST_H_ #define _TUSB_MSC_HOST_H_ -#include "common/tusb_common.h" -#include "host/usbh.h" #include "msc.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/net/net_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/net/net_device.h index 38c47d64769..f030f3077ac 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/net/net_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/net/net_device.h @@ -28,8 +28,6 @@ #ifndef _TUSB_NET_DEVICE_H_ #define _TUSB_NET_DEVICE_H_ -#include "common/tusb_common.h" -#include "device/usbd.h" #include "class/cdc/cdc.h" /* declared here, NOT in usb_descriptors.c, so that the driver can intelligently ZLP as needed */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_device.h index 2c3d79a3de8..6d9c784c086 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_device.h @@ -28,7 +28,6 @@ #define _TUSB_VENDOR_DEVICE_H_ #include "common/tusb_common.h" -#include "device/usbd.h" #ifndef CFG_TUD_VENDOR_EPSIZE #define CFG_TUD_VENDOR_EPSIZE 64 diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_host.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_host.h index fa1879376f0..07fa56c61b0 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_host.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/vendor/vendor_host.h @@ -24,15 +24,10 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup group_class - * \defgroup Group_Custom Custom Class (not supported yet) - * @{ */ - #ifndef _TUSB_VENDOR_HOST_H_ #define _TUSB_VENDOR_HOST_H_ #include "common/tusb_common.h" -#include "host/usbh.h" #ifdef __cplusplus extern "C" { @@ -70,5 +65,3 @@ void cush_close(uint8_t dev_addr); #endif #endif /* _TUSB_VENDOR_HOST_H_ */ - -/** @} */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_common.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_common.h index 88e85c9e002..3350ed86c28 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_common.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_common.h @@ -24,10 +24,6 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup Group_Common - * \defgroup Group_CommonH common.h - * @{ */ - #ifndef _TUSB_COMMON_H_ #define _TUSB_COMMON_H_ @@ -72,10 +68,11 @@ #include "tusb_option.h" #include "tusb_compiler.h" #include "tusb_verify.h" -#include "tusb_error.h" // TODO remove -#include "tusb_timeout.h" #include "tusb_types.h" +#include "tusb_error.h" // TODO remove +#include "tusb_timeout.h" // TODO remove + //------------- Mem -------------// #define tu_memclr(buffer, size) memset((buffer), 0, (size)) #define tu_varclr(_var) tu_memclr(_var, sizeof(*(_var))) @@ -287,8 +284,9 @@ TU_ATTR_ALWAYS_INLINE static inline void tu_unaligned_write16 (void* mem, ui // CFG_TUSB_DEBUG for debugging // 0 : no debug -// 1 : print when there is error -// 2 : print out log +// 1 : print error +// 2 : print warning +// 3 : print info #if CFG_TUSB_DEBUG void tu_print_mem(void const *buf, uint32_t count, uint8_t indent); @@ -306,25 +304,39 @@ void tu_print_var(uint8_t const* buf, uint32_t bufsize) for(uint32_t i=0; i 1 +// Log Level 2: Warn +#if CFG_TUSB_DEBUG >= 2 #define TU_LOG2 TU_LOG1 #define TU_LOG2_MEM TU_LOG1_MEM #define TU_LOG2_VAR TU_LOG1_VAR #define TU_LOG2_INT TU_LOG1_INT #define TU_LOG2_HEX TU_LOG1_HEX - #define TU_LOG2_LOCATION() TU_LOG1_LOCATION() #endif +// Log Level 3: Info +#if CFG_TUSB_DEBUG >= 3 + #define TU_LOG3 TU_LOG1 + #define TU_LOG3_MEM TU_LOG1_MEM + #define TU_LOG3_VAR TU_LOG1_VAR + #define TU_LOG3_INT TU_LOG1_INT + #define TU_LOG3_HEX TU_LOG1_HEX +#endif typedef struct { @@ -350,14 +362,23 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #endif // CFG_TUSB_DEBUG +#ifndef TU_LOG +#define TU_LOG(n, ...) +#define TU_LOG_MEM(n, ...) +#define TU_LOG_VAR(n, ...) +#define TU_LOG_INT(n, ...) +#define TU_LOG_HEX(n, ...) +#define TU_LOG_LOCATION() +#define TU_LOG_FAILED() +#endif + +// TODO replace all TU_LOGn with TU_LOG(n) #ifndef TU_LOG1 #define TU_LOG1(...) #define TU_LOG1_MEM(...) #define TU_LOG1_VAR(...) #define TU_LOG1_INT(...) #define TU_LOG1_HEX(...) - #define TU_LOG1_LOCATION() - #define TU_LOG1_FAILED() #endif #ifndef TU_LOG2 @@ -366,7 +387,14 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #define TU_LOG2_VAR(...) #define TU_LOG2_INT(...) #define TU_LOG2_HEX(...) - #define TU_LOG2_LOCATION() +#endif + +#ifndef TU_LOG3 + #define TU_LOG3(...) + #define TU_LOG3_MEM(...) + #define TU_LOG3_VAR(...) + #define TU_LOG3_INT(...) + #define TU_LOG3_HEX(...) #endif #ifdef __cplusplus @@ -374,5 +402,3 @@ static inline const char* tu_lookup_find(tu_lookup_table_t const* p_table, uint3 #endif #endif /* _TUSB_COMMON_H_ */ - -/** @} */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_fifo.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_fifo.h index 8d73911f040..cf299269d0e 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_fifo.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/common/tusb_fifo.h @@ -28,6 +28,10 @@ #ifndef _TUSB_FIFO_H_ #define _TUSB_FIFO_H_ +#ifdef __cplusplus +extern "C" { +#endif + // Due to the use of unmasked pointers, this FIFO does not suffer from loosing // one item slice. Furthermore, write and read operations are completely // decoupled as write and read functions do not modify a common state. Henceforth, @@ -37,25 +41,17 @@ // read pointers can be updated from within a DMA ISR. Overflows are detectable // within a certain number (see tu_fifo_overflow()). +#include "common/tusb_common.h" + // mutex is only needed for RTOS // for OS None, we don't get preempted #define CFG_FIFO_MUTEX (CFG_TUSB_OS != OPT_OS_NONE) -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - #if CFG_FIFO_MUTEX #include "osal/osal.h" #define tu_fifo_mutex_t osal_mutex_t #endif -/** \struct tu_fifo_t - * \brief Simple Circular FIFO - */ typedef struct { uint8_t* buffer ; ///< buffer pointer @@ -104,7 +100,8 @@ bool tu_fifo_clear(tu_fifo_t *f); bool tu_fifo_config(tu_fifo_t *f, void* buffer, uint16_t depth, uint16_t item_size, bool overwritable); #if CFG_FIFO_MUTEX -static inline void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t write_mutex_hdl, tu_fifo_mutex_t read_mutex_hdl) +TU_ATTR_ALWAYS_INLINE static inline +void tu_fifo_config_mutex(tu_fifo_t *f, tu_fifo_mutex_t write_mutex_hdl, tu_fifo_mutex_t read_mutex_hdl) { f->mutex_wr = write_mutex_hdl; f->mutex_rd = read_mutex_hdl; @@ -129,15 +126,16 @@ uint16_t tu_fifo_remaining (tu_fifo_t* f); bool tu_fifo_overflowed (tu_fifo_t* f); void tu_fifo_correct_read_pointer (tu_fifo_t* f); -static inline uint16_t tu_fifo_depth(tu_fifo_t* f) +TU_ATTR_ALWAYS_INLINE static inline +uint16_t tu_fifo_depth(tu_fifo_t* f) { return f->depth; } // Pointer modifications intended to be used in combinations with DMAs. // USE WITH CARE - NO SAFTY CHECKS CONDUCTED HERE! NOT MUTEX PROTECTED! -void tu_fifo_advance_write_pointer (tu_fifo_t *f, uint16_t n); -void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n); +void tu_fifo_advance_write_pointer(tu_fifo_t *f, uint16_t n); +void tu_fifo_advance_read_pointer (tu_fifo_t *f, uint16_t n); // If you want to read/write from/to the FIFO by use of a DMA, you may need to conduct two copies // to handle a possible wrapping part. These functions deliver a pointer to start diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd.h index 71e88054cf6..e17c62d4e3a 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd.h @@ -28,6 +28,7 @@ #define _TUSB_DCD_H_ #include "common/tusb_common.h" +#include "osal/osal.h" #include "common/tusb_fifo.h" #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h index 53519c4dec9..3857295d7f2 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h @@ -70,8 +70,8 @@ bool tud_mounted(void); bool tud_suspended(void); // Check if device is ready to transfer -TU_ATTR_ALWAYS_INLINE -static inline bool tud_ready(void) +TU_ATTR_ALWAYS_INLINE static inline +bool tud_ready(void) { return tud_mounted() && !tud_suspended(); } diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd_pvt.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd_pvt.h index 44310f02213..65fdadf5139 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd_pvt.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd_pvt.h @@ -73,7 +73,7 @@ void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr); bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes); // Submit a usb ISO transfer by use of a FIFO (ring buffer) - all bytes in FIFO get transmitted -bool usbd_edpt_iso_xfer(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes); +bool usbd_edpt_xfer_fifo(uint8_t rhport, uint8_t ep_addr, tu_fifo_t * ff, uint16_t total_bytes); // Claim an endpoint before submitting a transfer. // If caller does not make any transfer, it must release endpoint for others. @@ -94,7 +94,7 @@ void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr); // Check if endpoint is stalled bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr); -static inline +TU_ATTR_ALWAYS_INLINE static inline bool usbd_edpt_ready(uint8_t rhport, uint8_t ep_addr) { return !usbd_edpt_busy(rhport, ep_addr) && !usbd_edpt_stalled(rhport, ep_addr); diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hcd.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hcd.h index ba6a9c5caa3..46209dc4553 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hcd.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hcd.h @@ -28,6 +28,8 @@ #define _TUSB_HCD_H_ #include "common/tusb_common.h" +#include "osal/osal.h" +#include "common/tusb_fifo.h" #ifdef __cplusplus extern "C" { @@ -106,15 +108,8 @@ void hcd_int_enable (uint8_t rhport); // Disable USB interrupt void hcd_int_disable(uint8_t rhport); -// Get micro frame number (125 us) -uint32_t hcd_uframe_number(uint8_t rhport); - // Get frame number (1ms) -TU_ATTR_ALWAYS_INLINE static inline -uint32_t hcd_frame_number(uint8_t rhport) -{ - return hcd_uframe_number(rhport) >> 3; -} +uint32_t hcd_frame_number(uint8_t rhport); //--------------------------------------------------------------------+ // Port API @@ -141,21 +136,12 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr); bool hcd_setup_send(uint8_t rhport, uint8_t dev_addr, uint8_t const setup_packet[8]); bool hcd_edpt_open(uint8_t rhport, uint8_t dev_addr, tusb_desc_endpoint_t const * ep_desc); +bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen); bool hcd_edpt_busy(uint8_t dev_addr, uint8_t ep_addr); bool hcd_edpt_stalled(uint8_t dev_addr, uint8_t ep_addr); bool hcd_edpt_clear_stall(uint8_t dev_addr, uint8_t ep_addr); -// TODO merge with pipe_xfer -bool hcd_edpt_xfer(uint8_t rhport, uint8_t dev_addr, uint8_t ep_addr, uint8_t * buffer, uint16_t buflen); - -//--------------------------------------------------------------------+ -// PIPE API - TODO remove later -//--------------------------------------------------------------------+ -// TODO control xfer should be used via usbh layer -bool hcd_pipe_queue_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t buffer[], uint16_t total_bytes); // only queue, not transferring yet -bool hcd_pipe_xfer(uint8_t dev_addr, uint8_t ep_addr, uint8_t buffer[], uint16_t total_bytes, bool int_on_complete); - //--------------------------------------------------------------------+ // Event API (implemented by stack) //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hub.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hub.h index 851bb8e664a..a5111b8e768 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hub.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/hub.h @@ -37,7 +37,6 @@ #define _TUSB_HUB_H_ #include "common/tusb_common.h" -#include "usbh.h" #ifdef __cplusplus extern "C" { @@ -172,9 +171,11 @@ typedef struct { TU_VERIFY_STATIC( sizeof(hub_port_status_response_t) == 4, "size is not correct"); +bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb); +bool hub_port_set_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb); + bool hub_port_reset(uint8_t hub_addr, uint8_t hub_port, tuh_control_complete_cb_t complete_cb); bool hub_port_get_status(uint8_t hub_addr, uint8_t hub_port, void* resp, tuh_control_complete_cb_t complete_cb); -bool hub_port_clear_feature(uint8_t hub_addr, uint8_t hub_port, uint8_t feature, tuh_control_complete_cb_t complete_cb); bool hub_status_pipe_queue(uint8_t dev_addr); //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/usbh.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/usbh.h index 590c8a359a3..a9790b484fc 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/usbh.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/host/usbh.h @@ -34,10 +34,7 @@ extern "C" { #endif -//--------------------------------------------------------------------+ -// INCLUDE -//--------------------------------------------------------------------+ -#include "osal/osal.h" // TODO refractor move to common.h ? +#include "common/tusb_common.h" #include "hcd.h" //--------------------------------------------------------------------+ @@ -67,10 +64,6 @@ typedef struct { typedef bool (*tuh_control_complete_cb_t)(uint8_t dev_addr, tusb_control_request_t const * request, xfer_result_t result); -//--------------------------------------------------------------------+ -// INTERNAL OBJECT & FUNCTION DECLARATION -//--------------------------------------------------------------------+ - //--------------------------------------------------------------------+ // APPLICATION API //--------------------------------------------------------------------+ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ehci/ehci.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ehci/ehci.h index 212f605b1ab..874195a0c27 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ehci/ehci.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ehci/ehci.h @@ -24,12 +24,6 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup Group_HCD - * @{ - * \defgroup EHCI - * \brief EHCI driver. All documents sources mentioned here (eg section 3.5) is referring to EHCI Specs unless state otherwise - * @{ */ - #ifndef _TUSB_EHCI_H_ #define _TUSB_EHCI_H_ @@ -309,12 +303,11 @@ enum ehci_usbcmd_pos_ { enum ehci_portsc_change_mask_{ EHCI_PORTSC_MASK_CURRENT_CONNECT_STATUS = TU_BIT(0), - EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE = TU_BIT(1), - EHCI_PORTSC_MASK_PORT_EANBLED = TU_BIT(2), - EHCI_PORTSC_MASK_PORT_ENABLE_CHAGNE = TU_BIT(3), - EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE = TU_BIT(5), - - EHCI_PORTSC_MASK_PORT_RESET = TU_BIT(8), + EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE = TU_BIT(1), + EHCI_PORTSC_MASK_PORT_EANBLED = TU_BIT(2), + EHCI_PORTSC_MASK_PORT_ENABLE_CHAGNE = TU_BIT(3), + EHCI_PORTSC_MASK_OVER_CURRENT_CHANGE = TU_BIT(5), + EHCI_PORTSC_MASK_PORT_RESET = TU_BIT(8), EHCI_PORTSC_MASK_ALL = EHCI_PORTSC_MASK_CONNECT_STATUS_CHANGE | @@ -425,36 +418,8 @@ typedef volatile struct }; }ehci_registers_t; -//--------------------------------------------------------------------+ -// EHCI Data Organization -//--------------------------------------------------------------------+ -typedef struct -{ - ehci_link_t period_framelist[EHCI_FRAMELIST_SIZE]; - - // for NXP ECHI, only implement 1 ms & 2 ms & 4 ms, 8 ms (framelist) - // [0] : 1ms, [1] : 2ms, [2] : 4ms, [3] : 8 ms - ehci_qhd_t period_head_arr[4]; - - // Note control qhd of dev0 is used as head of async list - struct { - ehci_qhd_t qhd; - ehci_qtd_t qtd; - }control[CFG_TUSB_HOST_DEVICE_MAX+1]; - - ehci_qhd_t qhd_pool[HCD_MAX_ENDPOINT]; - ehci_qtd_t qtd_pool[HCD_MAX_XFER] TU_ATTR_ALIGNED(32); - - ehci_registers_t* regs; - - volatile uint32_t uframe_number; -}ehci_data_t; - #ifdef __cplusplus } #endif #endif /* _TUSB_EHCI_H_ */ - -/** @} */ -/** @} */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ohci/ohci.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ohci/ohci.h index 7f9e55b21c7..6a634592a4c 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ohci/ohci.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/ohci/ohci.h @@ -24,12 +24,6 @@ * This file is part of the TinyUSB stack. */ -/** \ingroup Group_HCD - * @{ - * \defgroup OHCI - * \brief OHCI driver. All documents sources mentioned here (eg section 3.5) is referring to OHCI Specs unless state otherwise - * @{ */ - #ifndef _TUSB_OHCI_H_ #define _TUSB_OHCI_H_ @@ -48,12 +42,6 @@ enum { OHCI_MAX_ITD = 4 }; -enum { - OHCI_PID_SETUP = 0, - OHCI_PID_OUT, - OHCI_PID_IN, -}; - //--------------------------------------------------------------------+ // OHCI Data Structure //--------------------------------------------------------------------+ @@ -73,7 +61,6 @@ typedef struct { uint32_t reserved2; }ohci_td_item_t; - typedef struct TU_ATTR_ALIGNED(16) { // Word 0 @@ -105,7 +92,7 @@ typedef struct TU_ATTR_ALIGNED(16) // Word 0 uint32_t dev_addr : 7; uint32_t ep_number : 4; - uint32_t pid : 2; // 00b from TD, 01b Out, 10b In + uint32_t pid : 2; uint32_t speed : 1; uint32_t skip : 1; uint32_t is_iso : 1; @@ -286,6 +273,3 @@ TU_VERIFY_STATIC( sizeof(ohci_registers_t) == 0x5c, "size is not correct"); #endif #endif /* _TUSB_OHCI_H_ */ - -/** @} */ -/** @} */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h index bb88d977f46..33f3ecd4191 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/raspberrypi/rp2040/rp2040_usb.h @@ -16,8 +16,6 @@ #define TUD_OPT_RP2040_USB_DEVICE_ENUMERATION_FIX PICO_RP2040_USB_DEVICE_ENUMERATION_FIX #endif -// For memset -#include #if false && !defined(NDEBUG) #define pico_trace(format,args...) printf(format, ## args) @@ -78,7 +76,7 @@ struct hw_endpoint #if TUSB_OPT_HOST_ENABLED // Only needed for host mode bool last_buf; - // HOST BUG. Host will incorrect write status to top half of buffer + // RP2040-E4: HOST BUG. Host will incorrect write status to top half of buffer // control register when doing transfers > 1 packet uint8_t buf_sel; // Only needed for host @@ -119,4 +117,44 @@ static inline uintptr_t hw_data_offset(uint8_t *buf) extern const char *ep_dir_string[]; +typedef union TU_ATTR_PACKED +{ + uint16_t u16; + struct TU_ATTR_PACKED + { + uint16_t xfer_len : 10; + uint16_t available : 1; + uint16_t stall : 1; + uint16_t reset_bufsel : 1; + uint16_t data_toggle : 1; + uint16_t last_buf : 1; + uint16_t full : 1; + }; +} rp2040_buffer_control_t; + +TU_VERIFY_STATIC(sizeof(rp2040_buffer_control_t) == 2, "size is not correct"); + +static inline void print_bufctrl16(uint32_t __unused u16) +{ + rp2040_buffer_control_t __unused bufctrl = { + .u16 = u16 + }; + + TU_LOG(2, "len = %u, available = %u, stall = %u, reset = %u, toggle = %u, last = %u, full = %u\r\n", + bufctrl.xfer_len, bufctrl.available, bufctrl.stall, bufctrl.reset_bufsel, bufctrl.data_toggle, bufctrl.last_buf, bufctrl.full); +} + +static inline void print_bufctrl32(uint32_t u32) +{ + uint16_t u16; + + u16 = u32 >> 16; + TU_LOG(2, "Buffer Control 1 0x%x: ", u16); + print_bufctrl16(u16); + + u16 = u32 & 0x0000ffff; + TU_LOG(2, "Buffer Control 0 0x%x: ", u16); + print_bufctrl16(u16); +} + #endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h index b317f7630b5..5cfcc08e29b 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h @@ -28,8 +28,8 @@ #define _TUSB_OPTION_H_ #define TUSB_VERSION_MAJOR 0 -#define TUSB_VERSION_MINOR 9 -#define TUSB_VERSION_REVISION 0 +#define TUSB_VERSION_MINOR 10 +#define TUSB_VERSION_REVISION 1 #define TUSB_VERSION_STRING TU_STRING(TUSB_VERSION_MAJOR) "." TU_STRING(TUSB_VERSION_MINOR) "." TU_STRING(TUSB_VERSION_REVISION) /** \defgroup group_mcu Supported MCU @@ -55,11 +55,11 @@ #define OPT_MCU_NRF5X 100 ///< Nordic nRF5x series // SAM -#define OPT_MCU_SAMD11 204 ///< MicroChip SAMD11 #define OPT_MCU_SAMD21 200 ///< MicroChip SAMD21 #define OPT_MCU_SAMD51 201 ///< MicroChip SAMD51 -#define OPT_MCU_SAME5X 203 ///< MicroChip SAM E5x #define OPT_MCU_SAMG 202 ///< MicroChip SAMDG series +#define OPT_MCU_SAME5X 203 ///< MicroChip SAM E5x +#define OPT_MCU_SAMD11 204 ///< MicroChip SAMD11 #define OPT_MCU_SAML22 205 ///< MicroChip SAML22 // STM32 @@ -113,6 +113,9 @@ // Renesas RX #define OPT_MCU_RX63X 1400 ///< Renesas RX63N/631 +// Mind Motion +#define OPT_MCU_MM32F327X 1500 ///< Mind Motion MM32F327 + /** @} */ /** \defgroup group_supported_os Supported RTOS diff --git a/tools/sdk/esp32s2/include/asio/port/include/esp_asio_config.h b/tools/sdk/esp32s2/include/asio/port/include/esp_asio_config.h index bcf8c38d40e..cba316527e6 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/esp_asio_config.h +++ b/tools/sdk/esp32s2/include/asio/port/include/esp_asio_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_CONFIG_H_ #define _ESP_ASIO_CONFIG_H_ diff --git a/tools/sdk/esp32s2/include/asio/port/include/esp_exception.h b/tools/sdk/esp32s2/include/asio/port/include/esp_exception.h index cbf20d7a639..6f88866a4ea 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/esp_exception.h +++ b/tools/sdk/esp32s2/include/asio/port/include/esp_exception.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_EXCEPTION_H_ #define _ESP_EXCEPTION_H_ diff --git a/tools/sdk/esp32s2/include/asio/port/include/openssl/conf.h b/tools/sdk/esp32s2/include/asio/port/include/openssl/conf.h index f125c3e6cf7..1ed025d93c1 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/openssl/conf.h +++ b/tools/sdk/esp32s2/include/asio/port/include/openssl/conf.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_CONF_H #define _ESP_ASIO_OPENSSL_CONF_H diff --git a/tools/sdk/esp32s2/include/asio/port/include/openssl/dh.h b/tools/sdk/esp32s2/include/asio/port/include/openssl/dh.h index def713cfd3d..af72e083aa7 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/openssl/dh.h +++ b/tools/sdk/esp32s2/include/asio/port/include/openssl/dh.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_DH_STUB_H #define _ESP_ASIO_OPENSSL_DH_STUB_H diff --git a/tools/sdk/esp32s2/include/asio/port/include/openssl/esp_asio_openssl_stubs.h b/tools/sdk/esp32s2/include/asio/port/include/openssl/esp_asio_openssl_stubs.h index fde5231722b..50627741079 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/openssl/esp_asio_openssl_stubs.h +++ b/tools/sdk/esp32s2/include/asio/port/include/openssl/esp_asio_openssl_stubs.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_STUBS_H #define _ESP_ASIO_OPENSSL_STUBS_H diff --git a/tools/sdk/esp32s2/include/asio/port/include/openssl/rsa.h b/tools/sdk/esp32s2/include/asio/port/include/openssl/rsa.h index 5d9d10e82be..53018a33a8f 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/openssl/rsa.h +++ b/tools/sdk/esp32s2/include/asio/port/include/openssl/rsa.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_RSA_STUB_H #define _ESP_ASIO_OPENSSL_RSA_STUB_H diff --git a/tools/sdk/esp32s2/include/asio/port/include/openssl/x509v3.h b/tools/sdk/esp32s2/include/asio/port/include/openssl/x509v3.h index 5ae8e784352..dad7475424a 100644 --- a/tools/sdk/esp32s2/include/asio/port/include/openssl/x509v3.h +++ b/tools/sdk/esp32s2/include/asio/port/include/openssl/x509v3.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_ASIO_OPENSSL_X509V3_STUB_H #define _ESP_ASIO_OPENSSL_X509V3_STUB_H diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_clock.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_clock.h index 98546e8290a..6b71f68f380 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_clock.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_clock.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h index 0723d195124..4d50649e019 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_common.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash.h index 8bf74852523..73aa48923d0 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash_config.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash_config.h index 6074faca2bc..8b802211325 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash_config.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_flash_config.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_mem.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_mem.h index bc54833ff3f..21c7114ce4c 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_mem.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_mem.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_random.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_random.h index 0c7b61eb9bc..44e988b0b25 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_random.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_random.h @@ -1,16 +1,8 @@ -// Copyright 2010-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -21,33 +13,38 @@ extern "C" { #endif /** - * @brief Enable early entropy source for RNG + * @brief Enable an entropy source for RNG if RF is disabled * - * Uses the SAR ADC to feed entropy into the HWRNG. The ADC is put - * into a test mode that reads an internal reference voltage and - * constantly feeds the LSB of data into the HWRNG. Consult the - * SoC Technical Reference Manual for more information. + * The exact internal entropy source mechanism depends on the chip in use but + * all SoCs use the SAR ADC to continuously mix random bits (an internal + * noise reading) into the HWRNG. Consult the SoC Technical Reference + * Manual for more information. * * Can also be used from app code early during operation, if true - * random numbers are required before WiFi stack is initialised. - * Call this function from app code only if WiFi/BT are not yet - * enabled and I2S and ADC are not in use. - * - * Call bootloader_random_disable() when done. + * random numbers are required before RF is initialised. Consult + * ESP-IDF Programming Guide "Random Number Generation" section for + * details. */ void bootloader_random_enable(void); /** - * @brief Disable early entropy source for RNG + * @brief Disable entropy source for RNG * - * Disables SAR ADC source and resets the I2S hardware. + * Disables internal entropy source. Must be called after + * bootloader_random_enable() and before RF features, ADC, or + * I2S (ESP32 only) are initialized. * + * Consult the ESP-IDF Programming Guide "Random Number Generation" + * section for details. */ void bootloader_random_disable(void); /** * @brief Fill buffer with 'length' random bytes * + * @note If this function is being called from app code only, and never + * from the bootloader, then it's better to call esp_fill_random(). + * * @param buffer Pointer to buffer * @param length This many bytes of random data will be copied to buffer */ diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_util.h b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_util.h index a1b8d89c95a..c44c80619c2 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_util.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/bootloader_util.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_app_format.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_app_format.h index 20237728dae..9be8784d3b2 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_app_format.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_app_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_data_types.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_data_types.h index fda6d5c645e..7b4171fdd32 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_data_types.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_data_types.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning esp_flash_data_types.h has been merged into esp_flash_partitions.h, please include esp_flash_partitions.h instead #include "esp_flash_partitions.h" diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_encrypt.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_encrypt.h index 33e6aabed24..1fecd33bc74 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_encrypt.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_encrypt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_partitions.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_partitions.h index 1fc9d4f6c1b..b1a83640ce1 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_partitions.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_flash_partitions.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_err.h" @@ -42,6 +34,9 @@ extern "C" { #define PART_FLAG_ENCRYPTED (1<<0) +/* The md5sum value is found this many bytes after the ESP_PARTITION_MAGIC_MD5 offset */ +#define ESP_PARTITION_MD5_OFFSET 16 + /* Pre-partition table fixed flash offsets */ #define ESP_BOOTLOADER_DIGEST_OFFSET 0x0 #define ESP_BOOTLOADER_OFFSET CONFIG_BOOTLOADER_OFFSET_IN_FLASH /* Offset of bootloader image. Has matching value in bootloader KConfig.projbuild file. */ diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_image_format.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_image_format.h index 7e7e6a28e17..1db62442537 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_image_format.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_image_format.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32s2/include/bootloader_support/include/esp_secure_boot.h b/tools/sdk/esp32s2/include/bootloader_support/include/esp_secure_boot.h index 94118c327c9..b9436a43448 100644 --- a/tools/sdk/esp32s2/include/bootloader_support/include/esp_secure_boot.h +++ b/tools/sdk/esp32s2/include/bootloader_support/include/esp_secure_boot.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include diff --git a/tools/sdk/esp32s2/include/config/sdkconfig.h b/tools/sdk/esp32s2/include/config/sdkconfig.h index deb45346d2a..a313bea1c24 100644 --- a/tools/sdk/esp32s2/include/config/sdkconfig.h +++ b/tools/sdk/esp32s2/include/config/sdkconfig.h @@ -174,6 +174,9 @@ #define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120 #define CONFIG_ESP_NETIF_TCPIP_LWIP 1 #define CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER 1 +#define CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE 1 +#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 +#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 #define CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT 1 #define CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE 1 #define CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK 1 @@ -216,8 +219,9 @@ #define CONFIG_ESP32_WIFI_NVS_ENABLED 1 #define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 #define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 -#define CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER 20 -#define CONFIG_ESP32_PHY_MAX_TX_POWER 20 +#define CONFIG_ESP_WIFI_FTM_ENABLE 1 +#define CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT 1 +#define CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_850 1 #define CONFIG_FATFS_CODEPAGE 850 @@ -557,5 +561,5 @@ #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "c13afea63" +#define CONFIG_ARDUINO_IDF_COMMIT "1d7068e4b" #define CONFIG_ARDUINO_IDF_BRANCH "master" diff --git a/tools/sdk/esp32s2/include/console/esp_console.h b/tools/sdk/esp32s2/include/console/esp_console.h index 29aab8b4fb7..a0b7cbf1783 100644 --- a/tools/sdk/esp32s2/include/console/esp_console.h +++ b/tools/sdk/esp32s2/include/console/esp_console.h @@ -1,16 +1,8 @@ -// Copyright 2016-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #ifdef __cplusplus diff --git a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/adc.h b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/adc.h index 88ec7233969..000fa73bb24 100644 --- a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/adc.h +++ b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/adc.h @@ -1,15 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/dac.h b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/dac.h index 6efcc5c2b0f..39f3e7e0687 100644 --- a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/dac.h +++ b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/dac.h @@ -1,15 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/temp_sensor.h b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/temp_sensor.h index 56907b236ce..c3a87068b60 100644 --- a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/temp_sensor.h +++ b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/temp_sensor.h @@ -1,16 +1,8 @@ -// Copyright 2010-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h index 86aae5adba0..178e3b1a9dd 100644 --- a/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h +++ b/tools/sdk/esp32s2/include/driver/esp32s2/include/driver/touch_sensor.h @@ -1,15 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/adc2_wifi_private.h b/tools/sdk/esp32s2/include/driver/include/driver/adc2_wifi_private.h index c4f622658d4..71481213a31 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/adc2_wifi_private.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/adc2_wifi_private.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/adc_common.h b/tools/sdk/esp32s2/include/driver/include/driver/adc_common.h index f083b32d24f..3fa15d7143d 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/adc_common.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/adc_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/can.h b/tools/sdk/esp32s2/include/driver/include/driver/can.h index e28a9c443f1..ec4c0e15dfe 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/can.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/can.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/dac_common.h b/tools/sdk/esp32s2/include/driver/include/driver/dac_common.h index b1aefc9539f..f0f2ecadaea 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/dac_common.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/dac_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/dedic_gpio.h b/tools/sdk/esp32s2/include/driver/include/driver/dedic_gpio.h index f381e2c64b0..0a40c179b89 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/dedic_gpio.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/dedic_gpio.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/gpio.h b/tools/sdk/esp32s2/include/driver/include/driver/gpio.h index 3e497e04b2c..0912c831b53 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/gpio.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "sdkconfig.h" diff --git a/tools/sdk/esp32s2/include/driver/include/driver/i2c.h b/tools/sdk/esp32s2/include/driver/include/driver/i2c.h index a2076cc459d..bbff4aad2f7 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/i2c.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/i2c.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_I2C_H_ #define _DRIVER_I2C_H_ @@ -97,6 +89,9 @@ esp_err_t i2c_driver_install(i2c_port_t i2c_num, i2c_mode_t mode, size_t slv_rx_ /** * @brief I2C driver delete * + * @note This function does not guarantee thread safety. + * Please make sure that no thread will continuously hold semaphores before calling the delete function. + * * @param i2c_num I2C port number * * @return diff --git a/tools/sdk/esp32s2/include/driver/include/driver/i2s.h b/tools/sdk/esp32s2/include/driver/include/driver/i2s.h index 6b53db68a2a..4ee73b594d7 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/i2s.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/i2s.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/ledc.h b/tools/sdk/esp32s2/include/driver/include/driver/ledc.h index 69660f3dda0..c1dc6d4d8c7 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/ledc.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/ledc.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h index c19b80e4f18..8774941e482 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/pcnt.h b/tools/sdk/esp32s2/include/driver/include/driver/pcnt.h index 6236e5407c1..1e5af9c1efd 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/pcnt.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/pcnt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/periph_ctrl.h b/tools/sdk/esp32s2/include/driver/include/driver/periph_ctrl.h index 3c6ff8503c7..adba0533cfb 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/periph_ctrl.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/periph_ctrl.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_PERIPH_CTRL_H_ #define _DRIVER_PERIPH_CTRL_H_ diff --git a/tools/sdk/esp32s2/include/driver/include/driver/rmt.h b/tools/sdk/esp32s2/include/driver/include/driver/rmt.h index ef9d58107d8..a7e2aad5f24 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/rmt.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/rmt.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/rtc_cntl.h b/tools/sdk/esp32s2/include/driver/include/driver/rtc_cntl.h index 44fd015096b..2a0f5916c08 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/rtc_cntl.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/rtc_cntl.h @@ -1,16 +1,8 @@ -// Copyright 2016-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2016-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/rtc_io.h b/tools/sdk/esp32s2/include/driver/include/driver/rtc_io.h index 4cdcf74ba48..cbf32c4fc04 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/rtc_io.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/rtc_io.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_RTC_GPIO_H_ #define _DRIVER_RTC_GPIO_H_ diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sdio_slave.h b/tools/sdk/esp32s2/include/driver/include/driver/sdio_slave.h index c1bc1fb7a5e..8adee65dfff 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sdio_slave.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sdio_slave.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SDIO_SLAVE_H_ #define _DRIVER_SDIO_SLAVE_H_ diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_defs.h b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_defs.h index 4f1e6ddc6b7..54e051f354e 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_defs.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_defs.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_host.h b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_host.h index e9da4ae1904..ff5ae71d011 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_host.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -59,8 +51,26 @@ extern "C" { * Extra configuration for SDMMC peripheral slot */ typedef struct { - gpio_num_t gpio_cd; ///< GPIO number of card detect signal - gpio_num_t gpio_wp; ///< GPIO number of write protect signal +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + gpio_num_t clk; ///< GPIO number of CLK signal. + gpio_num_t cmd; ///< GPIO number of CMD signal. + gpio_num_t d0; ///< GPIO number of D0 signal. + gpio_num_t d1; ///< GPIO number of D1 signal. + gpio_num_t d2; ///< GPIO number of D2 signal. + gpio_num_t d3; ///< GPIO number of D3 signal. + gpio_num_t d4; ///< GPIO number of D4 signal. Ignored in 1- or 4- line mode. + gpio_num_t d5; ///< GPIO number of D5 signal. Ignored in 1- or 4- line mode. + gpio_num_t d6; ///< GPIO number of D6 signal. Ignored in 1- or 4- line mode. + gpio_num_t d7; ///< GPIO number of D7 signal. Ignored in 1- or 4- line mode. +#endif // SOC_SDMMC_USE_GPIO_MATRIX + union { + gpio_num_t gpio_cd; ///< GPIO number of card detect signal + gpio_num_t cd; ///< GPIO number of card detect signal; shorter name. + }; + union { + gpio_num_t gpio_wp; ///< GPIO number of write protect signal + gpio_num_t wp; ///< GPIO number of write protect signal; shorter name. + }; uint8_t width; ///< Bus width used by the slot (might be less than the max width supported) uint32_t flags; ///< Features used by this slot #define SDMMC_SLOT_FLAG_INTERNAL_PULLUP BIT(0) @@ -72,18 +82,44 @@ typedef struct { #define SDMMC_SLOT_NO_CD GPIO_NUM_NC ///< indicates that card detect line is not used #define SDMMC_SLOT_NO_WP GPIO_NUM_NC ///< indicates that write protect line is not used -#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the default width for the slot (8 for slot 0, 4 for slot 1) +#define SDMMC_SLOT_WIDTH_DEFAULT 0 ///< use the maximum possible width for the slot + +#ifdef SOC_SDMMC_USE_GPIO_MATRIX + +/** + * Macro defining default configuration of SDMMC host slot + */ +#define SDMMC_SLOT_CONFIG_DEFAULT() {\ + .clk = GPIO_NUM_14, \ + .cmd = GPIO_NUM_15, \ + .d0 = GPIO_NUM_2, \ + .d1 = GPIO_NUM_4, \ + .d2 = GPIO_NUM_12, \ + .d3 = GPIO_NUM_13, \ + .d4 = GPIO_NUM_33, \ + .d5 = GPIO_NUM_34, \ + .d6 = GPIO_NUM_35, \ + .d7 = GPIO_NUM_36, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ + .width = SDMMC_SLOT_WIDTH_DEFAULT, \ + .flags = 0, \ +} + +#else // SOC_SDMMC_USE_GPIO_MATRIX /** * Macro defining default configuration of SDMMC host slot */ #define SDMMC_SLOT_CONFIG_DEFAULT() {\ - .gpio_cd = SDMMC_SLOT_NO_CD, \ - .gpio_wp = SDMMC_SLOT_NO_WP, \ + .cd = SDMMC_SLOT_NO_CD, \ + .wp = SDMMC_SLOT_NO_WP, \ .width = SDMMC_SLOT_WIDTH_DEFAULT, \ .flags = 0, \ } +#endif // SOC_SDMMC_USE_GPIO_MATRIX + /** * @brief Initialize SDMMC host peripheral * @@ -226,6 +262,9 @@ esp_err_t sdmmc_host_deinit(void); /** * @brief Enable the pull-ups of sd pins. * + * This function is deprecated. Please set SDMMC_SLOT_FLAG_INTERNAL_PULLUP flag in + * sdmmc_slot_config_t::flags instead. + * * @note You should always place actual pullups on the lines instead of using * this function. Internal pullup resistance are high and not sufficient, may * cause instability in products. This is for debug or examples only. @@ -238,7 +277,7 @@ esp_err_t sdmmc_host_deinit(void); * - ESP_ERR_INVALID_ARG: if configured width larger than maximum the slot can * support */ -esp_err_t sdmmc_host_pullup_en(int slot, int width); +esp_err_t sdmmc_host_pullup_en(int slot, int width) __attribute__((deprecated)); #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_types.h b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_types.h index 25310830261..cbb796fdbb3 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_types.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sdmmc_types.h @@ -1,6 +1,12 @@ +/* + * SPDX-FileCopyrightText: 2006 Uwe Stuehler + * + * SPDX-License-Identifier: ISC + * + * SPDX-FileContributor: 2016-2021 Espressif Systems (Shanghai) CO LTD + */ /* * Copyright (c) 2006 Uwe Stuehler - * Adaptations to ESP-IDF Copyright (c) 2016 Espressif Systems (Shanghai) PTE LTD * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sdspi_host.h b/tools/sdk/esp32s2/include/driver/include/driver/sdspi_host.h index 860ba1bfed4..abb690c39bc 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sdspi_host.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sdspi_host.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/sigmadelta.h b/tools/sdk/esp32s2/include/driver/include/driver/sigmadelta.h index d7e7eef122c..17f86b308e7 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/sigmadelta.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/sigmadelta.h @@ -1,15 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/spi_common.h b/tools/sdk/esp32s2/include/driver/include/driver/spi_common.h index 5fee265c0ad..a36f55a87f9 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/spi_common.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/spi_common.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/spi_common_internal.h b/tools/sdk/esp32s2/include/driver/include/driver/spi_common_internal.h index b490efeb7e0..31baaa75d70 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/spi_common_internal.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/spi_common_internal.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header, don't use it in the user code diff --git a/tools/sdk/esp32s2/include/driver/include/driver/spi_master.h b/tools/sdk/esp32s2/include/driver/include/driver/spi_master.h index e6ed8c5a0af..da5f5b52144 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/spi_master.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/spi_master.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/spi_slave.h b/tools/sdk/esp32s2/include/driver/include/driver/spi_slave.h index f03104bbc4d..92fa6004860 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/spi_slave.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/spi_slave.h @@ -1,16 +1,8 @@ -// Copyright 2010-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _DRIVER_SPI_SLAVE_H_ diff --git a/tools/sdk/esp32s2/include/driver/include/driver/spi_slave_hd.h b/tools/sdk/esp32s2/include/driver/include/driver/spi_slave_hd.h index b99d6feae23..5d6ff4c2b9e 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/spi_slave_hd.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/spi_slave_hd.h @@ -1,16 +1,8 @@ -// Copyright 2010-2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/timer.h b/tools/sdk/esp32s2/include/driver/include/driver/timer.h index 609d1006add..204fc9db27d 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/timer.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/timer.h @@ -1,16 +1,8 @@ -// Copyright 2010-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2010-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/touch_pad.h b/tools/sdk/esp32s2/include/driver/include/driver/touch_pad.h index 4b7a021f558..0c2feebd8af 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/touch_pad.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/touch_pad.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/touch_sensor_common.h b/tools/sdk/esp32s2/include/driver/include/driver/touch_sensor_common.h index f9855bc9dc3..e49c7d5de72 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/touch_sensor_common.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/touch_sensor_common.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/twai.h b/tools/sdk/esp32s2/include/driver/include/driver/twai.h index 0cb744008ab..ce616fe1251 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/twai.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/twai.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/uart.h b/tools/sdk/esp32s2/include/driver/include/driver/uart.h index 7269b3fa144..311f21a8334 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/uart.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/uart.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/driver/include/driver/uart_select.h b/tools/sdk/esp32s2/include/driver/include/driver/uart_select.h index f7a21a315b6..578f8c9d901 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/uart_select.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/uart_select.h @@ -1,17 +1,9 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _UART_SELECT_H_ #define _UART_SELECT_H_ diff --git a/tools/sdk/esp32s2/include/driver/include/esp_private/adc_cali.h b/tools/sdk/esp32s2/include/driver/include/esp_private/adc_cali.h index ab577a3121e..9c8a58d6d88 100644 --- a/tools/sdk/esp32s2/include/driver/include/esp_private/adc_cali.h +++ b/tools/sdk/esp32s2/include/driver/include/esp_private/adc_cali.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // Internal header for calibration, don't use in app diff --git a/tools/sdk/esp32s2/include/driver/include/esp_private/gdma.h b/tools/sdk/esp32s2/include/driver/include/esp_private/gdma.h index 2614a2d0fb3..5b548e0868e 100644 --- a/tools/sdk/esp32s2/include/driver/include/esp_private/gdma.h +++ b/tools/sdk/esp32s2/include/driver/include/esp_private/gdma.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ // DO NOT USE THESE APIS IN ANY APPLICATIONS // GDMA driver is not public for end users, but for ESP-IDF developpers. diff --git a/tools/sdk/esp32s2/include/driver/include/esp_private/gpio.h b/tools/sdk/esp32s2/include/driver/include/esp_private/gpio.h index 1c4811393c0..c4227dc8c4f 100644 --- a/tools/sdk/esp32s2/include/driver/include/esp_private/gpio.h +++ b/tools/sdk/esp32s2/include/driver/include/esp_private/gpio.h @@ -1,16 +1,8 @@ -// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse.h b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse.h index 9e5096b9b82..6922c8cc885 100644 --- a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse.h +++ b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_rtc_table.h b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_rtc_table.h index b9157ef0790..3cc54e20353 100644 --- a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_rtc_table.h +++ b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_rtc_table.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_table.h b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_table.h index f470944fdee..22dbec14b29 100644 --- a/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_table.h +++ b/tools/sdk/esp32s2/include/efuse/esp32s2/include/esp_efuse_table.h @@ -1,29 +1,22 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at", -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifdef __cplusplus extern "C" { #endif -// md5_digest_table d9cd89987a033ef74503daeb4dd8dd07 +// md5_digest_table bc8611ed5c3a91ac0a8ba29879968d70 // This file was generated from the file esp_efuse_table.csv. DO NOT CHANGE THIS FILE MANUALLY. // If you want to change some fields, you need to change esp_efuse_table.csv file // then run `efuse_common_table` or `efuse_custom_table` command it will generate this file. // To show efuse_table run the command 'show_efuse_table'. +extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_RD_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_DIS_RTC_RAM_BOOT[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_GROUP_1[]; @@ -52,6 +45,7 @@ extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY4[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_KEY5[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_SYS_DATA_PART2[]; extern const esp_efuse_desc_t* ESP_EFUSE_WR_DIS_USB_EXCHG_PINS[]; +extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY0[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY1[]; extern const esp_efuse_desc_t* ESP_EFUSE_RD_DIS_KEY2[]; diff --git a/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h b/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h index 019657938ac..e84975e587d 100644 --- a/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h b/tools/sdk/esp32s2/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h index 2336a9cebc2..803023ecdd8 100644 --- a/tools/sdk/esp32s2/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h +++ b/tools/sdk/esp32s2/include/esp-tls/esp-tls-crypto/esp_tls_crypto.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_CRYPTO_H #define _ESP_TLS_CRYPTO_H diff --git a/tools/sdk/esp32s2/include/esp-tls/esp_tls.h b/tools/sdk/esp32s2/include/esp-tls/esp_tls.h index 72a78c5e7d9..9330f9dd699 100644 --- a/tools/sdk/esp32s2/include/esp-tls/esp_tls.h +++ b/tools/sdk/esp32s2/include/esp-tls/esp_tls.h @@ -1,16 +1,8 @@ -// Copyright 2017-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_H_ #define _ESP_TLS_H_ @@ -171,7 +163,10 @@ typedef struct esp_tls_cfg { void *ds_data; /*!< Pointer for digital signature peripheral context */ bool is_plain_tcp; /*!< Use non-TLS connection: When set to true, the esp-tls uses - plain TCP transport rather then TLS/SSL connection */ + plain TCP transport rather then TLS/SSL connection. + Note, that it is possible to connect using a plain tcp transport + directly with esp_tls_plain_tcp_connect() API */ + struct ifreq *if_name; /*!< The name of interface for data to go through. Use the default interface without setting */ } esp_tls_cfg_t; @@ -599,6 +594,21 @@ int esp_tls_server_session_create(esp_tls_cfg_server_t *cfg, int sockfd, esp_tls void esp_tls_server_session_delete(esp_tls_t *tls); #endif /* ! CONFIG_ESP_TLS_SERVER */ +/** + * @brief Creates a plain TCP connection, returning a valid socket fd on success or an error handle + * + * @param[in] host Hostname of the host. + * @param[in] hostlen Length of hostname. + * @param[in] port Port number of the host. + * @param[in] cfg ESP-TLS configuration as esp_tls_cfg_t. + * @param[out] error_handle ESP-TLS error handle holding potential errors occurred during connection + * @param[out] sockfd Socket descriptor if successfully connected on TCP layer + * @return ESP_OK on success + * ESP_ERR_INVALID_ARG if invalid output parameters + * ESP-TLS based error codes on failure + */ +esp_err_t esp_tls_plain_tcp_connect(const char *host, int hostlen, int port, const esp_tls_cfg_t *cfg, esp_tls_error_handle_t error_handle, int *sockfd); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/esp-tls/esp_tls_errors.h b/tools/sdk/esp32s2/include/esp-tls/esp_tls_errors.h index bb281b0daea..5dfe74791c5 100644 --- a/tools/sdk/esp32s2/include/esp-tls/esp_tls_errors.h +++ b/tools/sdk/esp32s2/include/esp-tls/esp_tls_errors.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_TLS_ERRORS_H_ #define _ESP_TLS_ERRORS_H_ diff --git a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_error_capture_internal.h b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_error_capture_internal.h index fd065b2be4f..a59a3b7b344 100644 --- a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_error_capture_internal.h +++ b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_error_capture_internal.h @@ -1,16 +1,8 @@ -// Copyright 2017-2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ #define __ESP_TLS_ERROR_CAPTURE_INTERNAL_H__ diff --git a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_mbedtls.h b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_mbedtls.h index 7440f0c3c74..78694fc858e 100644 --- a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_mbedtls.h +++ b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_mbedtls.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_wolfssl.h b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_wolfssl.h index f29e9332f86..a0c86730b7d 100644 --- a/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_wolfssl.h +++ b/tools/sdk/esp32s2/include/esp-tls/private_include/esp_tls_wolfssl.h @@ -1,16 +1,8 @@ -// Copyright 2019 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2019-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include "esp_tls.h" diff --git a/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h b/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h index 46d9cf16c63..bfb729b58b6 100755 --- a/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h +++ b/tools/sdk/esp32s2/include/esp32-camera/driver/include/esp_camera.h @@ -104,7 +104,7 @@ typedef struct { int pin_href; /*!< GPIO pin for camera HREF line */ int pin_pclk; /*!< GPIO pin for camera PCLK line */ - int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 20KHz or 10KHz for OV2640 double FPS (Experimental) */ + int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode */ ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */ ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */ diff --git a/tools/sdk/esp32s2/include/esp_gdbstub/include/esp_gdbstub.h b/tools/sdk/esp32s2/include/esp_gdbstub/include/esp_gdbstub.h index 02fda63e58a..f1e7921de6b 100644 --- a/tools/sdk/esp32s2/include/esp_gdbstub/include/esp_gdbstub.h +++ b/tools/sdk/esp32s2/include/esp_gdbstub/include/esp_gdbstub.h @@ -14,13 +14,12 @@ #pragma once -#include "esp_gdbstub_arch.h" - #ifdef __cplusplus extern "C" { #endif -void esp_gdbstub_panic_handler(esp_gdbstub_frame_t *frame) __attribute__((noreturn)); +void esp_gdbstub_init(void); +void esp_gdbstub_panic_handler(void *frame); #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h index 0f89972ff40..f6ef1da340e 100644 --- a/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at - -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_CLIENT_H #define _ESP_HTTP_CLIENT_H @@ -158,6 +150,7 @@ typedef enum { HttpStatus_TemporaryRedirect = 307, /* 4xx - Client Error */ + HttpStatus_BadRequest = 400, HttpStatus_Unauthorized = 401, HttpStatus_Forbidden = 403, HttpStatus_NotFound = 404, diff --git a/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h b/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h index 445d0c0c274..d14a943c108 100644 --- a/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h +++ b/tools/sdk/esp32s2/include/esp_http_server/include/esp_http_server.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTP_SERVER_H_ #define _ESP_HTTP_SERVER_H_ diff --git a/tools/sdk/esp32s2/include/esp_http_server/include/http_server.h b/tools/sdk/esp32s2/include/esp_http_server/include/http_server.h index 56f73c5b74c..e28eb0af68d 100644 --- a/tools/sdk/esp32s2/include/esp_http_server/include/http_server.h +++ b/tools/sdk/esp32s2/include/esp_http_server/include/http_server.h @@ -1,2 +1,7 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #warning http_server.h has been renamed to esp_http_server.h, please update include directives #include "esp_http_server.h" diff --git a/tools/sdk/esp32s2/include/esp_https_server/include/esp_https_server.h b/tools/sdk/esp32s2/include/esp_https_server/include/esp_https_server.h index 968e74c632f..52f9dc2132a 100644 --- a/tools/sdk/esp32s2/include/esp_https_server/include/esp_https_server.h +++ b/tools/sdk/esp32s2/include/esp_https_server/include/esp_https_server.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_HTTPS_SERVER_H_ #define _ESP_HTTPS_SERVER_H_ diff --git a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_random.h b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_random.h index 7064fa8115c..cf4f408b513 100644 --- a/tools/sdk/esp32s2/include/esp_hw_support/include/esp_random.h +++ b/tools/sdk/esp32s2/include/esp_hw_support/include/esp_random.h @@ -24,27 +24,13 @@ extern "C" { /** * @brief Get one random 32-bit word from hardware RNG * - * The hardware RNG produces true random numbers under any of the following conditions: - * - * - An RF subsystem is running (i.e. Bluetooth or WiFi is enabled) - * - An internal entropy source has been enabled by calling bootloader_random_enable() - * and not yet disabled by calling bootloader_random_disable() - * - While the ESP-IDF bootloader is running (due to the internal entropy source being enabled - * for the duration of bootloader execution). - * - * If none of the above conditions are true, the hardware RNG will produce pseudo-random numbers only. - * - * When the hardware RNG is producing true random numbers, external entropy (noise samples) are - * continuously mixed into the internal hardware RNG state. Consult the SoC Technical Reference Manual - * for more details. + * If Wi-Fi or Bluetooth are enabled, this function returns true random numbers. In other + * situations, if true random numbers are required then consult the ESP-IDF Programming + * Guide "Random Number Generation" section for necessary prerequisites. * * This function automatically busy-waits to ensure enough external entropy has been - * introduced into the hardware RNG state, before returning a new random number. - * - * If generating random numbers from an app which has not yet enabled Bluetooth or Wi-Fi, call the - * API function bootloader_random_enable() before generating random numbers and then call - * bootloader_random_disable() before using any APIs for Bluetooth, Wi-Fi, ADC, or I2S. Consult the - * bootloader_random.h header for more details. + * introduced into the hardware RNG state, before returning a new random number. This delay + * is very short (always less than 100 CPU cycles). * * @return Random value between 0 and UINT32_MAX */ @@ -53,7 +39,8 @@ uint32_t esp_random(void); /** * @brief Fill a buffer with random bytes from hardware RNG * - * @note This function has the same restrictions regarding available entropy as esp_random() + * @note This function is implemented via calls to esp_random(), so the same + * constraints apply. * * @param buf Pointer to buffer to fill with random numbers. * @param len Length of buffer in bytes diff --git a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif.h b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif.h index 20f468739b6..92c937c1294 100644 --- a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif.h +++ b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif.h @@ -237,6 +237,54 @@ void esp_netif_action_disconnected(void *esp_netif, esp_event_base_t base, int32 */ void esp_netif_action_got_ip(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); +/** + * @brief Default building block for network interface action upon IPv6 multicast group join + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_join_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 multicast group leave + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_leave_ip6_multicast_group(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address added by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_add_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + +/** + * @brief Default building block for network interface action upon IPv6 address removed by the underlying stack + * + * @note This API can be directly used as event handler + * + * @param[in] esp_netif Handle to esp-netif instance + * @param base + * @param event_id + * @param data + */ +void esp_netif_action_remove_ip6_address(void *esp_netif, esp_event_base_t base, int32_t event_id, void *data); + /** * @} */ diff --git a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h index 903a678e008..da01500db1c 100644 --- a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h @@ -73,6 +73,18 @@ extern "C" { .route_prio = 20 \ }; +#define ESP_NETIF_INHERENT_DEFAULT_OPENTHREAD() \ + { \ + .flags = 0, \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(mac) \ + ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(ip_info) \ + .get_ip_event = 0, \ + .lost_ip_event = 0, \ + .if_key = "OT_DEF", \ + .if_desc = "openthread", \ + .route_prio = 15 \ +}; + #define ESP_NETIF_INHERENT_DEFAULT_SLIP() \ { \ .flags = ESP_NETIF_FLAG_IS_SLIP, \ @@ -85,6 +97,7 @@ extern "C" { .route_prio = 16 \ }; + /** * @brief Default configuration reference of ethernet interface */ @@ -162,12 +175,12 @@ extern "C" { #define ESP_NETIF_BASE_DEFAULT_SLIP &_g_esp_netif_inherent_slip_config - #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip +#define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread // // Include default network stacks configs @@ -194,6 +207,27 @@ extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#if CONFIG_OPENTHREAD_ENABLED +/** +* @brief Default configuration reference of SLIP client +*/ +#define ESP_NETIF_DEFAULT_OPENTHREAD() \ + { \ + .base = ESP_NETIF_BASE_DEFAULT_OPENTHREAD, \ + .driver = NULL, \ + .stack = ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD, \ + } + +/** + * @brief Default base config (esp-netif inherent) of openthread interface + */ +#define ESP_NETIF_BASE_DEFAULT_OPENTHREAD &_g_esp_netif_inherent_openthread_config + +extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_openthread; +extern const esp_netif_inherent_config_t _g_esp_netif_inherent_openthread_config; + +#endif // CONFIG_OPENTHREAD_ENABLED + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h index 7c68c7172ab..c6a7f3d6236 100644 --- a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h @@ -33,6 +33,8 @@ extern "C" { #define ESP_ERR_ESP_NETIF_DRIVER_ATTACH_FAILED ESP_ERR_ESP_NETIF_BASE + 0x08 #define ESP_ERR_ESP_NETIF_INIT_FAILED ESP_ERR_ESP_NETIF_BASE + 0x09 #define ESP_ERR_ESP_NETIF_DNS_NOT_CONFIGURED ESP_ERR_ESP_NETIF_BASE + 0x0A +#define ESP_ERR_ESP_NETIF_MLD6_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0B +#define ESP_ERR_ESP_NETIF_IP6_ADDR_FAILED ESP_ERR_ESP_NETIF_BASE + 0x0C /** @brief Type of esp_netif_object server */ @@ -125,6 +127,12 @@ typedef struct { int ip_index; /*!< IPv6 address index */ } ip_event_got_ip6_t; +/** Event structure for ADD_IP6 event */ +typedef struct { + esp_ip6_addr_t addr; /*!< The address to be added to the interface */ + bool preferred; /*!< The default preference of the address */ +} ip_event_add_ip6_t; + /** Event structure for IP_EVENT_AP_STAIPASSIGNED event */ typedef struct { esp_ip4_addr_t ip; /*!< IP address which was assigned to the station */ diff --git a/tools/sdk/esp32s2/include/esp_wifi/esp32s2/include/phy_init_data.h b/tools/sdk/esp32s2/include/esp_phy/esp32s2/include/phy_init_data.h similarity index 100% rename from tools/sdk/esp32s2/include/esp_wifi/esp32s2/include/phy_init_data.h rename to tools/sdk/esp32s2/include/esp_phy/esp32s2/include/phy_init_data.h diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_phy_init.h b/tools/sdk/esp32s2/include/esp_phy/include/esp_phy_init.h similarity index 100% rename from tools/sdk/esp32s2/include/esp_wifi/include/esp_phy_init.h rename to tools/sdk/esp32s2/include/esp_phy/include/esp_phy_init.h diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/phy.h b/tools/sdk/esp32s2/include/esp_phy/include/phy.h similarity index 100% rename from tools/sdk/esp32s2/include/esp_wifi/include/phy.h rename to tools/sdk/esp32s2/include/esp_phy/include/phy.h diff --git a/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_md5.h b/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_md5.h index 5bb71f3eb97..0deaca47148 100644 --- a/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_md5.h +++ b/tools/sdk/esp32s2/include/esp_rom/include/esp_rom_md5.h @@ -34,6 +34,8 @@ typedef struct MD5Context { uint8_t in[64]; } md5_context_t; +#define ESP_ROM_MD5_DIGEST_LEN 16 + /** * @brief Initialize the MD5 context * @@ -46,9 +48,9 @@ void esp_rom_md5_init(md5_context_t *context); * * @param context MD5 context which has been initialized by `MD5Init` * @param buf Input buffer - * @param len Buffer length + * @param len Buffer length in bytes */ -void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len); +void esp_rom_md5_update(md5_context_t *context, const void *buf, uint32_t len); /** * @brief Extract the MD5 result, and erase the context @@ -56,7 +58,7 @@ void esp_rom_md5_update(md5_context_t *context, const uint8_t *buf, uint32_t len * @param digest Where to store the 128-bit digest value * @param context MD5 context */ -void esp_rom_md5_final(uint8_t digest[16], md5_context_t *context); +void esp_rom_md5_final(uint8_t *digest, md5_context_t *context); #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/esp_system/include/esp_task.h b/tools/sdk/esp32s2/include/esp_system/include/esp_task.h index 105de5994cc..37d78bca6e8 100644 --- a/tools/sdk/esp32s2/include/esp_system/include/esp_task.h +++ b/tools/sdk/esp32s2/include/esp_system/include/esp_task.h @@ -21,6 +21,8 @@ * 4. If the configMAX_PRIORITIES is modified, please make all priority are * greater than 0 * 5. Make sure esp_task.h is consistent between wifi lib and idf + * 6. If changing system task priorities, please check the values documented in /api-guides/performance/speed.rst + * are up to date */ #ifndef _ESP_TASK_H_ diff --git a/tools/sdk/esp32s2/include/espcoredump/include/esp_core_dump.h b/tools/sdk/esp32s2/include/espcoredump/include/esp_core_dump.h index 7d41b97e57f..40fd90d8b26 100644 --- a/tools/sdk/esp32s2/include/espcoredump/include/esp_core_dump.h +++ b/tools/sdk/esp32s2/include/espcoredump/include/esp_core_dump.h @@ -14,10 +14,11 @@ #ifndef ESP_CORE_DUMP_H_ #define ESP_CORE_DUMP_H_ +#include "sdkconfig.h" #include #include "esp_err.h" #include "esp_private/panic_internal.h" -#include "esp_core_dump_summary_extra_info.h" +#include "esp_core_dump_summary_port.h" #ifdef __cplusplus extern "C" { @@ -25,14 +26,7 @@ extern "C" { #define APP_ELF_SHA256_SZ (CONFIG_APP_RETRIEVE_LEN_ELF_SHA + 1) -/** - * @brief Backtrace information - */ -typedef struct { - uint32_t bt[16]; /*!< Backtrace (array of PC) */ - uint32_t depth; /*!< Number of backtrace entries */ - bool corrupted; /*!< Status flag for backtrace is corrupt or not */ -} esp_core_dump_bt_info_t; +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF /** * @brief Core dump summary, Most meaningful contents of the core dump @@ -48,6 +42,8 @@ typedef struct { esp_core_dump_summary_extra_info_t ex_info; /*!< Architecture specific extra data */ } esp_core_dump_summary_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + /**************************************************************************************/ /******************************** EXCEPTION MODE API **********************************/ /**************************************************************************************/ @@ -137,15 +133,32 @@ esp_err_t esp_core_dump_image_get(size_t* out_addr, size_t *out_size); */ esp_err_t esp_core_dump_image_erase(void); +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + /** - * @brief Get the summary of a core dump. This function works only with ELF format core dumps. + * @brief Get the summary of a core dump. * * @param summary Summary of the core dump * * @return ESP_OK on success, otherwise \see esp_err_t + * + * @note This function works only if coredump is stored in flash and in ELF format + * + * Example usage: + * @code{c} + * esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t)); + * if (summary) { + * if (esp_core_dump_get_summary(summary) == ESP_OK) { + * // Do stuff + * } + * } + * free(summary); + * @endcode */ esp_err_t esp_core_dump_get_summary(esp_core_dump_summary_t *summary); +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h similarity index 51% rename from tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h index 510fdc06afe..f2b5d0d9e61 100644 --- a/tools/sdk/esp32c3/include/espcoredump/include/port/riscv/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32s2/include/espcoredump/include/port/riscv/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #ifdef __cplusplus @@ -19,6 +20,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + +/** + * @brief Backtrace information + * + * For RISCV, backtrace cannot be generated on device without including and parsing + * DWARF sections. Including these sections would increase the binary size so provide + * the stackdump that can be later used to generate backtrace with the help of GDB or by parsing the ELF file + * on the host machine + */ +typedef struct { + uint8_t stackdump[CONFIG_ESP_COREDUMP_SUMMARY_STACKDUMP_SIZE]; /*!< Stack dump of the crashing task. */ + uint32_t dump_size; /*!< Size (in bytes) of the stack dump */ +} esp_core_dump_bt_info_t; + /** * @brief RISC-V architecture specific extra information */ @@ -27,9 +43,13 @@ typedef struct { uint32_t mtvec; /* Machine Trap-Vector Base Address */ uint32_t mcause; /* Machine Trap Cause */ uint32_t mtval; /* Machine Trap Value */ - uint32_t exc_a[8]; /*!< a register set when the exception caused */ + uint32_t ra; /* Return Address */ + uint32_t sp; /* Stack pointer */ + uint32_t exc_a[8]; /* A0-A7 registers when the exception caused */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h b/tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h similarity index 70% rename from tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h rename to tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h index 3db7a70be82..815c1fff702 100644 --- a/tools/sdk/esp32c3/include/espcoredump/include/port/xtensa/esp_core_dump_summary_extra_info.h +++ b/tools/sdk/esp32s2/include/espcoredump/include/port/xtensa/esp_core_dump_summary_port.h @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. #pragma once +#include "sdkconfig.h" #include #include @@ -20,8 +21,21 @@ extern "C" { #endif +#if CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF + #define EPCx_REGISTER_COUNT XCHAL_NUM_INTLEVELS +/** + * @brief Backtrace information. + * + * For Xtensa, backtrace can be generated on device due to windowed register ABI. + */ +typedef struct { + uint32_t bt[16]; /*!< Backtrace (array of PC) */ + uint32_t depth; /*!< Number of backtrace entries */ + bool corrupted; /*!< Status flag for backtrace is corrupt or not */ +} esp_core_dump_bt_info_t; + /** * @brief Xtensa architecture specific extra information */ @@ -33,6 +47,8 @@ typedef struct { uint8_t epcx_reg_bits; /*!< Bit mask of available EPCx registers */ } esp_core_dump_summary_extra_info_t; +#endif /* CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH && CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF */ + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/freertos/include/freertos/FreeRTOSConfig.h b/tools/sdk/esp32s2/include/freertos/include/freertos/FreeRTOSConfig.h index 1796f1886ad..c64cb980d85 100644 --- a/tools/sdk/esp32s2/include/freertos/include/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32s2/include/freertos/include/freertos/FreeRTOSConfig.h @@ -136,11 +136,7 @@ #define configTICK_RATE_HZ ( CONFIG_FREERTOS_HZ ) /* This has impact on speed of search for highest priority */ -#ifdef SMALL_TEST -#define configMAX_PRIORITIES ( 7 ) -#else #define configMAX_PRIORITIES ( 25 ) -#endif /* Various things that impact minimum stack sizes */ diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/gpspi_flash_ll.h b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/gpspi_flash_ll.h index af35561ae29..44612385b33 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/gpspi_flash_ll.h +++ b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/gpspi_flash_ll.h @@ -370,6 +370,12 @@ static inline void gpspi_flash_ll_set_hold(spi_dev_t *dev, uint32_t hold_n) dev->user.cs_hold = (hold_n > 0? 1: 0); } +static inline void gpspi_flash_ll_set_cs_setup(spi_dev_t *dev, uint32_t cs_setup_time) +{ + dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0); + dev->ctrl2.cs_setup_time = cs_setup_time - 1; +} + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_flash_ll.h b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_flash_ll.h index cf20f55bf68..000a2fcc0d6 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_flash_ll.h +++ b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spi_flash_ll.h @@ -75,6 +75,7 @@ typedef union { #define spi_flash_ll_set_dummy(dev, dummy) gpspi_flash_ll_set_dummy((spi_dev_t*)dev, dummy) #define spi_flash_ll_set_dummy_out(dev, en, lev) gpspi_flash_ll_set_dummy_out((spi_dev_t*)dev, en, lev) #define spi_flash_ll_set_hold(dev, hold_n) gpspi_flash_ll_set_hold((spi_dev_t*)dev, hold_n) +#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) gpspi_flash_ll_set_cs_setup((spi_dev_t*)dev, cs_setup_time) #else @@ -103,6 +104,7 @@ typedef union { #define spi_flash_ll_set_dummy(dev, dummy) spimem_flash_ll_set_dummy((spi_mem_dev_t*)dev, dummy) #define spi_flash_ll_set_dummy_out(dev, en, lev) spimem_flash_ll_set_dummy_out((spi_mem_dev_t*)dev, en, lev) #define spi_flash_ll_set_hold(dev, hold_n) spimem_flash_ll_set_hold((spi_mem_dev_t*)dev, hold_n) +#define spi_flash_ll_set_cs_setup(dev, cs_setup_time) spimem_flash_ll_set_cs_setup((spi_mem_dev_t*)dev, cs_setup_time) #endif diff --git a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spimem_flash_ll.h b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spimem_flash_ll.h index f36d5149861..b04020eb519 100644 --- a/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spimem_flash_ll.h +++ b/tools/sdk/esp32s2/include/hal/esp32s2/include/hal/spimem_flash_ll.h @@ -539,6 +539,12 @@ static inline void spimem_flash_ll_set_hold(spi_mem_dev_t *dev, uint32_t hold_n) dev->user.cs_hold = (hold_n > 0? 1: 0); } +static inline void spimem_flash_ll_set_cs_setup(spi_mem_dev_t *dev, uint32_t cs_setup_time) +{ + dev->user.cs_setup = (cs_setup_time > 0 ? 1 : 0); + dev->ctrl2.cs_setup_time = cs_setup_time - 1; +} + #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h b/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h index be0f3c67c80..b70d0948b3b 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/adc_types.h @@ -56,9 +56,9 @@ typedef enum { */ typedef enum { ADC_ATTEN_DB_0 = 0, /*! +#include +#include "soc/usbh_struct.h" +#include "soc/usb_wrap_struct.h" +#include "hal/usbh_ll.h" +#include "hal/usb_types_private.h" + +// ------------------------------------------------ Macros and Types --------------------------------------------------- + +// ------------------ Constants/Configs -------------------- + +#define USBH_HAL_DMA_MEM_ALIGN 512 +#define USBH_HAL_FRAME_LIST_MEM_ALIGN 512 //The frame list needs to be 512 bytes aligned (contrary to the databook) +#define USBH_HAL_NUM_CHAN 8 +#define USBH_HAL_XFER_DESC_SIZE (sizeof(usbh_ll_dma_qtd_t)) +#define USBH_HAL_FIFO_TOTAL_USABLE_LINES 200 //Although we have a 256 lines, only 200 lines are usuable due to EPINFO_CTL + +/** + * @brief FIFO size configuration structure + */ +typedef struct { + uint32_t rx_fifo_lines; /**< Size of the RX FIFO in terms the number of FIFO lines */ + uint32_t nptx_fifo_lines; /**< Size of the Non-periodic FIFO in terms the number of FIFO lines */ + uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ +} usbh_hal_fifo_config_t; + +// --------------------- HAL States ------------------------ + +/** + * @brief Channel states + */ +typedef enum { + USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ + USBH_HAL_CHAN_STATE_ACTIVE, /**< The channel is active. A transfer descriptor list is being executed */ + USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ +} usbh_hal_chan_state_t; + +// --------------------- HAL Events ------------------------ + +/** + * @brief Host port HAL events + */ +typedef enum { + USBH_HAL_PORT_EVENT_NONE, /**< No event occurred, or could not decode interrupt */ + USBH_HAL_PORT_EVENT_CHAN, /**< A channel event has occurred. Call the the channel event handler instead */ + USBH_HAL_PORT_EVENT_CONN, /**< The host port has detected a connection */ + USBH_HAL_PORT_EVENT_DISCONN, /**< The host port has been disconnected */ + USBH_HAL_PORT_EVENT_ENABLED, /**< The host port has been enabled (i.e., connected to a device that has been reset. Started sending SOFs) */ + USBH_HAL_PORT_EVENT_DISABLED, /**< The host port has been disabled (no more SOFs). Could be due to disable/reset request, or a port error (e.g. port babble condition. See 11.8.1 of USB2.0 spec) */ + USBH_HAL_PORT_EVENT_OVRCUR, /**< The host port has encountered an overcurrent condition */ + USBH_HAL_PORT_EVENT_OVRCUR_CLR, /**< The host port has been cleared of the overcurrent condition */ +} usbh_hal_port_event_t; + +/** + * @brief Channel events + */ +typedef enum { + USBH_HAL_CHAN_EVENT_CPLT, /**< The channel has completed execution of a transfer descriptor that had the USBH_HAL_XFER_DESC_FLAG_HOC flag set. Channel is now halted */ + USBH_HAL_CHAN_EVENT_ERROR, /**< The channel has encountered an error. Channel is now halted. */ + USBH_HAL_CHAN_EVENT_HALT_REQ, /**< The channel has been successfully halted as requested */ + USBH_HAL_CHAN_EVENT_NONE, /**< No event (interrupt ran for internal processing) */ +} usbh_hal_chan_event_t; + +// --------------------- HAL Errors ------------------------ + +/** + * @brief Channel errors + */ +typedef enum { + USBH_HAL_CHAN_ERROR_XCS_XACT = 0, /**< Excessive (three consecutive) transaction errors (e.g., no response, bad CRC etc */ + USBH_HAL_CHAN_ERROR_BNA, /**< Buffer Not Available error (i.e., An inactive transfer descriptor was fetched by the channel) */ + USBH_HAL_CHAN_ERROR_PKT_BBL, /**< Packet babbler error (packet exceeded MPS) */ + USBH_HAL_CHAN_ERROR_STALL, /**< STALL response received */ +} usbh_hal_chan_error_t; + +// ------------- Transfer Descriptor Related --------------- + +/** + * @brief Flags used to describe the type of transfer descriptor to fill + */ +#define USBH_HAL_XFER_DESC_FLAG_IN 0x01 /**< Indicates this transfer descriptor is of the IN direction */ +#define USBH_HAL_XFER_DESC_FLAG_SETUP 0x02 /**< Indicates this transfer descriptor is an OUT setup */ +#define USBH_HAL_XFER_DESC_FLAG_HOC 0x04 /**< Indicates that the channel will be halted after this transfer descriptor completes */ + +/** + * @brief Status value of a transfer descriptor + * + * A transfer descriptor's status remains unexecuted until the entire transfer descriptor completes (either successfully + * or an error). Therefore, if a channel halt is requested before a transfer descriptor completes, the transfer + * descriptor remains unexecuted. + */ +#define USBH_HAL_XFER_DESC_STS_SUCCESS USBH_LL_QTD_STATUS_SUCCESS +#define USBH_HAL_XFER_DESC_STS_PKTERR USBH_LL_QTD_STATUS_PKTERR +#define USBH_HAL_XFER_DESC_STS_BUFFER_ERR USBH_LL_QTD_STATUS_BUFFER +#define USBH_HAL_XFER_DESC_STS_NOT_EXECUTED USBH_LL_QTD_STATUS_NOT_EXECUTED + +// -------------------- Object Types ----------------------- + +/** + * @brief Endpoint characteristics structure + */ +typedef struct { + union { + struct { + usb_priv_xfer_type_t type: 2; /**< The type of endpoint */ + uint32_t bEndpointAddress: 8; /**< Endpoint address (containing endpoint number and direction) */ + uint32_t mps: 11; /**< Maximum Packet Size */ + uint32_t dev_addr: 8; /**< Device Address */ + uint32_t ls_via_fs_hub: 1; /**< The endpoint is on a LS device that is routed through an FS hub. + Setting this bit will lead to the addition of the PREamble packet */ + uint32_t reserved2: 2; + }; + uint32_t val; + }; + struct { + usb_hal_interval_t interval; /**< The interval of the endpoint */ + uint32_t phase_offset_frames; /**< Phase offset in number of frames */ + } periodic; /**< Characteristic for periodic (interrupt/isochronous) endpoints only */ +} usbh_hal_ep_char_t; + +/** + * @brief Channel object + */ +typedef struct { + //Channel control, status, and information + union { + struct { + uint32_t active: 1; /**< The channel is enabled */ + uint32_t halt_requested: 1; /**< A halt has been requested */ + uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ + uint32_t reserved: 1; + uint32_t chan_idx: 4; /**< The index number of the channel */ + uint32_t reserved24: 24; + }; + uint32_t val; + } flags; /**< Flags regarding channel's status and information */ + usb_host_chan_regs_t *regs; /**< Pointer to the channel's register set */ + usbh_hal_chan_error_t error; /**< The last error that occurred on the channel */ + usb_priv_xfer_type_t type; /**< The transfer type of the channel */ + void *chan_ctx; /**< Context variable for the owner of the channel */ +} usbh_hal_chan_t; + +/** + * @brief HAL context structure + */ +typedef struct { + //Context + usbh_dev_t *dev; /**< Pointer to base address of DWC_OTG registers */ + usb_wrap_dev_t *wrap_dev; /**< Pointer to base address of USB Wrapper registers */ + //Host Port related + uint32_t *periodic_frame_list; /**< Pointer to scheduling frame list */ + usb_hal_frame_list_len_t frame_list_len; /**< Length of the periodic scheduling frame list */ + union { + struct { + uint32_t dbnc_lock_enabled: 1; /**< Debounce lock enabled */ + uint32_t fifo_sizes_set: 1; /**< Whether the FIFO sizes have been set or not */ + uint32_t periodic_sched_enabled: 1; /**< Periodic scheduling (for interrupt and isochronous transfers) is enabled */ + uint32_t reserved: 5; + uint32_t reserved24: 24; + }; + uint32_t val; + } flags; + //Channel related + struct { + int num_allocd; /**< Number of channels currently allocated */ + uint32_t chan_pend_intrs_msk; /**< Bit mask of channels with pending interrupts */ + usbh_hal_chan_t *hdls[USBH_HAL_NUM_CHAN]; /**< Handles of each channel. Set to NULL if channel has not been allocated */ + } channels; +} usbh_hal_context_t; + +// -------------------------------------------------- Core (Global) ---------------------------------------------------- + +/** + * @brief Initialize the HAL context and check if DWC_OTG is alive + * + * Entry: + * - The peripheral must have been reset and clock un-gated + * - GPIO pins configured + * - Interrupt allocated but DISABLED (in case of an unknown interupt state) + * Exit: + * - Checks to see if DWC_OTG is alive, and if HW version/config is correct + * - HAl context initialized + * - Sets default values to some global and OTG registers (GAHBCFG and GUSBCFG) + * - Umask global interrupt signal + * - Put DWC_OTG into host mode. Require 25ms delay before this takes effect. + * - State -> USBH_HAL_PORT_STATE_OTG + * - Interrupts cleared. Users can now enable their ISR + * + * @param[inout] hal Context of the HAL layer + */ +void usbh_hal_init(usbh_hal_context_t *hal); + +/** + * @brief Deinitialize the HAL context + * + * Entry: + * - All channels must be properly disabled, and any pending events handled + * Exit: + * - DWC_OTG global interrupt disabled + * - HAL context deinitialized + * + * @param hal Context of the HAL layer + */ +void usbh_hal_deinit(usbh_hal_context_t *hal); + +/** + * @brief Issue a soft reset to the controller + * + * This should be called when the host port encounters an error event or has been disconnected. Before calling this, + * users are responsible for safely freeing all channels as a soft reset will wipe all host port and channel registers. + * This function will result in the host port being put back into same state as after calling usbh_hal_init(). + * + * @note This has nothing to do with a USB bus reset. It simply resets the peripheral + * + * @param hal Context of the HAL layer + */ +void usbh_hal_core_soft_reset(usbh_hal_context_t *hal); + +/** + * @brief Set FIFO sizes + * + * This function will set the sizes of each of the FIFOs (RX FIFO, Non-periodic TX FIFO, Periodic TX FIFO) and must be + * called at least once before allocating the channel. Based on the type of endpoints (and the endpionts' MPS), there + * may be situations where this function may need to be called again to resize the FIFOs. If resizing FIFOs dynamically, + * it is the user's responsibility to ensure there are no active channels when this function is called. + * + * @note The totol size of all the FIFOs must be less than or equal to USBH_HAL_FIFO_TOTAL_USABLE_LINES + * @note After a port reset, the FIFO size registers will reset to their default values, so this function must be called + * again post reset. + * + * @param hal Context of the HAL layer + * @param fifo_config FIFO configuration + */ +void usbh_hal_set_fifo_size(usbh_hal_context_t *hal, const usbh_hal_fifo_config_t *fifo_config); + +// ---------------------------------------------------- Host Port ------------------------------------------------------ + +// ------------------ Host Port Control -------------------- + +/** + * @brief Initialize the host port + * + * - Will enable the host port's interrupts allowing port and channel events to occur + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_init(usbh_hal_context_t *hal) +{ + //Configure Host related interrupts + usbh_ll_haintmsk_dis_chan_intr(hal->dev, 0xFFFFFFFF); //Disable interrupts for all channels + usb_ll_en_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_HCHINT); +} + +/** + * @brief Deinitialize the host port + * + * - Will disable the host port's interrupts preventing further port aand channel events from ocurring + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_deinit(usbh_hal_context_t *hal) +{ + //Disable Host port and channel interrupts + usb_ll_dis_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_HCHINT); +} + +/** + * @brief Toggle the host port's power + * + * @param hal Context of the HAL layer + * @param power_on Whether to power ON or OFF the port + */ +static inline void usbh_hal_port_toggle_power(usbh_hal_context_t *hal, bool power_on) +{ + if (power_on) { + usbh_ll_hprt_en_pwr(hal->dev); + } else { + usbh_ll_hprt_dis_pwr(hal->dev); + } +} + +/** + * @brief Toggle reset signal on the bus + * + * The reset signal should be held for at least 10ms + * Entry: + * - Host port detects a device connection or Host port is already enabled + * Exit: + * - On release of the reset signal, a USBH_HAL_PORT_EVENT_ENABLED will be generated + * + * @note If the host port is already enabled, then issuing a reset will cause it be disabled and generate a + * USBH_HAL_PORT_EVENT_DISABLED event. The host port will not be enabled until the reset signal is released (thus + * generating the USBH_HAL_PORT_EVENT_ENABLED event) + * + * @param hal Context of the HAL layer + * @param enable Enable/disable reset signal + */ +static inline void usbh_hal_port_toggle_reset(usbh_hal_context_t *hal, bool enable) +{ + assert(hal->channels.num_allocd == 0); //Cannot reset if there are still allocated channels + usbh_ll_hprt_set_port_reset(hal->dev, enable); +} + +/** + * @brief Enable the host port + * + * Entry: + * - Host port enabled event triggered following a reset + * Exit: + * - Host port enabled to operate in scatter/gather DMA mode + * - DMA fifo sizes configured + * + * @param hal Context of the HAL layer + */ +void usbh_hal_port_enable(usbh_hal_context_t *hal); + +/** + * @brief Disable the host port + * + * Exit: + * - Host port disabled event triggered + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_disable(usbh_hal_context_t *hal) +{ + usbh_ll_hprt_port_dis(hal->dev); +} + +/** + * @brief Suspend the host port + * + * @param hal Context of the HAL layers + */ +static inline void usbh_hal_port_suspend(usbh_hal_context_t *hal) +{ + usbh_ll_hprt_set_port_suspend(hal->dev); +} + +/** + * @brief Toggle resume signal on the bus + * + * Hosts should hold the resume signal for at least 20ms + * + * @note If a remote wakeup event occurs, the resume signal is driven and cleared automatically. + * + * @param hal Context of the HAL layer + * @param enable Enable/disable resume signal + */ +static inline void usbh_hal_port_toggle_resume(usbh_hal_context_t *hal, bool enable) +{ + if (enable) { + usbh_ll_hprt_set_port_resume(hal->dev); + } else { + usbh_ll_hprt_clr_port_resume(hal->dev); + } +} + +/** + * @brief Check whether the resume signal is being driven + * + * If a remote wakeup event occurs, the core will automatically drive and clear the resume signal for the required + * amount of time. Call this function to check whether the resume signal has completed. + * + * @param hal Context of the HAL layer + * @return true Resume signal is still being driven + * @return false Resume signal is no longer driven + */ +static inline bool usbh_hal_port_check_resume(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_port_resume(hal->dev); +} + +// ---------------- Host Port Scheduling ------------------- + +/** + * @brief Sets the periodic scheduling frame list + * + * @note This function must be called before attempting configuring any channels to be period via + * usbh_hal_chan_set_ep_char() + * + * @param hal Context of the HAL layer + * @param frame_list Base address of the frame list + * @param frame_list_len Number of entries in the frame list (can only be 8, 16, 32, 64) + */ +static inline void usbh_hal_port_set_frame_list(usbh_hal_context_t *hal, uint32_t *frame_list, usb_hal_frame_list_len_t len) +{ + assert(!hal->flags.periodic_sched_enabled); + //Clear and save frame list + hal->periodic_frame_list = frame_list; + hal->frame_list_len = len; +} + +/** + * @brief Get the pointer to the periodic scheduling frame list + * + * @param hal Context of the HAL layer + * @return uint32_t* Base address of the periodic scheduling frame list + */ +static inline uint32_t *usbh_hal_port_get_frame_list(usbh_hal_context_t *hal) +{ + return hal->periodic_frame_list; +} + +/** + * @brief Enable periodic scheduling + * + * @note The periodic frame list must be set via usbh_hal_port_set_frame_list() should be set before calling this + * function + * @note This function must be called before activating any periodic channels + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_enable(usbh_hal_context_t *hal) +{ + assert(hal->periodic_frame_list != NULL && !hal->flags.periodic_sched_enabled); + usbh_ll_set_frame_list_base_addr(hal->dev, (uint32_t)hal->periodic_frame_list); + usbh_ll_hcfg_set_num_frame_list_entries(hal->dev, hal->frame_list_len); + usbh_ll_hcfg_en_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 1; +} + +/** + * @brief Disable periodic scheduling + * + * Disabling periodic scheduling will save a bit of DMA bandwith (as the controller will no longer fetch the schedule + * from the frame list). + * + * @note Before disabling periodic scheduling, it is the user's responsibility to ensure that all periodic channels have + * halted safely. + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_port_periodic_disable(usbh_hal_context_t *hal) +{ + assert(hal->flags.periodic_sched_enabled); + usbh_ll_hcfg_dis_perio_sched(hal->dev); + hal->flags.periodic_sched_enabled = 0; +} + +static inline uint32_t usbh_hal_port_get_cur_frame_num(usbh_hal_context_t *hal) +{ + return usbh_ll_get_frm_num(hal->dev); +} + +// --------------- Host Port Status/State ------------------ + +/** + * @brief Check if a device is currently connected to the host port + * + * This function is intended to be called after one of the following events followed by an adequate debounce delay + * - USBH_HAL_PORT_EVENT_CONN + * - USBH_HAL_PORT_EVENT_DISCONN + * + * @note No other connection/disconnection event will occur again until the debounce lock is disabled via + * usbh_hal_disable_debounce_lock() + * + * @param hal Context of the HAL layer + * @return true A device is connected to the host port + * @return false A device is not connected to the host port + */ +static inline bool usbh_hal_port_check_if_connected(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_conn_status(hal->dev); +} + +/** + * @brief Check the speed (LS/FS) of the device connected to the host port + * + * @note This function should only be called after confirming that a device is connected to the host port + * + * @param hal Context of the HAL layer + * @return usb_priv_speed_t Speed of the connected device (FS or LS only on the esp32-s2 and esp32-s3) + */ +static inline usb_priv_speed_t usbh_hal_port_get_conn_speed(usbh_hal_context_t *hal) +{ + return usbh_ll_hprt_get_speed(hal->dev); +} + +/** + * @brief Disable the debounce lock + * + * This function must be called after calling usbh_hal_port_check_if_connected() and will allow connection/disconnection + * events to occur again. Any pending connection or disconenction interrupts are cleared. + * + * @param hal Context of the HAL layer + */ +static inline void usbh_hal_disable_debounce_lock(usbh_hal_context_t *hal) +{ + hal->flags.dbnc_lock_enabled = 0; + //Clear Conenction and disconenction interrupt in case it triggered again + usb_ll_intr_clear(hal->dev, USB_LL_INTR_CORE_DISCONNINT); + usbh_ll_hprt_intr_clear(hal->dev, USBH_LL_INTR_HPRT_PRTENCHNG); + //Reenable the hprt (connection) and disconnection interrupts + usb_ll_en_intrs(hal->dev, USB_LL_INTR_CORE_PRTINT | USB_LL_INTR_CORE_DISCONNINT); +} + +// ----------------------------------------------------- Channel ------------------------------------------------------- + +// ----------------- Channel Allocation -------------------- + +/** + * @brief Allocate a channel + * + * @param[in] hal Context of the HAL layer + * @param[inout] chan_obj Empty channel object + * @param[in] chan_ctx Context variable for the allocator of the channel + * @return true Channel successfully allocated + * @return false Failed to allocate channel + */ +bool usbh_hal_chan_alloc(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, void *chan_ctx); + +/** + * @brief Free a channel + * + * @param[in] hal Context of the HAL layer + * @param[in] chan_obj Channel object + */ +void usbh_hal_chan_free(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj); + +// ---------------- Channel Configuration ------------------ + +/** + * @brief Get the context variable of the channel + * + * @param[in] chan_obj Channel object + * @return void* The context variable of the channel + */ +static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) +{ + return chan_obj->chan_ctx; +} + +/** + * @brief Get the current state of a channel + * + * @param chan_obj Channel object + * @return usbh_hal_chan_state_t State of the channel + */ +static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *chan_obj) +{ + if (chan_obj->flags.error_pending) { + return USBH_HAL_CHAN_STATE_ERROR; + } else if (chan_obj->flags.active) { + return USBH_HAL_CHAN_STATE_ACTIVE; + } else { + return USBH_HAL_CHAN_STATE_HALTED; + } +} + +/** + * @brief Set the endpoint information for a particular channel + * + * This should be called when a channel switches target from one EP to another + * + * @note the channel must be in the disabled state in order to change its EP + * information + * + * @param hal Context of the HAL layer + * @param chan_obj Channel object + * @param ep_char Endpoint characteristics + */ +void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_obj, usbh_hal_ep_char_t *ep_char); + +/** + * @brief Set the direction of the channel + * + * This is a convenience function to flip the direction of a channel without + * needing to reconfigure all of the channel's EP info. This is used primarily + * for control transfers. + * + * @note This function should only be called when the channel is halted + * + * @param chan_obj Channel object + * @param is_in Whether the direction is IN + */ +static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) +{ + //Cannot change direction whilst channel is still active or in error + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + usbh_ll_chan_set_dir(chan_obj->regs, is_in); +} + +/** + * @brief Set the next Packet ID of the channel (e.g., DATA0/DATA1) + * + * This should be called when a channel switches target from one EP to another + * or when change stages for a control transfer + * + * @note The channel should only be called when the channel is in the + * halted state. + * + * @param chan_obj Channel object + * @param pid PID of the next DATA packet (DATA0 or DATA1) + */ +static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) +{ + //Cannot change pid whilst channel is still active or in error + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + //Update channel object and set the register + usbh_ll_chan_set_pid(chan_obj->regs, pid); +} + +/** + * @brief Get the next PID of a channel + * + * Returns the next PID (DATA0 or DATA1) of the channel. This function should be + * used when the next PID of a pipe needs to be saved (e.g., when switching pipes + * on a channel) + * + * @param chan_obj Channel object + * @return uint32_t Starting PID of the next transfer (DATA0 or DATA1) + */ +static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) +{ + assert(!chan_obj->flags.active && !chan_obj->flags.error_pending); + return usbh_ll_chan_get_pid(chan_obj->regs); +} + +// ------------------- Channel Control --------------------- + +/** + * @brief Activate a channel + * + * Activating a channel will cause the channel to start executing transfer descriptors. + * + * @note This function should only be called on channels that were previously halted + * @note An event will be generated when the channel is halted + * + * @param chan_obj Channel object + * @param xfer_desc_list A filled transfer descriptor list + * @param desc_list_len Transfer descriptor list length + * @param start_idx Index of the starting transfer descriptor in the list + */ +void usbh_hal_chan_activate(usbh_hal_chan_t *chan_obj, void *xfer_desc_list, int desc_list_len, int start_idx); + +/** + * @brief Get the index of the current transfer descriptor + * + * @param chan_obj Channel object + * @return int Descriptor index + */ +static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) +{ + return usbh_ll_chan_get_ctd(chan_obj->regs); +} + +/** + * @brief Request to halt a channel + * + * This function should be called in order to halt a channel. If the channel is already halted, this function will + * return true. If the channel is still active, this function will return false and users must wait for the + * USBH_HAL_CHAN_EVENT_HALT_REQ event before treating the channel as halted. + * + * @note When a transfer is in progress (i.e., the channel is active) and a halt is requested, the channel will halt + * after the next USB packet is completed. If the transfer has more pending packets, the transfer will just be + * marked as USBH_HAL_XFER_DESC_STS_NOT_EXECUTED. + * + * @param chan_obj Channel object + * @return true The channel is already halted + * @return false The halt was requested, wait for USBH_HAL_CHAN_EVENT_HALT_REQ + */ +bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); + +/** + * @brief Get a channel's error + * + * @param chan_obj Channel object + * @return usbh_hal_chan_error_t The type of error the channel has encountered + */ +static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) +{ + assert(chan_obj->flags.error_pending); + return chan_obj->error; +} + +/** + * @brief Clear a channel of it's error + * + * @param chan_obj Channel object + */ +static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) +{ + //Can only clear error when an error has occurred + assert(chan_obj->flags.error_pending); + chan_obj->flags.error_pending = 0; +} + +// -------------------------------------------- Transfer Descriptor List ----------------------------------------------- + +/** + * @brief Fill a single entry in a transfer descriptor list + * + * - Depending on the transfer type, a single transfer descriptor may corresponds + * - A stage of a transfer (for control transfers) + * - A frame of a transfer interval (for interrupt and isoc) + * - An entire transfer (for bulk transfers) + * - Check the various USBH_HAL_XFER_DESC_FLAG_ flags for filling a specific type of descriptor + * - For IN transfer entries, set the USBH_HAL_XFER_DESC_FLAG_IN. The transfer size must also be an integer multiple of + * the endpoint's MPS + * + * @note Critical section is not required for this function + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + * @param xfer_data_buff Transfer data buffer + * @param xfer_len Transfer length + * @param flags Transfer flags + */ +static inline void usbh_hal_xfer_desc_fill(void *desc_list, uint32_t desc_idx, uint8_t *xfer_data_buff, int xfer_len, uint32_t flags) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + if (flags & USBH_HAL_XFER_DESC_FLAG_IN) { + usbh_ll_set_qtd_in(&qtd_list[desc_idx], + xfer_data_buff, xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC); + } else { + usbh_ll_set_qtd_out(&qtd_list[desc_idx], + xfer_data_buff, + xfer_len, + flags & USBH_HAL_XFER_DESC_FLAG_HOC, + flags & USBH_HAL_XFER_DESC_FLAG_SETUP); + } +} + +/** + * @brief Clear a transfer descriptor (sets all its fields to NULL) + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + */ +static inline void usbh_hal_xfer_desc_clear(void *desc_list, uint32_t desc_idx) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); +} + +/** + * @brief Parse a transfer decriptor's results + * + * @param desc_list Transfer descriptor list + * @param desc_idx Transfer descriptor index + * @param[out] xfer_rem_len Remaining length of the transfer in bytes + * @param[out] xfer_status Status of the transfer + * + * @note Critical section is not required for this function + */ +static inline void usbh_hal_xfer_desc_parse(void *desc_list, uint32_t desc_idx, int *xfer_rem_len, int *xfer_status) +{ + usbh_ll_dma_qtd_t *qtd_list = (usbh_ll_dma_qtd_t *)desc_list; + usbh_ll_get_qtd_status(&qtd_list[desc_idx], xfer_rem_len, xfer_status); + //Clear the QTD to prevent it from being read again + usbh_ll_set_qtd_null(&qtd_list[desc_idx]); +} + +// ------------------------------------------------- Event Handling ---------------------------------------------------- + +/** + * @brief Decode global and host port interrupts + * + * - Reads and clears global and host port interrupt registers + * - Decodes the interrupt bits to determine what host port event occurred + * + * @note This should be the first interrupt decode function to be run + * + * @param hal Context of the HAL layer + * @return usbh_hal_port_event_t Host port event + */ +usbh_hal_port_event_t usbh_hal_decode_intr(usbh_hal_context_t *hal); + +/** + * @brief Gets the next channel with a pending interrupt + * + * If no channel is pending an interrupt, this function will return NULL. If one or more channels are pending an + * interrupt, this function returns one of the channel's objects. Call this function repeatedly until it returns NULL. + * + * @param hal Context of the HAL layer + * @return usbh_hal_chan_t* Channel object. NULL if no channel are pending an interrupt. + */ +usbh_hal_chan_t *usbh_hal_get_chan_pending_intr(usbh_hal_context_t *hal); + +/** + * @brief Decode a particular channel's interrupt + * + * - Reads and clears the interrupt register of the channel + * - Returns the corresponding event for that channel + * + * @param chan_obj Channel object + * @return usbh_hal_chan_event_t Channel event + */ +usbh_hal_chan_event_t usbh_hal_chan_decode_intr(usbh_hal_chan_t *chan_obj); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h b/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h new file mode 100644 index 00000000000..a6c03e302a4 --- /dev/null +++ b/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h @@ -0,0 +1,980 @@ +// Copyright 2020 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include "soc/usbh_struct.h" +#include "soc/usb_wrap_struct.h" +#include "hal/usb_types_private.h" + +/* ----------------------------------------------------------------------------- +------------------------------- Global Registers ------------------------------- +----------------------------------------------------------------------------- */ + +/* + * Interrupt bit masks of the GINTSTS and GINTMSK registers + */ +#define USB_LL_INTR_CORE_WKUPINT (1 << 31) +#define USB_LL_INTR_CORE_SESSREQINT (1 << 30) +#define USB_LL_INTR_CORE_DISCONNINT (1 << 29) +#define USB_LL_INTR_CORE_CONIDSTSCHNG (1 << 28) +#define USB_LL_INTR_CORE_PTXFEMP (1 << 26) +#define USB_LL_INTR_CORE_HCHINT (1 << 25) +#define USB_LL_INTR_CORE_PRTINT (1 << 24) +#define USB_LL_INTR_CORE_RESETDET (1 << 23) +#define USB_LL_INTR_CORE_FETSUSP (1 << 22) +#define USB_LL_INTR_CORE_INCOMPIP (1 << 21) +#define USB_LL_INTR_CORE_INCOMPISOIN (1 << 20) +#define USB_LL_INTR_CORE_OEPINT (1 << 19) +#define USB_LL_INTR_CORE_IEPINT (1 << 18) +#define USB_LL_INTR_CORE_EPMIS (1 << 17) +#define USB_LL_INTR_CORE_EOPF (1 << 15) +#define USB_LL_INTR_CORE_ISOOUTDROP (1 << 14) +#define USB_LL_INTR_CORE_ENUMDONE (1 << 13) +#define USB_LL_INTR_CORE_USBRST (1 << 12) +#define USB_LL_INTR_CORE_USBSUSP (1 << 11) +#define USB_LL_INTR_CORE_ERLYSUSP (1 << 10) +#define USB_LL_INTR_CORE_GOUTNAKEFF (1 << 7) +#define USB_LL_INTR_CORE_GINNAKEFF (1 << 6) +#define USB_LL_INTR_CORE_NPTXFEMP (1 << 5) +#define USB_LL_INTR_CORE_RXFLVL (1 << 4) +#define USB_LL_INTR_CORE_SOF (1 << 3) +#define USB_LL_INTR_CORE_OTGINT (1 << 2) +#define USB_LL_INTR_CORE_MODEMIS (1 << 1) +#define USB_LL_INTR_CORE_CURMOD (1 << 0) + +/* + * Bit mask of interrupt generating bits of the the HPRT register. These bits + * are ORd into the USB_LL_INTR_CORE_PRTINT interrupt. + * + * Note: Some fields of the HPRT are W1C (write 1 clear), this we cannot do a + * simple read and write-back to clear the HPRT interrupt bits. Instead we need + * a W1C mask the non-interrupt related bits + */ +#define USBH_LL_HPRT_W1C_MSK (0x2E) +#define USBH_LL_HPRT_ENA_MSK (0x04) +#define USBH_LL_INTR_HPRT_PRTOVRCURRCHNG (1 << 5) +#define USBH_LL_INTR_HPRT_PRTENCHNG (1 << 3) +#define USBH_LL_INTR_HPRT_PRTCONNDET (1 << 1) + +/* + * Bit mask of channel interrupts (HCINTi and HCINTMSKi registers) + * + * Note: Under Scatter/Gather DMA mode, only the following interrupts can be unmasked + * - DESC_LS_ROLL + * - XCS_XACT_ERR (always unmasked) + * - BNAINTR + * - CHHLTD + * - XFERCOMPL + * The remaining interrupt bits will still be set (when the corresponding event occurs) + * but will not generate an interrupt. Therefore we must proxy through the + * USBH_LL_INTR_CHAN_CHHLTD interrupt to check the other interrupt bits. + */ +#define USBH_LL_INTR_CHAN_DESC_LS_ROLL (1 << 13) +#define USBH_LL_INTR_CHAN_XCS_XACT_ERR (1 << 12) +#define USBH_LL_INTR_CHAN_BNAINTR (1 << 11) +#define USBH_LL_INTR_CHAN_DATATGLERR (1 << 10) +#define USBH_LL_INTR_CHAN_FRMOVRUN (1 << 9) +#define USBH_LL_INTR_CHAN_BBLEER (1 << 8) +#define USBH_LL_INTR_CHAN_XACTERR (1 << 7) +#define USBH_LL_INTR_CHAN_NYET (1 << 6) +#define USBH_LL_INTR_CHAN_ACK (1 << 5) +#define USBH_LL_INTR_CHAN_NAK (1 << 4) +#define USBH_LL_INTR_CHAN_STALL (1 << 3) +#define USBH_LL_INTR_CHAN_AHBERR (1 << 2) +#define USBH_LL_INTR_CHAN_CHHLTD (1 << 1) +#define USBH_LL_INTR_CHAN_XFERCOMPL (1 << 0) + +/* + * QTD (Queue Transfer Descriptor) structure used in Scatter/Gather DMA mode. + * Each QTD describes one transfer. Scatter gather mode will automatically split + * a transfer into multiple MPS packets. Each QTD is 64bits in size + * + * Note: The status information part of the QTD is interpreted differently depending + * on IN or OUT, and ISO or non-ISO + */ +typedef struct { + union { + struct { + uint32_t xfer_size: 17; + uint32_t aqtd_offset: 6; + uint32_t aqtd_valid: 1; + uint32_t reserved_24: 1; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t rx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } in_non_iso; + struct { + uint32_t xfer_size: 12; + uint32_t reserved_12_24: 13; + uint32_t intr_cplt: 1; + uint32_t reserved_26_27: 2; + uint32_t rx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } in_iso; + struct { + uint32_t xfer_size: 17; + uint32_t reserved_17_23: 7; + uint32_t is_setup: 1; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t tx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } out_non_iso; + struct { + uint32_t xfer_size: 12; + uint32_t reserved_12_24: 13; + uint32_t intr_cplt: 1; + uint32_t eol: 1; + uint32_t reserved_27: 1; + uint32_t tx_status: 2; + uint32_t reserved_30: 1; + uint32_t active: 1; + } out_iso; + uint32_t buffer_status_val; + }; + uint8_t *buffer; +} usbh_ll_dma_qtd_t; + +/* ----------------------------------------------------------------------------- +------------------------------ USB Wrap Registers ------------------------------ +----------------------------------------------------------------------------- */ + +/** + * @brief Configures the internal PHY to operate as HOST + * + * @param hw Start address of the USB Wrap registers + */ +static inline void usbh_ll_internal_phy_conf(usb_wrap_dev_t *hw) +{ + //Enable internal PHY + hw->otg_conf.pad_enable = 1; + hw->otg_conf.phy_sel = 0; + //Set pulldowns on D+ and D- + hw->otg_conf.pad_pull_override = 1; + hw->otg_conf.dp_pulldown = 1; + hw->otg_conf.dm_pulldown = 1; +} + +/* ----------------------------------------------------------------------------- +------------------------------- Global Registers ------------------------------- +----------------------------------------------------------------------------- */ + +// --------------------------- GAHBCFG Register -------------------------------- + +static inline void usb_ll_en_dma_mode(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.dmaen = 1; +} + +static inline void usb_ll_en_slave_mode(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.dmaen = 0; +} + +static inline void usb_ll_set_hbstlen(usbh_dev_t *hw, uint32_t burst_len) +{ + hw->gahbcfg_reg.hbstlen = burst_len; +} + +static inline void usb_ll_en_global_intr(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.glbllntrmsk = 1; +} + +static inline void usb_ll_dis_global_intr(usbh_dev_t *hw) +{ + hw->gahbcfg_reg.glbllntrmsk = 0; +} + +// --------------------------- GUSBCFG Register -------------------------------- + +static inline void usb_ll_set_host_mode(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.forcehstmode = 1; +} + +static inline void usb_ll_dis_hnp_cap(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.hnpcap = 0; +} + +static inline void usb_ll_dis_srp_cap(usbh_dev_t *hw) +{ + hw->gusbcfg_reg.srpcap = 0; +} + +// --------------------------- GRSTCTL Register -------------------------------- + +static inline bool usb_ll_check_ahb_idle(usbh_dev_t *hw) +{ + return hw->grstctl_reg.ahbidle; +} + +static inline bool usb_ll_check_dma_req_in_progress(usbh_dev_t *hw) +{ + return hw->grstctl_reg.dmareq; +} + +static inline void usb_ll_flush_nptx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.txfnum = 0; //Set the TX FIFO number to 0 to select the non-periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //Flush the selected TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } +} + +static inline void usb_ll_flush_ptx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.txfnum = 1; //Set the TX FIFO number to 1 to select the periodic TX FIFO + hw->grstctl_reg.txfflsh = 1; //FLush the select TX FIFO + //Wait for the flushing to complete + while (hw->grstctl_reg.txfflsh) { + ; + } +} + +static inline void usb_ll_flush_rx_fifo(usbh_dev_t *hw) +{ + hw->grstctl_reg.rxfflsh = 1; + //Wait for the flushing to complete + while (hw->grstctl_reg.rxfflsh) { + ; + } +} + +static inline void usb_ll_reset_frame_counter(usbh_dev_t *hw) +{ + hw->grstctl_reg.frmcntrrst = 1; +} + +static inline void usb_ll_core_soft_reset(usbh_dev_t *hw) +{ + hw->grstctl_reg.csftrst = 1; +} + +static inline bool usb_ll_check_core_soft_reset(usbh_dev_t *hw) +{ + return hw->grstctl_reg.csftrst; +} + +// --------------------------- GINTSTS Register -------------------------------- + +/** + * @brief Reads and clears the global interrupt register + * + * @param hw Start address of the DWC_OTG registers + * @return uint32_t Mask of interrupts + */ +static inline uint32_t usb_ll_intr_read_and_clear(usbh_dev_t *hw) +{ + usb_gintsts_reg_t gintsts; + gintsts.val = hw->gintsts_reg.val; + hw->gintsts_reg.val = gintsts.val; //Write back to clear + return gintsts.val; +} + +/** + * @brief Clear specific interrupts + * + * @param hw Start address of the DWC_OTG registers + * @param intr_msk Mask of interrupts to clear + */ +static inline void usb_ll_intr_clear(usbh_dev_t *hw, uint32_t intr_msk) +{ + //All GINTSTS fields are either W1C or read only. So safe to write directly + hw->gintsts_reg.val = intr_msk; +} + +// --------------------------- GINTMSK Register -------------------------------- + +static inline void usb_ll_en_intrs(usbh_dev_t *hw, uint32_t intr_mask) +{ + hw->gintmsk_reg.val |= intr_mask; +} + +static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) +{ + hw->gintmsk_reg.val &= ~intr_mask; +} + +// --------------------------- GRXFSIZ Register -------------------------------- + +static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) +{ + //Set size in words + hw->grxfsiz_reg.rxfdep = num_lines; +} + +// -------------------------- GNPTXFSIZ Register ------------------------------- + +static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) +{ + usb_gnptxfsiz_reg_t gnptxfsiz; + gnptxfsiz.val = hw->gnptxfsiz_reg.val; + gnptxfsiz.nptxfstaddr = addr; + gnptxfsiz.nptxfdep = num_lines; + hw->gnptxfsiz_reg.val = gnptxfsiz.val; +} + +static inline uint32_t usb_ll_get_controller_core_id(usbh_dev_t *hw) +{ + return hw->gsnpsid_reg.val; +} + +/** + * @brief Get the hardware configuration regiters of the DWC_OTG controller + * + * The hardware configuraiton regitsers are read only and indicate the various + * features of the DWC_OTG core. + * + * @param hw Start address of the DWC_OTG registers + * @param[out] ghwcfg1 Hardware configuration registesr 1 + * @param[out] ghwcfg2 Hardware configuration registesr 2 + * @param[out] ghwcfg3 Hardware configuration registesr 3 + * @param[out] ghwcfg4 Hardware configuration registesr 4 + */ +static inline void usb_ll_get_hardware_config(usbh_dev_t *hw, uint32_t *ghwcfg1, uint32_t *ghwcfg2, uint32_t *ghwcfg3, uint32_t *ghwcfg4) +{ + *ghwcfg1 = hw->ghwcfg1_reg.val; + *ghwcfg2 = hw->ghwcfg2_reg.val; + *ghwcfg3 = hw->ghwcfg3_reg.val; + *ghwcfg4 = hw->ghwcfg4_reg.val; +} + +// --------------------------- HPTXFSIZ Register ------------------------------- + +static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint32_t num_lines) +{ + usb_hptxfsiz_reg_t hptxfsiz; + hptxfsiz.val = hw->hptxfsiz_reg.val; + hptxfsiz.ptxfstaddr = addr; + hptxfsiz.ptxfsize = num_lines; + hw->hptxfsiz_reg.val = hptxfsiz.val; +} + +/* ----------------------------------------------------------------------------- +-------------------------------- Host Registers -------------------------------- +----------------------------------------------------------------------------- */ + +// ----------------------------- HCFG Register --------------------------------- + +static inline void usbh_ll_hcfg_en_perio_sched(usbh_dev_t *hw) +{ + hw->hcfg_reg.perschedena = 1; +} + +static inline void usbh_ll_hcfg_dis_perio_sched(usbh_dev_t *hw) +{ + hw->hcfg_reg.perschedena = 0; +} + +/** + * Sets the length of the frame list + * + * @param num_entires Number of entires in the frame list + */ +static inline void usbh_ll_hcfg_set_num_frame_list_entries(usbh_dev_t *hw, usb_hal_frame_list_len_t num_entries) +{ + uint32_t frlisten; + switch (num_entries) { + case USB_HAL_FRAME_LIST_LEN_8: + frlisten = 0; + break; + case USB_HAL_FRAME_LIST_LEN_16: + frlisten = 1; + break; + case USB_HAL_FRAME_LIST_LEN_32: + frlisten = 2; + break; + default: //USB_HAL_FRAME_LIST_LEN_64 + frlisten = 3; + break; + } + hw->hcfg_reg.frlisten = frlisten; +} + +static inline void usbh_ll_hcfg_en_scatt_gatt_dma(usbh_dev_t *hw) +{ + hw->hcfg_reg.descdma = 1; +} + +static inline void usbh_ll_hcfg_set_fsls_supp_only(usbh_dev_t *hw) +{ + hw->hcfg_reg.fslssupp = 1; +} + +static inline void usbh_ll_hcfg_set_fsls_pclk_sel(usbh_dev_t *hw) +{ + hw->hcfg_reg.fslspclksel = 1; +} + +/** + * @brief Sets some default values to HCFG to operate in Host mode with scatter/gather DMA + * + * @param hw Start address of the USB Wrap registers + * @param speed Speed to initialize the host port at + */ +static inline void usbh_ll_hcfg_set_defaults(usbh_dev_t *hw, usb_priv_speed_t speed) +{ + hw->hcfg_reg.descdma = 1; //Enable scatt/gatt + hw->hcfg_reg.fslssupp = 1; //FS/LS support only + /* + Indicate to the OTG core what speed the PHY clock is at + Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, + so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. + */ + hw->hcfg_reg.fslspclksel = (speed == USB_PRIV_SPEED_FULL) ? 1 : 2; //PHY clock on esp32-sx for FS/LS-only + hw->hcfg_reg.perschedena = 0; //Disable perio sched +} + +// ----------------------------- HFIR Register --------------------------------- + +static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t speed) +{ + usb_hfir_reg_t hfir; + hfir.val = hw->hfir_reg.val; + hfir.hfirrldctrl = 0; //Disable dynamic loading + /* + Set frame interval to be equal to 1ms + Note: It seems like our PHY has an implicit 8 divider applied when in LS mode, + so the values of FSLSPclkSel and FrInt have to be adjusted accordingly. + */ + hfir.frint = (speed == USB_PRIV_SPEED_FULL) ? 48000 : 6000; //esp32-sx targets only support FS or LS + hw->hfir_reg.val = hfir.val; +} + +// ----------------------------- HFNUM Register -------------------------------- + +static inline uint32_t usbh_ll_get_frm_time_rem(usbh_dev_t *hw) +{ + return hw->hfnum_reg.frrem; +} + +static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) +{ + return hw->hfnum_reg.frnum; +} + +// ---------------------------- HPTXSTS Register ------------------------------- + +static inline uint32_t usbh_ll_get_p_tx_queue_top(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxqtop; +} + +static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxqspcavail; +} + +static inline uint32_t usbh_ll_get_p_tx_fifo_space_avail(usbh_dev_t *hw) +{ + return hw->hptxsts_reg.ptxfspcavail; +} + +// ----------------------------- HAINT Register -------------------------------- + +static inline uint32_t usbh_ll_get_chan_intrs_msk(usbh_dev_t *hw) +{ + return hw->haint_reg.haint; +} + +// --------------------------- HAINTMSK Register ------------------------------- + +static inline void usbh_ll_haintmsk_en_chan_intr(usbh_dev_t *hw, uint32_t mask) +{ + hw->haintmsk_reg.val |= mask; +} + +static inline void usbh_ll_haintmsk_dis_chan_intr(usbh_dev_t *hw, uint32_t mask) +{ + hw->haintmsk_reg.val &= ~mask; +} + +// --------------------------- HFLBAddr Register ------------------------------- + +/** + * @brief Set the base address of the scheduling frame list + * + * @note For some reason, this address must be 512 bytes aligned or else a bunch of frames will not be scheduled when + * the frame list rolls over. However, according to the databook, there is no mention of the HFLBAddr needing to + * be aligned. + * + * @param hw Start address of the DWC_OTG registers + * @param addr Base address of the scheduling frame list + */ +static inline void usbh_ll_set_frame_list_base_addr(usbh_dev_t *hw, uint32_t addr) +{ + hw->hflbaddr_reg.hflbaddr = addr; +} + +/** + * @brief Get the base address of the scheduling frame list + * + * @param hw Start address of the DWC_OTG registers + * @return uint32_t Base address of the scheduling frame list + */ +static inline uint32_t usbh_ll_get_frame_list_base_addr(usbh_dev_t *hw) +{ + return hw->hflbaddr_reg.hflbaddr; +} + +// ----------------------------- HPRT Register --------------------------------- + +static inline usb_priv_speed_t usbh_ll_hprt_get_speed(usbh_dev_t *hw) +{ + usb_priv_speed_t speed; + //esp32-s2 and esp32-s3 only support FS or LS + switch (hw->hprt_reg.prtspd) { + case 1: + speed = USB_PRIV_SPEED_FULL; + break; + default: + speed = USB_PRIV_SPEED_LOW; + break; + } + return speed; +} + +static inline uint32_t usbh_ll_hprt_get_test_ctl(usbh_dev_t *hw) +{ + return hw->hprt_reg.prttstctl; +} + +static inline void usbh_ll_hprt_set_test_ctl(usbh_dev_t *hw, uint32_t test_mode) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prttstctl = test_mode; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_en_pwr(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtpwr = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_dis_pwr(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtpwr = 0; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline uint32_t usbh_ll_hprt_get_pwr_line_status(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtlnsts; +} + +static inline void usbh_ll_hprt_set_port_reset(usbh_dev_t *hw, bool reset) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtrst = reset; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_reset(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtrst; +} + +static inline void usbh_ll_hprt_set_port_suspend(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtsusp = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_suspend(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtsusp; +} + +static inline void usbh_ll_hprt_set_port_resume(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtres = 1; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline void usbh_ll_hprt_clr_port_resume(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtres = 0; + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_W1C_MSK); +} + +static inline bool usbh_ll_hprt_get_port_resume(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtres; +} + +static inline bool usbh_ll_hprt_get_port_overcur(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtovrcurract; +} + +static inline bool usbh_ll_hprt_get_port_en(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtena; +} + +static inline void usbh_ll_hprt_port_dis(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hprt.prtena = 1; //W1C to disable + //we want to W1C ENA but not W1C the interrupt bits + hw->hprt_reg.val = hprt.val & ((~USBH_LL_HPRT_W1C_MSK) | USBH_LL_HPRT_ENA_MSK); +} + +static inline bool usbh_ll_hprt_get_conn_status(usbh_dev_t *hw) +{ + return hw->hprt_reg.prtconnsts; +} + +static inline uint32_t usbh_ll_hprt_intr_read_and_clear(usbh_dev_t *hw) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + //We want to W1C the interrupt bits but not that ENA + hw->hprt_reg.val = hprt.val & (~USBH_LL_HPRT_ENA_MSK); + //Return only the interrupt bits + return (hprt.val & (USBH_LL_HPRT_W1C_MSK & ~(USBH_LL_HPRT_ENA_MSK))); +} + +static inline void usbh_ll_hprt_intr_clear(usbh_dev_t *hw, uint32_t intr_mask) +{ + usb_hprt_reg_t hprt; + hprt.val = hw->hprt_reg.val; + hw->hprt_reg.val = ((hprt.val & ~USBH_LL_HPRT_ENA_MSK) & ~USBH_LL_HPRT_W1C_MSK) | intr_mask; +} + +//Per Channel registers + +// --------------------------- HCCHARi Register -------------------------------- + +static inline void usbh_ll_chan_start(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.chena = 1; +} + +static inline bool usbh_ll_chan_is_active(volatile usb_host_chan_regs_t *chan) +{ + return chan->hcchar_reg.chena; +} + +static inline void usbh_ll_chan_halt(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.chdis = 1; +} + +static inline void usbh_ll_chan_xfer_odd_frame(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.oddfrm = 1; +} + +static inline void usbh_ll_chan_xfer_even_frame(volatile usb_host_chan_regs_t *chan) +{ + chan->hcchar_reg.oddfrm = 0; +} + +static inline void usbh_ll_chan_set_dev_addr(volatile usb_host_chan_regs_t *chan, uint32_t addr) +{ + chan->hcchar_reg.devaddr = addr; +} + +static inline void usbh_ll_chan_set_ep_type(volatile usb_host_chan_regs_t *chan, usb_priv_xfer_type_t type) +{ + uint32_t ep_type; + switch (type) { + case USB_PRIV_XFER_TYPE_CTRL: + ep_type = 0; + break; + case USB_PRIV_XFER_TYPE_ISOCHRONOUS: + ep_type = 1; + break; + case USB_PRIV_XFER_TYPE_BULK: + ep_type = 2; + break; + default: //USB_PRIV_XFER_TYPE_INTR + ep_type = 3; + break; + } + chan->hcchar_reg.eptype = ep_type; +} + +//Indicates whether channel is commuunicating with a LS device connected via a FS hub. Setting this bit to 1 will cause +//each packet to be preceded by a PREamble packet +static inline void usbh_ll_chan_set_lspddev(volatile usb_host_chan_regs_t *chan, bool is_ls) +{ + chan->hcchar_reg.lspddev = is_ls; +} + +static inline void usbh_ll_chan_set_dir(volatile usb_host_chan_regs_t *chan, bool is_in) +{ + chan->hcchar_reg.epdir = is_in; +} + +static inline void usbh_ll_chan_set_ep_num(volatile usb_host_chan_regs_t *chan, uint32_t num) +{ + chan->hcchar_reg.epnum = num; +} + +static inline void usbh_ll_chan_set_mps(volatile usb_host_chan_regs_t *chan, uint32_t mps) +{ + chan->hcchar_reg.mps = mps; +} + +static inline void usbh_ll_chan_hcchar_init(volatile usb_host_chan_regs_t *chan, int dev_addr, int ep_num, int mps, usb_priv_xfer_type_t type, bool is_in, bool is_ls) +{ + //Sets all persistent fields of the channel over its lifetimez + usbh_ll_chan_set_dev_addr(chan, dev_addr); + usbh_ll_chan_set_ep_type(chan, type); + usbh_ll_chan_set_lspddev(chan, is_ls); + usbh_ll_chan_set_dir(chan, is_in); + usbh_ll_chan_set_ep_num(chan, ep_num); + usbh_ll_chan_set_mps(chan, mps); +} + +// ---------------------------- HCINTi Register -------------------------------- + +static inline uint32_t usbh_ll_chan_intr_read_and_clear(volatile usb_host_chan_regs_t *chan) +{ + usb_hcint_reg_t hcint; + hcint.val = chan->hcint_reg.val; + chan->hcint_reg.val = hcint.val; + return hcint.val; +} + +// --------------------------- HCINTMSKi Register ------------------------------ + +static inline void usbh_ll_chan_set_intr_mask(volatile usb_host_chan_regs_t *chan, uint32_t mask) +{ + chan->hcintmsk_reg.val = mask; +} + +// ---------------------- HCTSIZi and HCDMAi Registers ------------------------- + +static inline void usbh_ll_chan_set_pid(volatile usb_host_chan_regs_t *chan, uint32_t data_pid) +{ + if (data_pid == 0) { + chan->hctsiz_reg.pid = 0; + } else { + chan->hctsiz_reg.pid = 2; + } +} + +static inline uint32_t usbh_ll_chan_get_pid(volatile usb_host_chan_regs_t *chan) { + if (chan->hctsiz_reg.pid == 0) { + return 0; //DATA0 + } else { + return 1; //DATA1 + } +} + +static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs_t *chan, + void *dmaaddr, + uint32_t qtd_idx) +{ + //Set HCDMAi + chan->hcdma_reg.val = 0; + chan->hcdma_reg.non_iso.dmaaddr = (((uint32_t)dmaaddr) >> 9) & 0x7FFFFF; //MSB of 512 byte aligned address + chan->hcdma_reg.non_iso.ctd = qtd_idx; +} + +static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, + void *dmaaddr, + uint32_t ntd) +{ + int n; + if (ntd == 2) { + n = 4; + } else if (ntd == 4) { + n = 5; + } else if (ntd == 8) { + n = 6; + } else if (ntd == 16) { + n = 7; + } else if (ntd == 32) { + n = 8; + } else { //ntd == 64 + n = 9; + } + //Set HCTSIZi + chan->hctsiz_reg.ntd = ntd -1; + chan->hctsiz_reg.sched_info = 0xFF; //Always set to 0xFF for FS + //Set HCDMAi + chan->hcdma_reg.iso.dmaaddr_ctd = (((uint32_t)dmaaddr) & 0x1FF) << (n-3); //ctd is set to 0 +} + +static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) +{ + return chan->hcdma_reg.non_iso.ctd; +} + +static inline void usbh_ll_chan_hctsiz_init(volatile usb_host_chan_regs_t *chan) +{ + chan->hctsiz_reg.dopng = 0; //Don't do ping + chan->hctsiz_reg.sched_info = 0xFF; //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels +} + +static inline void usbh_ll_chan_set_qtd_list_len(volatile usb_host_chan_regs_t *chan, int qtd_list_len) +{ + chan->hctsiz_reg.ntd = qtd_list_len - 1; //Set the length of the descriptor list +} + +// ---------------------------- HCDMABi Register ------------------------------- + +static inline void *usbh_ll_chan_get_cur_buff_addr(volatile usb_host_chan_regs_t *chan) +{ + return (void *)chan->hcdmab_reg.hcdmab; +} + +/* ----------------------------------------------------------------------------- +---------------------------- Scatter/Gather DMA QTDs --------------------------- +----------------------------------------------------------------------------- */ + +// ---------------------------- Helper Functions ------------------------------- + +/** + * @brief Get the base address of a channel's register based on the channel's index + * + * @param dev Start address of the DWC_OTG registers + * @param chan_idx The channel's index + * @return usb_host_chan_regs_t* Pointer to channel's registers + */ +static inline usb_host_chan_regs_t *usbh_ll_get_chan_regs(usbh_dev_t *dev, int chan_idx) +{ + return &dev->host_chans[chan_idx]; +} + +// ------------------------------ QTD related ---------------------------------- + +#define USBH_LL_QTD_STATUS_SUCCESS 0x0 //If QTD was processed, it indicates the data was transmitted/received successfully +#define USBH_LL_QTD_STATUS_PKTERR 0x1 //Data trasnmitted/received with errors (CRC/Timeout/Stuff/False EOP/Excessive NAK). +//Note: 0x2 is reserved +#define USBH_LL_QTD_STATUS_BUFFER 0x3 //AHB error occurred. +#define USBH_LL_QTD_STATUS_NOT_EXECUTED 0x4 //QTD as never processed + +/** + * @brief Set a QTD for a non isochronous IN transfer + * + * @param qtd Pointer to the QTD + * @param data_buff Pointer to buffer containing the data to transfer + * @param xfer_len Number of bytes in transfer. Setting 0 will do a zero length IN transfer. + * Non zero length must be mulitple of the endpoint's MPS. + * @param hoc Halt on complete (will generate an interrupt and halt the channel) + */ +static inline void usbh_ll_set_qtd_in(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc) +{ + qtd->buffer = data_buff; //Set pointer to data buffer + qtd->buffer_status_val = 0; //Reset all flags to zero + qtd->in_non_iso.xfer_size = xfer_len; + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD + qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd + } + qtd->in_non_iso.active = 1; +} + +/** + * @brief Set a QTD for a non isochronous OUT transfer + * + * @param qtd Poitner to the QTD + * @param data_buff Pointer to buffer containing the data to transfer + * @param xfer_len Number of bytes to transfer. Setting 0 will do a zero length transfer. + * For ctrl setup packets, this should be set to 8. + * @param hoc Halt on complete (will generate an interrupt) + * @param is_setup Indicates whether this is a control transfer setup packet or a normal OUT Data transfer. + * (As per the USB protocol, setup packets cannot be STALLd or NAKd by the device) + */ +static inline void usbh_ll_set_qtd_out(usbh_ll_dma_qtd_t *qtd, uint8_t *data_buff, int xfer_len, bool hoc, bool is_setup) +{ + qtd->buffer = data_buff; //Set pointer to data buffer + qtd->buffer_status_val = 0; //Reset all flags to zero + qtd->out_non_iso.xfer_size = xfer_len; + if (is_setup) { + qtd->out_non_iso.is_setup = 1; + } + if (hoc) { + qtd->in_non_iso.intr_cplt = 1; //We need to set this to distinguish between a halt due to a QTD + qtd->in_non_iso.eol = 1; //Used to halt the channel at this qtd + } + qtd->out_non_iso.active = 1; +} + +/** + * @brief Set a QTD as NULL + * + * This sets the QTD to a value of 0. This is only useful when you need to insert + * blank QTDs into a list of QTDs + * + * @param qtd Pointer to the QTD + */ +static inline void usbh_ll_set_qtd_null(usbh_ll_dma_qtd_t *qtd) +{ + qtd->buffer = NULL; + qtd->buffer_status_val = 0; //Disable qtd by clearing it to zero. Used by interrupt/isoc as an unscheudled frame +} + +/** + * @brief Get the status of a QTD + * + * When a channel get's halted, call this to check whether each QTD was executed successfully + * + * @param qtd Poitner to the QTD + * @param[out] rem_len Number of bytes ramining in the QTD + * @param[out] status Status of the QTD + */ +static inline void usbh_ll_get_qtd_status(usbh_ll_dma_qtd_t *qtd, int *rem_len, int *status) +{ + //Status is the same regardless of IN or OUT + if (qtd->in_non_iso.active) { + //QTD was never processed + *status = USBH_LL_QTD_STATUS_NOT_EXECUTED; + } else { + *status = qtd->in_non_iso.rx_status; + } + *rem_len = qtd->in_non_iso.xfer_size; + //Clear the QTD just for safety + qtd->buffer_status_val = 0; +} + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s2/include/libsodium/port_include/sodium/version.h b/tools/sdk/esp32s2/include/libsodium/port_include/sodium/version.h index c0bf5869deb..820996409e2 100644 --- a/tools/sdk/esp32s2/include/libsodium/port_include/sodium/version.h +++ b/tools/sdk/esp32s2/include/libsodium/port_include/sodium/version.h @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef sodium_version_H #define sodium_version_H diff --git a/tools/sdk/esp32s2/include/log/include/esp_log.h b/tools/sdk/esp32s2/include/log/include/esp_log.h index c41a9d3c2f2..02f7d167fe7 100644 --- a/tools/sdk/esp32s2/include/log/include/esp_log.h +++ b/tools/sdk/esp32s2/include/log/include/esp_log.h @@ -9,8 +9,10 @@ #include #include -#include "esp_rom_sys.h" #include "sdkconfig.h" +#if !defined(CONFIG_IDF_TARGET_LINUX) +#include "esp_rom_sys.h" +#endif // !CONFIG_IDF_TARGET_LINUX #if CONFIG_IDF_TARGET_ESP32 #include "esp32/rom/ets_sys.h" // will be removed in idf v5.0 #elif CONFIG_IDF_TARGET_ESP32S2 diff --git a/tools/sdk/esp32s2/include/lwip/port/esp32/include/netif/openthreadif.h b/tools/sdk/esp32s2/include/lwip/port/esp32/include/netif/openthreadif.h new file mode 100644 index 00000000000..066e973ad24 --- /dev/null +++ b/tools/sdk/esp32s2/include/lwip/port/esp32/include/netif/openthreadif.h @@ -0,0 +1,52 @@ +// Copyright 2021 Espressif Systems (Shanghai) CO LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at + +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License + +#ifndef _OPENTHREAD_LWIP_IF_H_ +#define _OPENTHREAD_LWIP_IF_H_ + +#include "lwip/netif.h" +#include "lwip/err.h" +#include "lwip/ip6.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief This function initializes the OpenThread lwIP network interface. + * + * @param[in] netif The lwIP interface to initialize + * + * @return + * - ERR_OK + * + */ +err_t openthread_netif_init(struct netif *netif); + +/** + * @brief This function sends the buffer to the lwIP network interface + * + * @param[in] netif The lwIP interface to send to. + * @param[in] buffer The packet to send. + * @param[in] len The length of the buffer. + * @param[in] eb Unused. + * + */ +void openthread_netif_input(void *netif, void *buffer, size_t len, void *eb); + +#ifdef __cplusplus +} +#endif + +#endif /* _OPENTHREAD_LWIP_IF_H_ */ diff --git a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_reg.h b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_reg.h deleted file mode 100644 index 2f9c68f80bb..00000000000 --- a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_reg.h +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef _SOC_SDMMC_REG_H_ -#define _SOC_SDMMC_REG_H_ -#include "soc.h" - -#define SDMMC_CTRL_REG (DR_REG_SDMMC_BASE + 0x00) -#define SDMMC_PWREN_REG (DR_REG_SDMMC_BASE + 0x04) -#define SDMMC_CLKDIV_REG (DR_REG_SDMMC_BASE + 0x08) -#define SDMMC_CLKSRC_REG (DR_REG_SDMMC_BASE + 0x0c) -#define SDMMC_CLKENA_REG (DR_REG_SDMMC_BASE + 0x10) -#define SDMMC_TMOUT_REG (DR_REG_SDMMC_BASE + 0x14) -#define SDMMC_CTYPE_REG (DR_REG_SDMMC_BASE + 0x18) -#define SDMMC_BLKSIZ_REG (DR_REG_SDMMC_BASE + 0x1c) -#define SDMMC_BYTCNT_REG (DR_REG_SDMMC_BASE + 0x20) -#define SDMMC_INTMASK_REG (DR_REG_SDMMC_BASE + 0x24) -#define SDMMC_CMDARG_REG (DR_REG_SDMMC_BASE + 0x28) -#define SDMMC_CMD_REG (DR_REG_SDMMC_BASE + 0x2c) -#define SDMMC_RESP0_REG (DR_REG_SDMMC_BASE + 0x30) -#define SDMMC_RESP1_REG (DR_REG_SDMMC_BASE + 0x34) -#define SDMMC_RESP2_REG (DR_REG_SDMMC_BASE + 0x38) -#define SDMMC_RESP3_REG (DR_REG_SDMMC_BASE + 0x3c) - -#define SDMMC_MINTSTS_REG (DR_REG_SDMMC_BASE + 0x40) -#define SDMMC_RINTSTS_REG (DR_REG_SDMMC_BASE + 0x44) -#define SDMMC_STATUS_REG (DR_REG_SDMMC_BASE + 0x48) -#define SDMMC_FIFOTH_REG (DR_REG_SDMMC_BASE + 0x4c) -#define SDMMC_CDETECT_REG (DR_REG_SDMMC_BASE + 0x50) -#define SDMMC_WRTPRT_REG (DR_REG_SDMMC_BASE + 0x54) -#define SDMMC_GPIO_REG (DR_REG_SDMMC_BASE + 0x58) -#define SDMMC_TCBCNT_REG (DR_REG_SDMMC_BASE + 0x5c) -#define SDMMC_TBBCNT_REG (DR_REG_SDMMC_BASE + 0x60) -#define SDMMC_DEBNCE_REG (DR_REG_SDMMC_BASE + 0x64) -#define SDMMC_USRID_REG (DR_REG_SDMMC_BASE + 0x68) -#define SDMMC_VERID_REG (DR_REG_SDMMC_BASE + 0x6c) -#define SDMMC_HCON_REG (DR_REG_SDMMC_BASE + 0x70) -#define SDMMC_UHS_REG_REG (DR_REG_SDMMC_BASE + 0x74) -#define SDMMC_RST_N_REG (DR_REG_SDMMC_BASE + 0x78) -#define SDMMC_BMOD_REG (DR_REG_SDMMC_BASE + 0x80) -#define SDMMC_PLDMND_REG (DR_REG_SDMMC_BASE + 0x84) -#define SDMMC_DBADDR_REG (DR_REG_SDMMC_BASE + 0x88) -#define SDMMC_DBADDRU_REG (DR_REG_SDMMC_BASE + 0x8c) -#define SDMMC_IDSTS_REG (DR_REG_SDMMC_BASE + 0x8c) -#define SDMMC_IDINTEN_REG (DR_REG_SDMMC_BASE + 0x90) -#define SDMMC_DSCADDR_REG (DR_REG_SDMMC_BASE + 0x94) -#define SDMMC_DSCADDRL_REG (DR_REG_SDMMC_BASE + 0x98) -#define SDMMC_DSCADDRU_REG (DR_REG_SDMMC_BASE + 0x9c) -#define SDMMC_BUFADDRL_REG (DR_REG_SDMMC_BASE + 0xa0) -#define SDMMC_BUFADDRU_REG (DR_REG_SDMMC_BASE + 0xa4) -#define SDMMC_CARDTHRCTL_REG (DR_REG_SDMMC_BASE + 0x100) -#define SDMMC_BACK_END_POWER_REG (DR_REG_SDMMC_BASE + 0x104) -#define SDMMC_UHS_REG_EXT_REG (DR_REG_SDMMC_BASE + 0x108) -#define SDMMC_EMMC_DDR_REG_REG (DR_REG_SDMMC_BASE + 0x10c) -#define SDMMC_ENABLE_SHIFT_REG (DR_REG_SDMMC_BASE + 0x110) - -#define SDMMC_CLOCK_REG (DR_REG_SDMMC_BASE + 0x800) - -#define SDMMC_INTMASK_IO_SLOT1 BIT(17) -#define SDMMC_INTMASK_IO_SLOT0 BIT(16) -#define SDMMC_INTMASK_EBE BIT(15) -#define SDMMC_INTMASK_ACD BIT(14) -#define SDMMC_INTMASK_SBE BIT(13) -#define SDMMC_INTMASK_HLE BIT(12) -#define SDMMC_INTMASK_FRUN BIT(11) -#define SDMMC_INTMASK_HTO BIT(10) -#define SDMMC_INTMASK_DTO BIT(9) -#define SDMMC_INTMASK_RTO BIT(8) -#define SDMMC_INTMASK_DCRC BIT(7) -#define SDMMC_INTMASK_RCRC BIT(6) -#define SDMMC_INTMASK_RXDR BIT(5) -#define SDMMC_INTMASK_TXDR BIT(4) -#define SDMMC_INTMASK_DATA_OVER BIT(3) -#define SDMMC_INTMASK_CMD_DONE BIT(2) -#define SDMMC_INTMASK_RESP_ERR BIT(1) -#define SDMMC_INTMASK_CD BIT(0) - -#define SDMMC_IDMAC_INTMASK_AI BIT(9) -#define SDMMC_IDMAC_INTMASK_NI BIT(8) -#define SDMMC_IDMAC_INTMASK_CES BIT(5) -#define SDMMC_IDMAC_INTMASK_DU BIT(4) -#define SDMMC_IDMAC_INTMASK_FBE BIT(2) -#define SDMMC_IDMAC_INTMASK_RI BIT(1) -#define SDMMC_IDMAC_INTMASK_TI BIT(0) - -#endif /* _SOC_SDMMC_REG_H_ */ diff --git a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_struct.h b/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_struct.h deleted file mode 100644 index 7e3c6912eb0..00000000000 --- a/tools/sdk/esp32s2/include/soc/esp32s2/include/soc/sdmmc_struct.h +++ /dev/null @@ -1,377 +0,0 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -#ifndef _SOC_SDMMC_STRUCT_H_ -#define _SOC_SDMMC_STRUCT_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - uint32_t reserved1: 1; - uint32_t disable_int_on_completion: 1; - uint32_t last_descriptor: 1; - uint32_t first_descriptor: 1; - uint32_t second_address_chained: 1; - uint32_t end_of_ring: 1; - uint32_t reserved2: 24; - uint32_t card_error_summary: 1; - uint32_t owned_by_idmac: 1; - uint32_t buffer1_size: 13; - uint32_t buffer2_size: 13; - uint32_t reserved3: 6; - void* buffer1_ptr; - union { - void* buffer2_ptr; - void* next_desc_ptr; - }; -} sdmmc_desc_t; - -#define SDMMC_DMA_MAX_BUF_LEN 4096 - -_Static_assert(sizeof(sdmmc_desc_t) == 16, "invalid size of sdmmc_desc_t structure"); - - -typedef struct { - uint32_t cmd_index: 6; ///< Command index - uint32_t response_expect: 1; ///< set if response is expected - uint32_t response_long: 1; ///< 0: short response expected, 1: long response expected - uint32_t check_response_crc: 1; ///< set if controller should check response CRC - uint32_t data_expected: 1; ///< 0: no data expected, 1: data expected - uint32_t rw: 1; ///< 0: read from card, 1: write to card (don't care if no data expected) - uint32_t stream_mode: 1; ///< 0: block transfer, 1: stream transfer (don't care if no data expected) - uint32_t send_auto_stop: 1; ///< set to send stop at the end of the transfer - uint32_t wait_complete: 1; ///< 0: send command at once, 1: wait for previous command to complete - uint32_t stop_abort_cmd: 1; ///< set if this is a stop or abort command intended to stop current transfer - uint32_t send_init: 1; ///< set to send init sequence (80 clocks of 1) - uint32_t card_num: 5; ///< card number - uint32_t update_clk_reg: 1; ///< 0: normal command, 1: don't send command, just update clock registers - uint32_t read_ceata: 1; ///< set if performing read from CE-ATA device - uint32_t ccs_expected: 1; ///< set if CCS is expected from CE-ATA device - uint32_t enable_boot: 1; ///< set for mandatory boot mode - uint32_t expect_boot_ack: 1; ///< when set along with enable_boot, controller expects boot ack pattern - uint32_t disable_boot: 1; ///< set to terminate boot operation (don't set along with enable_boot) - uint32_t boot_mode: 1; ///< 0: mandatory boot operation, 1: alternate boot operation - uint32_t volt_switch: 1; ///< set to enable voltage switching (for CMD11 only) - uint32_t use_hold_reg: 1; ///< clear to bypass HOLD register - uint32_t reserved: 1; - uint32_t start_command: 1; ///< Start command; once command is sent to the card, bit is cleared. -} sdmmc_hw_cmd_t; ///< command format used in cmd register; this structure is defined to make it easier to build command values - -_Static_assert(sizeof(sdmmc_hw_cmd_t) == 4, "invalid size of sdmmc_cmd_t structure"); - - -typedef volatile struct { - union { - struct { - uint32_t controller_reset: 1; - uint32_t fifo_reset: 1; - uint32_t dma_reset: 1; - uint32_t reserved1: 1; - uint32_t int_enable: 1; - uint32_t dma_enable: 1; - uint32_t read_wait: 1; - uint32_t send_irq_response: 1; - uint32_t abort_read_data: 1; - uint32_t send_ccsd: 1; - uint32_t send_auto_stop_ccsd: 1; - uint32_t ceata_device_interrupt_status: 1; - uint32_t reserved2: 4; - uint32_t card_voltage_a: 4; - uint32_t card_voltage_b: 4; - uint32_t enable_od_pullup: 1; - uint32_t use_internal_dma: 1; - uint32_t reserved3: 6; - }; - uint32_t val; - } ctrl; - - uint32_t pwren; ///< 1: enable power to card, 0: disable power to card - - union { - struct { - uint32_t div0: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div1: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div2: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - uint32_t div3: 8; ///< 0: bypass, 1-255: divide clock by (2*div0). - }; - uint32_t val; - } clkdiv; - - union { - struct { - uint32_t card0: 2; ///< 0-3: select clock divider for card 0 among div0-div3 - uint32_t card1: 2; ///< 0-3: select clock divider for card 1 among div0-div3 - uint32_t reserved: 28; - }; - uint32_t val; - } clksrc; - - union { - struct { - uint32_t cclk_enable: 16; ///< 1: enable clock to card, 0: disable clock - uint32_t cclk_low_power: 16; ///< 1: enable clock gating when card is idle, 0: disable clock gating - }; - uint32_t val; - } clkena; - - union { - struct { - uint32_t response: 8; ///< response timeout, in card output clock cycles - uint32_t data: 24; ///< data read timeout, in card output clock cycles - }; - uint32_t val; - } tmout; - - union { - struct { - uint32_t card_width: 16; ///< one bit for each card: 0: 1-bit mode, 1: 4-bit mode - uint32_t card_width_8: 16; ///< one bit for each card: 0: not 8-bit mode (corresponding card_width bit is used), 1: 8-bit mode (card_width bit is ignored) - }; - uint32_t val; - } ctype; - - uint32_t blksiz: 16; ///< block size, default 0x200 - uint32_t : 16; - - uint32_t bytcnt; ///< number of bytes to be transferred - - union { - struct { - uint32_t cd: 1; ///< Card detect interrupt enable - uint32_t re: 1; ///< Response error interrupt enable - uint32_t cmd_done: 1; ///< Command done interrupt enable - uint32_t dto: 1; ///< Data transfer over interrupt enable - uint32_t txdr: 1; ///< Transmit FIFO data request interrupt enable - uint32_t rxdr: 1; ///< Receive FIFO data request interrupt enable - uint32_t rcrc: 1; ///< Response CRC error interrupt enable - uint32_t dcrc: 1; ///< Data CRC error interrupt enable - uint32_t rto: 1; ///< Response timeout interrupt enable - uint32_t drto: 1; ///< Data read timeout interrupt enable - uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt enable - uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt enable - uint32_t hle: 1; ///< Hardware locked write error interrupt enable - uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt enable - uint32_t acd: 1; ///< Auto command done interrupt enable - uint32_t ebe: 1; ///< End bit error / write no CRC interrupt enable - uint32_t sdio: 16; ///< SDIO interrupt enable - }; - uint32_t val; - } intmask; - - uint32_t cmdarg; ///< Command argument to be passed to card - - sdmmc_hw_cmd_t cmd; - - uint32_t resp[4]; ///< Response from card - - union { - struct { - uint32_t cd: 1; ///< Card detect interrupt masked status - uint32_t re: 1; ///< Response error interrupt masked status - uint32_t cmd_done: 1; ///< Command done interrupt masked status - uint32_t dto: 1; ///< Data transfer over interrupt masked status - uint32_t txdr: 1; ///< Transmit FIFO data request interrupt masked status - uint32_t rxdr: 1; ///< Receive FIFO data request interrupt masked status - uint32_t rcrc: 1; ///< Response CRC error interrupt masked status - uint32_t dcrc: 1; ///< Data CRC error interrupt masked status - uint32_t rto: 1; ///< Response timeout interrupt masked status - uint32_t drto: 1; ///< Data read timeout interrupt masked status - uint32_t hto: 1; ///< Data starvation-by-host timeout interrupt masked status - uint32_t frun: 1; ///< FIFO underrun/overrun error interrupt masked status - uint32_t hle: 1; ///< Hardware locked write error interrupt masked status - uint32_t sbi_bci: 1; ///< Start bit error / busy clear interrupt masked status - uint32_t acd: 1; ///< Auto command done interrupt masked status - uint32_t ebe: 1; ///< End bit error / write no CRC interrupt masked status - uint32_t sdio: 16; ///< SDIO interrupt masked status - }; - uint32_t val; - } mintsts; - - union { - struct { - uint32_t cd: 1; ///< Card detect raw interrupt status - uint32_t re: 1; ///< Response error raw interrupt status - uint32_t cmd_done: 1; ///< Command done raw interrupt status - uint32_t dto: 1; ///< Data transfer over raw interrupt status - uint32_t txdr: 1; ///< Transmit FIFO data request raw interrupt status - uint32_t rxdr: 1; ///< Receive FIFO data request raw interrupt status - uint32_t rcrc: 1; ///< Response CRC error raw interrupt status - uint32_t dcrc: 1; ///< Data CRC error raw interrupt status - uint32_t rto: 1; ///< Response timeout raw interrupt status - uint32_t drto: 1; ///< Data read timeout raw interrupt status - uint32_t hto: 1; ///< Data starvation-by-host timeout raw interrupt status - uint32_t frun: 1; ///< FIFO underrun/overrun error raw interrupt status - uint32_t hle: 1; ///< Hardware locked write error raw interrupt status - uint32_t sbi_bci: 1; ///< Start bit error / busy clear raw interrupt status - uint32_t acd: 1; ///< Auto command done raw interrupt status - uint32_t ebe: 1; ///< End bit error / write no CRC raw interrupt status - uint32_t sdio: 16; ///< SDIO raw interrupt status - }; - uint32_t val; - } rintsts; ///< interrupts can be cleared by writing this register - - union { - struct { - uint32_t fifo_rx_watermark: 1; ///< FIFO reached receive watermark level - uint32_t fifo_tx_watermark: 1; ///< FIFO reached transmit watermark level - uint32_t fifo_empty: 1; ///< FIFO is empty - uint32_t fifo_full: 1; ///< FIFO is full - uint32_t cmd_fsm_state: 4; ///< command FSM state - uint32_t data3_status: 1; ///< this bit reads 1 if card is present - uint32_t data_busy: 1; ///< this bit reads 1 if card is busy - uint32_t data_fsm_busy: 1; ///< this bit reads 1 if transmit/receive FSM is busy - uint32_t response_index: 6; ///< index of the previous response - uint32_t fifo_count: 13; ///< number of filled locations in the FIFO - uint32_t dma_ack: 1; ///< DMA acknowledge signal - uint32_t dma_req: 1; ///< DMA request signal - }; - uint32_t val; - } status; - - union { - struct { - uint32_t tx_watermark: 12; ///< FIFO TX watermark level - uint32_t reserved1: 4; - uint32_t rx_watermark: 12; ///< FIFO RX watermark level - uint32_t dw_dma_mts: 3; - uint32_t reserved2: 1; - }; - uint32_t val; - } fifoth; - - union { - struct { - uint32_t cards: 2; ///< bit N reads 0 if card N is present - uint32_t reserved: 30; - }; - uint32_t val; - } cdetect; - - union { - struct { - uint32_t cards: 2; ///< bit N reads 1 if card N is write protected - uint32_t reserved: 30; - }; - uint32_t val; - } wrtprt; - - uint32_t gpio; ///< unused - uint32_t tcbcnt; ///< transferred (to card) byte count - uint32_t tbbcnt; ///< transferred from host to FIFO byte count - - union { - struct { - uint32_t debounce_count: 24; ///< number of host cycles used by debounce filter, typical time should be 5-25ms - uint32_t reserved: 8; - }; - } debnce; - - uint32_t usrid; ///< user ID - uint32_t verid; ///< IP block version - uint32_t hcon; ///< compile-time IP configuration - uint32_t uhs; ///< TBD - - union { - struct { - uint32_t cards: 2; ///< bit N resets card N, active low - uint32_t reserved: 30; - }; - } rst_n; - - uint32_t reserved_7c; - - union { - struct { - uint32_t sw_reset: 1; ///< set to reset DMA controller - uint32_t fb: 1; ///< set if AHB master performs fixed burst transfers - uint32_t dsl: 5; ///< descriptor skip length: number of words to skip between two unchained descriptors - uint32_t enable: 1; ///< set to enable IDMAC - uint32_t pbl: 3; ///< programmable burst length - uint32_t reserved: 21; - }; - uint32_t val; - } bmod; - - uint32_t pldmnd; ///< set any bit to resume IDMAC FSM from suspended state - sdmmc_desc_t* dbaddr; ///< descriptor list base - - union { - struct { - uint32_t ti: 1; ///< transmit interrupt status - uint32_t ri: 1; ///< receive interrupt status - uint32_t fbe: 1; ///< fatal bus error - uint32_t reserved1: 1; - uint32_t du: 1; ///< descriptor unavailable - uint32_t ces: 1; ///< card error summary - uint32_t reserved2: 2; - uint32_t nis: 1; ///< normal interrupt summary - uint32_t fbe_code: 3; ///< code of fatal bus error - uint32_t fsm: 4; ///< DMAC FSM state - uint32_t reserved3: 15; - }; - uint32_t val; - } idsts; - - union { - struct { - uint32_t ti: 1; ///< transmit interrupt enable - uint32_t ri: 1; ///< receive interrupt enable - uint32_t fbe: 1; ///< fatal bus error interrupt enable - uint32_t reserved1: 1; - uint32_t du: 1; ///< descriptor unavailable interrupt enable - uint32_t ces: 1; ///< card error interrupt enable - uint32_t reserved2: 2; - uint32_t ni: 1; ///< normal interrupt interrupt enable - uint32_t ai: 1; ///< abnormal interrupt enable - uint32_t reserved3: 22; - }; - uint32_t val; - } idinten; - - uint32_t dscaddr; ///< current host descriptor address - uint32_t dscaddrl; ///< unused - uint32_t dscaddru; ///< unused - uint32_t bufaddrl; ///< unused - uint32_t bufaddru; ///< unused - uint32_t reserved_a8[22]; - uint32_t cardthrctl; - uint32_t back_end_power; - uint32_t uhs_reg_ext; - uint32_t emmc_ddr_reg; - uint32_t enable_shift; - uint32_t reserved_114[443]; - union { - struct { - uint32_t phase_dout: 3; ///< phase of data output clock (0x0: 0, 0x1: 90, 0x4: 180, 0x6: 270) - uint32_t phase_din: 3; ///< phase of data input clock - uint32_t phase_core: 3; ///< phase of the clock to SDMMC peripheral - uint32_t div_factor_p: 4; ///< controls clock period; it will be (div_factor_p + 1) / 160MHz - uint32_t div_factor_h: 4; ///< controls length of high pulse; it will be (div_factor_h + 1) / 160MHz - uint32_t div_factor_m: 4; ///< should be equal to div_factor_p - }; - uint32_t val; - } clock; -} sdmmc_dev_t; -extern sdmmc_dev_t SDMMC; - -_Static_assert(sizeof(sdmmc_dev_t) == 0x804, "invalid size of sdmmc_dev_t structure"); - -#ifdef __cplusplus -} -#endif - -#endif //_SOC_SDMMC_STRUCT_H_ diff --git a/tools/sdk/esp32s2/include/soc/include/soc/lldesc.h b/tools/sdk/esp32s2/include/soc/include/soc/lldesc.h index 31e02125c40..ef74ce7aa4b 100644 --- a/tools/sdk/esp32s2/include/soc/include/soc/lldesc.h +++ b/tools/sdk/esp32s2/include/soc/include/soc/lldesc.h @@ -31,6 +31,24 @@ /** Maximum size of data in the buffer that a DMA descriptor can hold. */ #define LLDESC_MAX_NUM_PER_DESC (4096-4) +// Some DMA operations might impose certain alignment restrictions on the length +#define LLDESC_MAX_NUM_PER_DESC_16B_ALIGNED (4096 - 16) +#define LLDESC_MAX_NUM_PER_DESC_32B_ALIGNED (4096 - 32) + +/** + * Generate a linked list pointing to a (huge) buffer in an descriptor array. + * + * The caller should ensure there is enough size to hold the array, by calling + * ``lldesc_get_required_num_constrained`` with the same max_desc_size argument. + * + * @param[out] out_desc_array Output of a descriptor array, the head should be fed to the DMA. + * @param buffer Buffer for the descriptors to point to. + * @param size Size (or length for TX) of the buffer + * @param max_desc_size Maximum length of each descriptor + * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. + */ +void lldesc_setup_link_constrained(lldesc_t *out_desc_array, const void *buffer, int size, int max_desc_size, bool isrx); + /** * Generate a linked list pointing to a (huge) buffer in an descriptor array. * @@ -42,7 +60,7 @@ * @param size Size (or length for TX) of the buffer * @param isrx The RX DMA may require the buffer to be word-aligned, set to true for a RX link, otherwise false. */ -void lldesc_setup_link(lldesc_t *out_desc_array, const void *buffer, int size, bool isrx); +#define lldesc_setup_link(out_desc_array, buffer, size, isrx) lldesc_setup_link_constrained(out_desc_array, buffer, size, LLDESC_MAX_NUM_PER_DESC, isrx) /** * @brief Get the received length of a linked list, until end of the link or eof. @@ -61,7 +79,16 @@ int lldesc_get_received_len(lldesc_t* head, lldesc_t** out_next); * * @return Numbers required. */ -static inline int lldesc_get_required_num(int data_size) +static inline int lldesc_get_required_num_constrained(int data_size, int max_desc_size) { - return (data_size + LLDESC_MAX_NUM_PER_DESC - 1) / LLDESC_MAX_NUM_PER_DESC; + return (data_size + max_desc_size - 1) / max_desc_size; } + +/** + * Get the number of descriptors required for a given buffer size. + * + * @param data_size Size to check descriptor num. + * @param max_desc_size Maximum length of each descriptor + * @return Numbers required. + */ +#define lldesc_get_required_num(data_size) lldesc_get_required_num_constrained(data_size, LLDESC_MAX_NUM_PER_DESC) diff --git a/tools/sdk/esp32s2/include/soc/include/soc/sdmmc_periph.h b/tools/sdk/esp32s2/include/soc/include/soc/sdmmc_periph.h index 7a64f4c5fe8..c1d38fa29b8 100644 --- a/tools/sdk/esp32s2/include/soc/include/soc/sdmmc_periph.h +++ b/tools/sdk/esp32s2/include/soc/include/soc/sdmmc_periph.h @@ -15,6 +15,7 @@ #pragma once #include //include soc related (generated) definitions +#include "soc/soc_caps.h" #include "soc/soc_pins.h" #include "soc/sdmmc_reg.h" #include "soc/sdmmc_struct.h" @@ -24,25 +25,50 @@ extern "C" { #endif +/** + * Common SDMMC slot info, doesn't depend on SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} + */ typedef struct { - uint8_t clk_gpio; - uint8_t cmd_gpio; - uint8_t d0_gpio; - uint8_t d1_gpio; - uint8_t d2_gpio; - uint8_t d3_gpio; - uint8_t d4_gpio; - uint8_t d5_gpio; - uint8_t d6_gpio; - uint8_t d7_gpio; - uint8_t card_detect; - uint8_t write_protect; - uint8_t card_int; - uint8_t width; + uint8_t width; /*!< Maximum supported slot width (1, 4, 8) */ + uint8_t card_detect; /*!< Card detect signal in GPIO Matrix */ + uint8_t write_protect; /*!< Write protect signal in GPIO Matrix */ + uint8_t card_int; /*!< Card interrupt signal in GPIO Matrix */ } sdmmc_slot_info_t; -/** pin and signal information of each slot */ -extern const sdmmc_slot_info_t sdmmc_slot_info[]; +/** Width and GPIO matrix signal numbers for auxillary SD host signals, one structure per slot */ +extern const sdmmc_slot_info_t sdmmc_slot_info[SOC_SDMMC_NUM_SLOTS]; + +/** + * This structure lists pin numbers (if SOC_SDMMC_USE_IOMUX is set) + * or GPIO Matrix signal numbers (if SOC_SDMMC_USE_GPIO_MATRIX is set) + * for the SD bus signals. Field names match SD bus signal names. + */ +typedef struct { + uint8_t clk; + uint8_t cmd; + uint8_t d0; + uint8_t d1; + uint8_t d2; + uint8_t d3; + uint8_t d4; + uint8_t d5; + uint8_t d6; + uint8_t d7; +} sdmmc_slot_io_info_t; + +/* Note: it is in theory possible to have both IOMUX and GPIO Matrix supported + * in the same SoC. However this is not used on any SoC at this point, and would + * complicate the driver. Hence only one of these options is supported at a time. + */ +#if SOC_SDMMC_USE_IOMUX +/** GPIO pin numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_num[SOC_SDMMC_NUM_SLOTS]; + +#elif SOC_SDMMC_USE_GPIO_MATRIX +/** GPIO matrix signal numbers of SD bus signals, one structure per slot */ +extern const sdmmc_slot_io_info_t sdmmc_slot_gpio_sig[SOC_SDMMC_NUM_SLOTS]; + +#endif // SOC_SDMMC_USE_{IOMUX,GPIO_MATRIX} #ifdef __cplusplus } diff --git a/tools/sdk/esp32s2/include/spi_flash/include/esp_flash_spi_init.h b/tools/sdk/esp32s2/include/spi_flash/include/esp_flash_spi_init.h index 85334d3ea5a..e586a8778c6 100644 --- a/tools/sdk/esp32s2/include/spi_flash/include/esp_flash_spi_init.h +++ b/tools/sdk/esp32s2/include/spi_flash/include/esp_flash_spi_init.h @@ -34,6 +34,7 @@ typedef struct { * automatically assigned by the SPI bus lock. */ int cs_id; + uint32_t cs_setup; ///< (cycles-1) of prepare phase by spi clock } esp_flash_spi_device_config_t; /** diff --git a/tools/sdk/esp32s2/include/spiffs/include/spiffs_config.h b/tools/sdk/esp32s2/include/spiffs/include/spiffs_config.h index ca7f0cc6fb9..5cc3d78049c 100644 --- a/tools/sdk/esp32s2/include/spiffs/include/spiffs_config.h +++ b/tools/sdk/esp32s2/include/spiffs/include/spiffs_config.h @@ -19,6 +19,7 @@ #include #include #include +#include // compile time switches #define SPIFFS_TAG "SPIFFS" diff --git a/tools/sdk/esp32s2/lib/libphy.a b/tools/sdk/esp32s2/ld/libphy.a similarity index 100% rename from tools/sdk/esp32s2/lib/libphy.a rename to tools/sdk/esp32s2/ld/libphy.a diff --git a/tools/sdk/esp32s2/lib/libapp_trace.a b/tools/sdk/esp32s2/lib/libapp_trace.a index 77834e42b82..4060ca245bc 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_trace.a and b/tools/sdk/esp32s2/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32s2/lib/libapp_update.a b/tools/sdk/esp32s2/lib/libapp_update.a index 97a99244ad2..f6a00059a98 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_update.a and b/tools/sdk/esp32s2/lib/libapp_update.a differ diff --git a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a index 8024a82e164..efb7da07e14 100644 Binary files a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a and b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a differ diff --git a/tools/sdk/esp32s2/lib/libasio.a b/tools/sdk/esp32s2/lib/libasio.a index 2af8e110c94..6b7f880f784 100644 Binary files a/tools/sdk/esp32s2/lib/libasio.a and b/tools/sdk/esp32s2/lib/libasio.a differ diff --git a/tools/sdk/esp32s2/lib/libbootloader_support.a b/tools/sdk/esp32s2/lib/libbootloader_support.a index c965c2a2d3e..2c41c8d15f4 100644 Binary files a/tools/sdk/esp32s2/lib/libbootloader_support.a and b/tools/sdk/esp32s2/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32s2/lib/libcbor.a b/tools/sdk/esp32s2/lib/libcbor.a index 7ff08049254..9c4ce46bc0c 100644 Binary files a/tools/sdk/esp32s2/lib/libcbor.a and b/tools/sdk/esp32s2/lib/libcbor.a differ diff --git a/tools/sdk/esp32s2/lib/libcmock.a b/tools/sdk/esp32s2/lib/libcmock.a index e89a1dca2e2..fb61af3a651 100644 Binary files a/tools/sdk/esp32s2/lib/libcmock.a and b/tools/sdk/esp32s2/lib/libcmock.a differ diff --git a/tools/sdk/esp32s2/lib/libcoap.a b/tools/sdk/esp32s2/lib/libcoap.a index bba4d7602fc..c075a1fe278 100644 Binary files a/tools/sdk/esp32s2/lib/libcoap.a and b/tools/sdk/esp32s2/lib/libcoap.a differ diff --git a/tools/sdk/esp32s2/lib/libconsole.a b/tools/sdk/esp32s2/lib/libconsole.a index c08cbbe6415..bff8c65d0ed 100644 Binary files a/tools/sdk/esp32s2/lib/libconsole.a and b/tools/sdk/esp32s2/lib/libconsole.a differ diff --git a/tools/sdk/esp32s2/lib/libcxx.a b/tools/sdk/esp32s2/lib/libcxx.a index 53d66430920..423eda47212 100644 Binary files a/tools/sdk/esp32s2/lib/libcxx.a and b/tools/sdk/esp32s2/lib/libcxx.a differ diff --git a/tools/sdk/esp32s2/lib/libdriver.a b/tools/sdk/esp32s2/lib/libdriver.a index bb6c886e50b..8c49522a409 100644 Binary files a/tools/sdk/esp32s2/lib/libdriver.a and b/tools/sdk/esp32s2/lib/libdriver.a differ diff --git a/tools/sdk/esp32s2/lib/libefuse.a b/tools/sdk/esp32s2/lib/libefuse.a index 4719778ba4c..7ef5cff692b 100644 Binary files a/tools/sdk/esp32s2/lib/libefuse.a and b/tools/sdk/esp32s2/lib/libefuse.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-dsp.a b/tools/sdk/esp32s2/lib/libesp-dsp.a index 19ec6948798..f1de513bc19 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-dsp.a and b/tools/sdk/esp32s2/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-face.a b/tools/sdk/esp32s2/lib/libesp-face.a index 664db6e5683..6b75659046f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-face.a and b/tools/sdk/esp32s2/lib/libesp-face.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-tls.a b/tools/sdk/esp32s2/lib/libesp-tls.a index 1aeabf77e84..74db39639d8 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-tls.a and b/tools/sdk/esp32s2/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32s2/lib/libesp32-camera.a b/tools/sdk/esp32s2/lib/libesp32-camera.a index ab7a3e1f2c1..47d2676ea9f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp32-camera.a and b/tools/sdk/esp32s2/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32s2/lib/libesp32s2.a b/tools/sdk/esp32s2/lib/libesp32s2.a index 283b22e9a7a..a573c5534c6 100644 Binary files a/tools/sdk/esp32s2/lib/libesp32s2.a and b/tools/sdk/esp32s2/lib/libesp32s2.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_adc_cal.a b/tools/sdk/esp32s2/lib/libesp_adc_cal.a index 6a0621fdb7d..02f4045749d 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_adc_cal.a and b/tools/sdk/esp32s2/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_common.a b/tools/sdk/esp32s2/lib/libesp_common.a index 320b57fc99b..c77213cc6d7 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_common.a and b/tools/sdk/esp32s2/lib/libesp_common.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_eth.a b/tools/sdk/esp32s2/lib/libesp_eth.a index c0c03d3e3f0..e7ffbb25fbe 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_eth.a and b/tools/sdk/esp32s2/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_event.a b/tools/sdk/esp32s2/lib/libesp_event.a index 99be114ec3e..658611a9a03 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_event.a and b/tools/sdk/esp32s2/lib/libesp_event.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_gdbstub.a b/tools/sdk/esp32s2/lib/libesp_gdbstub.a index 64cb9b6bfe4..0f080a5e627 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_gdbstub.a and b/tools/sdk/esp32s2/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hid.a b/tools/sdk/esp32s2/lib/libesp_hid.a index 9fa7dd668dc..1395c3128d0 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hid.a and b/tools/sdk/esp32s2/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_client.a b/tools/sdk/esp32s2/lib/libesp_http_client.a index 1e485a2412c..37a0befb803 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_client.a and b/tools/sdk/esp32s2/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_server.a b/tools/sdk/esp32s2/lib/libesp_http_server.a index 812fb054a27..ce0d10798f6 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_server.a and b/tools/sdk/esp32s2/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_ota.a b/tools/sdk/esp32s2/lib/libesp_https_ota.a index 76b78697ca9..0f17676f4bc 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_ota.a and b/tools/sdk/esp32s2/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_server.a b/tools/sdk/esp32s2/lib/libesp_https_server.a index 2f46057d73d..f7d54f48324 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_server.a and b/tools/sdk/esp32s2/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hw_support.a b/tools/sdk/esp32s2/lib/libesp_hw_support.a index 093fa30717f..7e718d6b1ee 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hw_support.a and b/tools/sdk/esp32s2/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ipc.a b/tools/sdk/esp32s2/lib/libesp_ipc.a index 3fdf7499070..0ea8ca03a31 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ipc.a and b/tools/sdk/esp32s2/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_lcd.a b/tools/sdk/esp32s2/lib/libesp_lcd.a index a470f16edb1..bf8e9416783 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_lcd.a and b/tools/sdk/esp32s2/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_littlefs.a b/tools/sdk/esp32s2/lib/libesp_littlefs.a index c129afdf676..f61e5dd4a4f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_littlefs.a and b/tools/sdk/esp32s2/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a index 2d00ff9046c..5e30be9bfd1 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a and b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_netif.a b/tools/sdk/esp32s2/lib/libesp_netif.a index cc506329181..800baa98935 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_netif.a and b/tools/sdk/esp32s2/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_phy.a b/tools/sdk/esp32s2/lib/libesp_phy.a new file mode 100644 index 00000000000..4d8763b8663 Binary files /dev/null and b/tools/sdk/esp32s2/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_pm.a b/tools/sdk/esp32s2/lib/libesp_pm.a index 495e3630080..b0654db1f9d 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_pm.a and b/tools/sdk/esp32s2/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ringbuf.a b/tools/sdk/esp32s2/lib/libesp_ringbuf.a index c154afdd07d..95141f2436c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ringbuf.a and b/tools/sdk/esp32s2/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_rom.a b/tools/sdk/esp32s2/lib/libesp_rom.a index 8c33945d05b..edd2dfa4c7f 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_rom.a and b/tools/sdk/esp32s2/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a index a8659307e20..b1b9a4d2ee9 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_system.a b/tools/sdk/esp32s2/lib/libesp_system.a index 37089e81f4a..b3e1109df59 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_system.a and b/tools/sdk/esp32s2/lib/libesp_system.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_timer.a b/tools/sdk/esp32s2/lib/libesp_timer.a index a9043360065..7792ee3db34 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_timer.a and b/tools/sdk/esp32s2/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_websocket_client.a b/tools/sdk/esp32s2/lib/libesp_websocket_client.a index 85fce95b337..0b36ba6c355 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_websocket_client.a and b/tools/sdk/esp32s2/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_wifi.a b/tools/sdk/esp32s2/lib/libesp_wifi.a index 19c8b8b1001..24a974a8edd 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_wifi.a and b/tools/sdk/esp32s2/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32s2/lib/libespcoredump.a b/tools/sdk/esp32s2/lib/libespcoredump.a index 8d15a431b63..d6f2ebc8b9c 100644 Binary files a/tools/sdk/esp32s2/lib/libespcoredump.a and b/tools/sdk/esp32s2/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32s2/lib/libexpat.a b/tools/sdk/esp32s2/lib/libexpat.a index c69dcb88fbd..c26f68625b9 100644 Binary files a/tools/sdk/esp32s2/lib/libexpat.a and b/tools/sdk/esp32s2/lib/libexpat.a differ diff --git a/tools/sdk/esp32s2/lib/libfatfs.a b/tools/sdk/esp32s2/lib/libfatfs.a index c0719e9e82d..0c71a5d8bb7 100644 Binary files a/tools/sdk/esp32s2/lib/libfatfs.a and b/tools/sdk/esp32s2/lib/libfatfs.a differ diff --git a/tools/sdk/esp32s2/lib/libfb_gfx.a b/tools/sdk/esp32s2/lib/libfb_gfx.a index 339f6d57698..c07683d043e 100644 Binary files a/tools/sdk/esp32s2/lib/libfb_gfx.a and b/tools/sdk/esp32s2/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32s2/lib/libfreemodbus.a b/tools/sdk/esp32s2/lib/libfreemodbus.a index 708308bf11a..34260fa5b57 100644 Binary files a/tools/sdk/esp32s2/lib/libfreemodbus.a and b/tools/sdk/esp32s2/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32s2/lib/libfreertos.a b/tools/sdk/esp32s2/lib/libfreertos.a index 5c40ceba4c9..1376b4def30 100644 Binary files a/tools/sdk/esp32s2/lib/libfreertos.a and b/tools/sdk/esp32s2/lib/libfreertos.a differ diff --git a/tools/sdk/esp32s2/lib/libhal.a b/tools/sdk/esp32s2/lib/libhal.a index 8d073dd1599..92d59d180c5 100644 Binary files a/tools/sdk/esp32s2/lib/libhal.a and b/tools/sdk/esp32s2/lib/libhal.a differ diff --git a/tools/sdk/esp32s2/lib/libheap.a b/tools/sdk/esp32s2/lib/libheap.a index 83b37bfc451..39fea2ba35b 100644 Binary files a/tools/sdk/esp32s2/lib/libheap.a and b/tools/sdk/esp32s2/lib/libheap.a differ diff --git a/tools/sdk/esp32s2/lib/libjsmn.a b/tools/sdk/esp32s2/lib/libjsmn.a index 814b7982087..874ba4c7281 100644 Binary files a/tools/sdk/esp32s2/lib/libjsmn.a and b/tools/sdk/esp32s2/lib/libjsmn.a differ diff --git a/tools/sdk/esp32s2/lib/libjson.a b/tools/sdk/esp32s2/lib/libjson.a index d285ae21527..46d42ed5077 100644 Binary files a/tools/sdk/esp32s2/lib/libjson.a and b/tools/sdk/esp32s2/lib/libjson.a differ diff --git a/tools/sdk/esp32s2/lib/liblibsodium.a b/tools/sdk/esp32s2/lib/liblibsodium.a index a704eb8b00e..01616784294 100644 Binary files a/tools/sdk/esp32s2/lib/liblibsodium.a and b/tools/sdk/esp32s2/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32s2/lib/liblog.a b/tools/sdk/esp32s2/lib/liblog.a index fc85814c2bb..119e1b6fbe2 100644 Binary files a/tools/sdk/esp32s2/lib/liblog.a and b/tools/sdk/esp32s2/lib/liblog.a differ diff --git a/tools/sdk/esp32s2/lib/liblwip.a b/tools/sdk/esp32s2/lib/liblwip.a index cceff921e8f..c0a9eae383b 100644 Binary files a/tools/sdk/esp32s2/lib/liblwip.a and b/tools/sdk/esp32s2/lib/liblwip.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedcrypto.a b/tools/sdk/esp32s2/lib/libmbedcrypto.a index 47b9eaf8793..71e5fd8cee6 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedcrypto.a and b/tools/sdk/esp32s2/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedtls.a b/tools/sdk/esp32s2/lib/libmbedtls.a index af3f2334732..fed2cf46c99 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedtls.a and b/tools/sdk/esp32s2/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedx509.a b/tools/sdk/esp32s2/lib/libmbedx509.a index 9301ab11ea3..f58cec38c7e 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedx509.a and b/tools/sdk/esp32s2/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32s2/lib/libmdns.a b/tools/sdk/esp32s2/lib/libmdns.a index 86bab904445..acf7b15dc71 100644 Binary files a/tools/sdk/esp32s2/lib/libmdns.a and b/tools/sdk/esp32s2/lib/libmdns.a differ diff --git a/tools/sdk/esp32s2/lib/libmqtt.a b/tools/sdk/esp32s2/lib/libmqtt.a index 9342fa6809e..c963b58f0ff 100644 Binary files a/tools/sdk/esp32s2/lib/libmqtt.a and b/tools/sdk/esp32s2/lib/libmqtt.a differ diff --git a/tools/sdk/esp32s2/lib/libnewlib.a b/tools/sdk/esp32s2/lib/libnewlib.a index e49a46c0f75..bc04468c734 100644 Binary files a/tools/sdk/esp32s2/lib/libnewlib.a and b/tools/sdk/esp32s2/lib/libnewlib.a differ diff --git a/tools/sdk/esp32s2/lib/libnghttp.a b/tools/sdk/esp32s2/lib/libnghttp.a index 41ebb611a1a..80e2f9dcd10 100644 Binary files a/tools/sdk/esp32s2/lib/libnghttp.a and b/tools/sdk/esp32s2/lib/libnghttp.a differ diff --git a/tools/sdk/esp32s2/lib/libnvs_flash.a b/tools/sdk/esp32s2/lib/libnvs_flash.a index 5d05156f918..7065a22808e 100644 Binary files a/tools/sdk/esp32s2/lib/libnvs_flash.a and b/tools/sdk/esp32s2/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32s2/lib/libopenssl.a b/tools/sdk/esp32s2/lib/libopenssl.a index 21da1f0c629..53302aea2fd 100644 Binary files a/tools/sdk/esp32s2/lib/libopenssl.a and b/tools/sdk/esp32s2/lib/libopenssl.a differ diff --git a/tools/sdk/esp32s2/lib/libperfmon.a b/tools/sdk/esp32s2/lib/libperfmon.a index 721619b51a9..6b5c1c9e9f5 100644 Binary files a/tools/sdk/esp32s2/lib/libperfmon.a and b/tools/sdk/esp32s2/lib/libperfmon.a differ diff --git a/tools/sdk/esp32s2/lib/libprotobuf-c.a b/tools/sdk/esp32s2/lib/libprotobuf-c.a index 9b57280db7f..5531be81528 100644 Binary files a/tools/sdk/esp32s2/lib/libprotobuf-c.a and b/tools/sdk/esp32s2/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32s2/lib/libprotocomm.a b/tools/sdk/esp32s2/lib/libprotocomm.a index e95462c0499..a0fc94c1216 100644 Binary files a/tools/sdk/esp32s2/lib/libprotocomm.a and b/tools/sdk/esp32s2/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32s2/lib/libpthread.a b/tools/sdk/esp32s2/lib/libpthread.a index 5e0fc30cc85..75f84839cfd 100644 Binary files a/tools/sdk/esp32s2/lib/libpthread.a and b/tools/sdk/esp32s2/lib/libpthread.a differ diff --git a/tools/sdk/esp32s2/lib/libsdmmc.a b/tools/sdk/esp32s2/lib/libsdmmc.a index 734a1461e6e..c2fd874a8c8 100644 Binary files a/tools/sdk/esp32s2/lib/libsdmmc.a and b/tools/sdk/esp32s2/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32s2/lib/libsoc.a b/tools/sdk/esp32s2/lib/libsoc.a index aa8b2dbc945..37159ddca73 100644 Binary files a/tools/sdk/esp32s2/lib/libsoc.a and b/tools/sdk/esp32s2/lib/libsoc.a differ diff --git a/tools/sdk/esp32s2/lib/libspi_flash.a b/tools/sdk/esp32s2/lib/libspi_flash.a index 34d468bedc6..0d770c8f17b 100644 Binary files a/tools/sdk/esp32s2/lib/libspi_flash.a and b/tools/sdk/esp32s2/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/lib/libspiffs.a b/tools/sdk/esp32s2/lib/libspiffs.a index 7d5a38bc0d1..5dfce3e9e1d 100644 Binary files a/tools/sdk/esp32s2/lib/libspiffs.a and b/tools/sdk/esp32s2/lib/libspiffs.a differ diff --git a/tools/sdk/esp32s2/lib/libtcp_transport.a b/tools/sdk/esp32s2/lib/libtcp_transport.a index f6b9df23734..45a6fc603e7 100644 Binary files a/tools/sdk/esp32s2/lib/libtcp_transport.a and b/tools/sdk/esp32s2/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32s2/lib/libtcpip_adapter.a b/tools/sdk/esp32s2/lib/libtcpip_adapter.a index 39e7f24ce0d..cb2c1490b8a 100644 Binary files a/tools/sdk/esp32s2/lib/libtcpip_adapter.a and b/tools/sdk/esp32s2/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32s2/lib/libtouch_element.a b/tools/sdk/esp32s2/lib/libtouch_element.a index 38d3328b579..bdeadf542d5 100644 Binary files a/tools/sdk/esp32s2/lib/libtouch_element.a and b/tools/sdk/esp32s2/lib/libtouch_element.a differ diff --git a/tools/sdk/esp32s2/lib/libulp.a b/tools/sdk/esp32s2/lib/libulp.a index ebec0c56aa5..6805592aa27 100644 Binary files a/tools/sdk/esp32s2/lib/libulp.a and b/tools/sdk/esp32s2/lib/libulp.a differ diff --git a/tools/sdk/esp32s2/lib/libunity.a b/tools/sdk/esp32s2/lib/libunity.a index f6d469a8b2f..67f82acb69f 100644 Binary files a/tools/sdk/esp32s2/lib/libunity.a and b/tools/sdk/esp32s2/lib/libunity.a differ diff --git a/tools/sdk/esp32s2/lib/libusb.a b/tools/sdk/esp32s2/lib/libusb.a index 56d4dc0daea..6fa470e7637 100644 Binary files a/tools/sdk/esp32s2/lib/libusb.a and b/tools/sdk/esp32s2/lib/libusb.a differ diff --git a/tools/sdk/esp32s2/lib/libvfs.a b/tools/sdk/esp32s2/lib/libvfs.a index 420c68dd113..0e5f910b499 100644 Binary files a/tools/sdk/esp32s2/lib/libvfs.a and b/tools/sdk/esp32s2/lib/libvfs.a differ diff --git a/tools/sdk/esp32s2/lib/libwear_levelling.a b/tools/sdk/esp32s2/lib/libwear_levelling.a index 8e2537f2080..867b22e8f17 100644 Binary files a/tools/sdk/esp32s2/lib/libwear_levelling.a and b/tools/sdk/esp32s2/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32s2/lib/libwifi_provisioning.a b/tools/sdk/esp32s2/lib/libwifi_provisioning.a index fee5b9f6ea8..42e66ab27f4 100644 Binary files a/tools/sdk/esp32s2/lib/libwifi_provisioning.a and b/tools/sdk/esp32s2/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32s2/lib/libwpa_supplicant.a b/tools/sdk/esp32s2/lib/libwpa_supplicant.a index 11932bac33b..cd3e2b496ae 100644 Binary files a/tools/sdk/esp32s2/lib/libwpa_supplicant.a and b/tools/sdk/esp32s2/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32s2/lib/libxtensa.a b/tools/sdk/esp32s2/lib/libxtensa.a index 10dc55371c9..e48f8ae327f 100644 Binary files a/tools/sdk/esp32s2/lib/libxtensa.a and b/tools/sdk/esp32s2/lib/libxtensa.a differ diff --git a/tools/sdk/esp32s2/sdkconfig b/tools/sdk/esp32s2/sdkconfig index 19434099004..bb6853b00d7 100644 --- a/tools/sdk/esp32s2/sdkconfig +++ b/tools/sdk/esp32s2/sdkconfig @@ -550,6 +550,15 @@ CONFIG_ESP_NETIF_TCPIP_LWIP=y CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y # end of ESP NETIF Adapter +# +# PHY +# +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# end of PHY + # # Power Management # @@ -563,6 +572,7 @@ CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER=y CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y # CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set # CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE=y CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y @@ -634,18 +644,12 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP32_WIFI_RX_IRAM_OPT is not set # CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE is not set # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set -# CONFIG_ESP_WIFI_FTM_ENABLE is not set +CONFIG_ESP_WIFI_FTM_ENABLE=y +CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT=y +CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # end of Wi-Fi -# -# PHY -# -# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set -CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 -CONFIG_ESP32_PHY_MAX_TX_POWER=20 -# end of PHY - # # Core dump #