Skip to main content
Visitor II
November 22, 2022
Question

Timer IT stop channel, but continue with base IT possible?

  • November 22, 2022
  • 4 replies
  • 1457 views

Calling HAL_TIM_OC_Stop_IT causes HAL_TIM_Base_Start_IT to also stop, is this normal? i want to stop a channel, not the entire base timer.

How do i achieve this? re-enabling the base timer after stopping the Channel is not working.

    This topic has been closed for replies.

    4 replies

    Graduate II
    November 22, 2022

    It's all the same for HAL_TIM_OC_Stop(), HAL_TIM_OC_Stop_IT(), HAL_TIM_OC_Stop_DMA() functions.

    https://github.com/STMicroelectronics/STM32CubeL4/blob/master/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c#L858-L865

    Edited by moderation team to adhere to community guidlines.

    Graduate II
    December 3, 2022

    Actually it's even worse - just search for all instances of "__HAL_TIM_MOE_DISABLE" in that file and all of those functions are broken the same way. Therefore the affected functions can be described as:

    HAL_TIM_***_Stop***()

    Technical Moderator
    December 2, 2022

    Hi @BSarn.1​ ,

    I reported this issue to our development team for deeper analysis. Meanwhile, could you please try to use the LL drivers?

    Internal ticket number: 140440(This is an internal tracking number and is not accessible or usable by customers).

    -Amel

    BSarn.1Author
    Visitor II
    December 2, 2022

    i have solved for myself but i had to make a modification into the stm32f4xx_hal_tim.c

    on line 1011 i have made:

     /* Disable the Peripheral */
     //__HAL_TIM_DISABLE(htim); //removed manually

    then the base timer will continue as i desire.

    Visitor II
    December 5, 2022

    A dirty workaround would be to disconnect the timer signal from ita pin by changin MODE bitfield from 10b