cancel
Showing results for 
Search instead for 
Did you mean: 

how to found out any printf function for debug messages?

User.100
Associate II

I use SPC5Studio-5.8.1, and SPC574S MCU, but I can not found any printf funciton example in the serial example code. Would you help me?

9 REPLIES 9

If using GNU/GCC wouldn't the STDIO plumbing come out via _write() ?

Implement output to a UART you've initialized for this purpose. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
User.100
Associate II

Thank you for your answer. would you give me some more information.

where can I found the  via _write() ?

Check or Google newlib/syscalls.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
User.100
Associate II

Hi Tesla,

I don't found any useful information in search newlib/syscalls.c.

and I found that SPC5Studio can not found the file of "newlib/syscalls.c".

so do you have any other suggestion?

Giuseppe DI-GIORE
ST Employee

SPC5Studio provides a component called "Runtime I/O" which implements the low lever software to enable printf().

Add "Runtime I/O" component to your project, configure it (which seria port to use) and use printf().

Hi Giuseppe DI-GIORE,

Thank you for your reply. I don't know how to add ​"Runtime I/O" component to my project.

Would you give me a example? I searched "Runtime I/O" in serial enabled project , but found nothing.

Select a Platform Component (right click)

0693W00000WIn3NQAT.pngThen select Runtime I/O component

0693W00000WIn4BQAT.png

Hi Giuseppe DI-GIORE,

Thanks you for your reply. I can add this ​"Runtime I/O" component to my project.

Then I need to select Linflex1 to use like picture. I use SPC574S64E3, I want to use PIN81 and PIN 82 to output data, so what should I do next? I tried to right click on "SPC5 Runtime -component" then select "Generate SPC5 application", it will show an error. attached picture for your reference.

0693W00000WIsagQAD.png0693W00000WIsaHQAT.png

Giuseppe DI-GIORE
ST Employee

Configure the serial port using the Low/Level Driver component (selecting the pin you need) and the select the just configured serial port in the Runtime I/O component.