stidio_user.h/retarget.c not generated

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

cross mob
grecobene
Level 1
Level 1
First reply posted First question asked First like given

Hello!

About a month ago I did a project that would return some ADC values to a computer through UART using printf(). Fast forward this week,  I am doing a similar project and the printf() no longer works (but UART_putstring() does).

After a bit of troubleshooting, I notice that the new projects I create with UART do not generate the files retarget.c and stdio_user.h/c which seem to be necessary to have printf() working.

Any idea on how I can force PSoC creator to generate these? And what could I have possibly done to cause this issue?

Hardware used: [CY8CPROTO-063-BLE (CYBLE-416054-02 + KitProg2)]

Thanks!

Marc

0 Likes
1 Solution
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @grecobene ,

You are not able to generate the stdio_user.c/h files because the retarget I/O library is not selected in the 'Build Settings' of your project.
You can do the same by checking the box for 'Retarget I/O' as shown below:

AlenAn14_1-1641907158897.png

Perform the build operation after this and you should see the stdio_user.c/h files generated under the 'Shared Files' folder.

Hope this helps.

Regards
Alen

View solution in original post

3 Replies
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @grecobene ,

You are not able to generate the stdio_user.c/h files because the retarget I/O library is not selected in the 'Build Settings' of your project.
You can do the same by checking the box for 'Retarget I/O' as shown below:

AlenAn14_1-1641907158897.png

Perform the build operation after this and you should see the stdio_user.c/h files generated under the 'Shared Files' folder.

Hope this helps.

Regards
Alen

grecobene
Level 1
Level 1
First reply posted First question asked First like given

Thank you Alen, that corrected the issue!

Out of curiosity, what could have changed this setting between my different projects? I certainly did not "uncheck" that option since last time... 

0 Likes
AlenAn14
Moderator
Moderator
Moderator
500 replies posted 100 solutions authored 250 replies posted

Hi @grecobene ,

When you create a new project you have to check this option.
Since this is a project dependent option and not an IDE dependent option, checking this option in one project will not check it for all the projects in the IDE, instead you have to do the same for each project.

Glad your query is resolved and please feel free to post any queries or issues you may face on Infineon products on the community and we will be happy to help.

Regards
Alen

0 Likes