Showing results for 
Search instead for 
Did you mean: 

Is CubeIDE generated DMA Interrupt code necessary \ what triggers it?


I’m using CubeIDE + STM32G4 to configure DMA transfers and I’m a bit confused by the interrupt code it generates.  Configuring DMA transfers on TIM8 defaults 'DMA1 Channel1 global interrupt' to enabled and generates a DMA1_Channel1_IRQ_Handler function. The point of using DMA is to avoid using interrupt code, so I’m hoping this is unnecessary bloat. How much of this code has to exist?

I ran some tests on the how the DMA interrupt functions and I see that it triggers when TIM8 receives a reset signal via ITR9 triggered by TIM20 CH1 output compare. I’m not sure how I deduce\configure what events trigger the DMA1 global interrupt. (Ideally I won’t even have one.) Where in the reference manual could I have read to find out that resetting TIM8 like this would activate the DMA interrupt?

DMA is unaware of what triggers it. In other words, the DMA interrupts are not triggered from the peripheral which triggers DMA; they are triggered from DMA. There are three events when the single-port DMA in 'G4 interrupts: Half Complete, Transfer Complete, and Transfer Error. Read the DMA chapter in RM.

That Cube interwebs DMA and TIM and interrupt and whatever code, for whatever purpose, is Cube's thing. I don't use Cube.