User Tools

Site Tools


Debug Freertos


To display the list of tasks states :

//Approximately 40 bytes per task should be sufficient
char buffer[400];
/* example of output */
// Name     State  Priority  Stack  Num
// CANAPP   R      2         178    3
// DBG      R      1         42     1
// IDLE     R      0         116    5
// LED      B      1         238    4
// MCTRL    B      4         202    2

For more information.


Enable you to check your config with a debugger.

/* Define configASSERT() to disable interrupts and sit in a loop. */
#define configASSERT(x)     if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }

For more information.

Openocd rtos awareness

Openocd is able to give you information about your system's tasks. For example, for the QuimDC we have added :

$_TARGETNAME configure -rtos auto

to “common/make/quimesis_stm32f10x.cfg”.

You must also add OpenOCD/contrib/rtos-helpers/FreeRTOS-openocd.c to your project and this line :

LDFLAGS += -Wl,--undefined=uxTopUsedPriority

when using gcc as specified in “common/lib/freertos/FreeRTOS-openocd.c”

For more information.

Hook Functions and Trace Hook Macros

Remove compiler optimization

To remove the compiler optimization step for debugging add -O0 to all the compile commands. You can also add virtual to some variable to be able to see their value in the debugger.

debug_freertos.txt · Last modified: 2018/05/22 10:33 (external edit)