kernel::radio
Which radios this build uses, and whether the board has them.
The feature set
Section titled “The feature set”| Feature | Means |
|---|---|
radio-wifi |
Wi-Fi. Costs no static DRAM |
radio-bt |
The Bluetooth controller is on, in some mode. Reserves DRAM |
radio-ble |
BLE. Implies radio-bt |
radio-bt-classic |
BR/EDR. Implies radio-bt |
radio-bt is not meant to be selected directly — radio-ble and
radio-bt-classic turn it on. It exists as a separate feature because the
thing that costs memory is the controller being enabled, not which mode
it runs in:
config BTDM_RESERVE_DRAM hex default 0xdb5c if BT_ENABLED default 0Identical for BLE-only, BR/EDR-only and dual-mode. Keying the memory map on
radio-ble would have meant rewriting the linker script the day BR/EDR
appeared, for no change in the number.
Enabling both modes is legal and is how dual-mode is selected. It reserves no more DRAM than either alone, but it does forfeit the claw-back described below.
What is not here
Section titled “What is not here”BLE Mesh is not a build flag at this layer. It is a host stack above
BLE, not a controller mode, so it costs heap rather than static DRAM and
would arrive as a crate on top of radio-ble. doc/plan-radio.md lists it
as a non-goal for now regardless.
The claw-back
Section titled “The claw-back”A BLE-only build can hand the unused BR/EDR sections back at runtime —
esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT), which esp-idf
documents as releasing “the BSS, data and other sections of the controller
to heap. The total size is about 70k bytes.” It is irreversible, which is
fine when the mode is fixed at build time. [RELEASE_CLASSIC_MEMORY] says
whether this build may do it.
Constants
Section titled “Constants”const BLE: bool;BLE specifically.
const BT: bool;The Bluetooth controller is enabled in some mode. This is the flag the
memory map is keyed on — see tools/build/src/map.rs.
BT_CLASSIC
Section titled “BT_CLASSIC”const BT_CLASSIC: bool;BR/EDR (“Bluetooth Classic”) specifically.
RELEASE_CLASSIC_MEMORY
Section titled “RELEASE_CLASSIC_MEMORY”const RELEASE_CLASSIC_MEMORY: bool;Whether the BR/EDR sections may be released to the heap at init.
Only when Bluetooth is on and Classic is not wanted. Releasing while Classic is in use would free memory the controller is about to rely on, and the operation cannot be undone.
const WIFI: bool;Wi-Fi is in use.