Skip to content

Commit d802e5f

Browse files
committed
espressif: 40KB radio heap reserve on the Feather/Metro/QT Py boards and bench devkits
The base branch defaults CIRCUITPY_ESP_RADIO_HEAP_RESERVE to 32 KB, which is what a plain softAP + ESP-NOW workload needs. Adding a TLS server on top needs more: at 32 KB the C6 hub still hit MemoryError starting a handshake and lost DHCP replies. Override to 40 KB on the Adafruit ESP32 / ESP32-S3 / ESP32-C6 Feathers, Metro S3, QT Py ESP32 / ESP32-S3, and the two bench devkits. Other Adafruit ESP32/S3 boards (ItsyBitsy, MatrixPortal, Sparkle Motion, Qualia, cameras) are deliberately left on the 32 KB default for now. Replaces the branch's old global 58140f6 ("radio heap reserve 40KB"), which raised the port-wide default instead of overriding per board.
1 parent c5706df commit d802e5f

13 files changed

Lines changed: 65 additions & 0 deletions

File tree

ports/espressif/boards/adafruit_feather_esp32_v2/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@
3434
// UART pins attached to the USB-serial converter chip
3535
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1)
3636
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3)
37+
38+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
39+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
40+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
41+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_esp32c6_4mbflash_nopsram/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@
3232

3333
// Explanation of how a user got into safe mode
3434
#define BOARD_USER_SAFE_MODE_ACTION MP_ERROR_TEXT("You pressed the BOOT button at start up.")
35+
36+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
37+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
38+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
39+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_esp32s3_4mbflash_2mbpsram/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@
2727
#define DEFAULT_UART_BUS_TX (&pin_GPIO39)
2828

2929
#define DOUBLE_TAP_PIN (&pin_GPIO34)
30+
31+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
32+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
33+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
34+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_esp32s3_nopsram/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@
2727
#define DEFAULT_UART_BUS_TX (&pin_GPIO39)
2828

2929
#define DOUBLE_TAP_PIN (&pin_GPIO34)
30+
31+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
32+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
33+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
34+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_esp32s3_reverse_tft/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@
2727
#define DEFAULT_UART_BUS_TX (&pin_GPIO39)
2828

2929
#define DOUBLE_TAP_PIN (&pin_GPIO34)
30+
31+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
32+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
33+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
34+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_esp32s3_tft/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@
2727
#define DEFAULT_UART_BUS_TX (&pin_GPIO1)
2828

2929
#define DOUBLE_TAP_PIN (&pin_GPIO38)
30+
31+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
32+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
33+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
34+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_feather_huzzah32/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@
2525
// UART pins attached to the USB-serial converter chip
2626
#define CIRCUITPY_CONSOLE_UART_TX (&pin_GPIO1)
2727
#define CIRCUITPY_CONSOLE_UART_RX (&pin_GPIO3)
28+
29+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
30+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
31+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
32+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_metro_esp32s3/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@
2626
#define DEFAULT_UART_BUS_TX (&pin_GPIO40)
2727

2828
#define DOUBLE_TAP_PIN (&pin_GPIO38)
29+
30+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
31+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
32+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
33+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_qtpy_esp32_pico/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@
2929

3030
// Reduce wifi.radio.tx_power due to the antenna design of this board
3131
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (15)
32+
33+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
34+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
35+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
36+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

ports/espressif/boards/adafruit_qtpy_esp32s3_4mbflash_2mbpsram/mpconfigboard.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@
2828

2929
// Reduce wifi.radio.tx_power due to the antenna design of this board
3030
#define CIRCUITPY_WIFI_DEFAULT_TX_POWER (15)
31+
32+
// Bench finding: 32 KB of IDF headroom is not enough for a softAP that also
33+
// serves TLS -- handshakes hit MemoryError and DHCP replies fail while the
34+
// Python heap still reports free space. 40 KB is what the C6 hub needed.
35+
#define CIRCUITPY_ESP_RADIO_HEAP_RESERVE (40 * 1024)

0 commit comments

Comments
 (0)