9 years, 5 months ago.

Build error when exporting to uVision 5

Hi

I'm using the SM32F103RB Nucleo board and wanted to test out a simple program. I exported the program from mbed to uVision 4. When I extracted and opened the project in uVision 5 it asked me to migrate to the new packages that support the device and I selected to migrate (Not doing so will cause the device to not be identified and the program cannot be built). I then choose to rebuild the program I get this error:

* Using Compiler 'V5.05 update 2 (build 169)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'mbed NUCLEO_F103RB' compiling main.cpp... linking... .\build\Nucleo_pwm2.axf: error: L6002U: Could not open file mbed/TARGET_NUCL: No such file or directory Finished: 0 information, 0 warning, 0 error and 1 fatal error messages. ".\build\Nucleo_pwm2.axf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:01

Any ideas on what might be wrong?

Regards

Did you copy the error message correctly? is it looking for mbed/TARGET_NUCL ? There is missing a file.

posted by Martin Kojtal 17 Jun 2015

Yes this is exactly the error it gave

Edit:

I checked the build\ folder and there is no file with the name Nucleo_blink_led.axf, is this file needed and/or supposed to be included?

posted by Christiaan Brand 18 Jun 2015

2 Answers

9 years, 3 months ago.

The error is due to the fact that the list of .o in the "misc control" section of the linker section is too long and thus gets truncated. I don't know what to do, I tried removing extra spaces but it didn't work.

EDIT : I found the solution. Just copy/paste all the files in TOOLCHAIN_ARM_MICRO directly into the mbed directory, then edit the "misc control" section of the linker settings and change all paths to mbed/nameOfTheFile instead of the former longer path. It should shorten the list enough and compile fine (at least it worked for me)

posted by florent Ecochard 03 Aug 2015

Also if you want it to upload correctly to the board / debug your program you have to go to "project > options for target > device", select the correct board, the still in the same window but under the "debug" tab, select ST-Link debugger instead of ULINK, then under "Utilities" tab, click "Settings", "Add", select the correct choice according to your board (for my Nucleo F411RE it was "STM32F4xx 512kB Flash"), click "Add" and change the change the size of "RAM for Algorythm" to 0x0800.

Then everything should work correctly :)

Hope it prevents other newbies like me to waste many hours figuring this out, and I also hope it will be corrected by the mbed team!

posted by florent Ecochard 03 Aug 2015
9 years, 4 months ago.

Getting the same problem. Think it has something to do with the complete path length, but even after placing the project in the root directory I still get the same error as you: .\build\Nucleo_printf.axf: error: L6002U: Could not open file mbed/TARGET_NUCLEO_F401RE/TOOLCHAIN_ARM_MIC: No such file or directory

The actual path is: C:\Nucleo_printf\mbed\TARGET_NUCLEO_F401RE\TOOLCHAIN_ARM_MICRO

The error has a truncated path. Not sure how to fix it.