Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

Usage of configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES

Posted by gezab on June 14, 2016

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 Queuet 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 xSTATICLISTITEM {

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 xSTATICLISTITEM StaticListItem_t;

/* See the comments above the struct xSTATICLISTITEM definition. */ struct xSTATICMINILIST_ITEM {

if( configUSELISTDATAINTEGRITYCHECK_BYTES == 1 )
TickType_t uxDummy0;
endif /* configUSELISTDATAINTEGRITYCHECK_BYTES */
TickType_t xDummy1;
void *pvDummy2[ 2 ];

}; typedef struct xSTATICMINILISTITEM StaticMiniListItemt;

/* See the comments above the struct xSTATICLISTITEM 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 Queuet 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


Usage of configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES

Posted by rtel on June 14, 2016

Sure you can use the list integrity checker in your application if you like, but note it was not intended for use by applications, and as such is not documented - and the issue you have noticed (which we will look at - thanks for reporting) reflects that. The integrity checking code is included in our code coverage tests.


Usage of configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES

Posted by gezab on June 14, 2016

Thanks for your reply. I was debugging a weird phenomenon that was corrupting my RAM, this is why I turned it on (unfortunately I do not have data tracing equipment and the problem showed up only occasionally). It really helped me to get closer to the problem which I already managed to sort out, that is why I think it would make sense to have this as an official option for applications, too.

Attachments

alternate (1758 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists