2019-12-19 10:55 AM
Whan I call HAL_TIM_PWM_Start_DMA on STM32F105RCT6, it behaves as if I called HAL_TIM_PWM_Start. I.e., it starts regular PWM, without DMA, with Pulsewidth value set in CubeMX and staying still all the time. Seems like it doesn't even look into pData array I passed to ...Start_DMA function.
PWM channel used in all tests is TIM2 CH3, on PA2 pin. Other pins or channes not tested.
Code is equivalent to examples provided with CubeMX, so is definitely NOT API misuse.
Problem persists on different F105 chips, BUT:
Same code copy-pasted and built for F103C8T6 runs fine - DMA starts and pulse width changes according to pData array passed.
Since same code misbehaves on multiple F105`s, but works on F103, F407, F072, F030 etc. (a very common copy-paste feature for me), I suppose it's an F105 silicon bug. Please consider making HAL or silicon review, and update errata page or HAL reference section regarding this API call.
2019-12-20 08:41 AM
Solution: put MX_DMA_INIT before other MX INITs, and wrap it in USER CODE BEGIN..END, to be not overwritten at next code generation. Cube mx will restore it after all inits, but it will not replay the bug anymore.