Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 5 months ago.
Exporting to Kiel-Uvision4 and then opening the project in Uvision5 gives linker error for smartcard
As the title says, I exported from the compiler page here to a Kiel-Uvision 4 project. Then opening the project in Kiel-Uvision 5 gives me the following after attempting to compile.
Error output
*** Using Compiler 'V5.05 update 2 (build 169)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'mbed NUCLEO_F303RE' compiling main.cpp... main.cpp(21): warning: #1-D: last line of file ends without a newline } main.cpp: 1 warning, 0 errors linking... .\build\nucleo_exporting.axf: error: L6002U: Could not open file mbed/TARGET_NUCLEO_F303RE/TOOLCHAIN_ARM_MICRO/stm32f3xx_hal_smartcard_: No such file or directory Finished: 0 information, 0 warning, 0 error and 1 fatal error messages. ".\build\nucleo_exporting.axf" - 1 Error(s), 1 Warning(s). Target not created. Build Time Elapsed: 00:00:01
The only project file is main.cpp consisting of the following:
main.cpp
#include "mbed.h" Serial pc_serial(USBTX, USBRX); // tx, rx DigitalOut board_led(LED2); int main() { while (1) { wait_ms(500); board_led = !board_led; pc_serial.printf("bap"); wait_ms(500); board_led = !board_led; pc_serial.printf("boosh\n\r"); } }
Question relating to:
1 Answer
9 years, 5 months ago.
Hi Marcin,
If you still facing this issue, then you probably also have the same problem as me. The list of object files to link together is too long for the linker command line. I do not know why they are not using a library instead?
You can open the Options dialog for your project in uVision and select the Linker tab. At the bottom half of this tab you should find the Misc controls edit box where you can see the full path references of all the mbed related object files. If you right click on this field and choose Select All and copy the whole text and place it into an editor then you can see that all lines start with a couple of space characters and the lines are separated by two empty lines. I removed all the empty lines and also the leading spaces. I copied the this way "compressed" text back into the Misc controls field and now it works.
I hope it helps.
Best regards, Laszlo