Skip to content

Commit 509bcd3

Browse files
committed
update idf libs, disable WDT on S2, use malloc for PSRAM
1 parent 85e21ed commit 509bcd3

File tree

190 files changed

+1383
-223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+1383
-223
lines changed

platform.txt

+2-2
Large diffs are not rendered by default.

tools/esptool.py

+188-102
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@
223223
"UNITY_INCLUDE_CONFIG_H",
224224
"WITH_POSIX",
225225
"_GNU_SOURCE",
226-
("IDF_VER", '\\"v4.2-dev-1415-ga2263571b\\"'),
226+
("IDF_VER", '\\"v4.2-dev-1575-ga3520970f\\"'),
227227
"ESP_PLATFORM",
228228
"ARDUINO_ARCH_ESP32",
229229
"ESP32",

tools/platformio-build-esp32s2.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
"UNITY_INCLUDE_CONFIG_H",
215215
"WITH_POSIX",
216216
"_GNU_SOURCE",
217-
("IDF_VER", '\\"v4.2-dev-1415-ga2263571b\\"'),
217+
("IDF_VER", '\\"v4.2-dev-1575-ga3520970f\\"'),
218218
"ESP_PLATFORM",
219219
"ARDUINO_ARCH_ESP32",
220220
"ESP32",

tools/sdk/esp32/include/config/sdkconfig.h

+9-4
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@
132132
#define CONFIG_SPIRAM_SIZE -1
133133
#define CONFIG_SPIRAM_SPEED_40M 1
134134
#define CONFIG_SPIRAM 1
135-
#define CONFIG_SPIRAM_USE_CAPS_ALLOC 1
135+
#define CONFIG_SPIRAM_USE_MALLOC 1
136+
#define CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL 16384
137+
#define CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL 32768
136138
#define CONFIG_SPIRAM_CACHE_WORKAROUND 1
137139
#define CONFIG_SPIRAM_CACHE_WORKAROUND_STRATEGY_MEMW 1
138140
#define CONFIG_SPIRAM_BANKSWITCH_ENABLE 1
@@ -212,9 +214,9 @@
212214
#define CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE 1
213215
#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 16
214216
#define CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM 32
215-
#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER 1
216-
#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 1
217-
#define CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM 32
217+
#define CONFIG_ESP32_WIFI_STATIC_TX_BUFFER 1
218+
#define CONFIG_ESP32_WIFI_TX_BUFFER_TYPE 0
219+
#define CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM 16
218220
#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1
219221
#define CONFIG_ESP32_WIFI_TX_BA_WIN 6
220222
#define CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED 1
@@ -328,6 +330,8 @@
328330
#define CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL 1
329331
#define CONFIG_MBEDTLS_HARDWARE_AES 1
330332
#define CONFIG_MBEDTLS_HAVE_TIME 1
333+
#define CONFIG_MBEDTLS_ECDSA_DETERMINISTIC 1
334+
#define CONFIG_MBEDTLS_SHA512_C 1
331335
#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1
332336
#define CONFIG_MBEDTLS_TLS_SERVER 1
333337
#define CONFIG_MBEDTLS_TLS_CLIENT 1
@@ -378,6 +382,7 @@
378382
#define CONFIG_MBEDTLS_ECP_NIST_OPTIM 1
379383
#define CONFIG_MDNS_MAX_SERVICES 10
380384
#define CONFIG_MDNS_TASK_PRIORITY 1
385+
#define CONFIG_MDNS_TASK_STACK_SIZE 4096
381386
#define CONFIG_MDNS_TASK_AFFINITY_CPU0 1
382387
#define CONFIG_MDNS_TASK_AFFINITY 0x0
383388
#define CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS 2000

tools/sdk/esp32/include/esp_common/include/esp_private/pm_impl.h

+32
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,38 @@ void esp_pm_impl_dump_stats(FILE* out);
109109
*/
110110
void esp_pm_impl_waiti(void);
111111

