2022-12-21 12:43 AM
I'm using an STM32F429. I'm doing a motor control application.
I enable a lot of timers at startup in my application.
But during runtime when the application receives a command it enables a timer capture through DMA on TIM8. This is when there is a small pause when it calls HAL_TIM_IC_Start_DMA(). This disturbs other interrupts that seem to pause temporarilly.
These are my timers I enable at startup:
// Start timers
HAL_TIM_Base_Start(&htim1);
HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_1);
HAL_TIM_IC_Start_IT(&htim2, TIM_CHANNEL_2);
HAL_TIM_PWM_Start(&htim3, TIM_CHANNEL_1);
HAL_TIM_IC_Start_DMA(&htim5, TIM_CHANNEL_4, countCapture, ARRAY_SIZE(countCapture));
HAL_TIM_IC_Start_IT(&htim5, TIM_CHANNEL_1);
HAL_TIM_Base_Start_IT(&htim6);
My call to HAL_TIM_IC_Start_DMA() during runtime. This is when other interrupts are disturbed.
HAL_TIM_IC_Start_DMA(&htim8, TIM_CHANNEL_1, (uint32_t *)countCaptureWholeTurn, ARRAY_SIZE(countCaptureWholeTurn));
Why does it pause other interrupts during this call?
2022-12-21 12:55 AM
Have you initialized TIM8 correctly?
Maybe it immediately jumps into a TIM8 ISR with higher priority and thus blocks other interrupts.
2022-12-21 12:57 AM
I have confirmed that the TIM8 interrupt only happens once after it has captured all values by DMA to my array.