STM32H7xx DMA interrupts not working on UART receive
Show older comments
Requirement:
Receive every byte of data over uart, as I need to look for \r and then process numbers before it, use interrupt driven code for better resource usage.
What I have tried:
Enable uart in cubeMX, add DMA request for uart in circular mode.
Then in simulink, I added a Hardware Interrupt Block and selected the DMA channel, which i set for uart, as interrupt source. I am checking only 'TC' event as interrupt source in hardware manager block.
Issue:
The code compiles and runs without error. But the triggered subsystem(function call) connected to Hardware Interrrupt Block never runs since my values counter never increments in the subsystem. I think that DMA is configured but it is not started properly by simulink to generate interrupts.
I have tried using Hardware interrupt block with External interrupts from button push, in that case, my interrupt driven counter increments. But when switch interrupt source to the DMA attached to uart RX, no interrupt occurs.
Question:
Has anybody any idea how can I generate interrupts from DMA block when it receives one word (4bytes) from UART and use the Hardware Interrupt block to call my triggered subsytem to process those bytes.
Thanks.
Accepted Answer
More Answers (3)
Umar
on 2 Jul 2024
0 votes
Hi Shazam,
My suggestions would be to verify that the DMA channel is properly linked to the UART and that the interrupt source is correctly selected in Simulink.Also, check the DMA settings, such as buffer size and triggering conditions, to ensure that interrupts are generated when data is received. Additionally, confirm that the Hardware Interrupt Block in Simulink is configured to respond to the correct interrupt source from the DMA channel associated with UART reception.
By carefully reviewing the DMA and interrupt configurations in Simulink, you can troubleshoot and resolve the issue of generating interrupts from the DMA block when receiving UART data for efficient interrupt-driven processing.
Hope this will help resolve your issues.
Gheorghe Lisca
on 2 Jul 2024
0 votes
How about some really technical explanations ? THis post by UMAR sheems absolutly shallow.
Of course we checked all the steps from this list. WHat does "Becarefull when DMA/int " even mean?? Be real.
I have been fighting with the same issue for a a few weeks and cannot make it work.
1 Comment
Umar
on 9 Jul 2024
Gheorghe,
Please see response from Nithin. I was trying to help. Please let us know if you have further questions.
Gheorghe Lisca
on 18 Sep 2024
Edited: Gheorghe Lisca
on 18 Sep 2024
0 votes
Hi @Nithin
Was wondering if this problem was solved with the lastest update of Simulink in M 2024 B?
We also tried Protocol deCODER, but we have no header in the UART message, so still waiting for you guys to fix the issue initially presented.
2 Comments
Nithin
on 19 Sep 2024
Hi Gheorge,
This has not been addressed in R2024b.
Gheorghe Lisca
on 19 Sep 2024
Any feedback when is realistically gonna be changed?
Categories
Find more on C2000 Microcontroller Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
