I am trying to migrate BLE peripheral implementation code from nRF52832 (SDK 132) to nRF52840 (SDK 140) using nRF52840 Preview-DK (PCA10056).
The application is based on freeRTOS and BLE is running as one of the tasks.
When I ran it I got error message " SOFTDEVICE: INVALID MEMORY ACCESS".
During debug I comment out all BLE related functions calls it ran without error.
but when I uncomment ble_init() function (see below function code) I received again the error message.
What can be the reason for this issue?
Thanks in advance
int
main(void)
{
...
if (pdPASS != xTaskCreate(BLETask, "BLETask", BLE_TASK_STACK_DEPTH, NULL, BLE_TASK_PRIORITY, &m_oBLETaskHandle))
{
NRF_LOG_WARNING("Init - BLE task creation failed");
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
...
}
void BLETask (void * pvParameter)
{
UNUSED_PARAMETER(pvParameter);
LOGPRINT(LOG_PRINT_BLE, "BLE init");
ble_init();
#ifdef BLE_ENABLE
LOGPRINT(LOG_PRINT_BLE, "BLE enable - start advertising");
// ble_start();
#endif
while (true)
{
// ble_queue_service ();
LOGPRINT(LOG_PRINT_BLE, "BLE Running");
taskYIELD();
}
}
void ble_init (void)
{
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();
}