This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Function softdevice_enable() doesn't return any adjusted warnings in case of changing central/peripheral connections.

Function softdevice_enable() doesn't return any adjusted warnings in case of changing central/peripheral connections, e.g. my ble_stack_init() function:

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);

ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT;
ble_enable_params.common_enable_params.vs_uuid_count = 2;

//Check the ram settings against the used number of links
CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);

// Enable BLE stack.
err_code = softdevice_enable(&ble_enable_params);
APP_ERROR_CHECK(err_code);

// Register with the SoftDevice handler module for BLE events.
err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
APP_ERROR_CHECK(err_code);

// Register with the SoftDevice handler module for BLE events.
err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
APP_ERROR_CHECK(err_code);
}

if I change ble_enable_params.common_enable_params.vs_uuid_count to 3, i'll get warning for memory adjusting according this function:uint32_t softdevice_enable(ble_enable_params_t * p_ble_enable_params)
{
#if (defined(S130) || defined(S132) || defined(S332))
uint32_t err_code;
uint32_t app_ram_base;

#if defined ( __CC_ARM )
extern uint32_t Image$$RW_IRAM1$$Base;
const volatile uint32_t ram_start = (uint32_t) &Image$$RW_IRAM1$$Base;
#elif defined ( __ICCARM__ )
extern uint32_t __ICFEDIT_region_RAM_start__;
volatile uint32_t ram_start = (uint32_t) &__ICFEDIT_region_RAM_start__;
#elif defined ( __GNUC__ )
extern uint32_t __data_start__;
volatile uint32_t ram_start = (uint32_t) &__data_start__;
#endif

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);

if (app_ram_base != ram_start)
{
NRF_LOG_WARNING("sd_ble_enable: RAM start should be adjusted to 0x%x\r\n",
app_ram_base);
NRF_LOG_WARNING("RAM size should be adjusted to 0x%x \r\n",
ram_end_address_get() - app_ram_base);
}
else if (err_code != NRF_SUCCESS)
{
NRF_LOG_ERROR("sd_ble_enable: error 0x%x\r\n", err_code);
}
return err_code;
#else
return NRF_SUCCESS;
#endif //defined(S130) || defined(S132) || defined(S332)

}

But, if I increase connection count, i just got error message 0x12 (NRF_ERROR_CONN_COUNT):
NRF_LOG_ERROR("sd_ble_enable: error 0x%x\r\n", err_code);
But any memory adjusting warnings. Why? Doesn't this softdevice version (sdk_12.3.0) (s130) support more then 1 connection? how can i change it?

My RAM size from linker script, if it necessary:
RAM (rwx) : ORIGIN = 0x20001ff8, LENGTH = 0x2008

Related