7 years, 4 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
.\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:


#include "mbed.h"

Serial pc_serial(USBTX, USBRX); // tx, rx

DigitalOut board_led(LED2);

int main() {
    while (1) {

        board_led = !board_led;



        board_led = !board_led;


Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F303RET6 microcontroller.

1 Answer

7 years, 4 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

The import into Keil was fixed with MDK v5.18 (onwards) - they recognised the problem.

posted by Philip Tranter 08 Aug 2016