2015-12-24 06:47 PM
Hi,
I got a keil C project and try to add ADC peripheral into this peoject.I do believe this original project was made from STM Cube and did not enable ADC function in the begining.When I just add ADC init function into main.c, error L6218E appears.linking....\Objects\charger_stm32f0.axf: Error: L6218E: Undefined symbol HAL_ADC_ConfigChannel (referred from main.o)..\Objects\charger_stm32f0.axf: Error: L6218E: Undefined symbol HAL_ADC_Init (referred from main.o).Not enough information to list image symbols.Finished: 1 information, 0 warning and 2 error messages.I do include ''stm32f0xx_hal_adc.h'' and ''stm32f0xx_hal_adc_ex.h'' in my project, but what i wonder about is the file version, ''stm32f0xx_hal_adc.h'' is V1.2.0 while ''stm32f0xx_hal_adc.c'' is V1.3.0. This difference could make this compiling error?I develop this project under MDK-ARM V5.15 #!stm32-!cubemx #l6218e2015-12-24 07:22 PM
You'd need to also ensure HAL_ADC_MODULE_ENABLED is defined.
2015-12-24 08:04 PM
Hi Clive,
thanks for your replyWhen I enable 'HAL_ADC_MODULE_ENABLED' and also update adc c file and h file to same verison (v1.3.0), some undefined errors show, such as error: #20: identifier ''ADC_CCR_ALL'' is undefinederror: #20: identifier ''ADC_CHANNEL_TEMPSENSOR'' is undefinedSTM32F0xx_HAL_Driver\Src\stm32f0xx_hal_adc_ex.c(238): error: #20: identifier ''HAL_ADC_STATE_ERROR'' is undefined........ I could not find these parameters in 'stm32f0xx_hal_adc.h' file but only in 'stm32f0xx_hal_adc.c' or 'stm32f0xx_hal_adc_ex.c'.I may need to figure out what version of HAL driver i used.2015-12-25 07:18 AM
Yeah, I don't understand, it would generally take MORE effort to get a project to use two mismatched versions of the library than one.
Suggest you use a current, singular, library and make sure your project has the right include paths and pulls source files from the same tree. Look at the Include Paths settings, remove all extraneous paths which might be pulling random Keil supplied includes over the ones you want, and modify the search order to prefer the library you are using.