diff --git a/cores/esp32/Esp.cpp b/cores/esp32/Esp.cpp index 22fc4ff6a60..8df9514ee66 100644 --- a/cores/esp32/Esp.cpp +++ b/cores/esp32/Esp.cpp @@ -26,9 +26,9 @@ #include #include #include -#include extern "C" { -#include +#include "esp_ota_ops.h" +#include "esp_image_format.h" } #include diff --git a/libraries/BLE b/libraries/BLE index 11a0aa64532..b232e7f5f0e 160000 --- a/libraries/BLE +++ b/libraries/BLE @@ -1 +1 @@ -Subproject commit 11a0aa645326aed0cb681e86060fe28d4623bc68 +Subproject commit b232e7f5f0e87f36afbc2f4e03a2c49c48dd47bc diff --git a/platform.txt b/platform.txt index a7426fc48a3..f71fa9f48f4 100644 --- a/platform.txt +++ b/platform.txt @@ -22,7 +22,7 @@ compiler.warning_flags.all=-Wall -Werror=all -Wextra compiler.path={runtime.tools.xtensa-esp32-elf-gcc.path}/bin/ compiler.sdk.path={runtime.platform.path}/tools/sdk -compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_https_server" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/unity" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" +compiler.cpreprocessor.flags=-DESP_PLATFORM -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DHAVE_CONFIG_H "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/app_trace" "-I{compiler.sdk.path}/include/app_update" "-I{compiler.sdk.path}/include/asio" "-I{compiler.sdk.path}/include/bootloader_support" "-I{compiler.sdk.path}/include/bt" "-I{compiler.sdk.path}/include/coap" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/driver" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp32" "-I{compiler.sdk.path}/include/esp_adc_cal" "-I{compiler.sdk.path}/include/esp_event" "-I{compiler.sdk.path}/include/esp_http_client" "-I{compiler.sdk.path}/include/esp_http_server" "-I{compiler.sdk.path}/include/esp_https_ota" "-I{compiler.sdk.path}/include/esp_https_server" "-I{compiler.sdk.path}/include/esp_ringbuf" "-I{compiler.sdk.path}/include/ethernet" "-I{compiler.sdk.path}/include/expat" "-I{compiler.sdk.path}/include/fatfs" "-I{compiler.sdk.path}/include/freemodbus" "-I{compiler.sdk.path}/include/freertos" "-I{compiler.sdk.path}/include/heap" "-I{compiler.sdk.path}/include/idf_test" "-I{compiler.sdk.path}/include/jsmn" "-I{compiler.sdk.path}/include/json" "-I{compiler.sdk.path}/include/libsodium" "-I{compiler.sdk.path}/include/log" "-I{compiler.sdk.path}/include/lwip" "-I{compiler.sdk.path}/include/mbedtls" "-I{compiler.sdk.path}/include/mdns" "-I{compiler.sdk.path}/include/micro-ecc" "-I{compiler.sdk.path}/include/mqtt" "-I{compiler.sdk.path}/include/newlib" "-I{compiler.sdk.path}/include/nghttp" "-I{compiler.sdk.path}/include/nvs_flash" "-I{compiler.sdk.path}/include/openssl" "-I{compiler.sdk.path}/include/protobuf-c" "-I{compiler.sdk.path}/include/protocomm" "-I{compiler.sdk.path}/include/pthread" "-I{compiler.sdk.path}/include/sdmmc" "-I{compiler.sdk.path}/include/smartconfig_ack" "-I{compiler.sdk.path}/include/soc" "-I{compiler.sdk.path}/include/spi_flash" "-I{compiler.sdk.path}/include/spiffs" "-I{compiler.sdk.path}/include/tcp_transport" "-I{compiler.sdk.path}/include/tcpip_adapter" "-I{compiler.sdk.path}/include/ulp" "-I{compiler.sdk.path}/include/unity" "-I{compiler.sdk.path}/include/vfs" "-I{compiler.sdk.path}/include/wear_levelling" "-I{compiler.sdk.path}/include/wifi_provisioning" "-I{compiler.sdk.path}/include/wpa_supplicant" "-I{compiler.sdk.path}/include/xtensa-debug-module" "-I{compiler.sdk.path}/include/esp32-camera" compiler.c.cmd=xtensa-esp32-elf-gcc compiler.c.flags=-std=gnu99 -Os -g3 -fstack-protector -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wpointer-arith {compiler.warning_flags} -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -Wno-old-style-declaration -MMD -c @@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls compiler.c.elf.cmd=xtensa-esp32-elf-gcc compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.common.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.spiram_incompatible_fns.ld -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception -compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lcxx -lxtensa-debug-module -ltcp_transport -lmdns -lvfs -lesp_ringbuf -lsoc -lcore -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lapp_update -lnghttp -lspiffs -lunity -lesp_https_server -lespnow -lnvs_flash -lesp_adc_cal -llog -lsmartconfig_ack -lexpat -lm -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lstdc++ +compiler.c.elf.libs=-lgcc -lopenssl -lbtdm_app -lfatfs -lwps -lcoexist -lwear_levelling -lesp_http_client -lprotobuf-c -lhal -lnewlib -ldriver -lbootloader_support -lpp -lfreemodbus -lmesh -lsmartconfig -ljsmn -lwpa -lethernet -lphy -lapp_trace -lconsole -lulp -lwpa_supplicant -lfreertos -lbt -lmicro-ecc -lesp32-camera -lcxx -lxtensa-debug-module -ltcp_transport -lmdns -lvfs -lesp_ringbuf -lsoc -lcore -lsdmmc -llibsodium -lcoap -ltcpip_adapter -lprotocomm -lesp_event -lc_nano -lesp-tls -lasio -lrtc -lspi_flash -lwpa2 -lwifi_provisioning -lesp32 -lapp_update -lnghttp -lspiffs -lunity -lesp_https_server -lespnow -lnvs_flash -lesp_adc_cal -llog -lsmartconfig_ack -lexpat -lm -lmqtt -lc -lheap -lmbedtls -llwip -lnet80211 -lesp_http_server -lpthread -ljson -lesp_https_ota -lstdc++ compiler.as.cmd=xtensa-esp32-elf-as diff --git a/tools/gen_esp32part.py b/tools/gen_esp32part.py index d029127abfc..53a65efc086 100755 --- a/tools/gen_esp32part.py +++ b/tools/gen_esp32part.py @@ -35,6 +35,9 @@ MD5_PARTITION_BEGIN = b"\xEB\xEB" + b"\xFF" * 14 # The first 2 bytes are like magic numbers for MD5 sum PARTITION_TABLE_SIZE = 0x1000 # Size of partition table +MIN_PARTITION_SUBTYPE_APP_OTA = 0x10 +NUM_PARTITION_SUBTYPE_APP_OTA = 16 + __version__ = '1.2' APP_TYPE = 0x00 @@ -254,8 +257,8 @@ class PartitionDefinition(object): } # add subtypes for the 16 OTA slot values ("ota_XX, etc.") - for ota_slot in range(16): - SUBTYPES[TYPES["app"]]["ota_%d" % ota_slot] = 0x10 + ota_slot + for ota_slot in range(NUM_PARTITION_SUBTYPE_APP_OTA): + SUBTYPES[TYPES["app"]]["ota_%d" % ota_slot] = MIN_PARTITION_SUBTYPE_APP_OTA + ota_slot def __init__(self): self.name = "" diff --git a/tools/platformio-build.py b/tools/platformio-build.py index f74b5a373f6..63c390c7ea5 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -151,6 +151,7 @@ join(FRAMEWORK_DIR, "tools", "sdk", "include", "wifi_provisioning"), join(FRAMEWORK_DIR, "tools", "sdk", "include", "wpa_supplicant"), join(FRAMEWORK_DIR, "tools", "sdk", "include", "xtensa-debug-module"), + join(FRAMEWORK_DIR, "tools", "sdk", "include", "esp32-camera"), join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) ], @@ -160,7 +161,7 @@ ], LIBS=[ - "-lgcc", "-lopenssl", "-lbtdm_app", "-lfatfs", "-lwps", "-lcoexist", "-lwear_levelling", "-lesp_http_client", "-lprotobuf-c", "-lhal", "-lnewlib", "-ldriver", "-lbootloader_support", "-lpp", "-lfreemodbus", "-lmesh", "-lsmartconfig", "-ljsmn", "-lwpa", "-lethernet", "-lphy", "-lapp_trace", "-lconsole", "-lulp", "-lwpa_supplicant", "-lfreertos", "-lbt", "-lmicro-ecc", "-lcxx", "-lxtensa-debug-module", "-ltcp_transport", "-lmdns", "-lvfs", "-lesp_ringbuf", "-lsoc", "-lcore", "-lsdmmc", "-llibsodium", "-lcoap", "-ltcpip_adapter", "-lprotocomm", "-lesp_event", "-lc_nano", "-lesp-tls", "-lasio", "-lrtc", "-lspi_flash", "-lwpa2", "-lwifi_provisioning", "-lesp32", "-lapp_update", "-lnghttp", "-lspiffs", "-lunity", "-lesp_https_server", "-lespnow", "-lnvs_flash", "-lesp_adc_cal", "-llog", "-lsmartconfig_ack", "-lexpat", "-lm", "-lmqtt", "-lc", "-lheap", "-lmbedtls", "-llwip", "-lnet80211", "-lesp_http_server", "-lpthread", "-ljson", "-lesp_https_ota", "-lstdc++" + "-lgcc", "-lopenssl", "-lbtdm_app", "-lfatfs", "-lwps", "-lcoexist", "-lwear_levelling", "-lesp_http_client", "-lprotobuf-c", "-lhal", "-lnewlib", "-ldriver", "-lbootloader_support", "-lpp", "-lfreemodbus", "-lmesh", "-lsmartconfig", "-ljsmn", "-lwpa", "-lethernet", "-lphy", "-lapp_trace", "-lconsole", "-lulp", "-lwpa_supplicant", "-lfreertos", "-lbt", "-lmicro-ecc", "-lesp32-camera", "-lcxx", "-lxtensa-debug-module", "-ltcp_transport", "-lmdns", "-lvfs", "-lesp_ringbuf", "-lsoc", "-lcore", "-lsdmmc", "-llibsodium", "-lcoap", "-ltcpip_adapter", "-lprotocomm", "-lesp_event", "-lc_nano", "-lesp-tls", "-lasio", "-lrtc", "-lspi_flash", "-lwpa2", "-lwifi_provisioning", "-lesp32", "-lapp_update", "-lnghttp", "-lspiffs", "-lunity", "-lesp_https_server", "-lespnow", "-lnvs_flash", "-lesp_adc_cal", "-llog", "-lsmartconfig_ack", "-lexpat", "-lm", "-lmqtt", "-lc", "-lheap", "-lmbedtls", "-llwip", "-lnet80211", "-lesp_http_server", "-lpthread", "-ljson", "-lesp_https_ota", "-lstdc++" ], LIBSOURCE_DIRS=[ diff --git a/tools/sdk/bin/bootloader_dio_40m.bin b/tools/sdk/bin/bootloader_dio_40m.bin index bddfa73fb5e..42565bc036d 100644 Binary files a/tools/sdk/bin/bootloader_dio_40m.bin and b/tools/sdk/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/bin/bootloader_dio_80m.bin b/tools/sdk/bin/bootloader_dio_80m.bin index 028eace5cac..60a7406cdaf 100644 Binary files a/tools/sdk/bin/bootloader_dio_80m.bin and b/tools/sdk/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/bin/bootloader_dout_40m.bin b/tools/sdk/bin/bootloader_dout_40m.bin index 9fdb019d4db..e75587fbb89 100644 Binary files a/tools/sdk/bin/bootloader_dout_40m.bin and b/tools/sdk/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/bin/bootloader_dout_80m.bin b/tools/sdk/bin/bootloader_dout_80m.bin index f2c1517ba31..a2f59c1d19e 100644 Binary files a/tools/sdk/bin/bootloader_dout_80m.bin and b/tools/sdk/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/bin/bootloader_qio_40m.bin b/tools/sdk/bin/bootloader_qio_40m.bin index f3edde65b3a..dcdd65251f9 100644 Binary files a/tools/sdk/bin/bootloader_qio_40m.bin and b/tools/sdk/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/bin/bootloader_qio_80m.bin b/tools/sdk/bin/bootloader_qio_80m.bin index 028eace5cac..8e7e9b1cd72 100644 Binary files a/tools/sdk/bin/bootloader_qio_80m.bin and b/tools/sdk/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/bin/bootloader_qout_40m.bin b/tools/sdk/bin/bootloader_qout_40m.bin index f3edde65b3a..5672fd40ab4 100644 Binary files a/tools/sdk/bin/bootloader_qout_40m.bin and b/tools/sdk/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/bin/bootloader_qout_80m.bin b/tools/sdk/bin/bootloader_qout_80m.bin index 5e4b6bdcf08..5ead19d8a96 100644 Binary files a/tools/sdk/bin/bootloader_qout_80m.bin and b/tools/sdk/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/include/app_update/esp_ota_ops.h b/tools/sdk/include/app_update/esp_ota_ops.h index ca77b54226e..3a2355d9e46 100644 --- a/tools/sdk/include/app_update/esp_ota_ops.h +++ b/tools/sdk/include/app_update/esp_ota_ops.h @@ -20,6 +20,7 @@ #include #include "esp_err.h" #include "esp_partition.h" +#include "esp_image_format.h" #ifdef __cplusplus extern "C" @@ -41,6 +42,14 @@ extern "C" */ typedef uint32_t esp_ota_handle_t; +/** + * @brief Return esp_app_desc structure. This structure includes app version. + * + * Return description for running app. + * @return Pointer to esp_app_desc structure. + */ +const esp_app_desc_t *esp_ota_get_app_description(void); + /** * @brief Commence an OTA update writing to the specified partition. @@ -170,6 +179,22 @@ const esp_partition_t* esp_ota_get_running_partition(void); */ const esp_partition_t* esp_ota_get_next_update_partition(const esp_partition_t *start_from); +/** + * @brief Returns esp_app_desc structure for app partition. This structure includes app version. + * + * Returns a description for the requested app partition. + * @param[in] partition Pointer to app partition. (only app partition) + * @param[out] app_desc Structure of info about app. + * @return + * - ESP_OK Successful. + * - ESP_ERR_NOT_FOUND app_desc structure is not found. Magic word is incorrect. + * - ESP_ERR_NOT_SUPPORTED Partition is not application. + * - ESP_ERR_INVALID_ARG Arguments is NULL or if partition's offset exceeds partition size. + * - ESP_ERR_INVALID_SIZE Read would go out of bounds of the partition. + * - or one of error codes from lower-level flash driver. + */ +esp_err_t esp_ota_get_partition_description(const esp_partition_t *partition, esp_app_desc_t *app_desc); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/bootloader_support/bootloader_common.h b/tools/sdk/include/bootloader_support/bootloader_common.h index d5a92cc79b6..f57b4b8a9af 100644 --- a/tools/sdk/include/bootloader_support/bootloader_common.h +++ b/tools/sdk/include/bootloader_support/bootloader_common.h @@ -14,6 +14,7 @@ #pragma once #include "esp_flash_data_types.h" +#include "esp_image_format.h" /// Type of hold a GPIO in low state typedef enum { @@ -23,21 +24,29 @@ typedef enum { } esp_comm_gpio_hold_t; /** - * @brief Calculate crc for the OTA data partition. + * @brief Calculate crc for the OTA data select. * - * @param[in] ota_data The OTA data partition. + * @param[in] s The OTA data select. * @return Returns crc value. */ uint32_t bootloader_common_ota_select_crc(const esp_ota_select_entry_t *s); /** - * @brief Verifies the validity of the OTA data partition + * @brief Verifies the validity of the OTA data select * - * @param[in] ota_data The OTA data partition. + * @param[in] s The OTA data select. * @return Returns true on valid, false otherwise. */ bool bootloader_common_ota_select_valid(const esp_ota_select_entry_t *s); +/** + * @brief Returns true if OTADATA is not marked as bootable partition. + * + * @param[in] s The OTA data select. + * @return Returns true if OTADATA invalid, false otherwise. + */ +bool bootloader_common_ota_select_invalid(const esp_ota_select_entry_t *s); + /** * @brief Check if the GPIO input is a long hold or a short hold. * @@ -91,3 +100,27 @@ bool bootloader_common_label_search(const char *list, char *label); * - ESP_FAIL: An allocation error occurred. */ esp_err_t bootloader_common_get_sha256_of_partition(uint32_t address, uint32_t size, int type, uint8_t *out_sha_256); + +/** + * @brief Returns the number of active otadata. + * + * @param[in] two_otadata Pointer on array from two otadata structures. + * + * @return The number of active otadata (0 or 1). + * - -1: If it does not have active otadata. + */ +int bootloader_common_get_active_otadata(esp_ota_select_entry_t *two_otadata); + +/** + * @brief Returns esp_app_desc structure for app partition. This structure includes app version. + * + * Returns a description for the requested app partition. + * @param[in] partition App partition description. + * @param[out] app_desc Structure of info about app. + * @return + * - ESP_OK: Successful. + * - ESP_ERR_INVALID_ARG: The arguments passed are not valid. + * - ESP_ERR_NOT_FOUND: app_desc structure is not found. Magic word is incorrect. + * - ESP_FAIL: mapping is fail. + */ +esp_err_t bootloader_common_get_partition_description(const esp_partition_pos_t *partition, esp_app_desc_t *app_desc); diff --git a/tools/sdk/include/bootloader_support/esp_image_format.h b/tools/sdk/include/bootloader_support/esp_image_format.h index bce3b1d7fad..7006cae98d4 100644 --- a/tools/sdk/include/bootloader_support/esp_image_format.h +++ b/tools/sdk/include/bootloader_support/esp_image_format.h @@ -89,6 +89,25 @@ typedef struct { uint32_t data_len; } esp_image_segment_header_t; +#define ESP_APP_DESC_MAGIC_WORD 0xABCD5432 /*!< The magic word for the esp_app_desc structure that is in DROM. */ + +/** + * @brief Description about application. + */ +typedef struct { + uint32_t magic_word; /*!< Magic word ESP_APP_DESC_MAGIC_WORD */ + uint32_t secure_version; /*!< Secure version */ + uint32_t reserv1[2]; /*!< --- */ + char version[32]; /*!< Application version */ + char project_name[32]; /*!< Project name */ + char time[16]; /*!< Compile time */ + char date[16]; /*!< Compile date*/ + char idf_ver[32]; /*!< Version IDF */ + uint8_t app_elf_sha256[32]; /*!< sha256 of elf file */ + uint32_t reserv2[20]; /*!< --- */ +} esp_app_desc_t; +_Static_assert(sizeof(esp_app_desc_t) == 256, "esp_app_desc_t should be 256 bytes"); + #define ESP_IMAGE_MAX_SEGMENTS 16 /* Structure to hold on-flash image metadata */ diff --git a/tools/sdk/include/bt/esp_bt.h b/tools/sdk/include/bt/esp_bt.h index 3115cacd0dd..b1dbc646738 100644 --- a/tools/sdk/include/bt/esp_bt.h +++ b/tools/sdk/include/bt/esp_bt.h @@ -405,7 +405,6 @@ esp_err_t esp_bt_mem_release(esp_bt_mode_t mode); * * For ORIG mode: * Bluetooth modem sleep is enabled in controller start up by default if CONFIG_BTDM_CONTROLLER_MODEM_SLEEP is set and "ORIG mode" is selected. In ORIG modem sleep mode, bluetooth controller will switch off some components and pause to work every now and then, if there is no event to process; and wakeup according to the scheduled interval and resume the work. It can also wakeup earlier upon external request using function "esp_bt_controller_wakeup_request". - * Note that currently there is problem in the combination use of bluetooth modem sleep and Dynamic Frequency Scaling(DFS). So do not enable DFS if bluetooth modem sleep is in use. * * @return * - ESP_OK : success diff --git a/tools/sdk/include/config/sdkconfig.h b/tools/sdk/include/config/sdkconfig.h index 2dd5024c482..b6a85ecdc63 100644 --- a/tools/sdk/include/config/sdkconfig.h +++ b/tools/sdk/include/config/sdkconfig.h @@ -63,6 +63,7 @@ #define CONFIG_MBEDTLS_PEM_WRITE_C 1 #define CONFIG_BT_SPP_ENABLED 1 #define CONFIG_BT_RESERVE_DRAM 0xdb5c +#define CONFIG_APP_COMPILE_TIME_DATE 1 #define CONFIG_CXX_EXCEPTIONS 1 #define CONFIG_FATFS_FS_LOCK 0 #define CONFIG_IP_LOST_TIMER_INTERVAL 120 @@ -76,6 +77,7 @@ #define CONFIG_SPIRAM_SUPPORT 1 #define CONFIG_LWIP_MAX_SOCKETS 10 #define CONFIG_LWIP_NETIF_LOOPBACK 1 +#define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread" #define CONFIG_EMAC_TASK_PRIORITY 20 #define CONFIG_TIMER_TASK_STACK_DEPTH 2048 #define CONFIG_TCP_MSS 1436 @@ -201,6 +203,7 @@ #define CONFIG_MB_QUEUE_LENGTH 20 #define CONFIG_SW_COEXIST_PREFERENCE_VALUE 0 #define CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA 1 +#define CONFIG_OV2640_SUPPORT 1 #define CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER 1 #define CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_PSK 1 #define CONFIG_PPP_SUPPORT 1 @@ -270,8 +273,10 @@ #define CONFIG_MBEDTLS_TLS_CLIENT 1 #define CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI 1 #define CONFIG_BT_ENABLED 1 +#define CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY 1 #define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1 #define CONFIG_MONITOR_BAUD 115200 +#define CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT -1 #define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1 #define CONFIG_TCPIP_LWIP 1 #define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST 1 diff --git a/tools/sdk/include/driver/driver/spi_slave.h b/tools/sdk/include/driver/driver/spi_slave.h index e0837bd0b6e..522c9fb8ab0 100644 --- a/tools/sdk/include/driver/driver/spi_slave.h +++ b/tools/sdk/include/driver/driver/spi_slave.h @@ -73,7 +73,10 @@ struct spi_slave_transaction_t { size_t length; ///< Total data length, in bits size_t trans_len; ///< Transaction data length, in bits const void *tx_buffer; ///< Pointer to transmit buffer, or NULL for no MOSI phase - void *rx_buffer; ///< Pointer to receive buffer, or NULL for no MISO phase + void *rx_buffer; /**< Pointer to receive buffer, or NULL for no MISO phase. + * When the DMA is anabled, must start at WORD boundary (``rx_buffer%4==0``), + * and has length of a multiple of 4 bytes. + */ void *user; ///< User-defined variable. Can be used to store eg transaction ID. }; diff --git a/tools/sdk/include/esp32-camera/esp_camera.h b/tools/sdk/include/esp32-camera/esp_camera.h new file mode 100755 index 00000000000..fddff1b82bb --- /dev/null +++ b/tools/sdk/include/esp32-camera/esp_camera.h @@ -0,0 +1,179 @@ +// 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. +/* + * Example Use + * + static camera_config_t camera_example_config = { + .pin_pwdn = PIN_PWDN, + .pin_reset = PIN_RESET, + .pin_xclk = PIN_XCLK, + .pin_sscb_sda = PIN_SIOD, + .pin_sscb_scl = PIN_SIOC, + .pin_d7 = PIN_D7, + .pin_d6 = PIN_D6, + .pin_d5 = PIN_D5, + .pin_d4 = PIN_D4, + .pin_d3 = PIN_D3, + .pin_d2 = PIN_D2, + .pin_d1 = PIN_D1, + .pin_d0 = PIN_D0, + .pin_vsync = PIN_VSYNC, + .pin_href = PIN_HREF, + .pin_pclk = PIN_PCLK, + + .xclk_freq_hz = 20000000, + .ledc_timer = LEDC_TIMER_0, + .ledc_channel = LEDC_CHANNEL_0, + .pixel_format = PIXFORMAT_JPEG, + .frame_size = FRAMESIZE_SVGA, + .jpeg_quality = 10, + .fb_count = 2 + }; + + esp_err_t camera_example_init(){ + return esp_camera_init(&camera_example_config); + } + + esp_err_t camera_example_capture(){ + //capture a frame + camera_fb_t * fb = esp_camera_fb_get(); + if (!fb) { + ESP_LOGE(TAG, "Frame buffer could not be acquired"); + return ESP_FAIL; + } + + //replace this with your own function + display_image(fb->width, fb->height, fb->pixformat, fb->buf, fb->len); + + //return the frame buffer back to be reused + esp_camera_fb_return(fb); + + return ESP_OK; + } +*/ + +#pragma once + +#include "esp_err.h" +#include "driver/ledc.h" +#include "sensor.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Configuration structure for camera initialization + */ +typedef struct { + int pin_pwdn; /*!< GPIO pin for camera power down line */ + int pin_reset; /*!< GPIO pin for camera reset line */ + int pin_xclk; /*!< GPIO pin for camera XCLK line */ + int pin_sscb_sda; /*!< GPIO pin for camera SDA line */ + int pin_sscb_scl; /*!< GPIO pin for camera SCL line */ + int pin_d7; /*!< GPIO pin for camera D7 line */ + int pin_d6; /*!< GPIO pin for camera D6 line */ + int pin_d5; /*!< GPIO pin for camera D5 line */ + int pin_d4; /*!< GPIO pin for camera D4 line */ + int pin_d3; /*!< GPIO pin for camera D3 line */ + int pin_d2; /*!< GPIO pin for camera D2 line */ + int pin_d1; /*!< GPIO pin for camera D1 line */ + int pin_d0; /*!< GPIO pin for camera D0 line */ + int pin_vsync; /*!< GPIO pin for camera VSYNC line */ + 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 10KHz or 20KHz */ + + 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 */ + + pixformat_t pixel_format; /*!< Format of the pixel data: PIXFORMAT_ + YUV422|GRAYSCALE|RGB565|JPEG */ + framesize_t frame_size; /*!< Size of the output image: FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA */ + + int jpeg_quality; /*!< Quality of JPEG output. 0-63 lower means higher quality */ + size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */ +} camera_config_t; + +/** + * @brief Data structure of camera frame buffer + */ +typedef struct { + uint8_t * buf; /*!< Pointer to the pixel data */ + size_t len; /*!< Length of the buffer in bytes */ + size_t width; /*!< Width of the buffer in pixels */ + size_t height; /*!< Height of the buffer in pixels */ + pixformat_t format; /*!< Format of the pixel data */ +} camera_fb_t; + +#define ESP_ERR_CAMERA_BASE 0x20000 +#define ESP_ERR_CAMERA_NOT_DETECTED (ESP_ERR_CAMERA_BASE + 1) +#define ESP_ERR_CAMERA_FAILED_TO_SET_FRAME_SIZE (ESP_ERR_CAMERA_BASE + 2) +#define ESP_ERR_CAMERA_NOT_SUPPORTED (ESP_ERR_CAMERA_BASE + 3) + +/** + * @brief Initialize the camera driver + * + * @note call camera_probe before calling this function + * + * This function detects and configures camera over I2C interface, + * allocates framebuffer and DMA buffers, + * initializes parallel I2S input, and sets up DMA descriptors. + * + * Currently this function can only be called once and there is + * no way to de-initialize this module. + * + * @param config Camera configuration parameters + * + * @return ESP_OK on success + */ +esp_err_t esp_camera_init(const camera_config_t* config); + +/** + * @brief Deinitialize the camera driver + * + * @return + * - ESP_OK on success + * - ESP_ERR_INVALID_STATE if the driver hasn't been initialized yet + */ +esp_err_t esp_camera_deinit(); + +/** + * @brief Obtain pointer to a frame buffer. + * + * @return pointer to the frame buffer + */ +camera_fb_t* esp_camera_fb_get(); + +/** + * @brief Return the frame buffer to be reused again. + * + * @param fb Pointer to the frame buffer + */ +void esp_camera_fb_return(camera_fb_t * fb); + +/** + * @brief Get a pointer to the image sensor control structure + * + * @return pointer to the sensor + */ +sensor_t * esp_camera_sensor_get(); + + +#ifdef __cplusplus +} +#endif + +#include "img_converters.h" + diff --git a/tools/sdk/include/esp32-camera/esp_jpg_decode.h b/tools/sdk/include/esp32-camera/esp_jpg_decode.h new file mode 100644 index 00000000000..f13536edf4d --- /dev/null +++ b/tools/sdk/include/esp32-camera/esp_jpg_decode.h @@ -0,0 +1,43 @@ +// 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 _ESP_JPG_DECODE_H_ +#define _ESP_JPG_DECODE_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "esp_err.h" + +typedef enum { + JPG_SCALE_NONE, + JPG_SCALE_2X, + JPG_SCALE_4X, + JPG_SCALE_8X, + JPG_SCALE_MAX = JPG_SCALE_8X +} jpg_scale_t; + +typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len); +typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); + +esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg); + +#ifdef __cplusplus +} +#endif + +#endif /* _ESP_JPG_DECODE_H_ */ diff --git a/tools/sdk/include/esp32-camera/img_converters.h b/tools/sdk/include/esp32-camera/img_converters.h new file mode 100644 index 00000000000..2b83c4d6f42 --- /dev/null +++ b/tools/sdk/include/esp32-camera/img_converters.h @@ -0,0 +1,126 @@ +// 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 _IMG_CONVERTERS_H_ +#define _IMG_CONVERTERS_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include "esp_camera.h" + +typedef size_t (* jpg_out_cb)(void * arg, size_t index, const void* data, size_t len); + +/** + * @brief Convert image buffer to JPEG + * + * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param quality JPEG quality of the resulting image + * @param cp Callback to be called to write the bytes of the output JPEG + * @param arg Pointer to be passed to the callback + * + * @return true on success + */ +bool fmt2jpg_cb(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, jpg_out_cb cb, void * arg); + +/** + * @brief Convert camera frame buffer to JPEG + * + * @param fb Source camera frame buffer + * @param quality JPEG quality of the resulting image + * @param cp Callback to be called to write the bytes of the output JPEG + * @param arg Pointer to be passed to the callback + * + * @return true on success + */ +bool frame2jpg_cb(camera_fb_t * fb, uint8_t quality, jpg_out_cb cb, void * arg); + +/** + * @brief Convert image buffer to JPEG buffer + * + * @param src Source buffer in RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param quality JPEG quality of the resulting image + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool fmt2jpg(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t quality, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert camera frame buffer to JPEG buffer + * + * @param fb Source camera frame buffer + * @param quality JPEG quality of the resulting image + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool frame2jpg(camera_fb_t * fb, uint8_t quality, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert image buffer to BMP buffer + * + * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param width Width in pixels of the source image + * @param height Height in pixels of the source image + * @param format Format of the source image + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool fmt2bmp(uint8_t *src, size_t src_len, uint16_t width, uint16_t height, pixformat_t format, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert camera frame buffer to BMP buffer + * + * @param fb Source camera frame buffer + * @param out Pointer to be populated with the address of the resulting buffer + * @param out_len Pointer to be populated with the length of the output buffer + * + * @return true on success + */ +bool frame2bmp(camera_fb_t * fb, uint8_t ** out, size_t * out_len); + +/** + * @brief Convert image buffer to RGB888 buffer (used for face detection) + * + * @param src Source buffer in JPEG, RGB565, RGB888, YUYV or GRAYSCALE format + * @param src_len Length in bytes of the source buffer + * @param format Format of the source image + * @param rgb_buf Pointer to the output buffer (width * height * 3) + * + * @return true on success + */ +bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf); + +#ifdef __cplusplus +} +#endif + +#endif /* _IMG_CONVERTERS_H_ */ diff --git a/tools/sdk/include/esp32-camera/sensor.h b/tools/sdk/include/esp32-camera/sensor.h new file mode 100755 index 00000000000..f50501d1dbd --- /dev/null +++ b/tools/sdk/include/esp32-camera/sensor.h @@ -0,0 +1,127 @@ +/* + * This file is part of the OpenMV project. + * Copyright (c) 2013/2014 Ibrahim Abdelkader + * This work is licensed under the MIT license, see the file LICENSE for details. + * + * Sensor abstraction layer. + * + */ +#ifndef __SENSOR_H__ +#define __SENSOR_H__ +#include + +#define OV9650_PID (0x96) +#define OV2640_PID (0x26) +#define OV7725_PID (0x77) + +typedef enum { + PIXFORMAT_RGB565, // 2BPP/RGB565 + PIXFORMAT_YUV422, // 2BPP/YUV422 + PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE + PIXFORMAT_JPEG, // JPEG/COMPRESSED + PIXFORMAT_RGB888, // 3BPP/RGB888 +} pixformat_t; + +typedef enum { + FRAMESIZE_QQVGA, // 160x120 + FRAMESIZE_QQVGA2, // 128x160 + FRAMESIZE_QCIF, // 176x144 + FRAMESIZE_HQVGA, // 240x176 + FRAMESIZE_QVGA, // 320x240 + FRAMESIZE_CIF, // 400x296 + FRAMESIZE_VGA, // 640x480 + FRAMESIZE_SVGA, // 800x600 + FRAMESIZE_XGA, // 1024x768 + FRAMESIZE_SXGA, // 1280x1024 + FRAMESIZE_UXGA, // 1600x1200 +} framesize_t; + +typedef enum { + GAINCEILING_2X, + GAINCEILING_4X, + GAINCEILING_8X, + GAINCEILING_16X, + GAINCEILING_32X, + GAINCEILING_64X, + GAINCEILING_128X, +} gainceiling_t; + +typedef struct { + uint8_t MIDH; + uint8_t MIDL; + uint8_t PID; + uint8_t VER; +} sensor_id_t; + +typedef struct { + framesize_t framesize;//0 - 10 + uint8_t quality;//0 - 63 + int8_t brightness;//-2 - 2 + int8_t contrast;//-2 - 2 + int8_t saturation;//-2 - 2 + uint8_t special_effect;//0 - 6 + uint8_t wb_mode;//0 - 4 + uint8_t awb; + uint8_t awb_gain; + uint8_t aec; + uint8_t aec2; + int8_t ae_level;//-2 - 2 + uint16_t aec_value;//0 - 1200 + uint8_t agc; + uint8_t agc_gain;//0 - 30 + uint8_t gainceiling;//0 - 6 + uint8_t bpc; + uint8_t wpc; + uint8_t raw_gma; + uint8_t lenc; + uint8_t hmirror; + uint8_t vflip; + uint8_t dcw; + uint8_t colorbar; +} camera_status_t; + +typedef struct _sensor sensor_t; +typedef struct _sensor { + sensor_id_t id; // Sensor ID. + uint8_t slv_addr; // Sensor I2C slave address. + pixformat_t pixformat; + camera_status_t status; + + // Sensor function pointers + int (*init_status) (sensor_t *sensor); + int (*reset) (sensor_t *sensor); + int (*set_pixformat) (sensor_t *sensor, pixformat_t pixformat); + int (*set_framesize) (sensor_t *sensor, framesize_t framesize); + int (*set_contrast) (sensor_t *sensor, int level); + int (*set_brightness) (sensor_t *sensor, int level); + int (*set_saturation) (sensor_t *sensor, int level); + int (*set_gainceiling) (sensor_t *sensor, gainceiling_t gainceiling); + int (*set_quality) (sensor_t *sensor, int quality); + int (*set_colorbar) (sensor_t *sensor, int enable); + int (*set_whitebal) (sensor_t *sensor, int enable); + int (*set_gain_ctrl) (sensor_t *sensor, int enable); + int (*set_exposure_ctrl) (sensor_t *sensor, int enable); + int (*set_hmirror) (sensor_t *sensor, int enable); + int (*set_vflip) (sensor_t *sensor, int enable); + + int (*set_aec2) (sensor_t *sensor, int enable); + int (*set_awb_gain) (sensor_t *sensor, int enable); + int (*set_agc_gain) (sensor_t *sensor, int gain); + int (*set_aec_value) (sensor_t *sensor, int gain); + + int (*set_special_effect) (sensor_t *sensor, int effect); + int (*set_wb_mode) (sensor_t *sensor, int mode); + int (*set_ae_level) (sensor_t *sensor, int level); + + int (*set_dcw) (sensor_t *sensor, int enable); + int (*set_bpc) (sensor_t *sensor, int enable); + int (*set_wpc) (sensor_t *sensor, int enable); + + int (*set_raw_gma) (sensor_t *sensor, int enable); + int (*set_lenc) (sensor_t *sensor, int enable); +} sensor_t; + +// Resolution table (in camera.c) +extern const int resolution[][2]; + +#endif /* __SENSOR_H__ */ diff --git a/tools/sdk/include/esp32/esp_phy_init.h b/tools/sdk/include/esp32/esp_phy_init.h index f06375d1a6e..6783ff54b47 100644 --- a/tools/sdk/include/esp32/esp_phy_init.h +++ b/tools/sdk/include/esp32/esp_phy_init.h @@ -156,6 +156,18 @@ esp_err_t esp_phy_load_cal_data_from_nvs(esp_phy_calibration_data_t* out_cal_dat */ esp_err_t esp_phy_store_cal_data_to_nvs(const esp_phy_calibration_data_t* cal_data); +/** + * @brief Erase PHY calibration data which is stored in the NVS + * + * This is a function which can be used to trigger full calibration as a last-resort remedy + * if partial calibration is used. It can be called in the application based on some conditions + * (e.g. an option provided in some diagnostic mode). + * + * @return ESP_OK on success + * @return others on fail. Please refer to NVS API return value error number. + */ +esp_err_t esp_phy_erase_cal_data_in_nvs(void); + /** * @brief Initialize PHY and RF module * @@ -214,6 +226,12 @@ esp_err_t esp_modem_sleep_register(modem_sleep_module_t module); */ esp_err_t esp_modem_sleep_deregister(modem_sleep_module_t module); +/** + * @brief Get the time stamp when PHY/RF was switched on + * @return return 0 if PHY/RF is never switched on. Otherwise return time in + * microsecond since boot when phy/rf was last switched on +*/ +int64_t esp_phy_rf_get_on_ts(void); #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/esp32/esp_wifi_internal.h b/tools/sdk/include/esp32/esp_wifi_internal.h index acb78eaae35..67bfd926d28 100644 --- a/tools/sdk/include/esp32/esp_wifi_internal.h +++ b/tools/sdk/include/esp32/esp_wifi_internal.h @@ -46,6 +46,40 @@ typedef struct { void *storage; /**< storage for FreeRTOS queue */ } wifi_static_queue_t; +/** + * @brief WiFi log level + * + */ +typedef enum { + WIFI_LOG_ERROR = 0, /*enabled by default*/ + WIFI_LOG_WARNING, /*enabled by default*/ + WIFI_LOG_INFO, /*enabled by default*/ + WIFI_LOG_DEBUG, /*can be set in menuconfig*/ + WIFI_LOG_VERBOSE, /*can be set in menuconfig*/ +} wifi_log_level_t; + +/** + * @brief WiFi log module definition + * + */ +typedef enum { + WIFI_LOG_MODULE_ALL = 0, /*all log modules */ + WIFI_LOG_MODULE_WIFI, /*logs related to WiFi*/ + WIFI_LOG_MODULE_COEX, /*logs related to WiFi and BT(or BLE) coexist*/ + WIFI_LOG_MODULE_MESH, /*logs related to Mesh*/ +} wifi_log_module_t; + +/** + * @brief WiFi log submodule definition + * + */ +#define WIFI_LOG_SUBMODULE_ALL (0) /*all log submodules*/ +#define WIFI_LOG_SUBMODULE_INIT (1) /*logs related to initialization*/ +#define WIFI_LOG_SUBMODULE_IOCTL (1<<1) /*logs related to API calling*/ +#define WIFI_LOG_SUBMODULE_CONN (1<<2) /*logs related to connecting*/ +#define WIFI_LOG_SUBMODULE_SCAN (1<<3) /*logs related to scaning*/ + + /** * @brief Initialize Wi-Fi Driver * Alloc resource for WiFi driver, such as WiFi control structure, RX/TX buffer, @@ -224,6 +258,46 @@ void *wifi_calloc( size_t n, size_t size ); */ esp_err_t esp_wifi_internal_update_mac_time( uint32_t time_delta ); +/** + * @brief Set current WiFi log level + * + * @param level Log level. + * + * @return + * - ESP_OK: succeed + * - ESP_FAIL: level is invalid + */ +esp_err_t esp_wifi_internal_set_log_level(wifi_log_level_t level); + +/** + * @brief Set current log module and submodule + * + * @param module Log module + * @param submodule Log submodule + * @param enable enable or disable + * If module == 0 && enable == 0, all log modules are disabled. + * If module == 0 && enable == 1, all log modules are enabled. + * If submodule == 0 && enable == 0, all log submodules are disabled. + * If submodule == 0 && enable == 1, all log submodules are enabled. + * + * @return + * - ESP_OK: succeed + * - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init + * - ESP_ERR_WIFI_ARG: invalid argument + */ +esp_err_t esp_wifi_internal_set_log_mod(wifi_log_module_t module, uint32_t submodule, bool enable); + +/** + * @brief Get current WiFi log info + * + * @param log_level the return log level. + * @param log_mod the return log module and submodule + * + * @return + * - ESP_OK: succeed + */ +esp_err_t esp_wifi_internal_get_log(wifi_log_level_t *log_level, uint32_t *log_mod); + #ifdef __cplusplus } #endif diff --git a/tools/sdk/include/pthread/esp_pthread.h b/tools/sdk/include/pthread/esp_pthread.h index 3ce3703dccb..76f45a32abd 100644 --- a/tools/sdk/include/pthread/esp_pthread.h +++ b/tools/sdk/include/pthread/esp_pthread.h @@ -14,6 +14,9 @@ #pragma once +#include "esp_err.h" +#include + #ifdef __cplusplus extern "C" { #endif @@ -24,11 +27,22 @@ extern "C" { /** pthread configuration structure that influences pthread creation */ typedef struct { - size_t stack_size; ///< the stack size of the pthread - size_t prio; ///< the thread's priority - bool inherit_cfg; ///< inherit this configuration further + size_t stack_size; ///< The stack size of the pthread + size_t prio; ///< The thread's priority + bool inherit_cfg; ///< Inherit this configuration further + const char* thread_name; ///< The thread name. + int pin_to_core; ///< The core id to pin the thread to. Has the same value range as xCoreId argument of xTaskCreatePinnedToCore. } esp_pthread_cfg_t; +/** + * @brief Creates a default pthread configuration based + * on the values set via menuconfig. + * + * @return + * A default configuration structure. + */ +esp_pthread_cfg_t esp_pthread_get_default_config(); + /** * @brief Configure parameters for creating pthread * diff --git a/tools/sdk/include/soc/soc/apb_ctrl_struct.h b/tools/sdk/include/soc/soc/apb_ctrl_struct.h index 0d8e49a42ed..a871af84212 100644 --- a/tools/sdk/include/soc/soc/apb_ctrl_struct.h +++ b/tools/sdk/include/soc/soc/apb_ctrl_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_APB_CTRL_STRUCT_H_ #define _SOC_APB_CTRL_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/can_struct.h b/tools/sdk/include/soc/soc/can_struct.h index 3f566b135d5..fd9609344d5 100644 --- a/tools/sdk/include/soc/soc/can_struct.h +++ b/tools/sdk/include/soc/soc/can_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_CAN_STRUCT_H_ #define _SOC_CAN_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/gpio_sd_struct.h b/tools/sdk/include/soc/soc/gpio_sd_struct.h index e5001c23f5f..4b82be052ca 100644 --- a/tools/sdk/include/soc/soc/gpio_sd_struct.h +++ b/tools/sdk/include/soc/soc/gpio_sd_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_GPIO_SD_STRUCT_H_ #define _SOC_GPIO_SD_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/gpio_struct.h b/tools/sdk/include/soc/soc/gpio_struct.h index 46ee88229c2..15038fed3ff 100644 --- a/tools/sdk/include/soc/soc/gpio_struct.h +++ b/tools/sdk/include/soc/soc/gpio_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_GPIO_STRUCT_H_ #define _SOC_GPIO_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/hinf_struct.h b/tools/sdk/include/soc/soc/hinf_struct.h index 1c2d9e3b784..8e46f5397d0 100644 --- a/tools/sdk/include/soc/soc/hinf_struct.h +++ b/tools/sdk/include/soc/soc/hinf_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_HINF_STRUCT_H_ #define _SOC_HINF_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/host_struct.h b/tools/sdk/include/soc/soc/host_struct.h index a86c2982db1..6c350abfc3a 100644 --- a/tools/sdk/include/soc/soc/host_struct.h +++ b/tools/sdk/include/soc/soc/host_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_HOST_STRUCT_H_ #define _SOC_HOST_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/i2c_struct.h b/tools/sdk/include/soc/soc/i2c_struct.h index 7e7818700e3..c60bb1e7c18 100644 --- a/tools/sdk/include/soc/soc/i2c_struct.h +++ b/tools/sdk/include/soc/soc/i2c_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_I2C_STRUCT_H_ #define _SOC_I2C_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/i2s_struct.h b/tools/sdk/include/soc/soc/i2s_struct.h index 8ec3145cdc8..aa92bb75fea 100644 --- a/tools/sdk/include/soc/soc/i2s_struct.h +++ b/tools/sdk/include/soc/soc/i2s_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_I2S_STRUCT_H_ #define _SOC_I2S_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/ledc_struct.h b/tools/sdk/include/soc/soc/ledc_struct.h index 4c87dfc2654..d07e059f209 100644 --- a/tools/sdk/include/soc/soc/ledc_struct.h +++ b/tools/sdk/include/soc/soc/ledc_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_LEDC_STRUCT_H_ #define _SOC_LEDC_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/mcpwm_struct.h b/tools/sdk/include/soc/soc/mcpwm_struct.h index f41d40c6448..1d5110bf8c9 100644 --- a/tools/sdk/include/soc/soc/mcpwm_struct.h +++ b/tools/sdk/include/soc/soc/mcpwm_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_MCPWM_STRUCT_H__ #define _SOC_MCPWM_STRUCT_H__ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/pcnt_struct.h b/tools/sdk/include/soc/soc/pcnt_struct.h index 8cfd4ca36e2..a551835bb8f 100644 --- a/tools/sdk/include/soc/soc/pcnt_struct.h +++ b/tools/sdk/include/soc/soc/pcnt_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_PCNT_STRUCT_H_ #define _SOC_PCNT_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/rmt_struct.h b/tools/sdk/include/soc/soc/rmt_struct.h index 3fb254ad60b..bc4cd7a2ec5 100644 --- a/tools/sdk/include/soc/soc/rmt_struct.h +++ b/tools/sdk/include/soc/soc/rmt_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_RMT_STRUCT_H_ #define _SOC_RMT_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/rtc_cntl_struct.h b/tools/sdk/include/soc/soc/rtc_cntl_struct.h index e203722608d..17a2d180382 100644 --- a/tools/sdk/include/soc/soc/rtc_cntl_struct.h +++ b/tools/sdk/include/soc/soc/rtc_cntl_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_RTC_CNTL_STRUCT_H_ #define _SOC_RTC_CNTL_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/rtc_io_struct.h b/tools/sdk/include/soc/soc/rtc_io_struct.h index f20ad4c2cf2..d82f1bd8c04 100644 --- a/tools/sdk/include/soc/soc/rtc_io_struct.h +++ b/tools/sdk/include/soc/soc/rtc_io_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_RTC_IO_STRUCT_H_ #define _SOC_RTC_IO_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/sdmmc_struct.h b/tools/sdk/include/soc/soc/sdmmc_struct.h index 6aa64b43cc3..17b8b3f24f7 100644 --- a/tools/sdk/include/soc/soc/sdmmc_struct.h +++ b/tools/sdk/include/soc/soc/sdmmc_struct.h @@ -16,6 +16,8 @@ #include +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/sens_struct.h b/tools/sdk/include/soc/soc/sens_struct.h index 37069a94560..f572148cd1d 100644 --- a/tools/sdk/include/soc/soc/sens_struct.h +++ b/tools/sdk/include/soc/soc/sens_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_SENS_STRUCT_H_ #define _SOC_SENS_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/slc_struct.h b/tools/sdk/include/soc/soc/slc_struct.h index 3d93ceef71d..55506a5b436 100644 --- a/tools/sdk/include/soc/soc/slc_struct.h +++ b/tools/sdk/include/soc/soc/slc_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_SLC_STRUCT_H_ #define _SOC_SLC_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/soc.h b/tools/sdk/include/soc/soc/soc.h index c3cb55db82a..64a0fab3fbb 100644 --- a/tools/sdk/include/soc/soc/soc.h +++ b/tools/sdk/include/soc/soc/soc.h @@ -286,6 +286,8 @@ #define SOC_DROM_HIGH 0x3F800000 #define SOC_IROM_LOW 0x400D0000 #define SOC_IROM_HIGH 0x40400000 +#define SOC_IROM_MASK_LOW 0x40000000 +#define SOC_IROM_MASK_HIGH 0x40070000 #define SOC_CACHE_PRO_LOW 0x40070000 #define SOC_CACHE_PRO_HIGH 0x40078000 #define SOC_CACHE_APP_LOW 0x40078000 diff --git a/tools/sdk/include/soc/soc/soc_memory_layout.h b/tools/sdk/include/soc/soc/soc_memory_layout.h index 68c87623c3d..ddc0fa1b21a 100644 --- a/tools/sdk/include/soc/soc/soc_memory_layout.h +++ b/tools/sdk/include/soc/soc/soc_memory_layout.h @@ -144,6 +144,11 @@ inline static bool IRAM_ATTR esp_ptr_dma_capable(const void *p) return (intptr_t)p >= SOC_DMA_LOW && (intptr_t)p < SOC_DMA_HIGH; } +inline static bool IRAM_ATTR esp_ptr_word_aligned(const void *p) +{ + return ((intptr_t)p) % 4 == 0; +} + inline static bool IRAM_ATTR esp_ptr_executable(const void *p) { intptr_t ip = (intptr_t) p; diff --git a/tools/sdk/include/soc/soc/spi_struct.h b/tools/sdk/include/soc/soc/spi_struct.h index a52ddf41050..3e36c81c905 100644 --- a/tools/sdk/include/soc/soc/spi_struct.h +++ b/tools/sdk/include/soc/soc/spi_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_SPI_STRUCT_H_ #define _SOC_SPI_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/syscon_struct.h b/tools/sdk/include/soc/soc/syscon_struct.h index 42bd643d169..4fb86f42b99 100644 --- a/tools/sdk/include/soc/soc/syscon_struct.h +++ b/tools/sdk/include/soc/soc/syscon_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_SYSCON_STRUCT_H_ #define _SOC_SYSCON_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/timer_group_struct.h b/tools/sdk/include/soc/soc/timer_group_struct.h index da9acd0c7a0..6d312969d49 100644 --- a/tools/sdk/include/soc/soc/timer_group_struct.h +++ b/tools/sdk/include/soc/soc/timer_group_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_TIMG_STRUCT_H_ #define _SOC_TIMG_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/uart_struct.h b/tools/sdk/include/soc/soc/uart_struct.h index 59b84d2afc2..4efd6cf9011 100644 --- a/tools/sdk/include/soc/soc/uart_struct.h +++ b/tools/sdk/include/soc/soc/uart_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_UART_STRUCT_H_ #define _SOC_UART_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/soc/soc/uhci_struct.h b/tools/sdk/include/soc/soc/uhci_struct.h index 1c1ff0b8891..543af215c44 100644 --- a/tools/sdk/include/soc/soc/uhci_struct.h +++ b/tools/sdk/include/soc/soc/uhci_struct.h @@ -14,6 +14,8 @@ #ifndef _SOC_UHCI_STRUCT_H_ #define _SOC_UHCI_STRUCT_H_ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/tools/sdk/include/ulp/esp32/ulp.h b/tools/sdk/include/ulp/esp32/ulp.h index 6960ac97d84..c9ca5110179 100644 --- a/tools/sdk/include/ulp/esp32/ulp.h +++ b/tools/sdk/include/ulp/esp32/ulp.h @@ -898,6 +898,9 @@ esp_err_t ulp_run(uint32_t entry_point); * i.e. period number 0. ULP program code can use SLEEP instruction to select * which of the SENS_ULP_CP_SLEEP_CYCx_REG should be used for subsequent wakeups. * + * However, please note that SLEEP instruction issued (from ULP program) while the system + * is in deep sleep mode does not have effect, and sleep cycle count 0 is used. + * * @param period_index wakeup period setting number (0 - 4) * @param period_us wakeup period, us * @note The ULP FSM requires two clock cycles to wakeup before being able to run the program. diff --git a/tools/sdk/ld/esp32.common.ld b/tools/sdk/ld/esp32.common.ld index 888508e290b..b7a5d5b7070 100644 --- a/tools/sdk/ld/esp32.common.ld +++ b/tools/sdk/ld/esp32.common.ld @@ -285,6 +285,9 @@ SECTIONS { _rodata_start = ABSOLUTE(.); + *(.rodata_desc .rodata_desc.*) /* Should be the first. App version info. DO NOT PUT ANYTHING BEFORE IT! */ + *(.rodata_custom_desc .rodata_custom_desc.*) /* Should be the second. Custom app version info. DO NOT PUT ANYTHING BEFORE IT! */ + *(EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libgcov.a *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.*) .rodata EXCLUDE_FILE(*libapp_trace.a *libesp32.a:panic.* *libphy.a *libsoc.a:rtc_clk.* *libgcov.a *libheap.a:multi_heap.* *libheap.a:multi_heap_poisoning.*) .rodata.*) *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */ diff --git a/tools/sdk/lib/libapp_trace.a b/tools/sdk/lib/libapp_trace.a index abb359adde0..c8533ac5ec6 100644 Binary files a/tools/sdk/lib/libapp_trace.a and b/tools/sdk/lib/libapp_trace.a differ diff --git a/tools/sdk/lib/libapp_update.a b/tools/sdk/lib/libapp_update.a index 0863939bbc7..6a4603be406 100644 Binary files a/tools/sdk/lib/libapp_update.a and b/tools/sdk/lib/libapp_update.a differ diff --git a/tools/sdk/lib/libasio.a b/tools/sdk/lib/libasio.a index bd2a401c4f1..ce85e6c20ee 100644 Binary files a/tools/sdk/lib/libasio.a and b/tools/sdk/lib/libasio.a differ diff --git a/tools/sdk/lib/libbootloader_support.a b/tools/sdk/lib/libbootloader_support.a index 34e0c378a9e..c23dc8e2978 100644 Binary files a/tools/sdk/lib/libbootloader_support.a and b/tools/sdk/lib/libbootloader_support.a differ diff --git a/tools/sdk/lib/libbt.a b/tools/sdk/lib/libbt.a index a14df8124f9..af4cad0f34c 100644 Binary files a/tools/sdk/lib/libbt.a and b/tools/sdk/lib/libbt.a differ diff --git a/tools/sdk/lib/libbtdm_app.a b/tools/sdk/lib/libbtdm_app.a index e92a20ba1d0..d12422460b5 100755 Binary files a/tools/sdk/lib/libbtdm_app.a and b/tools/sdk/lib/libbtdm_app.a differ diff --git a/tools/sdk/lib/libcoap.a b/tools/sdk/lib/libcoap.a index 247b2240739..b84dd7d4eb6 100644 Binary files a/tools/sdk/lib/libcoap.a and b/tools/sdk/lib/libcoap.a differ diff --git a/tools/sdk/lib/libcoexist.a b/tools/sdk/lib/libcoexist.a index 548f13ef315..f92ca42c324 100644 Binary files a/tools/sdk/lib/libcoexist.a and b/tools/sdk/lib/libcoexist.a differ diff --git a/tools/sdk/lib/libconsole.a b/tools/sdk/lib/libconsole.a index 51f526d96a9..2980accdcce 100644 Binary files a/tools/sdk/lib/libconsole.a and b/tools/sdk/lib/libconsole.a differ diff --git a/tools/sdk/lib/libcore.a b/tools/sdk/lib/libcore.a index 8dc94e2f149..115ff3bed2b 100644 Binary files a/tools/sdk/lib/libcore.a and b/tools/sdk/lib/libcore.a differ diff --git a/tools/sdk/lib/libcxx.a b/tools/sdk/lib/libcxx.a index 610c12ba691..3789c5d27bd 100644 Binary files a/tools/sdk/lib/libcxx.a and b/tools/sdk/lib/libcxx.a differ diff --git a/tools/sdk/lib/libdriver.a b/tools/sdk/lib/libdriver.a index 4809b4bbfc4..e6b26581f85 100644 Binary files a/tools/sdk/lib/libdriver.a and b/tools/sdk/lib/libdriver.a differ diff --git a/tools/sdk/lib/libesp-tls.a b/tools/sdk/lib/libesp-tls.a index 1ee9a0922cf..42095b09bb8 100644 Binary files a/tools/sdk/lib/libesp-tls.a and b/tools/sdk/lib/libesp-tls.a differ diff --git a/tools/sdk/lib/libesp32-camera.a b/tools/sdk/lib/libesp32-camera.a new file mode 100644 index 00000000000..3b8a8930718 Binary files /dev/null and b/tools/sdk/lib/libesp32-camera.a differ diff --git a/tools/sdk/lib/libesp32.a b/tools/sdk/lib/libesp32.a index 51da611b364..6ccedaf87a8 100644 Binary files a/tools/sdk/lib/libesp32.a and b/tools/sdk/lib/libesp32.a differ diff --git a/tools/sdk/lib/libesp_adc_cal.a b/tools/sdk/lib/libesp_adc_cal.a index 1b5fcf54f3f..5be5c0b14de 100644 Binary files a/tools/sdk/lib/libesp_adc_cal.a and b/tools/sdk/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/lib/libesp_event.a b/tools/sdk/lib/libesp_event.a index 8baed232cb7..a4aed6a8b60 100644 Binary files a/tools/sdk/lib/libesp_event.a and b/tools/sdk/lib/libesp_event.a differ diff --git a/tools/sdk/lib/libesp_http_client.a b/tools/sdk/lib/libesp_http_client.a index 034126b19f1..e62c1f4e107 100644 Binary files a/tools/sdk/lib/libesp_http_client.a and b/tools/sdk/lib/libesp_http_client.a differ diff --git a/tools/sdk/lib/libesp_http_server.a b/tools/sdk/lib/libesp_http_server.a index 2e82e08eb3f..0096b272350 100644 Binary files a/tools/sdk/lib/libesp_http_server.a and b/tools/sdk/lib/libesp_http_server.a differ diff --git a/tools/sdk/lib/libesp_https_ota.a b/tools/sdk/lib/libesp_https_ota.a index 56ffb90f1b1..f4cecb7c72a 100644 Binary files a/tools/sdk/lib/libesp_https_ota.a and b/tools/sdk/lib/libesp_https_ota.a differ diff --git a/tools/sdk/lib/libesp_https_server.a b/tools/sdk/lib/libesp_https_server.a index a59bd924f1f..45408e4d31f 100644 Binary files a/tools/sdk/lib/libesp_https_server.a and b/tools/sdk/lib/libesp_https_server.a differ diff --git a/tools/sdk/lib/libesp_ringbuf.a b/tools/sdk/lib/libesp_ringbuf.a index 5adb253051f..abad2528965 100644 Binary files a/tools/sdk/lib/libesp_ringbuf.a and b/tools/sdk/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/lib/libespnow.a b/tools/sdk/lib/libespnow.a index 7fc8aff45ea..e1ec61158e8 100644 Binary files a/tools/sdk/lib/libespnow.a and b/tools/sdk/lib/libespnow.a differ diff --git a/tools/sdk/lib/libethernet.a b/tools/sdk/lib/libethernet.a index d44178150f2..b3615da5193 100644 Binary files a/tools/sdk/lib/libethernet.a and b/tools/sdk/lib/libethernet.a differ diff --git a/tools/sdk/lib/libexpat.a b/tools/sdk/lib/libexpat.a index 38a6814f0ba..a14c322368b 100644 Binary files a/tools/sdk/lib/libexpat.a and b/tools/sdk/lib/libexpat.a differ diff --git a/tools/sdk/lib/libfatfs.a b/tools/sdk/lib/libfatfs.a index 2bc171a5f96..55a5b19a0c2 100644 Binary files a/tools/sdk/lib/libfatfs.a and b/tools/sdk/lib/libfatfs.a differ diff --git a/tools/sdk/lib/libfreemodbus.a b/tools/sdk/lib/libfreemodbus.a index e738c9f7044..6a04cf41b95 100644 Binary files a/tools/sdk/lib/libfreemodbus.a and b/tools/sdk/lib/libfreemodbus.a differ diff --git a/tools/sdk/lib/libfreertos.a b/tools/sdk/lib/libfreertos.a index a260a91f443..acf8b8987b9 100644 Binary files a/tools/sdk/lib/libfreertos.a and b/tools/sdk/lib/libfreertos.a differ diff --git a/tools/sdk/lib/libheap.a b/tools/sdk/lib/libheap.a index da34ff6be89..62d2317ab2a 100644 Binary files a/tools/sdk/lib/libheap.a and b/tools/sdk/lib/libheap.a differ diff --git a/tools/sdk/lib/libjsmn.a b/tools/sdk/lib/libjsmn.a index f7d4535402e..f3f792f392b 100644 Binary files a/tools/sdk/lib/libjsmn.a and b/tools/sdk/lib/libjsmn.a differ diff --git a/tools/sdk/lib/libjson.a b/tools/sdk/lib/libjson.a index 727c02748e2..1c867990f8d 100644 Binary files a/tools/sdk/lib/libjson.a and b/tools/sdk/lib/libjson.a differ diff --git a/tools/sdk/lib/liblibsodium.a b/tools/sdk/lib/liblibsodium.a index 8212a07e121..89888203ea0 100644 Binary files a/tools/sdk/lib/liblibsodium.a and b/tools/sdk/lib/liblibsodium.a differ diff --git a/tools/sdk/lib/liblog.a b/tools/sdk/lib/liblog.a index 4963163f58a..3fc8ab0f6c1 100644 Binary files a/tools/sdk/lib/liblog.a and b/tools/sdk/lib/liblog.a differ diff --git a/tools/sdk/lib/liblwip.a b/tools/sdk/lib/liblwip.a index 467b408aa52..d0248d9e4cc 100644 Binary files a/tools/sdk/lib/liblwip.a and b/tools/sdk/lib/liblwip.a differ diff --git a/tools/sdk/lib/libmbedtls.a b/tools/sdk/lib/libmbedtls.a index 28682283d78..2f1c0469aed 100644 Binary files a/tools/sdk/lib/libmbedtls.a and b/tools/sdk/lib/libmbedtls.a differ diff --git a/tools/sdk/lib/libmdns.a b/tools/sdk/lib/libmdns.a index 1f755d56268..557d4dcc7ee 100644 Binary files a/tools/sdk/lib/libmdns.a and b/tools/sdk/lib/libmdns.a differ diff --git a/tools/sdk/lib/libmesh.a b/tools/sdk/lib/libmesh.a index 294e455bebf..9bee951749b 100644 Binary files a/tools/sdk/lib/libmesh.a and b/tools/sdk/lib/libmesh.a differ diff --git a/tools/sdk/lib/libmicro-ecc.a b/tools/sdk/lib/libmicro-ecc.a index 10c9656d942..bb4b034d0ab 100644 Binary files a/tools/sdk/lib/libmicro-ecc.a and b/tools/sdk/lib/libmicro-ecc.a differ diff --git a/tools/sdk/lib/libmqtt.a b/tools/sdk/lib/libmqtt.a index 6cca475542e..9811090c3fe 100644 Binary files a/tools/sdk/lib/libmqtt.a and b/tools/sdk/lib/libmqtt.a differ diff --git a/tools/sdk/lib/libnet80211.a b/tools/sdk/lib/libnet80211.a index 71adbca1918..74b792d4329 100644 Binary files a/tools/sdk/lib/libnet80211.a and b/tools/sdk/lib/libnet80211.a differ diff --git a/tools/sdk/lib/libnewlib.a b/tools/sdk/lib/libnewlib.a index a9d1bc5d8cd..5f85db3c86f 100644 Binary files a/tools/sdk/lib/libnewlib.a and b/tools/sdk/lib/libnewlib.a differ diff --git a/tools/sdk/lib/libnghttp.a b/tools/sdk/lib/libnghttp.a index 8ec2f9a3ab1..97f76748e28 100644 Binary files a/tools/sdk/lib/libnghttp.a and b/tools/sdk/lib/libnghttp.a differ diff --git a/tools/sdk/lib/libnvs_flash.a b/tools/sdk/lib/libnvs_flash.a index abd7485aa04..34be0014055 100644 Binary files a/tools/sdk/lib/libnvs_flash.a and b/tools/sdk/lib/libnvs_flash.a differ diff --git a/tools/sdk/lib/libopenssl.a b/tools/sdk/lib/libopenssl.a index a44de9f9eea..9dea8477e8b 100644 Binary files a/tools/sdk/lib/libopenssl.a and b/tools/sdk/lib/libopenssl.a differ diff --git a/tools/sdk/lib/libpp.a b/tools/sdk/lib/libpp.a index 52e7fe88580..2b2eba26ca0 100644 Binary files a/tools/sdk/lib/libpp.a and b/tools/sdk/lib/libpp.a differ diff --git a/tools/sdk/lib/libprotobuf-c.a b/tools/sdk/lib/libprotobuf-c.a index c040dd85b35..7c67c6f7488 100644 Binary files a/tools/sdk/lib/libprotobuf-c.a and b/tools/sdk/lib/libprotobuf-c.a differ diff --git a/tools/sdk/lib/libprotocomm.a b/tools/sdk/lib/libprotocomm.a index e3a1f6ed873..a2cec1998f4 100644 Binary files a/tools/sdk/lib/libprotocomm.a and b/tools/sdk/lib/libprotocomm.a differ diff --git a/tools/sdk/lib/libpthread.a b/tools/sdk/lib/libpthread.a index 6a87ffd8e18..d71889b85d0 100644 Binary files a/tools/sdk/lib/libpthread.a and b/tools/sdk/lib/libpthread.a differ diff --git a/tools/sdk/lib/librtc.a b/tools/sdk/lib/librtc.a index dac81d53814..3b3370a36a5 100644 Binary files a/tools/sdk/lib/librtc.a and b/tools/sdk/lib/librtc.a differ diff --git a/tools/sdk/lib/libsdmmc.a b/tools/sdk/lib/libsdmmc.a index 4f9d90cb874..c18511daf23 100644 Binary files a/tools/sdk/lib/libsdmmc.a and b/tools/sdk/lib/libsdmmc.a differ diff --git a/tools/sdk/lib/libsmartconfig.a b/tools/sdk/lib/libsmartconfig.a index 93f933abac4..7f2d28e8fa4 100644 Binary files a/tools/sdk/lib/libsmartconfig.a and b/tools/sdk/lib/libsmartconfig.a differ diff --git a/tools/sdk/lib/libsmartconfig_ack.a b/tools/sdk/lib/libsmartconfig_ack.a index e17df273e6c..3b9f8ce85a3 100644 Binary files a/tools/sdk/lib/libsmartconfig_ack.a and b/tools/sdk/lib/libsmartconfig_ack.a differ diff --git a/tools/sdk/lib/libsoc.a b/tools/sdk/lib/libsoc.a index 376cbd23333..062c249a969 100644 Binary files a/tools/sdk/lib/libsoc.a and b/tools/sdk/lib/libsoc.a differ diff --git a/tools/sdk/lib/libspi_flash.a b/tools/sdk/lib/libspi_flash.a index e76152ad244..5342a8440f1 100644 Binary files a/tools/sdk/lib/libspi_flash.a and b/tools/sdk/lib/libspi_flash.a differ diff --git a/tools/sdk/lib/libspiffs.a b/tools/sdk/lib/libspiffs.a index d416c79258a..f16c99b69f8 100644 Binary files a/tools/sdk/lib/libspiffs.a and b/tools/sdk/lib/libspiffs.a differ diff --git a/tools/sdk/lib/libtcp_transport.a b/tools/sdk/lib/libtcp_transport.a index 0a15fb11801..af8b5c87ad2 100644 Binary files a/tools/sdk/lib/libtcp_transport.a and b/tools/sdk/lib/libtcp_transport.a differ diff --git a/tools/sdk/lib/libtcpip_adapter.a b/tools/sdk/lib/libtcpip_adapter.a index 0199927591d..bce1dadffac 100644 Binary files a/tools/sdk/lib/libtcpip_adapter.a and b/tools/sdk/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/lib/libulp.a b/tools/sdk/lib/libulp.a index 4112ed0831e..9e7df941b85 100644 Binary files a/tools/sdk/lib/libulp.a and b/tools/sdk/lib/libulp.a differ diff --git a/tools/sdk/lib/libunity.a b/tools/sdk/lib/libunity.a index 6ab498a0a1e..ad75780ac61 100644 Binary files a/tools/sdk/lib/libunity.a and b/tools/sdk/lib/libunity.a differ diff --git a/tools/sdk/lib/libvfs.a b/tools/sdk/lib/libvfs.a index 6db0d002e50..ebe7f6a0277 100644 Binary files a/tools/sdk/lib/libvfs.a and b/tools/sdk/lib/libvfs.a differ diff --git a/tools/sdk/lib/libwear_levelling.a b/tools/sdk/lib/libwear_levelling.a index c5859e2f6c6..2fb76a923ac 100644 Binary files a/tools/sdk/lib/libwear_levelling.a and b/tools/sdk/lib/libwear_levelling.a differ diff --git a/tools/sdk/lib/libwifi_provisioning.a b/tools/sdk/lib/libwifi_provisioning.a index 7498b6347fe..f9820a4f770 100644 Binary files a/tools/sdk/lib/libwifi_provisioning.a and b/tools/sdk/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/lib/libwpa.a b/tools/sdk/lib/libwpa.a index 839e4896eae..0b761b827df 100644 Binary files a/tools/sdk/lib/libwpa.a and b/tools/sdk/lib/libwpa.a differ diff --git a/tools/sdk/lib/libwpa2.a b/tools/sdk/lib/libwpa2.a index 656c1e19f23..7e033af8bd8 100644 Binary files a/tools/sdk/lib/libwpa2.a and b/tools/sdk/lib/libwpa2.a differ diff --git a/tools/sdk/lib/libwpa_supplicant.a b/tools/sdk/lib/libwpa_supplicant.a index d68d3a4ce04..19e88e9624a 100644 Binary files a/tools/sdk/lib/libwpa_supplicant.a and b/tools/sdk/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/lib/libwps.a b/tools/sdk/lib/libwps.a index c835b576aba..5ddb1bead35 100644 Binary files a/tools/sdk/lib/libwps.a and b/tools/sdk/lib/libwps.a differ diff --git a/tools/sdk/lib/libxtensa-debug-module.a b/tools/sdk/lib/libxtensa-debug-module.a index efacb71f669..46eb2603ec7 100644 Binary files a/tools/sdk/lib/libxtensa-debug-module.a and b/tools/sdk/lib/libxtensa-debug-module.a differ diff --git a/tools/sdk/sdkconfig b/tools/sdk/sdkconfig index 4661c972291..7b19e5ec1cf 100644 --- a/tools/sdk/sdkconfig +++ b/tools/sdk/sdkconfig @@ -11,6 +11,11 @@ CONFIG_TOOLPREFIX="xtensa-esp32-elf-" CONFIG_PYTHON="python" CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=y +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y + # # Arduino Configuration # @@ -363,6 +368,7 @@ CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1= CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE= # # PHY @@ -377,6 +383,12 @@ CONFIG_ESP32_PHY_MAX_TX_POWER=20 # CONFIG_PM_ENABLE= +# +# Camera configuration +# +CONFIG_OV2640_SUPPORT=y +CONFIG_OV7725_SUPPORT= + # # ADC-Calibration # @@ -720,6 +732,11 @@ CONFIG_OPENSSL_ASSERT_EXIT= CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=2048 CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0= +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1= +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" # # SPI Flash driver