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

cross mob
Level 1
Level 1
First reply posted First question asked Welcome!

Hello community,

I am looking for printf style debugging feature in ModusToolBox for PSoC. Actually I want printf style debugging feature available on STMCUBE IDE. As ModusToolBox is also an eclipse based IDE, I want to know how to use printf statement in main.c of my PSoC6 project on MTB. 

I already know about UART style printf debugging. Please do not suggest UART based serial terminal code example for such feature. I want to use MTB with printf over ARM Cortex M4 ITM-SWO line, so that I can directly see print statement on ITM console.


Tony Stark,

Stark Industries

3 Replies
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA


I thought that PSoC6 and MTB has been supporting "printf" from the first place, 
unlike PSoC Creator.

So I tested with 



I created a new project using the template of "Hello World"

main.c seems to be using "printf"


I built the project and debugged with my CY8CKIT-062-BLE, 

the output in the Tera Term was


So apparently "printf" is working.

Although I'm not sure what you mean with "ITM-SWO", 
I checked the pin assignment, UART pins seemed to be assinged to P5[0] and P5[1].

If you want to assign UART pins to other pins, 
I hope that you can change these pins in the Devie Configurator > Pins


Meantime, I wonder if the following information can be a hint for you to use "printf"




on MTB, using the Retarget-IO library allow you to directly use the printf 

An another link with debuging through SWO PSoC6 Cortex-M4 SWD SWO debug output - Infineon Developer Community

Level 1
Level 1
First reply posted Welcome!

In ModusToolBox for PSoC, achieving printf-style debugging without relying on UART can be seamlessly integrated using the ARM Cortex-M4 Instrumentation Trace Macrocell - Serial Wire Output (ITM-SWO) feature. This approach allows you to directly visualize print statements on the ITM console. To implement this, ensure your project's main.c includes the necessary configurations. Utilize the ITM_SendChar function to send characters to the ITM channel, allowing you to observe printf outputs in real-time. Avoid UART-based serial terminal examples, as this method provides a more direct and efficient means of printf-style debugging in the ModusToolBox Eclipse-based IDE for PSoC6 projects.