2020-06-29 11:14 AM
I'm trying to set up DMA to DAC waveform generation on the G474 using CubeMX for setup. I have the device configured as follows:
TIM6 at 10KHz, Trigger Out on update
DAC1 OUT1, Trigger 6 Trigger Out event
DMA configured for DAC1_CH1, DMA1 Channel 5 circular mode
My code sets up with:
HAL_TIM_Base_Start_IT(&htim6);
HAL_DAC_Start_DMA(&hdac1, DAC_CHANNEL_1, (uint32_t*)dacWavetable, 512, DAC_ALIGN_12B_R);
When run, the DAC output is static and the DMA Xfer callback is never called but using the same configuration and code on the F407 produces the expected waveform.
If I configure the DAC for noise waveform generation, it updates a noise waveform at the expected 10khz, so it must be getting triggered by TIM6. I've crossreferenced the registers in debug mode to the technical manual, and they seem correct. Has anyone else been able to get DMA to work on the G474 DAC?
2021-05-27 06:58 AM
Hi SOCal,
Please study the code example provided for STM32Cube FW: \STM32Cube_FW_G4_V1.4.0\Projects\NUCLEO-G474RE\Examples\DAC\DAC_SignalsGeneration2.
This can help to find the problem in your code.
Regards
Igor