cancel
Showing results for 
Search instead for 
Did you mean: 

Reset ''shadow M0AR'' DMA-controller register after incomplete DMA-transfer?

arnold_w
Senior
Posted on May 18, 2017 at 23:17

I am working with the STM32F405 microcontroller and I have a an SPI-bus across a detachable cable (please no comments about this, it works fine and it's not the point of this post) and I'm using the DMA-controller to be able to handle large bursts of data. Problem arises when the user unplugs the cable in middle of a transaction and then plugs it back in again. Since the DMA transfer was stopped halfways when the cable was unplugged, the internal pointers in the DMA-controller will be in the wrong position when cable is plugged in again and a good, complete packet is received. I found a good link on the internet, 

https://blog.frankvh.com/2011/08/18/stm32f2xx-dma-controllers/

 and using the terminology from that webpage my questions is, how can I reset the 'internal shadow M0AR-register' so that it points to the beginning of the buffer again?

#stm32f4-dma
3 REPLIES 3
Posted on May 18, 2017 at 23:27

Write the desired starting address into it.

JW

Posted on May 18, 2017 at 23:29

You mean I should write to M0AR, that is, the non-internal non-shadow register and this will reset the internal shadow

M0AR register

?
Posted on May 19, 2017 at 00:01

Yes, write to the 'visible' address register writes to both to it and to the 'invisible' one.

This is described in the RM, but they use the word 'update' which may be confusing.

JW