cancel
Showing results for 
Search instead for 
Did you mean: 

DMA RX interrupt sometimes not firing?

SKarl.3
Associate II

I have an  STM32L452 part in a system with multiple DMA and interrupt operations going on.

The main problem I'm having right now is _sometimes_ I don't get the interrupt for DMA RX on UART4. Sometimes I do, sometimes I don't.

I have been adjusting the NVIC priorities and have set "UART4 Global Interrupt", and "DMA2 Channel 2 Global Interrupt" (the DMA for UART4) at the highest priority (0), and given that DMA the highest priority among the other DMAs

 

I have a strong feeling that the issue is related to interrupt preemption, and that the UART 4 interrupts not being reset correctly. However, the issue persists even when when I give UART 4 max priority over everything.

 

The code is to complex to post, but I'm hoping that someone can throw out some ideas for me to check out?

Thank you!

4 REPLIES 4
BarryWhit
Lead II

Does the problem go away if you disable other interrupt sources other than what's necessary for the channel you're having issues with?

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.

Interesting... just as an experiment i disabled the other interrupts and DMAs and the issue is still happening. Maybe its not interrupt related? I've implemented the HAL_UART_ErrorCallback(), and HAL_DMA_ErrorCallback() functions to check for DMA and UART errors, but they never get called.

I do see the data coming back into the board as expected with a scope.. so its coming.. just sometimes not getting detected for some reason.Reply

TDK
Guru

> The code is to complex to post, but I'm hoping that someone can throw out some ideas for me to check out?

Probably a bug in the code as opposed to a bug in silicon.

Missing volatile, bad logic, race condition, could be any number of things.

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

Create a new project with simplest code you can to replicate the functionality. If it works, you need to identify the difference between the two. If it doesn't work, you're doing something wrong, and you can ask a more detailed question here with specific code examples. 

- If someone's post helped resolve your issue, please thank them by clicking "Accept as Solution".
- Please post an update with details once you've solved your issue. Your experience may help others.