I'm using a stm32f10x microcontroller and I'm trying to program its DMA module for normal mode transfers.

The first transfer works perfectly, but after it's over, I try to change the source, destination, size, or any other of the other configuration parameters, one of two things happen:

  • Either the flag remains high the entire time and no other transfers occur;
  • Or (happens when I clear the flag), it doesn't matter how many times I write the DMA_Cmd(DMA_Channel1, ENABLE), it doesn't do anything, even though the transfer complete flag is reset;

Any ideas what could be wrong?

PS: I'm using the device's library

  • 1
    \$\begingroup\$ Have you tried disabling the DMA first? Rally hard to answer without seeing the relevant code. \$\endgroup\$
    – Eugene Sh.
    Dec 15, 2014 at 15:24
  • \$\begingroup\$ @EugeneSh.Found my error. I didn't take into consideration that the DMA moodule in normal mode, after a transfer, sets de transfer size to zero. Took care of that and now everything works alright. As soon as I can I'll answer my own question for everybody else to see \$\endgroup\$
    – morcillo
    Dec 15, 2014 at 18:39
  • \$\begingroup\$ @EugeneSh. Sorry for not putting the code, completely forgot about it \$\endgroup\$
    – morcillo
    Dec 15, 2014 at 18:39

1 Answer 1


Well, there are a couple of solutions for this, basically you need to reconfigure the module and the DMA and make sure that the necessary bits are set, another way is to just DeInit the hardware module (SPI, UART, whatever), DeInit the DMA and finally configure everything like it was the first time


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.