cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging FREERTOS application on Nucleo board - step by step to watch the expressions?

VPirc.1
Associate II

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.

4 REPLIES 4
KnarfB
Principal III

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

VPirc.1
Associate II

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:

0693W00000QKks3QAD.pngI 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?

VPirc.1
Associate II

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!