#include <ble.h>
Enable the BLE stack.
- Parameters
-
| [in,out] | p_app_ram_base | Pointer to a variable containing the start address of the application RAM region (APP_RAM_BASE). On return, this will contain the minimum start address of the application RAM region required by the SoftDevice for this configuration. |
- Warning
- After this call, the SoftDevice may generate several events. The list of events provided below require the application to initiate a SoftDevice API call. The corresponding API call is referenced in the event documentation. If the application fails to do so, the BLE connection may timeout, or the SoftDevice may stop communicating with the peer device.
- Note
- The memory requirement for a specific configuration will not increase between SoftDevices with the same major version number.
-
At runtime the IC's RAM is split into 2 regions: The SoftDevice RAM region is located between 0x20000000 and APP_RAM_BASE-1 and the application's RAM region is located between APP_RAM_BASE and the start of the call stack.
This call initializes the BLE stack, no BLE related function other than sd_ble_cfg_set can be called before this one.
- Relevant Message Sequence Charts
-
- Return values
-
| NRF_SUCCESS | The BLE stack has been initialized successfully. |
| NRF_ERROR_INVALID_STATE | The BLE stack had already been initialized and cannot be reinitialized, or the random number generator has not been seeded. See sd_rand_seed_set. |
| NRF_ERROR_INVALID_ADDR | Invalid or not sufficiently aligned pointer supplied. |
| NRF_ERROR_NOT_SUPPORTED | The number of concurrent connections configured (ble_gap_conn_cfg_t::conn_count) is less than the configured connection count (ble_gap_cfg_role_count_t). |
| NRF_ERROR_NO_MEM | One or more of the following is true:
- The amount of memory assigned to the SoftDevice by *p_app_ram_base is not large enough to fit this configuration's memory requirement. Check *p_app_ram_base and set the start address of the application RAM region accordingly.
- Dynamic part of the SoftDevice RAM region is larger then 64 kB which is currently not supported.
|