I am using uVision 5.11.1.0 with projects based on LPCOpen examples. My application uses C++ and C routines.
I have managed to send printf() output to UART using by implementing fputc(). I now want to direct file access to different devices. I have followed: www.keil.com/.../armlib_chr1358938932518.htm and have added _sys_open() etc but on linking get many Error L6200E _sys_write multiply defined.
Ticking project options Code Generation 'Use MicroLIB' allows a successful build but my functions are not included (cannot set a break point).
I am new to uVision and could not find where the stdio_streams.o etc files get pulled in. There is nothing under options Linker AFAIK. The redirecting advice is not clear. An example would be helpful!
Hello Pete,
retargetting the syste, level I/O functions (_sys_open, _sys_write etc.) does not work with MicroLib. You can only retarget the low-level functions like fputc and fgetc.
Kind regards,
Christopher
Thanks. Yes, I understand that MicroLIB does not have the ability to retarget. This comment was ment more in the way that I have tried all the options available to me.
How do I remove the duplicate symbols errors (when MicroLIB is not checked)? Somehow _sys_open() etc are being pulled in despite the fact that I have compiled my own versions. How do I stop the default implementations from being linked in?
If you want to retarget I/O you need to implement all of the following functions: _sys_open, _sys_close, _sys_write, _sys_read, _ttywrch, _sys_istty, _sys_seek, _sys_flen.
After that the linker error should go away.
Thanks. I got a retarget.c file from support that seems to work.
A cut & paste from the link I posted did not work.
Hello Pete (and future readers),
These articles may be useful for you:
ARMLINK: ERROR: L6200E: SYMBOL __STDOUT MULTIPLY DEFINED http://www.keil.com/support/docs/3279.htm
ARM: Application Builds Without Error, But Does Not Run http://www.keil.com/support/docs/3614.htm
The 2nd article has several retarget.c examples attached. It does a good job of troubleshooting issues with semihosting, microlib, retarget.c and heap.