2020-02-12 03:23 AM
Hi,
I'm trying to get DMA2 requests working, using TIM and HAL. Iam using TIM5_CH2 and iam not sure which DMA2 stream should be used here (i use stream1). Creating PWM signal isn't a problem, but i want to change duty cycles (very common problem) by delivering a buffer of different pulses.
HAL_TIM_PWM_Start_DMA(&htim5, TIM_CHANNEL_2,(uint32_t*)buffer, 2) does not give the expected results.
According to the ref (p.1187 and 1227) there should probably be used multiplexing via DMAMUX, but i don't know how to use and how to interpret the table.
Maybe it is something like:
hdma_tim5_ch2.Instance = DMA2_Stream0;
hdma_tim5_ch2.DMAmuxChannel = DMAMUX1_Channel6;
in the TIM-DMA init, because DMAMUX has 16 channels with 8 streams each.
Thank you in advance!
2020-02-13 12:02 AM
Hello,
Did you try generating a dummy project using CubeMx and check the generated code.