I'm using TIM6-DAC-DMAMUX-DMA to create a periodic signal as shown in the following picture. The yellow curve is DAC output, and green curve is a toggled GPIO for debug. I catched an unexpected interrption time point which is described as followed:
Registers Setting:
DMA_S0CR: MSIZE=PSIZE=16bit, DBM=1, MINC=1, CIRC=1, DIR=M2P, TCIE=1, EN=1
DMA_S0NDTR = 8
DMA_S0M0AR points to a buffer: 0x8000, 0x6000, 0x4000, 0x2000, 0x0000, 0x2000, 0x4000, 0x6000
DMA_S0M1AR points to a buffer: 0x7000, 0x5000, 0x3000, 0x1000, 0x0000, 0x1000, 0x3000, 0x5000
When TCIF0 interruption occurs, I toggle the green GPIO to indicate transfer completed.
Trigger: TIM6 generates TRGO when EN and UPDATE.
I got an interrupt at time point 1(red arrow), Is this the time when DMA finished reading from memory? why doesn't it occur at the next trig ? (There are only 7 trigs from begining, not 8).
But, the important qestion is, how can I got the interrupt at time point 2 ?, because I think this time point is a right time to stop the DAC output when a full periodic signal has finished.
