Irregular adc conversions triggered / synchronized by timer
Hi there!
I'm working with a nucleo144-STM32F767zi and facing a problem with irregular ADC conversions (HAL_ADC_Start_IT) which are triggered by a eg. 50 kHz timer update event (every 20 us TIM1 fires an update event)

ADC Clock prescaler seems to be PCLK2 / 4 = 96 MHz / 4 = 24 MHz according to my clock configuration

So I expect the quickest ADC conversion rate to be 24 MHz / (12+3 cycles) = 1.6 MHz -> 0,625 us which is way below my desired timer triggered conversion of 20 us.
However my adc readings are irregular every 1 millisecond for one reading. In the image below I have triggered a output pin which I read via an oscilloscope.
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)
{
adc_val = HAL_ADC_GetValue(&hadc1);
GPIOA -> ODR ^= GPIO_PIN_3;
}
I don't do anything with the adc value yet. When I look at the signal, I have every 1 ms this longer timing of up 7-10 us longer for one reading (the conversion takes 7-10us more time). This limit my maximum frequency to 50 kHz, at 100 kHz I have missing values! If I toogle this pin without active adc, I get a perfectly regular 50 kHz oscillation triggered by timer period elapsed callback.

I have initialzed USB and huart in a non blocking mode and I'm not sending or receiving anything during adc reading. I am also not using the 1 ms systick handler in any way. So I dont understand, why I get these glitches every 1 millisecond. I am not using any delays.
Does anyone know why this may occur ? I appreciate any help here :)
Thank you in advance :)
It would also be okay to just find a way around this maybe via DMA? But my readings must be perfectly at 100 kHz or 50 kHz spacing, so I must be able to rely on the spacing between my values which is why I implemented this with single read and with the conversion complete callback
