cancel
Showing results for 
Search instead for 
Did you mean: 

Printf fails to retarget to UART when GNU Extensions are enabled

cchan.3
Associate II

IDE: Keil

Toolchain: MDK ARM compiler version 5

MCU: STM32F411RE

When GNU Extensions are enabled in the Compiler options/ --gnu compiler control string is enabled in C/C++ options for Target, the printf does not get executed. The GNU extensions are required for my application. Please help me resolve this.

cchan3_0-1692287235408.png

 

3 REPLIES 3

Yes, looks like it is still calling/expecting the semihosting.

Are you using the Keil _ttywrch() / fputc() implementation, or the GNU/GCC _write() ones? Likely going to depend on the libraries / syscalls pulled in.. Suggest you look at the .MAP or get a disassembly / analysis via FROMELF tool.

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

I am using fputc() implementation. 

cchan3_0-1692293008548.png

I don't have much knowledge on analyzing .MAP. I have attached the .map file that got generated.

 

cchan.3
Associate II