Skip to content

Commit

Permalink
samples: wifi: esp32s2_saola: reduce RAM usage
Browse files Browse the repository at this point in the history
This modification frees up around ~10kB of RAM and make sample code
working again.

1) Reduced net packet size and count.
2) Increase Wi-Fi heap to avoid memory allocation failure.
3) Keep log as minimal.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
  • Loading branch information
sylvioalves authored and carlescufi committed Sep 13, 2023
1 parent 5f0bb1d commit a6756c3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions samples/net/wifi/boards/esp32s2_saola.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
CONFIG_WIFI=y
CONFIG_HEAP_MEM_POOL_SIZE=32768
CONFIG_HEAP_MEM_POOL_SIZE=34816

# decrease packet count and size to save RAM
CONFIG_NET_PKT_RX_COUNT=7
CONFIG_NET_PKT_TX_COUNT=7
CONFIG_NET_BUF_RX_COUNT=7
CONFIG_NET_BUF_TX_COUNT=7

# when enabling NET_SHELL, the following
# helps to optimize memory footprint
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_IRAM_OPT=n
CONFIG_ESP32_WIFI_RX_IRAM_OPT=n

Expand All @@ -15,5 +16,7 @@ CONFIG_NET_L2_ETHERNET=y
CONFIG_NET_IPV6=n
CONFIG_NET_IPV4=y
CONFIG_NET_DHCPV4=y
CONFIG_ESP32_WIFI_STA_AUTO_DHCPV4=y

CONFIG_LOG_MODE_MINIMAL=y
CONFIG_NET_LOG=y

0 comments on commit a6756c3

Please sign in to comment.