<stdio.h> problems

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

cross mob
StMa_3607891
Level 2
Level 2
5 replies posted 5 questions asked 5 sign-ins

Hi guys,

I am using PSoC 6 PLE Pioneer board.

I have stdio redirected appropriately for debugging with an external terminal using printf and getchar

Everything has been working perfectly until the following problems appeared from nowhere and are persistent:

  • printf will not output anything to the serial line.
  • getchar blocks (even when the receive fifo says it is not empty and having disabled STDIN input buffering).

I thought it would be easy to debug this but I have been at it for considerably longer than I expected.

I wonder if someone could point me into an area to look at?

Many thanks.

 

0 Likes
1 Solution
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @StMa_3607891

Can you please let us know if you are using ModusToolbox or PSoC Creator? If you are using PSoC Creator and if you regenerated the code then you will have to add UART_1_HW in stdio_user.h. Can you please confirm if that is added?

You could also try running our code examples that use print statements and check if that works and use it as a reference.

This blog might also help you - https://iotexpert.com/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/

Thanks and Regards,
Rakshith M B

View solution in original post

0 Likes
3 Replies
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Hi @StMa_3607891

Can you please let us know if you are using ModusToolbox or PSoC Creator? If you are using PSoC Creator and if you regenerated the code then you will have to add UART_1_HW in stdio_user.h. Can you please confirm if that is added?

You could also try running our code examples that use print statements and check if that works and use it as a reference.

This blog might also help you - https://iotexpert.com/lesson-3-psoc-6-introduction-freertos-and-a-debugging-uart/

Thanks and Regards,
Rakshith M B
0 Likes

Many thanks Rakshith,

Fixed!

Didn't realise that regenerating the code recreates a new stdio_user.h.

0 Likes
Rakshith
Moderator
Moderator
Moderator
250 likes received 1000 replies posted 750 replies posted

Glad it worked 🙂

Thanks and Regards,
Rakshith M B
0 Likes