DAC DMA not working on STM32f429zi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-03 8:56 AM
Hi
I'm just trying to run a simple DAC program using the DMA but its not working. The details are as follows:
- signed 16bit int lookup table with the size of 128
- using timer 2 trigger out event for DAC DMA
- 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
- start the DAC by using HAL_DAC_START function
- start the DAC DMA by using HAL_DAC_DMA_START function
- start the timer 2 (HAL_TIM_BASE_START_IT function)
- 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
- Labels:
-
DAC
-
DMA
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-03 9:32 AM
Follow the example in CubeMX:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-04 2:11 AM
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
