Facing data abort issue in xQueueGenericReceive() function.
Here is the call stack
000|xQueueGenericReceive(
** |** xQueue = 0x0,
| pvBuffer = 0x0,
| ?,
| xJustPeeking = 0)
| xTimeOut = (xOverflowCount = 1, xTimeOnEntering = 536870943)
| pcOriginalReadPosition = 0x80E0F460
| pxQueue = 0x0
| uxMessagesWaiting = 0
-001|xQueueTakeMutexRecursive()
| xMutex = 0x901C1E8C → ,
| xTicksToWait = 4294967295)
| xReturn = -1877205364
| pxMutex = 0x901C1E8C → (
| pcHead = 0x0,
| pcTail = 0x0,
| pcWriteTo = 0x901C1E8C,
| uxMessagesWaiting = 1,
| uxLength = 1,
| uxItemSize = 0,
| cRxLock = -1,
| cTxLock = -1,
| ucStaticallyAllocated = 0)
else
| {
| xReturn = xQueueGenericReceive( pxMutex, NULL, xTicksToWait, pdFALSE );
While acquiring mutex it is failing and entering into xQueueGenericReceive()
Parameters passed to xQueueGenericReceive() from xQueueTakeMutexRecursive() looks fine.
pxMutex is passed from xQueueTakeMutexRecursive() to pxQueue in xQueueGenericReceive()
Assembly code:
1260| taskENTER_CRITICAL();
ST:0000:9012E546|F6DBFE07 bl 0x9000A158 ; vPortEnterCritical
| {
1262| const UBaseType_t uxMessagesWaiting = pxQueue->uxMessagesWaiting;
ST:0000:9012E54A|6BA5 ldr r5,[r4,#0x38]
|
| /* Is there data in the queue now? To be running the calling task
| must be the highest priority task wanting to access the queue. */
1266| if( uxMessagesWaiting > ( UBaseType_t ) 0 )
ST:0000:9012E54C|B31D cbz r5,0x9012E596 ; uxMessagesWaiting,0x9012E596
| {
| /* Remember the read position in case the queue is only being
| peeked. */
1270| pcOriginalReadPosition = pxQueue->u.pcReadFrom;
ST:0000:9012E54E|4641 mov r1,r8 ; r1,pvBuffer
ST:0000:9012E550|4620 mov r0,r4 ; r0,xQueue
ST:0000:9012E552|68E6 ldr r6,[r4,#0x0C] ; xEntryTimeSet,[r4,#12]
1272| prvCopyDataFromQueue( pxQueue, pvBuffer );
ST:0000:9012E554|F6DAFBBC bl 0x90008CD0 ; prvCopyDataFromQueue
|
1274| if( xJustPeeking == pdFALSE )
ST:0000:9012E558|F1B90F00 cmp r9,#0x0 ; xJustPeeking,#0
ST:0000:9012E55C|D114 bne 0x9012E588
| {
1276| traceQUEUE_RECEIVE( pxQueue );
|
| /* Actually removing data, not just peeking. */
1279| pxQueue->uxMessagesWaiting = uxMessagesWaiting - 1;
ST:0000:9012E55E|6823 ldr r3,[r4]
ST:0000:9012E560|3D01 subs r5,r5,#0x1 ; uxMessagesWaiting,uxMessagesWaiting,#1
ST:0000:9012E562|63A5________________str_____r5,[r4,#0x38]//Data abort at this point
Register Info
N N R0 901C1E8C R8 0 ^S+ ^Stack_+
Z _ R1 0 R9 0
C _ R2 0 R10 0
V _ R3 0 R11 A5A5A5A5
Q _ R4 0 R12 BE82209D
R5 FFFFFFFF R13 901C3EE8
0 _ R6 80E0F460 R14 9000A161
1 _ R7 0 PC 9012E562
Any help would be appreciated ? Please share some thoughts