Hi all,
I am developing a new project and therefore I set the above define to 1, in order to catch list corruptions. I also have configASSERT() defined and it broke execution when my first static semaphore was about to be created, since Queue
t and StaticQueuet are not of the same size. In order to get rid of the error, I needed to make the following changes in FreeRTOS.h:
~~~
/*
* In line with software engineering best practice, FreeRTOS implements a strict
* data hiding policy, so the real structures used by FreeRTOS to maintain the
* state of tasks, queues, semaphores, etc. are not accessible to the application
* code. However, if the application writer wants to statically allocate such
* an object then the size of the object needs to be know. Dummy structures
* that are guaranteed to have the same size and alignment requirements of the
* real objects are used for this purpose. The dummy list and list item
* structures below are used for inclusion in such a dummy structure.
*/
struct xSTATIC_LIST_ITEM
{
if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy0;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
TickType_t xDummy1;
void *pvDummy2[ 4 ];
if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy3;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
};
typedef struct xSTATIC
LISTITEM StaticListItem_t;
/* See the comments above the struct xSTATIC
LISTITEM definition. */
struct xSTATIC_MINI_LIST_ITEM
{
if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy0;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
TickType_t xDummy1;
void *pvDummy2[ 2 ];
};
typedef struct xSTATIC
MINILIST
ITEM StaticMiniListItemt;
/* See the comments above the struct xSTATIC
LISTITEM definition. */
typedef struct xSTATIC_LIST
{
if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy0;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
UBaseType_t uxDummy1;
void *pvDummy2;
StaticMiniListItem_t xDummy3;
if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy4;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
} StaticList_t;
~~~
This way, even if the define in the subject is set to 1, the sizes of Queue
t and StaticQueuet are equal and the assert is passing.
Can this be an intentional thing? Are we allowed to use the list integrity checker in our applications?
Regards,
Geza