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.
8 years, 7 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
8 years, 7 months ago.
I got beta enabled, using Nucleo_blink_led, latest mbed library. Export to uvision , build - OK in Uvision5.
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 03 Sep 2015beta: https://developer.mbed.org/betamode/
And update : click on mbed library in your online IDE, rught button mouse, Update, should be v106
posted by 03 Sep 2015Hi 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 03 Sep 2015The 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 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 03 Sep 2015Hi 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 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 03 Sep 2015I 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 03 Sep 2015