-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 Firmware image size too high (IDFGH-5663) #7385
Comments
It is the same guide you linked to. If you switch to newlib nano printf you can save some more space. Idf.py size-files will show you exactly what is using the space. Remember it is hello world running on top of a full rtos. Optimizing the size of hello world is not going to be that useful in helping you optimize a large app. They sell 16mb modules for a reason. |
Thanks. I am able to further reduce memory footprint by enabling nano printf in hello world. Its now ~80KB. What are the options to reduce memory footprint if BLE(Bluedroid) is enabled? I have already disabled debug logs but is there any other options that can help ? |
Can you consider using NimBLE stack instead of Bluedroid? It has lower code size. |
Hi, Is there any document available that shows memory consumption / footprint differences when using Bluedroid and nimble. |
Hi @ashigupta , As of today, there doesn't exist a document for this. The stack configuration for bluedroid / nimble is different. However, if you take an existing example in ESP-SDK which works for both bluedroid and nimble ( say wifi_prov_mgr ) and compile it for the respective stacks, then we should the size with nimble stack to be around 240KB lesser than the same when compiled with bluedroid ( for default configuration ) Again, please note, this is a general estimate as configuration change can change the final numbers. |
Hi @ashigupta , did the above nimble stack suggestion help ? |
Closing this issue. Please feel free to reopen in case of any queries. |
Environment
Problem Description
Firmware image size is too high after build even for 'hello world' example code
//Detailed problem description goes here.
I am developing my application on ESP32 and using Wifi Station mode, IOT, BLE(Bluedroid). I realized that my firmware size is going beyond 1.6MB.
I compiled 'Hello World' example code and found that firmware image is **
sdkconfig - Copy.txt
** which is too huge just for hello world program. Below is the output of 'idf.py size' command
Total sizes:
DRAM .data size: 8376 bytes
DRAM .bss size: 2104 bytes
Used static DRAM: 10480 bytes ( 170256 available, 5.8% used)
Used static IRAM: 40689 bytes ( 90383 available, 31.0% used)
Flash code: 77795 bytes
Flash rodata: 24448 bytes
Total image size:~ 153412 bytes (.bin may be padded larger
I read espressif document on below link that explains how we can reduce image size.
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/performance/size.html
Following this i am able to reduce the firmware image size to 120KB which is still huge for just hello world program. Below is the output of idf.py size command
Total sizes:
DRAM .data size: 5528 bytes
DRAM .bss size: 1856 bytes
Used static DRAM: 7384 bytes ( 173352 available, 4.1% used)
Used static IRAM: 32363 bytes ( 98709 available, 24.7% used)
Flash code: 72207 bytes
Flash rodata: 11044 bytes
Total image size:~ 122998 bytes (.bin may be padded larger)
I have attached my modified sdkconfig file for hello world with which i am able to reduce size to 120KB.
I want to understand how i can reduce the firmware image size more.
I know Bluedroid consume more memory as compare to nimble but is there any way to reduce size when i am using Wifi, BLE both. I will be using OTA firmware update and with this huge image size upgrade size will be too high and i also have to alot high memory size OTA partition.
I have gone through many blogs, videos but still there is no great help.
Expected Behavior
I expect bin image size should be small for just a hello world program.
Actual Behavior
Bin image size is too high.
Steps to reproduce
The text was updated successfully, but these errors were encountered: