Hi all,
I am trying to get the ble template of SDK12.2 working in eclipse using a managed makefile. The softdevice I use is s132 v3.0.0. The board is an evaluation kit from Taiyo Yuden (EKSHCNZXZ) which uses the NRF52832 chip.
I programmed the softdevice using nRFgo Studio.
I use ARM GNU build tools and compiler.
I can compile the project and even debug the project using J-Link, however when I try to enable the bluetooth stack it resets and start at the beginning of main.
I am using the main file from ble_peripherals/ble_app_template
The SDK I added manually in Eclipse which seems to work fine.
The following code is used (in main.c):
int main(void)
{
uint32_t err_code;
bool erase_bonds;
// Initialize.
err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);
timers_init();
buttons_leds_init(&erase_bonds);
ble_stack_init();
From there we go to (in main.c):
static void ble_stack_init(void)
{
uint32_t err_code;
nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;
// Initialize the SoftDevice handler module.
SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
ble_enable_params_t ble_enable_params;
err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
PERIPHERAL_LINK_COUNT,
&ble_enable_params);
APP_ERROR_CHECK(err_code);
// Check the ram settings against the used number of links
CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT, PERIPHERAL_LINK_COUNT);
// Enable BLE stack.
ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_MAX_MTU_SIZE;
err_code = softdevice_enable(&ble_enable_params);
And then to (in softdevice_handler.c):
uint32_t softdevice_enable(ble_enable_params_t * p_ble_enable_params)
{
uint32_t err_code;
uint32_t app_ram_base;
extern uint32_t __data_start__;
volatile uint32_t ram_start = (uint32_t) &__data_start__;
app_ram_base = ram_start;
NRF_LOG_DEBUG("sd_ble_enable: RAM start at 0x%x\r\n",
app_ram_base);
err_code = sd_ble_enable(p_ble_enable_params, &app_ram_base);
Which launches (in ble.h):
SVCALL(SD_BLE_ENABLE, uint32_t, sd_ble_enable(ble_enable_params_t * p_ble_enable_params, uint32_t * p_app_ram_base))
After this call it resets and start at the beginning of main.
Do any of you have an idea what I might be missing.
EDIT: I found some more info about the problem I am experiencing. Investigating some more i found the sd_ble_enable function returned an error code 0x04 which represents:
* @retval ::NRF_ERROR_NO_MEM 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.
I'm going to check why this is happening.