![^^](https://forum.segger.com/wcf/images/smilies/grin.png)
![:P](https://forum.segger.com/wcf/images/smilies/tongue.png)
I met some troubles, i want to retarget printf to UART, if i import project from Keil and use the ARMCC, that will be very easy, the only thing i should do is "use the MircoLib and retarget printf to UART via some codes".
But if i Set Build Configurations to "Internal"(using the SEEGER Compiler/ Linker, Include Standard Libraries with SEGGER Runtime Library), i can't make it work
![X/](https://forum.segger.com/wcf/images/smilies/pinch.png)
After that i followed the wiki,and found that:
so i guess, i should set the "Library I/O = STD" and define the int __SEGGER_RTL_stdout_putc(int c) to retarget the printf().SEGGER Wiki wrote:
When STD is selected as Library I/O, the user has to supply an implementation of int __SEGGER_RTL_stdout_putc(int c); which can be used to route character output to any resource, such as a UART or other terminal.
And I did it,but i get a strange error:
undefined symbol: __SEGGER_RTL_X_file_write
After many attempts, i couldn't find the reason, but to my surprise, if i set the options "Code > Compiler > Use Compiler Driver = NO-->YES", the error will gone, but printf() still not working
![?(](https://forum.segger.com/wcf/images/smilies/confused.png)
that's my code,trying to retarget printf to UART1, like what i done in keil, emm, and i'm using the STM32 HAL library yet.
![:thumbsup:](https://forum.segger.com/wcf/images/smilies/thumbsup.png)
![;(](https://forum.segger.com/wcf/images/smilies/crying.png)