Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User3847
Level 3
Level 3
Hello everybody,

I am trying to use the ITM_SendChar function to send debug strings to the J/Link SWO Viewer (included with Dave installation) but I just cant get it to work.

Debugging the ITM_SendChar function I see ITM_TCR and ITM_TER are both 0, so it doesn't even write to the ITM Stimulus register. I tried initializin them but they remain 0. I also tried adjusting TPIU_ACR to 20 (120000 KHz / 6000 KHz).

Another thing that makes me doubt is the SWO Viewer config, when I choose the XMC4500/1024 and measure the CPU speed it is giving me near 24 Mhz instead of 120 MHz. I tried to put 120000KHz manually but still it doesnt work.

Any idea?

Thank you
0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi sblanco,

To program the ITM you need before to write the access key 0xC5ACCE55 (CoreSight ACCESS), i.e. ITM->LAR = 0xC5ACCE55.
Please find a DAVE project that is working with a SWO frequency of 1MHz since the JLink Lite Cortex-M is limited to that frequency.
If you have further questions please do not hesitate to contact.

Best regards,
Jesus
0 Likes
User5581
Level 3
Level 3
I found that to get SWO to work reliably with the Jlink Lite Cortex M and the XMC4500 Hexagon kit, I additionally needed to clear the following bit in the initialization code:

TPI->FFCR &= ~TPI_FFCR_EnFCont_Msk;

Hope this is useful.
0 Likes
User3847
Level 3
Level 3
Thanks for the tip, I will try it!

Now I am not using ITM that much because I am working form standard Eclipse on Linux. I am waiting for Segger to release a new version of JLink. They told me it will autodetect ITM settings and redirect it to another GDB server port (which then I will use via telnet).
0 Likes