TIM1 update does not request DMA
Hello,
I'm trying to generate a custom PWM output signal with the F103V8TxLQFP100. I took inspiration from here: Custom Signal generation using PWM and DMA - STMicroelectronics Community
The basic code looks like this:
...
uint8_t tempBuffer[10];
tempBuffer[0] = 80;
tempBuffer[1] = 70;
tempBuffer[2] = 60;
tempBuffer[3] = 50;
tempBuffer[4] = 40;
tempBuffer[5] = 30;
tempBuffer[6] = 40;
tempBuffer[7] = 50;
tempBuffer[8] = 60;
tempBuffer[9] = 0;
(void)htim1.Instance->DIER;
while (1)
{
HAL_Delay(500);
__HAL_TIM_SET_COUNTER(&htim1, 0);
HAL_TIM_PWM_Start_DMA(&htim1,TIM_CHANNEL_1,(uint32_t*)tempBuffer,10);
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
...
htim1.instance->ARR = 89;
I modified HAL_TIM_PWM_Start_DMA() to enable the TIM update DMA request:
__HAL_TIM_ENABLE_DMA(htim, TIM_DMA_UPDATE);
I did this because with the trigger on capture compare I got multiple capture compare events in one timer period, when the compare values are assending (30, 40, 50,60).
My problem now is: It does not work. The DMA never finsh (HAL_TIM_PWM_PulseFinishedCallback() never gets called when DMA request is on TIM_DMA_UPDATE only in TIM_DMA_CC1). The timer is working (interrupt on tim1 update does work).
I had the same problem on the F042G6Ux (multiple compare events in one timer period). On that chip i could simply change the DMA request form capture compare to update and everything was fine.
