2023-12-13 06:25 AM
The example project does not provide information on ADC4 register configurations, ADC4 seems to be different then prior peripherals (e.g. compared to L4).
...\NUCLEO-U575ZI-Q\Examples_LL\ADC\ADC_SingleConversion_TriggerSW_IT_Init
STM32CubeMX configuration tool is close, but does not generated completely working examples (not for me at least).
Merging the two together, I created the attached example (crude but functional).
change these two #define's in main.h to switch ADC peripheral ADC1(2) or ADC4
#define MY_ADC_TYPEDEF ADC1 //ADC1 or ADC4
#define MY_ADC_IRQHandler ADC1_IRQHandler //ADC1_IRQHandler or ADC4_IRQHandler
enjoy, hope this helps someone get started with the ADC4 peripheral on the STM32U5
note: the post only allowed three files
stm32u5xx_it.h
requires this addition, based on the #define in main.h
/* USER CODE BEGIN EFP */
void MY_ADC_IRQHandler(void);