2022-07-08 05:09 AM
I am trying to do step by step debugging of my FreeRTOS application in STM32CUBEIDE, and I have a problem because every time I try to make a step in debug mode the state of the execution pointer in GUI goes into the TIM8_TRG_COM_TIM14_IRQHandler. For FreeRTOS I am using TIM14 as a Systick (initialized in CubeMX). How can I solve this debugging issue so that I can step by step debug my running thread?
Just to provide more information, I have two tasks running both with Normal priority and I can confirm by watching Live expressions and two counters, that both tasks are running in Round Robin type of scheduling. However I would like to step by step debug my application and i am not able because whenever I click next step the poitner goes into the TIM8_TRG_COM_TIM14_IRQHandler.
2022-07-08 05:29 AM
Check for __HAL_DBGMCU_FREEZE_... macros. They set flags that will stop a timer while debugging is paused. Note that there are also chip bugs for certian chips (F7?).
hth
KnarfB
2022-07-08 06:00 AM
I am not sure but I think I shouldn't freeze TIM14 even in debug mode because I have it configured for FreeRTOS like this:
I am using STM32F746ZGT on nucleo development board and after the hardware will be done I will port firmware to the STM32F732ZET6. Do you know any particular bugs that are associated with these MCUs?
2022-07-08 06:21 AM
Update: Calling the mentioned Macro __HAL_DBGMCU_FREEZE_TIM14() at the beggining of main seems to be succesfull. From what I understand calling this macro makes the TIM14 stop when the debugger stopps the execution. Macro and other simillair macros are found in /Drivers/STM32F7xx_HAL_Driver/Inc/stm32f7xx_hal.h
Many thank KnarfB!
2022-07-08 08:27 AM
Glad I could help. I referred to this bug: https://community.st.com/s/question/0D50X0000A4pIcQSQU/stm32f746-cortexm7-silicon-bug-singlestep-lands-in-interrupt-handler
hth
KnarfB