printf() using ITM

Showing results for 
Search instead for 
Did you mean: 

printf() using ITM

Contributor III


I need to make use of printf() statements for debugging. Since the code involves multiple interrupts, I want to use retargetting to UART instead of using semihosting (as recommended at What is Semihosting?). I am using Redlib nohost library. I am using the LPCOpen Chip library only and not the board library. I have added the retarget_itm.c file available at- How to use ITM Printf.

I have some queries regarding the same. 

1. Can ITM be used both with and without semihosting? If yes, then how does it happen? (since it requires that the redlib semihost or redlib or newlib nohost library be used.)

2. How is printf() mapped to the __sys_write() function defined in the retarget_itm.c? 

3. The __sys_write() function in retarget_itm.c is not being called when I use printf statements. However, the program gets compiled. Please let me know what might be the issue.



0 Kudos
0 Replies