STM32H7xx DMA interrupts not working on UART receive
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (3)
Umar
il 2 Lug 2024
0 voti
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
il 2 Lug 2024
0 voti
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 Commento
Umar
il 9 Lug 2024
Gheorghe,
Please see response from Nithin. I was trying to help. Please let us know if you have further questions.
Gheorghe Lisca
il 18 Set 2024
Modificato: Gheorghe Lisca
il 18 Set 2024
0 voti
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 Commenti
Nithin
il 19 Set 2024
Hi Gheorge,
This has not been addressed in R2024b.
Gheorghe Lisca
il 19 Set 2024
Any feedback when is realistically gonna be changed?
Categorie
Scopri di più su C2000 Microcontroller Blockset in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

