ADC reads on STM32F030 not restarting reliably - weird timing issue?
- 12 replies
- 2354 views
NOTE: I have built a test project in STM32CubeIDE to demonstrate this issue (see attached). (Change "POSITION" from 1 to 2 to demonstrate the bug - see line 164 in main.c).
I am reading multiple ADC channels on a custom board with a STM32F030RCT6TR. I have 8 channels defined in my Cube project and am using DMA and the callback function to know when it's finished.
At startup, I call HAL_ADC_Start_DMA() to get things going. Then, in my main loop I look for completion by examining a variable set by the callback function. If the readings are complete, I dump their values out a serial port and then start another conversion with HAL_ADC_Start_DMA().
The weirdness is that if I run these reads as fast as possible, they work OK. However, if I only check them every 500 milliseconds, I see only one read - and the subsequent read never completes.
Any thoughts?
