2024-07-03 09:27 PM
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.
Solved! Go to Solution.
2024-07-05 02:36 AM
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
2024-07-05 02:36 AM
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