Skip to main content
IAtam.1
Associate II
August 11, 2021
Solved

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

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.

    This topic has been closed for replies.
    TDK
    TDKBest answer
    August 11, 2021

    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""."

    2 replies

    TDK
    TDKBest answer
    August 11, 2021

    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""."
    IAtam.1
    IAtam.1Author
    Associate II
    August 13, 2021

    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.