How to activate FIFO and BURST on DMA Memory to Timer transaction (STM32F7)
Hello,
I try to activate fifo + burst in dma transaction, without success (goal is a DSHOT driver* for drone)
My setup (stm32f767):
memory to timer TIM3 in pwm mode, writing several CCR registers in timer using DPAR+DBA+DBL (DBA set to access CCR registers, DBL set for length=2)
transaction is triggered by TIM3_UP stream
psize = msize = half word
inc peripheral = false, inc memory = true
circular = false
number of beat is 40
if I don’t use fifo, (neither burst), it works when the dma controller is not busy with other transfer, but when there is lot of spi, i²c and SDIO using DMA at the same time, I have up to 7% of malformed dshot frames : the TIM CCR registers are not updated in time due to latency on the DMA controller, and the timer use the previous CCR value to generate pulse.
I want to activate fifo (DMDIS=1) and burst in an attempt to mitigate this latency problem :
I tried this setups :
fifo theshold 4/4
mburst = 4
pburst = 4
Does not work at all : the timer is not updated, and I get FEIF (fifo error) bit set when DMA ISR is called. Most of the time the ISR is called, the fifo status is FIFO FULL.
I follow RM0410 recommendations :
beat number (40) is multiple of burst size * data size (8)
buffer memory address and DPAR address are aligned(8)
buffer memory is in a non Dcached memory area
I probably miss an obvious thing, but I am on this since few days now, so any help is welcome !
Alexandre
* https://github.com/alex31/chibios_enac_various_common/blob/fix_dma_fifo/esc_dshot.c