feat(bt): Frees BLE memory when no longer in use

It will free libble.a & libbt all txt, data and bss segment memory.
          This memory is combined into one large memory and put into the heap
          pool.
This commit is contained in:
Shen Weilong
2023-08-17 12:13:12 +08:00
parent 55d3bc2d37
commit ea06b047c2
9 changed files with 150 additions and 39 deletions

View File

@@ -161,6 +161,7 @@ The following options will reduce IRAM usage of some ESP-IDF features:
- Setting :ref:`CONFIG_HAL_DEFAULT_ASSERTION_LEVEL` to disable assertion for HAL component saves some IRAM, especially for HAL code who calls ``HAL_ASSERT`` a lot and resides in IRAM.
- Refer to the sdkconfig menu ``Auto-detect Flash chips``, and you can disable flash drivers which you do not need to save some IRAM.
- Enable :ref:`CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH`. Provided that :ref:`CONFIG_SPI_MASTER_ISR_IN_IRAM` is not enabled and the heap functions are not incorrectly used from ISRs, this option is safe to enable in all configurations.
:esp32c2: - Enable :ref:`CONFIG_BT_RELEASE_IRAM`. Release BT text section and merge BT data, bss & text into a large free heap region when ``esp_bt_mem_release`` is called. This makes Bluetooth unavailable until the next restart, but saving ~22 KB or more of IRAM.
.. only:: esp32