Print to terminal using Printf()

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I am trying to print to the terminal using teh printf() function. I am able to print using UART_UartPutString() but the printf function doesnt work. I did include the file to assign _write() function of GCC.

   

​Kindly have a look at the attached project here and tell me where I am going wrong.

   

Thanks

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is your program working with the correct code.  You can change the data to what you want. Also I removed the Debug file as it was not in the files when you sent them.

View solution in original post

0 Likes
3 Replies
lock attach
Attachments are accessible only for community members.
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Here is your program working with the correct code.  You can change the data to what you want. Also I removed the Debug file as it was not in the files when you sent them.

0 Likes
Anonymous
Not applicable

Thanks a lot.

   

But why cant I use the printf() function in my codes. I am able to use it with other codes from 100 projects in 100 days.

0 Likes
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

That example had a tinyprintf component that has been replaced in the latest PsoC Creator using stdio.h  and if you try to use this old component it will not work if you need the other functions that the stdio.h provides. You can try to use it but you must remove the stdio.h from the header part of the program.  You also need to add the tinyprintf component to your schematic.

   

You will notice the missing stdio.h in the old program I pen it in to show you where it would have been.

   

   

0 Likes