ESP32-C6 Flash consumption for WiFi + NimBLE
Posted: Thu Jun 26, 2025 2:54 pm
Hello
Just want to check if this is expected. I have combined the WiFi station example (https://github.com/espressif/esp-idf/tr ... ed/station) and NimBLE power save example (https://github.com/espressif/esp-idf/tr ... power_save) into one Application.
Interestingly, this doesn't fit into 1MB. When extending the factory partition to 2MB, there is about 33% free. So it needs ~1.5MB Flash.
Comparing this with the total 4MB in ESP32-C6FH4, this is quite a tight Flash budget. Especially when thinking to also integrate Zigbee and User logic code.
Are there any chances to drastically optimize this, or is this just reality that such an application needs 2-3MB Flash partition to be adequately future proof?
I have already implemented these parameters in a try to reduce NimBLE Flash usage:
Components Flash usage:
Just want to check if this is expected. I have combined the WiFi station example (https://github.com/espressif/esp-idf/tr ... ed/station) and NimBLE power save example (https://github.com/espressif/esp-idf/tr ... power_save) into one Application.
Interestingly, this doesn't fit into 1MB. When extending the factory partition to 2MB, there is about 33% free. So it needs ~1.5MB Flash.
Comparing this with the total 4MB in ESP32-C6FH4, this is quite a tight Flash budget. Especially when thinking to also integrate Zigbee and User logic code.
Are there any chances to drastically optimize this, or is this just reality that such an application needs 2-3MB Flash partition to be adequately future proof?
I have already implemented these parameters in a try to reduce NimBLE Flash usage:
Code: Select all
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1
CONFIG_BT_NIMBLE_MAX_BONDS=1
CONFIG_BT_NIMBLE_MAX_CCCDS=1
CONFIG_BT_NIMBLE_ROLE_CENTRAL=n
CONFIG_BT_NIMBLE_ROLE_OBSERVER=n
CONFIG_BT_NIMBLE_LOG_LEVEL_NONE=y
Code: Select all
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━┓
┃ Archive File ┃ Total Size ┃ DIRAM ┃ .bss ┃ .data ┃ .text ┃ Flash Code ┃ .rodata ┃ .appdesc ┃ .text ┃ LP SRAM ┃ .rtc_reserved ┃ .force_fast ┃ .text ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━┩
│ libble_app.a │ 214099 │ 19213 │ 229 │ 272 │ 18712 │ 194886 │ 7186 │ 0 │ 187700 │ 0 │ 0 │ 0 │ 0 │
│ libnet80211.a │ 186657 │ 19557 │ 10446 │ 1793 │ 7318 │ 167100 │ 18944 │ 0 │ 148156 │ 0 │ 0 │ 0 │ 0 │
│ libpp.a │ 112196 │ 45453 │ 2746 │ 3201 │ 39506 │ 66743 │ 10517 │ 0 │ 56226 │ 0 │ 0 │ 0 │ 0 │
│ liblwip.a │ 102615 │ 2482 │ 2470 │ 12 │ 0 │ 100133 │ 3455 │ 0 │ 96678 │ 0 │ 0 │ 0 │ 0 │
│ libbt.a │ 97369 │ 10365 │ 5952 │ 617 │ 3796 │ 87004 │ 2418 │ 0 │ 84586 │ 0 │ 0 │ 0 │ 0 │
│ libmbedcrypto.a │ 80483 │ 470 │ 268 │ 116 │ 86 │ 80013 │ 6569 │ 0 │ 73444 │ 0 │ 0 │ 0 │ 0 │
│ libwpa_supplicant.a │ 78931 │ 1329 │ 1321 │ 8 │ 0 │ 77602 │ 1608 │ 0 │ 75994 │ 0 │ 0 │ 0 │ 0 │
│ libesp_app_format.a │ 72145 │ 10 │ 10 │ 0 │ 0 │ 72135 │ 71349 │ 256 │ 530 │ 0 │ 0 │ 0 │ 0 │
│ libesp_hw_support.a │ 57638 │ 17281 │ 165 │ 1682 │ 15434 │ 40221 │ 4205 │ 0 │ 36016 │ 136 │ 24 │ 32 │ 80 │