2023-12-13 12:23 PM
I have a new (to me) STM32H563 Nucleo board and I just need a bit of help with the new style DMA system. I haven't been able to find any reasonable examples for the H5 or U5 that have the new DMA controller, so I'm asking for help here.
The end goal is to periodically pull data off of an external SPI mounted ADC using DMA, triggered by a timer.
I have timer2 set up to generate a 1kHz output pulse. I wish to route TRGO from TIM2 to trigger a DMA transfer on an edge pushing, say, 3 bytes into SPI2 transmit data register to force the data out of the ADC.
So far I have been able to get the timer going (actually I am going to use 2 synchronized timers, but I've stripped the sample project to just use TIM2). I have the SPI set up the way that I need, with hardware NSS, and a 20-bit transfer, and I can transmit using HAL_SPI_Transmit() and the appropriate wave form shows up on my oscilloscope. I've set up the DMA linked list as much as I've been able to figure it out and linked the list to the DMA (I think).
So the final part, that I haven't been able to get working, is having the DMA trigger on TIM2 TRGO to start the SPI.
Can someone take a look at the attached project (CubeMXIDE latest) to see what I'm missing.
Thanks in advance,
Andrei (From The Great White North)
Solved! Go to Solution.
2023-12-14 04:08 PM
Okay, got it. I needed to enable the SPI global interrupt to get the DMA to start working.
That is all. Case closed.
Andrei
2023-12-14 04:08 PM
Okay, got it. I needed to enable the SPI global interrupt to get the DMA to start working.
That is all. Case closed.
Andrei