cancel
Showing results for 
Search instead for 
Did you mean: 

RTOS debug with STM32CubeIDE

mattias norlander
ST Employee

Hi Community,

Today you will provide the answers, and I will ask the questions!

Looking at the statistics gathered by our tools (assuming customer consent given), we can see the huge popularity of designing software relying on an RTOS. FreeRTOS is widely used, and we assume that the adoption Azure ThreadX will also spread quickly.

As CubeIDE tools guys, we have invested some effort in RTOS debug features. To quickly summarize the RTOS debug offer, let's make a list:

  • Window > Show > View > Other > FreeRTOS / ThreadX
    • Provides views to visualize kernel objects for the 2 RTOSes
  • Debug config > Debugger > Enable RTOS Proxy
    • Will allow the debugger to unwind and display the full call stack for ALL threads in the RTOS, not only the one currently in context!
  • For Azure ThreadX CubeIDE 1.8.0 can also conveniently export trace logs to be visualized "offline" in Microsoft TraceX tool

In our view the RTOS support is now quite decent! ;)

What is puzzling is the lack of feedback and bug reports on these tools.

We don't want to invest time in features which very few customer need or care about!

Please use this thread to share your thoughts/feedback/experience with us!

36 REPLIES 36
DGabc.1
Associate III

Hello,

I am using latest STM32Cube IDE (2.1.1) and Nucleo-64 board with STM32L476 MCU. I am trying to use the ST-LINK that is present on the board. I did update the ST-LINK firmware to the latest version available.

In my Debug Configuration, I have Enable RTOS Proxy selected, driver FreeRTOS and Port ARM_CM4F.

Debugging works, but the FreeRTOS tasks are not displayed. Only Thread #1 is displayed, regardless of which FreeRTOS task happened to be paused (breakpoint).

Also, I can see the following error from the debugger:

Update threads. Failed collecting threads.

What would cause this error?

 

Jakub_LEM
Associate II

Hello everyone,

I have a case simillar to @DGabc.1's. Upgrading CubeIDE from the version that had MX integrated inside to the latest version where we have two standalone applications made my RTOS-based project undebuggable :x At least I cannot see the actual live task state when I stop the program. It was a really nice feature. Tried everything I swear. Hope the STM team is going to solve the issue soon. 

I am not even sure what caused the problem. Trying to debug the project made with old CubeMX version did not really help. So I am guessing this is about CubeIDE... but why?

I had to check something, because one of my colleagues ran the project on his machine and it worked right away... It puzzled me but I think I found a temporary solution - I simply installed the older version of STM32CubeIDE (2.0.0). My guess is that rtosproxy driver changed. I cannot prove my thesis though that the driver is responsible. However, according to the release notes for the latest STM32Cube IDE v2.1.1 there is a new version of RTOS Proxy (v0.18.0). I think it might be it.

DeeFuse
Associate II

Have a look at my previous reply in which I describe a solution for this bug in the RTOS-Proxy.

Been there...  according to your reply:
"(...) So if you add "#define portREMOVE_STATIC_QUALIFIER" to your "FreeRTOSConfig.h" inside a USER CODE section the debugging should work with ST-Link and GDB as usual(...)"

adding the macro should fix the issue but it did not in my case :\

DeeFuse
Associate II

After Updating CubeIDE to 2.1.1 I encounter the same problem. I think RTOS-Proxy 0.18.0 is Broken.
RTOS-Proxy 0.17.0 is working fine with and without my workaround.

For the time you should not upgrade to CubeIDE 2.1.x
The issue is also tracked in the errata for the 2.1.x Release

DGabc.1
Associate III

Thank you @DeeFuse for pointing to the errata.

I did try different workarounds, mentioned here and in other posts. Nothing worked.

Going to downgrade CubeIDE.