DMA and HWDEF.DAT

I’m hoping somebody can help me understand something about DMA ports. I’m playing with some LEDs on a Matek H743-Wlite.

I have LEDs working from a script the LED pin, PWM13. No problem

I move the LEDs to PWM12 and I get an error “No DMA on 11 and 12” (or something like that). No LEDs.

I move the LEDs to PWM10 and they work from the script again. Good.

The HWDEF says:

# Motors
PB0  TIM3_CH3 TIM3  PWM(1)  GPIO(50) BIDIR
PB1  TIM3_CH4 TIM3  PWM(2)  GPIO(51)
PA0  TIM2_CH1 TIM2  PWM(3)  GPIO(52) BIDIR
PA1  TIM2_CH2 TIM2  PWM(4)  GPIO(53)
PA2  TIM5_CH3 TIM5  PWM(5)  GPIO(54) BIDIR
PA3  TIM5_CH4 TIM5  PWM(6)  GPIO(55)
PD12 TIM4_CH1 TIM4  PWM(7)  GPIO(56) BIDIR
PD13 TIM4_CH2 TIM4  PWM(8)  GPIO(57)

# Disable DMA on PWM9-12 so that the LEDs get a channel
PD14 TIM4_CH3 TIM4 PWM(9) GPIO(58) NODMA
PD15 TIM4_CH4 TIM4 PWM(10) GPIO(59) NODMA
PE5  TIM15_CH1 TIM15 PWM(11) GPIO(60) NODMA
PE6  TIM15_CH2 TIM15 PWM(12) GPIO(61) NODMA

DMA_PRIORITY SPI1* SPI4*
DMA_NOSHARE SPI1* SPI4* TIM3* TIM2* TIM5* TIM4*

My question is: If I was to read the HWDEF I would assume that my LED script shouldn’t work on PWM10, but it does. Am I missing something or is there more to it?

The HWDEF is wrong. The LEDs need TIM4_UP to operate which applies to the whole timer - since this is already configured for PWM7 and 8 it will also work on 9 and 10 - so the NODMA on these channels could be removed.

1 Like