Skip to main content

[FreeRTOS] Enable Context-ID trace on Arm - Knowledgebase / OS-aware debugging - Lauterbach Support

[FreeRTOS] Enable Context-ID trace on Arm

Authors list
Note

The information below is applicable for ARMv7, ARMv8, ARMv9 cores in 32bit mode, e.g. CortexA32/R52/A7.

A function T32_Magic_Update is used to write the pxCurrectTCB value to the CONTEXTIDR (C15:0x10d).

The C-MACRO traceTASK_SWITCHED_IN is used to write the pxCurrentTCB pointer (address of the current task structure) to the CONTEXTIDR (C15:0x10d) register.

FreeRTOSConfig.h:

#define traceTASK_SWITCHED_IN() \
{ \
  __asm volatile ("MCR	P15, 0x0,%0,C13,C0,0x1" : :"r" (pxCurrentTCB)); \
}

Setting within TRACE32:

ETM.ContextID 32 	
ETM.TraceON 	
ETM.ON


Helpful Unhelpful

Add a comment

ID-0
To prove you are a human, please tell us the text you see in the CAPTCHA image