Hello =)
I’m trying to retarget printf to USART1.
I tryed to redefine function _write
int _write(int file, char *ptr, int len) {
while (! USART_GetFlagStatus (DEBUG_USART, USART_FLAG_TXE));
USART_SendData(DEBUG_USART, (uint8_t) ptr[0]);
return 0;
}
But linker showed me a message:
Quote:
c:/sysgcc/arm-eabi/bin/../lib/gcc/arm-eabi/4.8.2/../../../../arm-eabi/lib/thumb/cortex_m4libc.a(lib_a-syscalls.o): In function `_write':
1>q:gnuautonewlib-bu-2.23.1+gcc-4.8.2+gmp-4.2.4+mpfr-2.4.1+mpc-0.8+newlib-2.0.0-arm-eabiarm-eabithumbcortex_m4newliblibcsysarm................newlib-2.0.0newliblibcsysarmsyscalls.c(335): error VGDB1001: multiple definition of `_write'
1> Debug/syscalls.o:C:WorkSVNbranchesReNewProjectVisualGDB../../../System/Config/syscalls.c:35: first defined here
1>collect2.exe : error : ld returned 1 exit status
How to make it work?
Thnaks