2023-12-26 04:14 PM
Hi
I have a problem with the right priority setting, although I am not sure.
The genelranie timer worked for me and refreshed the LCD screen every 375ms, but when I added interrupts for the ADC (needs to handle a potentiometer) then suddenly the TIM6 stopped working. Debugging the code I noticed that after going through this instruction:
HAL_TIM_Base_Start_IT(&htim6);
terminates the program, it just doesn't continue. This can be seen in the posted screenshots.
Do you have any ideas? I also tried using DMA and unfortunately the effect was the same :(
Solved! Go to Solution.
2023-12-26 08:40 PM
It's stuck in the ADC handler, so either the ADC is triggering too often (most likely) or there is some flag not being cleared by the handler (less likely).
Reduce your ADC trigger frequency to, say, max 10 kHz.
2023-12-26 04:40 PM - edited 2023-12-26 04:40 PM
Hit pause, see where execution is at. Probably you are swamped with interrupt requests, or your interrupt handler is stalling. Could be due to ADC being triggered repeatedly.
2023-12-26 04:54 PM - edited 2023-12-26 04:59 PM
It stopped here. But it doesn't tell me anything. How do I fix it?
EDIT:
The earlier screen was after small modifications
Below is consistent with the information contained in the start of the thread
2023-12-26 08:40 PM
It's stuck in the ADC handler, so either the ADC is triggering too often (most likely) or there is some flag not being cleared by the handler (less likely).
Reduce your ADC trigger frequency to, say, max 10 kHz.
2023-12-27 04:50 AM
Ok it worked after setting the Timer to 10kHz - the code moved on
BUT
now the ADC doesn't work, did I set everything right?
When doing the ADC I suggested this article: https://controllerstech.com/stm32-adc-single-channel/
2023-12-27 03:29 PM
Could someone please check?