cancel
Showing results for 
Search instead for 
Did you mean: 

DAC DMA not working on STM32f429zi

Mr ZEE
Associate II

Hi

I'm just trying to run a simple DAC program using the DMA but its not working. The details are as follows:

  1. signed 16bit int lookup table with the size of 128
  2. using timer 2 trigger out event for DAC DMA
  3. DAC on OUT1 (PA4 pin) and DMA stream 5 selected on low priority

in my main function before entering while loop i do the following

  1. start the DAC by using HAL_DAC_START function
  2. start the DAC DMA by using HAL_DAC_DMA_START function
  3. start the timer 2 (HAL_TIM_BASE_START_IT function)
  4. in the timer call-back, I just restart the timer again nothing special

I have been using complete call-backs and half complete call-back as well to check whether the data has been chunk out or not but no success.

I have also tried to change the priority level of the DAC DMA stream 5 to high as well but still no success.

Any solution to this problem would be much appreciated

P.S I am using the latest versions of cube MX and IDE

2 REPLIES 2
TDK
Guru

Follow the example in CubeMX:

https://github.com/STMicroelectronics/STM32CubeF4/blob/b5abca20c9676b04f8d2885a668a9b653ee65705/Projects/STM324xG_EVAL/Examples/DAC/DAC_SignalsGeneration/Src/main.c

Don't call both HAL_DAC_Start and HAL_DAC_Start_DMA.

> HAL_DAC_DMA_START 

It's a lot better to just paste your code here so people can read/interpret it. That way you avoid issues like typos like this.

If you feel a post has answered your question, please click "Accept as Solution".
Mr ZEE
Associate II

Thanks for the reply @TDK​ . I know it was a silly move to call both HAL_DAC_START and HAL_DAC_START_DMA functions as nothing was working at that moment but it turned out the timer i was using for DMA trigger out event was set to "Timer event selection = RESET" whereas it needs to be on "UPDATE EVENT" for DAC DMA to work properly. My bad