112+
#if CONFIG_IDF_TARGET_ESP32S2
113+
/**
114+
* @brief Callback function type for peripherals to skip light sleep.
115+
*
116+
*/
117+
typedef bool (* skip_light_sleep_cb_t)(void);
118+
119+
/**
120+
* @brief Register peripherals skip light sleep callback
121+
*
122+
* This function allows you to register a callback that gets the result
123+
* that if light sleep should be skipped by peripherals.
124+
* @param cb function to get the result
125+
* @return
126+
* - ESP_OK on success
127+
* - ESP_ERR_NO_MEM if no more callback slots are available
128+
*/
129+
esp_err_t esp_pm_register_skip_light_sleep_callback(skip_light_sleep_cb_t cb);
130+
131+
/**
132+
* @brief Unregisterperipherals skip light sleep callback
133+
*
134+
* This function allows you to unregister a callback which was previously
135+
* registered using esp_register_skip_light_sleep_callback.
136+
* @param cb function to get the result
137+
* @return
138+
* - ESP_OK on success
139+
* - ESP_ERR_INVALID_STATE if the given callback hasn't been registered before
140+
*/
141+
esp_err_t esp_pm_unregister_skip_light_sleep_callback(skip_light_sleep_cb_t cb);
142+
#endif
143+
112144
#ifdef CONFIG_PM_PROFILING
113145
#define WITH_PROFILING
114146
#endif

tools/sdk/esp32/include/esp_eth/include/esp_eth_mac.h

+24
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,30 @@ struct esp_eth_mac_s {
7373
*/
7474
esp_err_t (*deinit)(esp_eth_mac_t *mac);
7575

76+
/**
77+
* @brief Start Ethernet MAC
78+
*
79+
* @param[in] mac: Ethernet MAC instance
80+
*
81+
* @return
82+
* - ESP_OK: start Ethernet MAC successfully
83+
* - ESP_FAIL: start Ethernet MAC failed because some other error occurred
84+
*
85+
*/
86+
esp_err_t (*start)(esp_eth_mac_t *mac);
87+
88+
/**
89+
* @brief Stop Ethernet MAC
90+
*
91+
* @param[in] mac: Ethernet MAC instance
92+
*
93+
* @return
94+
* - ESP_OK: stop Ethernet MAC successfully
95+
* - ESP_FAIL: stop Ethernet MAC failed because some error occurred
96+
*
97+
*/
98+
esp_err_t (*stop)(esp_eth_mac_t *mac);
99+
76100
/**
77101
* @brief Transmit packet from Ethernet MAC
78102
*

tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h

+14
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,20 @@ bool esp_http_client_is_complete_data_received(esp_http_client_handle_t client);
511511

512512
int esp_http_client_read_response(esp_http_client_handle_t client, char *buffer, int len);
513513

514+
/**
515+
* @brief Get URL from client
516+
*
517+
* @param[in] client The esp_http_client handle
518+
* @param[inout] url The buffer to store URL
519+
* @param[in] len The buffer length
520+
*
521+
* @return
522+
* - ESP_OK
523+
* - ESP_FAIL
524+
*/
525+
526+
esp_err_t esp_http_client_get_url(esp_http_client_handle_t client, char *url, const int len);
527+
514528
#ifdef __cplusplus
515529
}
516530
#endif

tools/sdk/esp32/include/esp_https_ota/include/esp_https_ota.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ esp_err_t esp_https_ota_finish(esp_https_ota_handle_t https_ota_handle);
162162
esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, esp_app_desc_t *new_app_info);
163163

164164

165-
/*
165+
/**
166166
* @brief This function returns OTA image data read so far.
167167
*
168168
* @note This API should be called only if `esp_https_ota_perform()` has been called atleast once or

tools/sdk/esp32/include/esp_netif/include/esp_netif.h

+27
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,22 @@ esp_err_t esp_netif_set_old_ip_info(esp_netif_t *esp_netif, const esp_netif_ip_i
402402
*/
403403
int esp_netif_get_netif_impl_index(esp_netif_t *esp_netif);
404404

