2024-05-24 02:34 AM
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?
2024-05-26 01:55 AM
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
2024-05-26 07:52 PM
Dear @STOne-32
Thanks for your reply. Sorry, I misrepresented it. It's not HAL_PWR_DisableSleepOnExit(). It's HAL_PWR_EnableSleepOnExit.
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