Hi there,
I am writing an application on an ESP32-WROOM-32UE module with a lot of RAM usage and the NimBLE bluetooth stack does not fit into RAM anymore. I made some tests (reduced memory of other components, so that BLE fits) comparing my firmware with BLE and without BLE (ESP-IDF V5.0).
My results are, that activating the NimbleBLE stack with default values, occupies the following RAM:
During compile time (static allocated):
- IRAM: 47 KB
- DRAM: 14 KB
During runtime (allocated from heap)
- 88 KB
In sum, this is 149 KB.
I have tested some options in the sdkconfig, but these only made changes of max. 5 KB.
Is there a hidden option or some genious trick to reduce BLE memory footprint by factor of two or more?
Many thanks for ideas.
mauh72
Reduce RAM usage of Bluetooth NimBLE stack
-
- Posts: 2
- Joined: Mon Feb 19, 2024 9:29 am
Re: Reduce RAM usage of Bluetooth NimBLE stack
Hi,
Did you find this "hidden" option?
I'm using the Blufi example compiled using Nimble and Bludroid to compare Heap usage.
Using the same exact code, using Nimble requires 6 to 7 KB more Heap.
It reduces substantially the flash space tho.
I use the ESP IDF v5.1
Is this the expected behavior?
Regards,
Fieb44
Did you find this "hidden" option?
I'm using the Blufi example compiled using Nimble and Bludroid to compare Heap usage.
Using the same exact code, using Nimble requires 6 to 7 KB more Heap.
It reduces substantially the flash space tho.
I use the ESP IDF v5.1
Is this the expected behavior?
Regards,
Fieb44
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Reduce RAM usage of Bluetooth NimBLE stack
You can try 'optimizing' NimBLE's "Memory Settings" in menuconfig.
-
- Posts: 2
- Joined: Mon Feb 19, 2024 9:29 am
Re: Reduce RAM usage of Bluetooth NimBLE stack
Hi,
Indeed, the Memory Setting has a big impact. It reduced quite substantially the IRAM usage !
I gained approximately 20KB of heap. I reduced the Blocks and Buffer counts until my app didn't work.
The effectiveness of these optimizations may vary depending on your application. Further optimization is likely possible.
In comparison to my previously "optimized" Bluedroid config, using Nimble resulted in the following changes:
- reduced Flash usage by 167KB
- increased IRAM usage by 1.5KB
- reduced Total Heap usage by 8.5KB
Thank you for the suggestion!
Indeed, the Memory Setting has a big impact. It reduced quite substantially the IRAM usage !
I gained approximately 20KB of heap. I reduced the Blocks and Buffer counts until my app didn't work.
The effectiveness of these optimizations may vary depending on your application. Further optimization is likely possible.
In comparison to my previously "optimized" Bluedroid config, using Nimble resulted in the following changes:
- reduced Flash usage by 167KB
- increased IRAM usage by 1.5KB
- reduced Total Heap usage by 8.5KB
Thank you for the suggestion!
Who is online
Users browsing this forum: Bing [Bot] and 88 guests