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

why when i add my adc source file it has error Undefined symbol ADC_CommonInit

when i added my ADC source to my project for stm32F407VG in keilv5. ADC.c ADC.h

i used this tutorial stm32f4-discovery.net/.../

here in adc.c it was defined functions

void ADC_CommonInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct)
{ uint32_t tmpreg1 = 0; /* Check the parameters */ assert_param(IS_ADC_MODE(ADC_CommonInitStruct->ADC_Mode)); assert_param(IS_ADC_PRESCALER(ADC_CommonInitStruct->ADC_Prescaler)); assert_param(IS_ADC_DMA_ACCESS_MODE(ADC_CommonInitStruct->ADC_DMAAccessMode)); assert_param(IS_ADC_SAMPLING_DELAY(ADC_CommonInitStruct->ADC_TwoSamplingDelay)); /*---------------------------- ADC CCR Configuration -----------------*/ /* Get the ADC CCR value */ tmpreg1 = ADC->CCR;

/* Clear MULTI, DELAY, DMA and ADCPRE bits */ tmpreg1 &= CR_CLEAR_MASK;

/* Configure ADCx: Multi mode, Delay between two sampling time, ADC prescaler, and DMA access mode for multimode */ /* Set MULTI bits according to ADC_Mode value */ /* Set ADCPRE bits according to ADC_Prescaler value */ /* Set DMA bits according to ADC_DMAAccessMode value */ /* Set DELAY bits according to ADC_TwoSamplingDelay value */ tmpreg1 |= (uint32_t)(ADC_CommonInitStruct->ADC_Mode | ADC_CommonInitStruct->ADC_Prescaler | ADC_CommonInitStruct->ADC_DMAAccessMode | ADC_CommonInitStruct->ADC_TwoSamplingDelay);

/* Write to ADC CCR */ ADC->CCR = tmpreg1;
}

in header file adc.h it defined
void ADC_CommonInit(ADC_CommonInitTypeDef* ADC_CommonInitStruct);

it is done too for ADC_Init,ADC_RegularChannelConfig now when i compile it in keil v5 it returns errors

.\OBJ\STM324xG.axf: Error: L6218E: Undefined symbol ADC_CommonInit (referred from tm_stm32f4_adc.o). .\OBJ\STM324xG.axf: Error: L6218E: Undefined symbol ADC_Init (referred from tm_stm32f4_adc.o). .\OBJ\STM324xG.axf: Error: L6218E: Undefined symbol ADC_RegularChannelConfig (referred from tm_stm32f4_adc.o).

how can i solve my problem???