Board was created using nrf 52832. The program is being created using S132 in .sdk 14.2.0
Copy and use the contents of the " ble_app_beacon " from the sample furnace code.
In the " nrf_sdh_ble_enable " function used in " ble_stack_init ", Returns error code 4 " NRF_ERROR_NO_ MEM ".
The trace shows a change in the value of the " p_app_ram_start " variable in the " sd_ble_enable " function. The entered memory has an address of " 0x20001368 " and the variable value appears as " 0x200023a0 ".
Can I get some advice on this?
The source below is :
//main.c
static void ble_stack_init(void)
{
ret_code_t err_code;
err_code = nrf_sdh_enable_request();
APP_ERROR_CHECK(err_code);
// Configure the BLE stack using the default settings.
// Fetch the start address of the application RAM.
uint32_t ram_start = 0;
err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
APP_ERROR_CHECK(err_code);
// Enable BLE stack.
err_code = nrf_sdh_ble_enable(&ram_start); //return error 4(NRF_ERROR_NO_MEM"
APP_ERROR_CHECK(err_code);
}
{
ret_code_t err_code;
err_code = nrf_sdh_enable_request();
APP_ERROR_CHECK(err_code);
// Configure the BLE stack using the default settings.
// Fetch the start address of the application RAM.
uint32_t ram_start = 0;
err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
APP_ERROR_CHECK(err_code);
// Enable BLE stack.
err_code = nrf_sdh_ble_enable(&ram_start); //return error 4(NRF_ERROR_NO_MEM"
APP_ERROR_CHECK(err_code);
}
//nrf_sdh_ble.c
ret_code_t nrf_sdh_ble_enable(uint32_t * const p_app_ram_start)
{
// Start of RAM, obtained from linker symbol.
uint32_t const app_ram_start_link = *p_app_ram_start;
NRF_LOG_DEBUG("RAM starts at 0x%x", app_ram_start_link);
{
// Start of RAM, obtained from linker symbol.
uint32_t const app_ram_start_link = *p_app_ram_start;
NRF_LOG_DEBUG("RAM starts at 0x%x", app_ram_start_link);
//input value = 0x20001368, *p_app_ram_start = 0x200023a0, app_ram_start_link = 0x20001368
ret_code_t ret_code = sd_ble_enable(p_app_ram_start);
if (*p_app_ram_start != app_ram_start_link)
{
NRF_LOG_WARNING("RAM starts at 0x%x, can be adjusted to 0x%x.",
app_ram_start_link, *p_app_ram_start);
NRF_LOG_WARNING("RAM size can be adjusted to 0x%x.",
ram_end_address_get() - (*p_app_ram_start));
}
if (ret_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("sd_ble_enable() returned %s.", nrf_strerror_get(ret_code));
}
return ret_code;
}
ret_code_t ret_code = sd_ble_enable(p_app_ram_start);
if (*p_app_ram_start != app_ram_start_link)
{
NRF_LOG_WARNING("RAM starts at 0x%x, can be adjusted to 0x%x.",
app_ram_start_link, *p_app_ram_start);
NRF_LOG_WARNING("RAM size can be adjusted to 0x%x.",
ram_end_address_get() - (*p_app_ram_start));
}
if (ret_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("sd_ble_enable() returned %s.", nrf_strerror_get(ret_code));
}
return ret_code;
}