bdouram wrote on Tuesday, October 15, 2019:
Hello!
Working with the trace macros, I came across documentation that says pxCurrentTCB-> uxTaskNumber would give me the number of the task to create or was running on the CPU.
I have read the docs and search in forum, but i have not found anything that could help me in this situation.
I set the trace setting
#define configUSE_TRACE_FACILITY 1
And I defined the macros, including this header bellow at the bottom of FreeRTOSConfig.h:
#include "FreeRTOS.h"
#ifndef ON_CREATE_TASK
#define ON_CREATE_TASK
#define traceTASK_CREATE(xTask) taskCreated((int) pxCurrentTCB-> uxTaskNumber)
#define traceTASK_SWITCHED_IN() taskIn((int) pxCurrentTCB-> uxTaskNumber)
#endif
However, in debugging any task, the value contained in** pxCurrentTCB-> uxTaskNumber** is always 0 and the value that was supposed to be in uxTaskNumber, for example, 2, is in uxTCBNumber, not uxTaskNumber.
Below are the screenshots of pxCurrentTCB in debug mode on Eclipse IDE.
What i’m doing wrong in this case? Thanks.