Skip to main content
ConfusedContrarian
Associate III
February 6, 2020
Solved

How to set up FreeRTOS debugging using STM32CubeIDE

  • February 6, 2020
  • 3 replies
  • 6051 views

Hi, I'm trying to debug a FreeRTOS program and coming from a Keil + STM32CubeMX world, I'm having trouble setting up any of the eclipse based IDES to use the FreeRTOS thread aware debugging tools. So far, I've tried a combination of using the StateViewer, switching to J-Link, and installing the NXP plugin but nothing seems to work. The closest I've got is by following this thread here: https://community.st.com/s/question/0D50X0000BVp8RtSQJ/thread-awareness-debugging-in-freertos-stm32cubeide-110-has-a-bug-for-using-rtos-freertos-on-stlinkopenocd

but when I try to debug I'm running into the following error:

FreeRTOS: uxTopUsedPriority is not defined, consult the OpenOCD manual for a work-around

I've looked at the workaroun which seems to be based here: https://mcuoneclipse.com/2016/04/09/freertos-thread-debugging-with-eclipse-and-openocd/

https://github.com/arduino/OpenOCD/blob/master/contrib/rtos-helpers/FreeRTOS-openocd.c

but I'm not exactly sure how I implement this to into my program. I've tried to copy it into my freertos.c file but I still encounter the same error.

Is anyone please able to write a step by step process for dummies to get freeRTOS debugging working on STM32CubeIDE or System Workbench/Atollic from a STM32CubeMX workflow?

This topic has been closed for replies.

3 replies

KOkun.1048
KOkun.1048Best answer
Associate II
May 6, 2020
Brian TIDAL
ST Technical Moderator
February 9, 2021

Hi,

STM32CubeIDE version >= 1.5.0 has now the support for FreeRTOS™ thread-aware debugging.

See chapter 6 (RTOS-aware debugging) in STM32CubeIDE user guide UM2609

Rgds

BT

In order 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.
XR.1
Senior
July 11, 2023

Broken link. As per 07/11/23 this LINK works (it opens in a new tab).