cancel
Showing results for 
Search instead for 
Did you mean: 

Question about STM32 Nucleo CubeMX debugging - Undefined symbol

kufosan
Associate II
Posted on June 10, 2015 at 02:26

0690X00000603KNQAY.jpgDear

I have tested the STM32F030R8 Nucleo board using STM32CubeMX 4.8.0 and keil 5.14.

using the samples in the (STM32Cube_FW_F0_V1.2.0-sample/Projects/STM32F030R8-Nucleo/Examples/)

I tried to add both (UART\UART_TwoBoards_ComIT) and (ADC\ADC_DMA_Transfer).

but like attached images, the compiling error was happened.

about Undefined symbol, so I included the file such as

''stm32f0xx_hal_adc.h'',''stm32f0xx_hal_adc.c'' ''stm32f0xx_hal_adc_ex.h'' ''stm32f0xx_hal_adc_ex.c''

Would you help me?

#cubemx #stm32f03 #undefined-symbol
5 REPLIES 5
kufosan
Associate II
Posted on June 10, 2015 at 02:37

after included the files, the errors were also happened.

Posted on June 10, 2015 at 05:07

Yeah, I don't understand the rational of adding the .H files to the project, that's not how it's done, they should be #included, and appear as dependencies under the .C files as you punch down with the [+]

If you're getting ''Undefined Symbol'' at the linker level it because your aren't supplying body code for the C functions, in a .C file, not prototypes in a .H file.

So let's start with the exact error you were starting with and try and figure out exactly what is missing.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kufosan
Associate II
Posted on June 10, 2015 at 07:11

Thanks

but  I included the header file such as,

#include ''stm32f0xx_hal_adc.h''

#include ''stm32f0xx_hal_adc_ex.h''

and the Undefined symbol error occurred also,

So I added the related source files in project,

''stm32f0xx_hal_adc.c''

''stm32f0xx_hal_adc_ex.c''

but the error is not removed.

0690X00000603KSQAY.jpg

Would you help?

Posted on June 10, 2015 at 11:29

Ok, so a linker error

Have you looked at the HAL source files in question to see why it might not be defining the bodies of the functions you need?

Do you have HAL_ADC_MODULE_ENABLED defined in your project? Perhaps this needs to be in a CONF.H type file, or as a compiler command line define? I'm not a HAL user.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
kufosan
Associate II
Posted on June 10, 2015 at 12:45

Thanks your good comment!!!