cancel
Showing results for 
Search instead for 
Did you mean: 

What is the cause a DMA transfer error?

LHarm.1
Associate III

I am trying to read from an external SPI ADC at a 1MHz rate using a timer and 4 dma channels.

I setup TIM 3 to run at 16 MHz and rollover at a count of 24.

CC1 pulse is 1, cc2 pulse is 2 cc3 pulse is 22.

CC1 drives DMA1 stream4 which is setup to transfer from memory to a GPIO BSSR register , cs assert

CC2 drives DMA1 stream 5 which writes a 16bit value to the SPI Tx register, starting a transfer

CC3 drives DMA1 stream 7 which is setup to transfer from memory to a GPIO BSSR register, cs de-assert

The SPI transfer works as expected, but bothe the GPIO DMAs fail with a transfer error and the NDTR register decremented by 1 from the programmed value.

How can I debug the DMA transfer error. I have tried both 16 and 32 bit transfers as well as just running a single channel. No luck.

Any help will be apprreciated.

1 ACCEPTED SOLUTION

Accepted Solutions

You have to use DMA2 to transfer from/to GPIO.

http://efton.sk/STM32/gotcha/g30.html

JW

View solution in original post

4 REPLIES 4
TDK
Guru

Please put your chip number in your post.

If you feel a post has answered your question, please click "Accept as Solution".
LHarm.1
Associate III

stm32f411RETx. I am using a Nucleo-f411RE board.

You have to use DMA2 to transfer from/to GPIO.

http://efton.sk/STM32/gotcha/g30.html

JW

Thank you.