cancel
Showing results for 
Search instead for 
Did you mean: 

why STM32F303 stop at HAL_TIM_Base_Start_IT(Help)

Zuo
Associate

I found a issue.

if the code is

HAL_PWR_DisableSleepOnExit();

HAL_TIM_Base_Start_IT(&htim2);

 

it will stop at "if (IS_TIM_SLAVE_INSTANCE(htim->Instance))", but i didnt set break point at here.

if i change code:

HAL_TIM_Base_Start_IT(&htim2);

HAL_PWR_DisableSleepOnExit();

it will run success

Does anyone know anything about this?

2 REPLIES 2
STOne-32
ST Employee

Dear @Zuo ,

Welcome in our Community and thank you for the contribution. Is that possible to know the compiler used and also the Optimization level that generates this issue . If you can share the generated assembly to understand how the CPU sleep is entered ? It seems a scheduling timing issue and best to ensure that that disabling SleepOnExit is already propagated to the core register .

Hope it helps .

STOne-32

Dear @STOne-32 

 

Thanks for your reply. Sorry, I misrepresented it. It's not HAL_PWR_DisableSleepOnExit(). It's HAL_PWR_EnableSleepOnExit.

Zuo_0-1716777668661.png

It will stop at "if (IS_TIM_SLAVE_INSTANCE(htim->Instance))".

I also check the assembly language and register .It seems not this issue.

The optimization level is -O0. It seems not this issue too.

I put whole code at here https://drive.google.com/file/d/1C0Okxb4L-GLFftIXyY93LVBHNR7QFbBk/view?usp=sharing