405+
/**
406+
* @brief Get net interface name from network stack implementation
407+
*
408+
* @note This name could be used in `setsockopt()` to bind socket with appropriate interface
409+
*
410+
* @param[in] esp_netif Handle to esp-netif instance
411+
* @param[out] name Interface name as specified in underlying TCP/IP stack. Note that the
412+
* actual name will be copied to the specified buffer, which must be allocated to hold
413+
* maximum interface name size (6 characters for lwIP)
414+
*
415+
* @return
416+
* - ESP_OK
417+
* - ESP_ERR_ESP_NETIF_INVALID_PARAMS
418+
*/
419+
esp_err_t esp_netif_get_netif_impl_name(esp_netif_t *esp_netif, char* name);
420+
405421
/**
406422
* @}
407423
*/
@@ -648,6 +664,17 @@ esp_err_t esp_netif_get_ip6_linklocal(esp_netif_t *esp_netif, esp_ip6_addr_t *if
648664
*/
649665
esp_err_t esp_netif_get_ip6_global(esp_netif_t *esp_netif, esp_ip6_addr_t *if_ip6);
650666

667+
/**
668+
* @brief Get all IPv6 addresses of the specified interface
669+
*
670+
* @param[in] esp_netif Handle to esp-netif instance
671+
* @param[out] if_ip6 Array of IPv6 addresses will be copied to the argument
672+
*
673+
* @return
674+
* number of returned IPv6 addresses
675+
*/
676+
int esp_netif_get_all_ip6(esp_netif_t *esp_netif, esp_ip6_addr_t if_ip6[]);
677+
651678
/**
652679
* @brief Sets IPv4 address to the specified octets
653680
*

tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi.h

+11
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,17 @@ esp_err_t esp_wifi_internal_get_negotiated_channel(wifi_interface_t ifx, uint8_t
414414
*/
415415
esp_err_t esp_wifi_internal_get_negotiated_bandwidth(wifi_interface_t ifx, uint8_t aid, uint8_t *bw);
416416

417+
#if CONFIG_IDF_TARGET_ESP32S2
418+
/**
419+
* @brief Check if WiFi TSF is active
420+
*
421+
* @return
422+
* - true: Active
423+
* - false: Not active
424+
*/
425+
bool esp_wifi_internal_is_tsf_active(void);
426+
#endif
427+
417428
#ifdef __cplusplus
418429
}
419430
#endif

tools/sdk/esp32/include/esp_wifi/include/esp_wifi_types.h

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ typedef enum {
5757
WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */
5858
WIFI_AUTH_WPA2_ENTERPRISE, /**< authenticate mode : WPA2_ENTERPRISE */
5959
WIFI_AUTH_WPA3_PSK, /**< authenticate mode : WPA3_PSK */
60+
WIFI_AUTH_WPA2_WPA3_PSK, /**< authenticate mode : WPA2_WPA3_PSK */
6061
WIFI_AUTH_MAX
6162
} wifi_auth_mode_t;
6263

tools/sdk/esp32/include/freertos/include/freertos/semphr.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,14 @@ typedef QueueHandle_t SemaphoreHandle_t;
235235
*
236236
* void vATask( void * pvParameters )
237237
* {
238-
* // Semaphore cannot be used before a call to xSemaphoreCreateBinary().
238+
* // Semaphore cannot be used before a call to xSemaphoreCreateBinary() or
239+
* // xSemaphoreCreateBinaryStatic().
239240
* // The semaphore's data structures will be placed in the xSemaphoreBuffer
240241
* // variable, the address of which is passed into the function. The
241242
* // function's parameter is not NULL, so the function will not attempt any
242243
* // dynamic memory allocation, and therefore the function will not return
243244
* // return NULL.
244-
* xSemaphore = xSemaphoreCreateBinary( &xSemaphoreBuffer );
245+
* xSemaphore = xSemaphoreCreateBinaryStatic( &xSemaphoreBuffer );
245246
*
246247
* // Rest of task code goes here.
247248
* }

tools/sdk/esp32/include/idf_test/include/idf_performance.h

+12-12
Original file line numberDiff line numberDiff line change
@@ -71,23 +71,23 @@
7171
#define IDF_PERFORMANCE_MAX_ISR_EXIT_CYCLES 565
7272
#endif
7373

74-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_4BIT
75-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_4BIT 12200
74+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_4BIT
75+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_4BIT 12200
7676
#endif
77-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_4BIT
78-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_4BIT 12200
77+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_4BIT
78+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_4BIT 12200
7979
#endif
80-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_1BIT
81-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_1BIT 4000
80+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_1BIT
81+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_1BIT 4000
8282
#endif
83-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_1BIT
84-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_1BIT 4000
83+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_1BIT
84+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_1BIT 4000
8585
#endif
86-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_SPI
87-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_TOHOST_SPI 1000
86+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_SPI
87+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_TOHOST_SPI 1000
8888
#endif
89-
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_SPI
90-
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_MBSEC_FRHOST_SPI 1000
89+
#ifndef IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_SPI
90+
#define IDF_PERFORMANCE_MIN_SDIO_THROUGHPUT_KBSEC_FRHOST_SPI 1000
9191
#endif
9292

9393
//time to perform the task selection plus context switch (from task)

