cancel
Showing results for 
Search instead for 
Did you mean: 

'ADC1' undeclared and 'ADC1_COMMON' undeclared

it3
Associate

Hello,

 

I am trying to create a new STM32 baremetal project for STM32MP131Axx.

 

Errors occurred when to build the project that ADC2 is enabled by using STM32CubeMX.

'ADC1' undeclared (first use in this function); did you mean 'ADC2'? stm32mp13xx_hal_adc.c  line 2786

'ADC1_COMMON' undeclared (first use in this function); did you mean 'ADC2_COMMON'? stm32mp13xx_ll_adc.h  line 1970

 

STM31MP131Axx has only ADC2 but the FW package seems to expect the definition of ADC1 exists.

 

I avoid these errors by modifying "stm32mp131axx_ca7.h" as below since I though it is better not to change "stm32mp13xx_hal_adc.c" and "stm32mp13xx_ll_adc.h" because they are common files for STM32MP13 series.

#define ADC1                ((ADC_TypeDef *) ADC2_BASE)
#define ADC1_COMMON        ((ADC_Common_TypeDef *) ADC2_COMMON_BASE)
#define ADC2                ((ADC_TypeDef *) ADC2_BASE)
#define ADC2_COMMON        ((ADC_Common_TypeDef *) ADC2_COMMON_BASE)

 

I would be appreciated if you could explain the better way to avoid these errors.

 

Best regards.

1 REPLY 1
Olivier GALLIEN
ST Employee

Hi @it3 ,

This is known issue. 

Will be fixed in next release plan for November. 

In the meantime, find the patch attached for proper correction. 

Olivier 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.