cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446RE Timer Interrupt and UART Interrupt Doesn't Work With Each Other.

IAtam.1
Associate II

I have Timer 2 interrupt and an UART 4 interrupt for reading from a GPS module. But they don't work with each other. When I disable Timer 2 interrupt UART 4 interrupt starts to work.

I did set Timer 2 interrupt preemption priority to 1 and UART 4 interrupt preemption priority to 0. And nothing changed.

If I understood it correctly it looks like Timer interrupt is so fast and distrupts the UART interrupt. But again If I understood it correctly with preemption priority settings software shouldn't call Timer interrupt when in UART interrupt because UART interrupt has a priority. What I'm doing wrong in here? Thank you for reading.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The MCU won't interrupt a higher priority interrupt in order to service a lower priority one. There has to be a bug somewhere.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

The MCU won't interrupt a higher priority interrupt in order to service a lower priority one. There has to be a bug somewhere.

If you feel a post has answered your question, please click "Accept as Solution".

You're right it turned out my problem wasn't about priority. It turned out I wasn't able to give enough current to my circuit via USB connection. When I connected a external battery it worked.