cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4x DMA NDTR, need your help

vbesson
Associate III

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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".
vbesson
Associate III

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