2025-02-04 07:02 AM
I am using STM32 with the following peripherals:
My setup:
When using these settings, the ADC half-complete and complete callbacks are triggered correctly, meaning ADC DMA is working. However, nothing seems to happen in the while(1) loop in main().
Could it be related to TIM7 interrupt priority, DMA behavior, or CPU being blocked?
Is the DMA transfer taking over completely, preventing execution in while(1)?
Any insights or suggestions would be greatly appreciated!
2025-02-04 07:27 AM
Hello,
May be due to the CPU load due to the interrupt timing rate and the CPU was not able to get a time slot to reach the while loop. As soon as it exits the interrupt it returns in it again. If you disable the interrupt do you reach the while(1)?
2025-02-04 07:29 AM - edited 2025-02-04 07:29 AM
30 kHz * half-complete and complete callbacks = 60k interrupts/s ?
That's alot, especially when using HAL. Try lowering the freq. generously by increasing PSC until "something happens" in the main loop. You may use the DWT cycle counter to estimate the length your code spends in the interrupts or use some logic analyzer for that.
Solved: How do you measure the execution CPU cycles for a ... - STMicroelectronics Community
hth
KnarfB