Hello guys, i'm a student and i'm learning STM32. I used to programming in Keil5(MDK), but i met the SES few days ago and fell in love with it soon.
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 .i know that if i retarget printf to UART, the "Library I/O" shouldn't be setted to SEMIHOST(or RTT/SWO), so i set it to the "STD".
After that i followed the wiki,and found that:
And I did it,but i get a strange error:
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 .
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.
if you can help me, i would appreciate it very much! Forgive my poor English ~~
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 .i know that if i retarget printf to UART, the "Library I/O" shouldn't be setted to SEMIHOST(or RTT/SWO), so i set it to the "STD".
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 .
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.
if you can help me, i would appreciate it very much! Forgive my poor English ~~