Post navigation

NXP FTF Hands-On with FreeRTOS Task Aware Debugger

I mentioned the hands-on sessions on FreeRTOS I do this week at NXP FTF Tech Forum in Austin in my previous post. What we are using in the session is an Eclipse plugin in Kinetis Design Studio showing all kinds of FreeRTOS information:

NXP FreeRTOS Plugin in Kinetis Design Studio

That Task Aware Debugger (TAD) plugin is not publicly released yet. The plugin should work with any standard Eclipse and GDB, and I have been running on the Eclipse Luna based NXP Kinetis Design Studio V3.2.0. with the NXP Kinetis SDK v2.0 on a FRDM-K22F board (it works as well fine on a FRDM-KL46Z board).

Installation is through the normal Eclipse ‘Install New Software’ process. The plugin adds a FreeRTOS menu from where I can open different views:

FreeRTOS Menu

The views are accessible through the normal Window > Show Views command:

NXP FreeRTOS Views

The Timer List lists all the FreeRTOS software timers with the data and status:

FreeRTOS Timer List

The Task List shows all the task in the system with their status. A very useful thing is to see the colored status of the task stack usage:

FreeRTOS Task List

The Queue List shows all the queues and semaphore/mutex (because FreeRTOS implements them as ‘queues with no data’), plus the data behind the queues:

FreeRTOS Queue List

The Heap Usage lists the FreeRTOS heap status with all the memory blocks allocated in it:

FreeRTOS Heap Usage

Each of the views has a button to export the data in into a CSV format file:

Save to File

The plugin works in ‘GDB stop mode’: I have to halt/suspend the target board with the debugger, then the plugin reads all the RTOS data from the device through the GDB commands.

The plugin should be available soon, and if you are NXP FTF this week (class FTF-DES-N2048 is today), you can get your hands on it. Together with the Eclipse GDB thread awareness (see “FreeRTOS Thread Debugging with Segger GDB in Eclipse“) this is a big step forward to me for anyone doing FreeRTOS development :-).

Hello Eric, you have no idea how your blog has always been so helpful.
So I got stuck with an issue, hoping to get a reply on it from you. So earlier I used KL25z to connect to cloud using TCP/IP using a GSM module. But now I have the requirement of sending it via HTTPS. Is it possible using KL25 board.if so then how? Please help me, will be glad to get a reply from you.
Thanks

Hi Sabbi,
if you were using TCP/iP with the KL25Z, you should be able to use HTTP. However, to use HTTPS it requires more ressources/RAM for the secure connection. It all depends what your GSM modem is able to provide you on that level. And what level of RAM buffers you need. So I cannot give a definitive answer: it all depends on your legroom you have and need on the device.
Erich

I’m still left with a couple of questions about the plug in, but seeing that your FreeRTOS component provides the info I need through the shell, I’ll just make the switch to your component rather than the SDK1.3 freertos component.

I switched over to your FreeRTOS componenet, I’m already enjoying some of the Debugging tools that come with it.

With that said I’ve ran into an issue that wasn’t happening when I was using the KSDK’s freertos component. I was hoping you could give me a little insight.

My program keeps getting stuck in the IDLE task after a OSA_TimeDelay or OSA_MutexLock call.

At first I thought it may be a priority issue because all the tasks have a priority of 0 ( tskIDLE_PRIORITY ). But I do have “Idle Should Yield” enabled, plus if I raise the priorities of the other tasks the issue isn’t fixed.

When I open up Task List, it shows that all the tasks are BLOCKED and IDLE is running.

I know when I call OSA_TimeDelay or OSA_MutexLock, the task becomes blocked, I’m just not sure why its not becoming unblocked.

Anything that may point me in the right direction, is much appreciated.

I’m using this tool for my stm32 projetc with gnu arm eclipse.
everything seems work good but in the Task List window, the list of runtime show nothing 🙂
do you know how should I do please..
I’m not use timer in my project.Is this problem?
hope your replay,
forget my terrible English 🙂
Thank you.

Hi Aaron,
for the performance analysis and runtime counters, you need to have some kind of timer for the measurement, either use the Systick (as possible with my port for NXP Kinetis) or your own timer (should be 10x the freqency of systick).
Additionally, you need to turn on configUSE_TRACE_FACILITY and config_GENERATE_RUNTIME_STATS.
I hope this helps,
Erich

Hi Erich,
my reply disappered~~~~
so I’m rewrite this [cry]
I have done this (use STM32 TIM5 with 10x of the freqency of freertos tick freq), and I can print the runtime state use uxTaskGetSystemState with semihosting~

Hi Aaron,
I cleaned up the number of comments, sorry about this, but sometimes WordPress is picky about preventing spam (usually a good thing).

As for diagnostics: inside your workspace folder there is a debug log folder named FreeRTOS_TAD_logs which has log text files. It seems you already have found them.
What I see is
“com.nxp.freertos.gdb.tad.controller.tasklist.TaskFactory” at 109. line when calling method “getSize(pxReadyTasksLists)”
com.nxp.freertos.gdb.tad.controller.TadFactory.getSize(TadFactory.java:116)
11:15:04.647 ERROR: [TadFactoryData] Could not load data for “Queue List” view! For more information check TAD log
11:15:05.149 EXCEPTION: [TaskFactory] ReadingException in class

so somehow it is not able to get the needed data. Is the TAD log showing anything useful?

What version of RTOS are you using? I’m using V9.0.0.
And there seems to be a known issue on Linux at least (see https://community.nxp.com/message/809333). Maybe you could post your problem in that community forum too as the engineers at NXP are in the loop there.

Hi dear Erich
By having this great plugin do we still need tracealyzer? Does tracealyzer give us any more useful data?
I’m using this plugin in truestudio, which is an eclipse based IDE for STM32. Does it have any impact on data it shows me? Can I trust it? You know it is basically developed for NXP microcontrollers, not ST.
PS: Thanks for your great blog. My life is divided into “before” and “after” times of knowing your blog. 🙂 You are a great teacher.

These plugins give you only a ‘stop-mode’ view, means when the target is halted. I still need Tracealyzer as it records more and it it shows me how things go over time.
The Plugin is for FreeRTOS in general, and as long as your FreeRTOS is up-to-date and includes the settings as in https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/, you should be fine.