2019-10-29 10:15 AM
I have configured a DAC to use DMA in single mode. I have created HAL_DAC_ConvCpltCallbackCh1(). In this function, I reenable the DMA process using HAL_DAC_Start_DMA(...), which appears to be really slow. How can I make this faster. I don't want to reinitialize the entire DMA but rather just retrigger it.
2019-10-29 10:35 AM
You could review the RM for the STM32 in question to understand the register level implementation. Likely have to disable the channel to change address/length, and then re-enable/engage.
Most use cases use a circular buffer, serviced a HT/TC DMA interrupts, to create a ping-pong buffer, and where you fill the inactive half.
2019-10-29 12:45 PM
You did not tell us the STM32 model you are using. And you don't have a normal name/nick, please change it.
> HAL_DAC_Start_DMA(...), which appears to be really slow.
How do you know it's slow?
> You could review the RM for the STM32 in question to understand the register level implementation.
Or, you just take the function in question, copy it into your project, and remove everything which is redundant and may cause the "slowness", e.g. unused branches, writes to variables which are already set to the same value, etc.. There may be a chain of calls so you may want to do them all. There may be inherent obstacles, though, like waiting for some genuine event to happen, e.g. trigger of the last holding-to-output register transfer. Also reconsider your compiler optimization options.
Of course, it never hurts to know what are you doing, i.e. I still recommend reading the given chapters in the RM, and dump Cube.
JW