cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Interrupt is not triggered

Posted on April 29, 2018 at 20:44

Hello Community,

I just getting started with STM32 and Hal Library. For one project i would like to collect data from an RPLidar (2000 Samples per second). In that case i want to use the DMA unit to perform the data collection. After a week of reading Datasheets and don't getting it to work i want to ask you for help. My problem is that i don't know if the DMA collects DATA and not throws any interrupt or it just not collects any data. I think my problem is elementary so i hope i just forget some init. I would be happy if someone with experience in the DMA could watch for my code and say if there is something wrong. 

Some information about the project:

I started with the UART example for the STM767ZI from the CUBEMX and tried upon that to get the DMA to work.

main.c

https://git.fh-muenster.de/ak534552/RPLidar_STM_Obstacle_Avoidance/tree/master/Projects/STM32F767ZI-Nucleo/Examples/UART/UART_Printf/Src

init

https://git.fh-muenster.de/ak534552/RPLidar_STM_Obstacle_Avoidance/tree/master/Projects/STM32F767ZI-Nucleo/Examples/UART/UART_Printf/SW4STM32/STM32F767ZI-UART/Example/User

3 REPLIES 3
Posted on April 29, 2018 at 21:49

Typically it is because the DMA isn't working, either it is not triggered, or throws an error. You could paint the buffer with a recognizable data pattern and observe if it changes, but if you don't see HT or TC interrupts it is because it is not doing sufficient transfers.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 29, 2018 at 21:55

For UART receive make sure that any pending errors have been cleared (parity, framing, noise, etc)

UART5 RX would be DMA1 Channel 4 Stream 0, initialization looks reasonable, although I'd approach this differently.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 30, 2018 at 12:28

Unfortunately i forgot to set up the IRQ_Handlers. Now i also receive the Error messages for the UART. It is the Overrun Error which was expectable also the DMA receive Data correctly.

But why is the DMA working fine when first the ERROR_Handler is called?

Ok, i think as i am receive data from the uart register the flags are automatically cleared and after that the callback is 'fired'.