cancel
Showing results for 
Search instead for 
Did you mean: 

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

BSarn.1
Associate

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.

5 REPLIES 5
Piranha
Chief II

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.

Amel NASRI
ST Employee

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

BSarn.1
Associate

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.

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***()

S.Ma
Principal

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