Skip to main content
Mr_M_from_G
Senior II
November 16, 2018
Question

How to recover from DAC - DMAUDR ?

  • November 16, 2018
  • 2 replies
  • 585 views

Hello,

I use DAC with DMA on STM32F439 (Nucleo board). Now it happens that I create a DAC trigger although all DMA data is sent, ie NDTR has already reached zero. Therefore DMAUDR gets set. When I want to start a new DAC - DMA run I get an unwanted DMA transfer that is not triggered by DAC DMA request. I tried a lot but the only ways I found to fix this is to reset DAC by using RCC_APB1RSTR_DACRST. This has the side effect of an ugly glitch on DAC output, because I use 2048 as the base level.

Is there any other way to recover from this situation?

Thanks for any help.

Martin

(sorry, I accidentally posted this also in STM32 MCU group)

    This topic has been closed for replies.

    2 replies

    waclawek.jan
    Super User
    November 18, 2018

    It should be enough to disable/reenable the DAC, i.e. toggle the DAC_CR.ENx bit.

    JW

    [EDIT] On second thought, it's not a good idea as that disables the DMA output, too; however, clearing and setting DAC_CR.DMAENx should also have the effect of clearing "spurious/outstanding" DMA request, without disabling DMA output.

    Mr_M_from_G
    Senior II
    November 22, 2018

    Hello Jan,

    thank you for your answer.

    I have not tried it but I guess, as you write in your edit, this will also cause a glitch on DAC output (??)

    Meanwhile I found another solution and that is to control end of DMA by the peripheral so I can set NDTR to 0xFFFF which is always sufficient.

    Martin