FreeRTOS Task Debugging - Same Backtrace for all Threads

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FreeRTOS Task Debugging - Same Backtrace for all Threads

1,435 Views
lemk34
Contributor II

Hi,

I'm debugging a FreeRTOS sample project on i.MX1024EVK using MCUXpresso version 11.7.1. Using JLink SWD, the 'Select RTOS plugin' is set to 'GDBServer/RTOSPlugin_FreeRTOS'. Optimization is set to none (-O0). When debugger is stopped, the 'Debug' view in MCUXpresso is populated with the correct number of tasks, but they all have the same backtrace. This seems like it would be a frequently reported issue, since I have a fairly default setup, using the EVK with a sample project, but I can't find a similar reported issue anywhere. The GDB command line in 'Debugger Console' reports the same results. This issue is observed with multiple sample and custom projects.

freertos_task_bt_issue.png

Any help appreciated.

lemk

Tags (1)
0 Kudos
Reply
5 Replies

1,386 Views
lemk34
Contributor II

Hi Edwin,

Thanks for your reply. I'm using JLink, not LinkServer. The all-stop/non-stop option is not available from what I can tell. Per the 'IDE FreeRTOS Debug Guide', the only configuration I've changed in the 'JLink Debugger' configuration is selecting 'GDBServer/RTOSPlugin_FreeRTOS' for 'Select RTOS Plugin'

Thanks,
lemk

0 Kudos
Reply

1,367 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @lemk34,

I'm not able to reproduce this issue. As you can see on the following screenshot, I am able to see the proper backtrace for each one of the tasks from the hello_world_freertos example:

EdwinHz_0-1709669610419.png

It is worth noting that I am using an RT1020EVK with the onboard debugger, but this goes to show that there is no limitation about the backtraces not displaying properly. I am also using MCUXpresso IDE version 11.9.0. Please try with the newest version of the IDE, as bugfixes and improvements are constantly being applied to newer versions of our IDE.

BR,
Edwin.

0 Kudos
Reply

1,362 Views
lemk34
Contributor II

Hi Edwin,

Because of your last email, I switched to the onboard debugger and was able to view each task's backtrace successfully. Unfortunately that isn't an option for our custom board. But I shifted focus to the  JLink RTOS plugin, and upgraded the JLink software and am now successful. A couple of recent comments in the release notes might have resolved the issue (RTOSPlugin for FreeRTOS did not report correct task registers. Fixed.).  ¯\_(ツ)_/¯

Thanks for your responses.

lemk

 

0 Kudos
Reply

1,359 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi again @lemk34,

I'm glad to hear that you were able to solve this problem! Interesting that the issue was present because of the JLink drivers. Anyhow, thanks for reporting this, as I am sure it can prove useful for other clients in the future that might get similar issues with the backtrace on Jlink RTOS Plugin.

Have a nice day. c:
Edwin.

0 Kudos
Reply

1,393 Views
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @lemk34,

Quick question. Are you certain you are debugging on All-Stop mode (rather than the default Non-Stop mode)?

EdwinHz_0-1709583445062.png

This is one of the steps needed to do thread-aware debugging for FreeRTOS applications, for example. I got this from the MCUXpresso IDE FreeRTOS Debug Guide, which if you haven't read, I highly recommend you do so. You can find this guide on your MCUXpresso IDE installation path, by default it should look like this: <C:\nxp\MCUXpressoIDE_11.9.0_2144>.

BR,
Edwin.

0 Kudos
Reply