tools/sdk/esp32/include/mbedtls/port/include/mbedtls/esp_config.h

+69-3
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,11 @@
400400
*
401401
* Comment this macro to disable deterministic ECDSA.
402402
*/
403+
#ifdef CONFIG_MBEDTLS_ECDSA_DETERMINISTIC
403404
#define MBEDTLS_ECDSA_DETERMINISTIC
405+
#else
406+
#undef MBEDTLS_ECDSA_DETERMINISTIC
407+
#endif
404408

405409
/**
406410
* \def MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
@@ -1692,17 +1696,19 @@
16921696
/**
16931697
* \def MBEDTLS_HKDF_C
16941698
*
1695-
* Disable the HKDF algorithm (RFC 5869).
1699+
* Enable the HKDF algorithm (RFC 5869).
16961700
*
16971701
* Module: library/hkdf.c
16981702
* Caller:
16991703
*
17001704
* Requires: MBEDTLS_MD_C
17011705
*
1702-
* This module adds support for the Hashed Message Authentication Code
1706+
* This module enables support for the Hashed Message Authentication Code
17031707
* (HMAC)-based key derivation function (HKDF).
17041708
*/
1705-
#ifdef MBEDTLS_HKDF_C
1709+
#ifdef CONFIG_MBEDTLS_HKDF_C
1710+
#define MBEDTLS_HKDF_C
1711+
#else
17061712
#undef MBEDTLS_HKDF_C
17071713
#endif
17081714

@@ -2026,7 +2032,11 @@
20262032
*
20272033
* This module adds support for SHA-384 and SHA-512.
20282034
*/
2035+
#ifdef CONFIG_MBEDTLS_SHA512_C
20292036
#define MBEDTLS_SHA512_C
2037+
#else
2038+
#undef MBEDTLS_SHA512_C
2039+
#endif
20302040

20312041
/**
20322042
* \def MBEDTLS_SSL_CACHE_C
@@ -2368,6 +2378,62 @@
23682378
*/
23692379
#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_KEY_EXCHANGE
23702380

2381+
/**
2382+
* \def MBEDTLS_THREADING_C
2383+
*
2384+
* Enable the threading abstraction layer.
2385+
* By default mbed TLS assumes it is used in a non-threaded environment or that
2386+
* contexts are not shared between threads. If you do intend to use contexts
2387+
* between threads, you will need to enable this layer to prevent race
2388+
* conditions. See also our Knowledge Base article about threading:
2389+
* https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
2390+
*
2391+
* Module: library/threading.c
2392+
*
2393+
* This allows different threading implementations (self-implemented or
2394+
* provided).
2395+
*
2396+
* You will have to enable either MBEDTLS_THREADING_ALT or
2397+
* MBEDTLS_THREADING_PTHREAD.
2398+
*
2399+
* Enable this layer to allow use of mutexes within mbed TLS
2400+
*/
2401+
#ifdef CONFIG_MBEDTLS_THREADING_C
2402+
#define MBEDTLS_THREADING_C
2403+
#else
2404+
#undef MBEDTLS_THREADING_C
2405+
#endif
2406+
2407+
/**
2408+
* \def MBEDTLS_THREADING_ALT
2409+
*
2410+
* Provide your own alternate threading implementation.
2411+
*
2412+
* Requires: MBEDTLS_THREADING_C
2413+
*
2414+
* Uncomment this to allow your own alternate threading implementation.
2415+
*/
2416+
#ifdef CONFIG_MBEDTLS_THREADING_ALT
2417+
#define MBEDTLS_THREADING_ALT
2418+
#else
2419+
#undef MBEDTLS_THREADING_ALT
2420+
#endif
2421+
2422+
/**
2423+
* \def MBEDTLS_THREADING_PTHREAD
2424+
*
2425+
* Enable the pthread wrapper layer for the threading layer.
2426+
*
2427+
* Requires: MBEDTLS_THREADING_C
2428+
*
2429+
* Uncomment this to enable pthread mutexes.
2430+
*/
2431+
#ifdef CONFIG_MBEDTLS_THREADING_PTHREAD
2432+
#define MBEDTLS_THREADING_PTHREAD
2433+
#else
2434+
#undef MBEDTLS_THREADING_PTHREAD
2435+
#endif
2436+
23712437
/* \} name SECTION: Module configuration options */
23722438

23732439
#if defined(TARGET_LIKE_MBED)

0 commit comments

Comments
 (0)