Skip to main content
Senior
July 17, 2024
Solved

STM32F4x DMA NDTR, need your help

  • July 17, 2024
  • 1 reply
  • 994 views

Hello, 

I have a SPI TX DMA, 

and I need to do the following

  • Step 1:start the TX DMA ,
  • Step 2:stop the DMA,
  • Step 3: store the NDTR register,
  • Step 4: modify the size of the DMA SPI
  • Step 5: restart the DMA with the new size
  • Step 6: and restore the position of the NDTR register to continue (restart) at the same position as previously

I guess the last step (6) is not possible ? right ? or is there a way to change the current position

I tried to change it using the __HAL_SET_COUNTER but it is not working

Do I miss something ? 

Vincent

 

Best answer by TDK

You cannot resume a DMA transfer after changing the size. It always starts at the beginning of the buffer with NDTR at the max/starting value.

1 reply

TDK
TDKBest answer
July 17, 2024

You cannot resume a DMA transfer after changing the size. It always starts at the beginning of the buffer with NDTR at the max/starting value.

"If you feel a post has answered your question, please click ""Accept as Solution""."
vbessonAuthor
Senior
July 17, 2024

This is what I thought as well... 

the only way to do it is to shift the memcpy of the new buffer in 2 parts to simulate the resume of the position.

thanks 

Vincent