4 years, 11 months ago.

Undefined symbol error when exporting from mbed to Keil µvision

Hi,

I don't know what I am doing wrong, but every program I export from the mbed compiler to µvision gives me tons of errors. The errors are always of the same kind. They are "Undefined symbol errors". I even get these on a simple blinky program. Here is what I get on the mbed blinky:

Quote:

* Using Compiler 'V5.05 update 2 (build 169)', folder: 'E:\Keil_v5\ARM\ARMCC\Bin'

Build target 'mbed NUCLEO_F401RE'

linking...

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol gpio_init_out (referred from main.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol mbed_assert_internal (referred from main.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol wait (referred from main.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_ADCEx_InjectedConvCpltCallback (referred from stm32f4xx_hal_adc.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_I2S_ErrorCallback (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_I2S_MspInit (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_I2S_RxCpltCallback (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_I2S_TxCpltCallback (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_DMAError (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_DMARxHalfCplt (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_DMATxHalfCplt (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_Receive_IT (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_Transmit_IT (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol I2S_WaitFlagStateUntilTimeout (referred from stm32f4xx_hal_i2s_ex.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_NVIC_SetPriority (referred from stm32f4xx_hal.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_NVIC_SetPriorityGrouping (referred from stm32f4xx_hal.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol HAL_SYSTICK_Config (referred from stm32f4xx_hal.o).

.\build\mbed_blinky.axf: Error: L6218E: Undefined symbol wait_ms (referred from board.o).

Not enough information to list image symbols.

Finished: 1 information, 0 warning and 18 error messages.

".\build\mbed_blinky.axf" - 18 Error(s), 0 Warning(s).

Target not created.

Build Time Elapsed: 00:00:00

1 Answer

4 years, 11 months ago.

I got beta enabled, using Nucleo_blink_led, latest mbed library. Export to uvision , build - OK in Uvision5.

Accepted Answer

No matter if I export it from the compiler or from the repository, it will not build. I get the same errors over and over again. How do I enable beta? And what exactly do I need to do to get the latest mbed library?

posted by Tijl Schepens 03 Sep 2015

Here is what my workspace looks like: http://i.imgur.com/1hFwvR7.jpg

posted by Tijl Schepens 03 Sep 2015

beta: https://developer.mbed.org/betamode/

And update : click on mbed library in your online IDE, rught button mouse, Update, should be v106

posted by Martin Kojtal 03 Sep 2015

Hi Martin and Tijl, I've just run some tests. If you use the Compiled mbed libraries then the error is recreated as you've found Tijl to Uvision v5 If you use the mbed-src libraries and export then Uvision works! Interestingly when Exporting the Nucleo F401RE it exports as a STM32F401RCx ? I would for now use the mbed-src and not the mbed when exporting Hope this helps Martin

posted by Martin Simpson 03 Sep 2015

The latest update I can get for the mbed library is v91. I am in beta mode so I don't know why it doesn't want to update to v106. I have restarted my online IDE. http://i.imgur.com/vfcthXr.jpg

posted by Tijl Schepens 03 Sep 2015

@Tijl , click on mbed there, then choose update. The screen shows the revision of the example, not mbed library.

@MartinSimpson Ah that's interesting, something wrong with the library? Although this report is probably for older version library.. Something to investigate

posted by Martin Kojtal 03 Sep 2015

Hi Martin S.,

The source library almost compiles for me. The only error that I get is:

.\build\mbed-src.axf: Error: L6218E: Undefined symbol $Super$$main (referred from retarget.o).

Any idea where this comes from?

I guess the reason the exported program does not compile is because µvision can't handle the .ar files well. And as many recources µvision needs are in here it fails to compile.

posted by Tijl Schepens 03 Sep 2015

@Martin Simpson, It was my fault, I forgot to add a main file.

@Martin Kojtal, Even after updating the mbed library to the latest build it gives me the same errors. But I am almost there getting it to work with the mbed-src library.

posted by Tijl Schepens 03 Sep 2015

I think it works with the mbed-src export. It doesn't want to link with a main program because I exceeded my code limit.

Anyway thanks very much for all of your time and help!!!

posted by Tijl Schepens 03 Sep 2015

ok no worries. You might want to try selecting 'one ELF section per function' in your project Options C/C++ under Uvision5 this will reduce your compiled file size considerably (This is unselected by default) Kind Regards

posted by Martin Simpson 03 Sep 2015

Well that did indeed reduce the code alot. I just downloaded the program in KEIL µvision into my Nucleo and it WORKS! I am so happy I can program from µvision now!!!

Again thanks soooo much for your help!!! I really appreciate it!

posted by Tijl Schepens 03 Sep 2015