2011-06-17 10:25 AM
I am running the simplest sample program that came with the Standard Peripheral Library Template (that lights 4 LEDs, displays a line on the UART, and 3 lines on the LCD). Using the Keil tool chain, I turned off Use MicroLib (I'd rather not use MicroLib so I can use C++ code), and the program stopped working (seems to go to a BKPT instruction). So I read ''Note for MDK-ARM in the StdLib help, and it said to use:
#pragma import(__use_no_semihosting_swi) But the Linker complains: .\STM3210C-EVAL\STM3210C-EVAL.axf: Error: L6915E: Library reports error: __use_no_semihosting_swi was requested, but _sys_exit was referenced .\STM3210C-EVAL\STM3210C-EVAL.axf: Error: L6915E: Library reports error: __use_no_semihosting_swi was requested, but _sys_open was referenced .\STM3210C-EVAL\STM3210C-EVAL.axf: Error: L6915E: Library reports error: __use_no_semihosting_swi was requested, but _ttywrch was referenced I tried making dummy routines for these 3 in main.c, and got rid of the complaints about _sys_exit and _ttywrch, but _sys_open still complains: .\STM3210C-EVAL\STM3210C-EVAL.axf: Error: L6200E: Symbol _sys_open multiply defined (by sys_io.o and main.o). How do I get around this problem, so I don't have to use MicroLib?2011-06-18 08:09 AM
There is nothing to stop you from creating your own putchar()/getchar() type routines to output the USART or whatever, and not use the library/semihosting/whatever.
If you use functions from the library, you're going to have to link in the library, or equivalents. If you don't want to use the library, DON'T use stdio.h, and scanf(), printf(), etc.2011-06-19 05:09 AM
You need an appropriate retarget.c. Try the attached one.
You need to implement your own char sending/receiving functions that are declared in the retarget.c as follows: extern int sendchar (int ch); extern int getkey (void); Look for serial.c in your example folders to find some implementations for the functions. P.S. If you wanna use Flash-FS from KEIL in the future, switch microlib OFF! ________________ Attachments : Retarget.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Uz&d=%2Fa%2F0X0000000bap%2F8.mGSDW2kiizbTUutT7OZd3mZO8Qnw3bqXAmf9j6R_k&asPdf=false