cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H5 timer triggered SPI won't trigger

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)

1 ACCEPTED SOLUTION

Accepted Solutions

Okay, got it. I needed to enable the SPI global interrupt to get the DMA to start working.

That is all. Case closed.

 

Andrei

View solution in original post

1 REPLY 1

Okay, got it. I needed to enable the SPI global interrupt to get the DMA to start working.

That is all. Case closed.

 

Andrei