Hi,
I'm developing an application which uses BLE softdevices and 2 other created tasks. The problem is that when I call xQueueSend to send an event to one task, I get a hard fault error:
<error> hardfault: HARD FAULT at 0x000482BC
<error> hardfault: R0: 0x00000015 R1: 0x00000015 R2: 0x00000000 R3: 0x00000000
<error> hardfault: R12: 0xA5A5A5A5 LR: 0x000497C5 PSR: 0x41000000
<error> hardfault: Cause: The processor has made an unaligned memory access.
This happens at :
pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
which is inside UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
The above issue only happens when the BLE connection is active. There is no issue if there is no connection. It seems to me that this is somehow could be related to softdevices.
I tried to increase the stack and heap sizes but it didnt help.
Here is the task init for the task which has the issue:
static TaskHandle_t DFTask_Handle = NULL;
static QueueHandle_t DF_qHandle = NULL;
#define DF_TASK_STACK_SIZE 256
void DF_Task_init(void)
{
DF_qHandle = xQueueCreate(16,sizeof(uint8_t));
if (pdPASS != xTaskCreate(DFTask_Callback, "DFTASK1", DF_TASK_STACK_SIZE, NULL, 1, &DFTask_Handle))
{
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
}
Regards
Ehad