I am new to KEIL and start learning for an project. I have got the message error shown below : Error: L6218E: Undefined symbol ADC_RegularChannelConfig (referred from main_test_adc.o).
I searched about this error but I still don't know how to solve it. I am using uvision 4 and stm32f103rb processor and write a simple program using ADC. Please help me if you encounter similar problem before. I really appreciate everyone's help. :)
It shouldn't matter if you are new to Keil.
Your program wants to call a specific function, but your project doesn't contain any source file with the source code for that function. And the project doesn't contain an object file or library with a pre-compiled version of that function.
So either you need to figure out why your program wants to use that function. Or you'll have to go searching for that function.
One adds STM32F10x_StdPeriph_Lib_V3.5.0\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_adc.c (or equivalent in your setup) to the project so it has the source to the function being called.
Thanks a lot but I still have another problem. I have added adc.c and rcc.c to my project file. It has solved the error I had before. But I got this new error plus a lot of warnings : ..\src\stm32f10x_rcc.c(1451): warning: #223-D: function "assert_param" declared implicitly
.\new11_stm32Rb_new.axf: Error: L6218E: Undefined symbol assert_param (referred from stm32f10x_adc.o). I searched about it and I saw that "assert_param" is a macro function. I am not sure how and where to define this function. Or is there any other way to declare the ADC initialization ? I have used this code.
ADC1->CR2 |= ADC_CR2_ADON | ADC_CR2_CONT; //turn on adc and enable continuous mode ADC_RegularChannelConfig(ADC1,0,1,ADC_SampleTime_239Cycles5); // config to use ADC1 channel 0, first in sequence, sampling time ADC1->CR1 = ADC_CR1_EOCIE; //Enable interrupt for end of conversion NVIC_EnableIRQ(ADC1_2_IRQn); //Enable interrupt for ADC1 ADC1->CR2 |= ADC_CR2_ADON; //Turn on conversion
I will use ADC interrupt and I found this program from some web and I try to write by myself. If you see any errors, please correct them. If you have some simple ADC program for stm32f10x, please share the links, too. Thank you :)