mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
f610249bdd
1. Modify esp_bt_controller_mem_release() to release BTDM BSS and Data to heap if ESP_BT_MODE_BTDM mode is passed to it 2. Add a new API esp_bt_mem_release() which internally calls esp_bt_controller_mem_release() with the provided mode and then if mode is ESP_BT_MODE_BTDM, releases BT BSS and Data to heap. Background: For Wi-Fi and BT/BLE applications, for e.g. the usecase is like when Bluetooth is used for provisioning and once the device is connected to the Wi-Fi AP, we can turn off Bluetooth completely. In such scenarios, it should be possible to reclaim all the memory of Bluetooth. Although, currently this does not happen. Experiment: Made the following modifications to examples/bluetooth/gatt_server : 1. Added support of simple_wifi to it 2. Moved all the bluetooth related code under CONFIG_BT_ENABLED config option 3. Calculated the free heap in 2 similar scenarios: i. Disabled BT (CONFIG_BT_ENABLED undefined) and checked the free heap after STA connected ii. Kept BT enabled and disabled it after STA connected and checked the free heap Ideally, the numbers for i., ii. above should have been similar. But there was a delta of almost 30-31K. (i. > ii.) 4. Through make size-components checked the common BSS for libbta.a and libbtdm_app.a and found it to be almost 30K. Data is around 1K Solution: 1. Modified the linker script to mark the BSS and Data for these libraries and free it when ESP_BT_MODE_BTDM mode is passed to mem release APIs. 2. Verified that the free heap is comparable for i. and ii. above. Note: It is known that once this is done, Bluetooth can only be used again post reboot. Signed-off-by: Hrishikesh Dhayagude <hrishi@espressif.com> |
||
---|---|---|
.. | ||
elf_to_ld.sh | ||
esp32.common.ld | ||
esp32.ld | ||
esp32.peripherals.ld | ||
esp32.rom.ld | ||
esp32.rom.libgcc.ld | ||
esp32.rom.nanofmt.ld | ||
esp32.rom.spiflash.ld | ||
esp32.rom.spiram_incompatible_fns.ld | ||
esp32.spiram.rom-functions-dram.ld | ||
esp32.spiram.rom-functions-iram.ld |