-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Increasing BLE sketch size of ~156k after adding BluetoothSerial lib #1194
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
Comments
The Bluetooth stack is very large. You need to change you partition sizes as shown in the Wiki. |
@beegee-tokyo - tnx! this is a option but... |
I do not know if there are two different stacks for BLE and Bluetooth, because that is somewhere down below in the ESP-IDF. But I started with using BLE only first and added Bluetooth Serial later (check my blog) the program size didn't double, so I guess there is only one stack. |
In that case, if only one stack, who eats ~157k ? new libbt.a from sdk? I check this on raw example from library BLE->BLE_Server as-is (without any addition like SerialBT) in my opinion it is a very large increase BTW. @beegee-tokyo, great blog, very useful |
Hi all, I faced the same issue and did not found a easy solution, so I finally forked the library and create a "light version" of it. I saved about ~30KB program size with this version. |
You can save ~10k by remove the long Mode / Vendor / ... String lists in the BThelp.c (or move it to a seperate .c Files) Also you can save ~47kb (Wow!) of ram by release the classic BT ram if not needed. Or use the idf direct and save a lot RAM/ROM, have less bugs but also less comfort. |
when i do that my program is compiling with errors |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: Branch_b4b9a79 05/03/2018
IDE name: Arduino IDE
Flash Frequency: 80Mhz
Upload Speed: 921600
Description:
after adding the BluetoothSerial library (b4b9a79), sketches which use BLE library (https://github.com/nkolban/ESP32_BLE_Arduino/tree/6bad7b42a96f0aa493323ef4821a8efb0e8815f2) increase finally size by ~156 kbytes!
Lets try for example library: BLE -> example: BLE_uart:
branch with previous commit (835268c) finally sketch size: 931869 bytes (71%)
branch with BluetoothSerial library (b4b9a79) finally sketch size: 1088621 bytes (83%)
For this reason my sketches with BLE and several additions do not fit esp32 flash any more,
even though I do not use new BluetoothSerial library in these cases (increase size from 1265006 to 1422022)
What is interesting, I did not notice the increase final sketch size when BLE library is not used.
In the current situation, creation a little more advanced programs with BLE and for e.g. display, becomes impossible due to lack of space.
Sketch:
library: BLE -> example: BLE_uart
The text was updated successfully, but these errors were encountered: