This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ERROR L218E : how to solve it?

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. :)

Parents
  • 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 :)

Reply
  • 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 :)

Children
No data