The STM32F302x8 (as opposed to the 302xc) does not have an ADC2, and the ADC1_2_COMMON structure (defined in the CMSIS file) is therefore name ADC1_COMMON. This causes an error in adc_lld.c, at the line:
Code: Select all
ADCD1.adcc = ADC1_2_COMMON;
There are also similar errors in stm32_rcc.h, complaining about the macro RCC_AHBENR_ADC12EN.
I've verified that the structures are identical, and that the RCC macro refers to the same register bit.
I propose the following fix:
Code: Select all
#if defined(ADC1_2_COMMON)
ADCD1.adcc = ADC1_2_COMMON;
#else
ADCD1.adcc = ADC1_COMMON;
#endif
with similar constructs in stm32_rcc.h. This seems to me to leave the most room for flexibility with respect to future chip versions.
EDIT: It's likely that this is also present in the 301x8 and the 318xx -- the above fix should fix it in all versions.