AnsweredAssumed Answered

Runtime error in bf561 COREB when pointing to structure data

Question asked by willrobot on Feb 6, 2012
Latest reply on Mar 14, 2012 by willrobot

Hi, I've a runtime error in several function when it try to access structure data generally pass as a parameter to the function.

 

 

the first instance of the problem is:

 

signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, void * const p\

vBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )

{

..............

 

if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TY\

PE ) 0 )

               

.......................

 

}

 

where pxQueue is a structure:

 

typedef xQUEUE * xQueueHandle;

 

with:

 

typedef struct QueueDefinition

{

        signed char *pcHead;                            /*< Points to the begin\

ning of the queue storage area. */

    signed char *pcTail;                            /*< Points to the byte \

at the end of the queue storage area.  Once more byte is allocated than necessa\

ry to store the queue items, this is used as a marker. */

 

        signed char *pcWriteTo;                         /*< Points to the free \

next place in the storage area. */

        signed char *pcReadFrom;  

                 /*< Points to the last \

place that a queued item was read from. */

 

    xList xTasksWaitingToSend;                          /*< List of tas\

ks that are blocked waiting to post onto this queue.  Stored in priority order.\

*/

    xList xTasksWaitingToReceive;               /*< List of tasks that \

are blocked waiting to read from this queue.  Stored in priority order. */

 

    volatile unsigned portBASE_TYPE uxMessagesWaiting;/*< The number of ite\

ms currently in the queue. */

    unsigned portBASE_TYPE uxLength;            /*< The length of the q\

ueue defined as the number of items it will hold, not the number of bytes. */

    unsigned portBASE_TYPE uxItemSize;          /*< The size of each it\

ems that the queue will hold. */

 

    signed portBASE_TYPE xRxLock;               /*< Stores the number o\

f items received from the queue (removed from the queue) while the queue was lo\

cked.  Set to queueUNLOCKED when the queue is not locked. */

    signed portBASE_TYPE xTxLock;               /*< Stores the number o\

f items transmitted to the queue (added to the queue)

while the queue was locke\

d.  Set to queueUNLOCKED when the queue is not locked. */

 

} xQUEUE;

 

the runtime error is:

.....

COREB: start xQueueGenericReceive                                         
COREB: execption 24 addr 3c00384                                          
COREB: coreb dump stack                                                   
COREB: found fp: ff700900                                                 
COREB:  call frame 0 -12 feb055e2                                         
COREB:  call frame 0 -11 00000000                                         
COREB:  call frame 0 -9 00000000                                          
COREB:  call frame 0 -8 ff7008d0

......

 

 

Similarly, I've the same problem with the following function:

 

void vListRemove( xListItem *pxItemToRemove )

{

xList * pxList;

 

   pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;

        pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;

}

 

where pxItemToRemove->pxPrevious can be read but not pxItemToRemove->pxNext->pxPrevious

 

it structure is:

 

struct xLIST_ITEM

{

     portTickType xItemValue;                                /*< The value b\

eing listed.  In most cases this is used to sort the list in descending order. \

*/

        volatile struct xLIST_ITEM * pxNext;    /*< Pointer to the next xListIt\

em in the list. */

        volatile struct xLIST_ITEM * pxPrevious;/*< Pointer to the previous xLi\

stItem in the list. */

        void * pvOwner;                                                 /*< Poi\

nter to the object (normally a TCB) that contains the list item.  There is ther\

efore a two way link between the object containing the list item and the list i\

tem itself. */

        void * pvContainer;                                             /*< Poi\

nter to the list in which this list item is placed (if any). */

};

typedef struct xLIST_ITEM xListItem;            /* For some reason lint wants t\

his as two separate definitions. */

 

the runtime error is:

 

COREB: got to vTaskDelete                                                 
COREB: pxTCB GLI prev: a5a5a5a5                                           
COREB: sent to list: 3d02004                                              
COREB: list_rem px prev: a5a5a5a5                                         
COREB: execption 24 addr 3c05444                                          
COREB: coreb dump stack                                                   
COREB: found fp: ff7008fc                                                 
COREB:  call frame 0 -12 feb055e2                                         
COREB:  call frame 0 -11 00000000                                         
COREB:  call frame 0 -9 00000000                                          
COREB:  call frame 0 -8 ff7008cc                                          
COREB:  call frame 0 -7 ff700ff4 

 

 

Thank you in advance.

 

William

Outcomes