NXP has released their Kernel Awareness for FreeRTOS in Eclipse (Kinetis Design Studio):
The plugin was showcased at FTF 2016 in Austin (see “NXP FTF Hands-On with FreeRTOS Task Aware Debugger“), now it is available on NXP web site.
Installation
The preferred way to install the plugin is with an Eclipse upate. Use the menu Help > Install New Software and point to the following update site:
http://nxp.com/lgfiles/updates/Eclipse/KDS
Then go through the installation process. Restart Eclipse at the end of the installation.
The plugin can be downloaded from www.nxp.com/kds and then installed into Eclipse too:
Views
The plugin adds a ‘FreeRTOS’ menu under the debug perspective:
Otherwise the FreeRTOS views are available under Window > Show View:
The Heap Usage view shows the heap scheme selected with all the memory blocks:
The Timer List view shows all the software timers in the system:
The Task List is probably the one which I’m using the most: it shows all the tasks with the stack usage:
In Queue List I have all the queues, semaphore and mutex listed with their data:
Summary
After FTF, the plugin is now available for download. I have it working in KDS V3.2.0 and it works with my latest FreeRTOS V9.0.0. It already helped me to find a problem in my application which I need to fix now :-).
Happy Kerneling 🙂
Hi Erich,
Easier, you can find the different view directly under the “FreeRTOS” menu, in the main menu, between “Processor Expert” and “Window”.
Yvan
LikeLike
Hi Yvan,
I missed to describe that one. I have added it now, thanks!
Erich
LikeLike
Hi Erich,
I am using FreeRTOS 8.x version. In the Task list view, some tasks are shown as suspended, even though these tasks are in blocked state (waiting for Notification). I was expecting all the tasks except running task to be marked as blocked (as in your screenshot). Is it because of FreeRTOS version?
Visakhan
LikeLike
Hi Visakhan,
I have moved to FreeRTOS 9.0.0, and have not tried it with 8.x. But indeed it could be because of the RTOS version difference. I noticed that other viewers like the Wittenstein one (https://mcuoneclipse.com/2013/08/04/diy-free-toolchain-for-kinetis-part-5-freertos-eclipse-kernel-awareness-with-gdb/) does not work well any more with v9.0.0.
LikeLike
Hello Erich,
Have you tested the plugin into an Eclipse MARS1 IDE?
I have installed it and it works fine, however when I try to open the Heap screen gives me an error:
13:43:52.606 EXCEPTION: [HeapFactory] ReadingException in class “com.nxp.freertos.gdb.tad.controller.heapusage.HeapFactory” at 179. line when calling method “readLongVariable(xNextFreeByte)”
com.nxp.freertos.gdb.tad.controller.TadFactory.readLongVariable(TadFactory.java:251)
com.nxp.freertos.gdb.tad.controller.heapusage.HeapFactory.getData(HeapFactory.java:179)
com.nxp.freertos.gdb.tad.model.TadModel$3.execute(TadModel.java:256)
com.nxp.freertos.gdb.tad.model.TadModel$4.run(TadModel.java:356)
Don’t know if it may be related to the problem, but Iam using a Jlink v5.12g
I’ve been using also a lot of queues on my implementation however nothing appears on the Queue screen. And I can only see a single thread on the debug view….
I think I have missed some sort of configuration….
Thx,
Thiago
LikeLike
Hi Thiago,
I have only used it so far with Luna. There is definitely not a configuration problem as there is nothing to configure.
Could you check the log files inside the FreeRTOS_TAD_logs (inside the workspace) folder?
What version of FreeRTOS are you using?
In any case, it might be worthwile to post your stack dump and the log files in the NXP Kinetis Design Studio forum so they can have a look.
Erich
LikeLike
I am using FreeRTOS version 8.2.3.
Looking at the log, the message is the same. There is a INFO before informing that I’m using Heap Type 1….
11:14:30.371 INFO: [HeapFactory] Application is using Heap type “1” (defined by configFRTOS_MEMORY_SCHEME in FreeRTOSConfig.h).
I will start a thread on the NXP forum….
Thanks
LikeLike
Hi,
Did you managed to get it working? I’m having the same issue!
LikeLike
Yes, I have it working. But with your old FreerRTOS version 8.2.3 it might be missing something in the kernel. I suggest you upgrade to the lastest and greatest version (10.0.1).
LikeLike
This looks great, a big improvement on the OpenOCD task aware features. After installing, I’m having an issue where the plug-in views say something like “Plug-in com.nxp.freertos.gdb.tad was unable to load class com.nxp.freertos.gdb.tad.view.views.queuelist.QueueListView.” NXP discussion here: https://community.nxp.com/message/809333
LikeLike
do the other views work (so it is only a problem for the queues)?
LikeLike
From the screenshots it looks your are using Mac? I have it working on Windows (I don’t have a Mac 😦 )
LikeLike
Same issue on all the views. Yeah, I’m on Mac, that’s probably it
LikeLike
Is this plug-in open source?
I’d like to extend it to support CMSIS++ objects and include it in GNU ARM Eclipse.
LikeLike
I have been told that this is the intent, but I have not seen a git repository for it yet.
LikeLike
please let me know when you have more details.
LikeLike
Oh man, I owe you another beer! Next time your in Austin please collect!
LikeLike
I add that to my list of things for next time in Austin 🙂
LikeLike
Hi,
I have installed the TAD plugin, installation was ‘uneventful’. I believe I have the freshiest version of all modules (KDS 3.2.0, FreeRTOS port 1.502 dated 25/6/2016). Because of my MCU (MK10FN1M0VLQ12) I can not use KSDK as no version supports my chip.
I can open the Task/View/Timer/Heap windows from the menu, but as soon as the program tries to fetch data it crashes.
Could it be because of the missing KSDK support? Is KSDK somehow required for this operation?
Ludek
The GDB log says:
“FreeRTOS Task Aware Debugger for GDB” version 1.0.0 (201606200848)
(c) 2016 NXP Semiconductors, Inc.
==================================
13:20:49.292 INFO: [TadModel] DSF session ID 9 has started.
13:21:00.181 INFO: [TadState] TAD state changed: DEBUG_STARTED -> DEBUG_INIT_0 (SUSPENDED, USER_REQUEST)
13:21:03.490 INFO: [TadState] TAD state changed: DEBUG_INIT_0 -> DEBUG_INIT_1 (RESUMED, USER_REQUEST)
13:21:03.554 INFO: [TadState] TAD state changed: DEBUG_INIT_1 -> DEBUG_SUSPENDED (SUSPENDED, BREAKPOINT)
13:21:52.801 INFO: [TadState] TAD state changed: DEBUG_SUSPENDED -> DEBUG_RESUMED (RESUMED, STEP)
13:21:52.987 INFO: [TadState] TAD state changed: DEBUG_RESUMED -> READY (SUSPENDED, STEP)
13:24:30.358 INFO: [Benchmark] Loading data for “Task List” has started.
13:24:31.222 EXCEPTION: [TadModel] NullPointerException while “Task List” data load.
com.nxp.freertos.gdb.tad.model.readers.MemoryReader.readMemoryUntilZero(MemoryReader.java:150)
com.nxp.freertos.gdb.tad.controller.TadFactory.readMemoryUntilZero(TadFactory.java:351)
com.nxp.freertos.gdb.tad.controller.TadFactory.readTextAtAddress(TadFactory.java:189)
com.nxp.freertos.gdb.tad.controller.TadFactory.readTaskName(TadFactory.java:303)
com.nxp.freertos.gdb.tad.controller.queuelist.QueueFactory.getQueue(QueueFactory.java:193)
com.nxp.freertos.gdb.tad.controller.queuelist.QueueFactory.getData(QueueFactory.java:109)
com.nxp.freertos.gdb.tad.model.TadModel$3.execute(TadModel.java:237)
com.nxp.freertos.gdb.tad.model.TadModel$4.run(TadModel.java:356)
13:24:32.70 INFO: [TadModel] DSF session ID 9 has ended.
LikeLike
Hi Ludek,
no, there is no dependency on the SDK. I’m using the plugin with KSDK, Processor Expert and ‘bare’ projects and have not seen this. Could you report/post this in the NXP community so the NXP engineers could have a look there? It would be good if you could post as much information there as possible (project, including the GDB trace log, see https://mcuoneclipse.com/2016/07/01/board-bring-up-tips-gdb-logs-and-traces-in-eclipse/).
LikeLike
Hi Erich,
I think I found out what was my problem with TAD. In your PEx component FreeRTOS I have checked in the Component Inspector the checkbox ‘Percepio Trace’ in the Percepio Trace tab. Which turned out to be wrong. After unchecking the box I have reinstalled the TAD plug-in according to this post and it is running.
Ludek
LikeLike
Hi Ludek,
that is strange, and I don’t understand it. I do have Percepio turned on for many projects, and I have not seen such an issue?
Erich
LikeLike
Hi Erich,
again, I see no Reply button to react to your post. So I am opening a new one.
When I tried to use NXP TAD with the Percepio Tracelyzer for FreeRTOS option selected at the same time the TAD showed the aboved mentioned null pointer error. I thought this might be wrong (having both options at the same time) so I unchecked the Percepio Tracelyzer support and reinstalled the NXP TAD and now it works.
I am not saying that Percepio Tracelyzer does not work, I just described a method that worked in my case when the additionally installed NXP TAD seemed to be not working for me.
Are you saying that both systems (NXP TAD and Percepio Tracelyzer for FreeRTOS can be turned on at the same time?
Ludek
LikeLike
Hi Ludek,
yes, the Precepio Trace works for me in combination with the NXP TAD without any issues.
Erich
LikeLike
Is this supposed to be supported on Linux?
After installing on Linux and doing Window > show view > other…> FreeRTOS > Heap Usage” a new Heap Usage view is opened but it is broken with a message:
“Plug-in com.nxp.freertos.gdb.tad was unable to load class com.nxp.freertos.gdb.tad.view.views.heapusage.HeapUsageView.”
LikeLiked by 1 person
Hi John,
I have not tried it under Linux, but I don’t see any reason why it should not work. Are you using my port of FreeRTOS (version 9.0.0)? Beceause as outlined in https://mcuoneclipse.com/2016/06/13/adding-freertos-thread-awareness-to-gdb-and-eclipse/ there are certain symbols needed. Additionally I have updated the FreeRTOS port on the McuOnEclipse GitHub site to provide better heap detection (see https://github.com/ErichStyger/McuOnEclipse_PEx/commit/69d4334006b9560ec2c2cdde81d6137aea4d59a5 which is part of the latest relesase (https://mcuoneclipse.com/2016/07/31/mcuoneclipse-components-31-july-2016-release/)).
LikeLike
Hi John,
it seems it is the same issue as reported here: https://community.nxp.com/thread/429765
Erich
LikeLiked by 1 person
Hi Erich, thanks for the link. Any idea when NXP might provide a fix? cheers john
LikeLike
John,
I have no idea. But does it work for you on Windows? I believe it is not a Linux issue.
And as for the issue I have seen: I have fixed it with a change in FreeRTOS V9.0.0. So it will take a while until that fix (or better solution will end up in a new FreeRTOS release). I think the main problem is that you are using the RTOS of the KSDK?
LikeLike
Hi Erich,
Yes it works fine on windows.
On Linux I installed the NXP ‘FreeRTOS Task Aware Debugger for GDB’ plugin, using their archive installer “Eclipse add-on to add FreeRTOS Plug ins.zip” in a fresh install of eclipse and clean workspace attempted to open the view; no projects or other features installed.
This suggests to me that the plugin is not loading on Linux.
cheers john
LikeLike
Pingback: McuOnEclipse Components: 30-Oct-2016 Release | MCU on Eclipse
Hi Eric – Thanks as always for your great stuff. The task viewer is crashing under latest updates from NXP. Details here: https://community.nxp.com/message/853129
Any ideas?
Thanks, Best Regards, Dave
LikeLike
I have not seen that one, but it could be because I have seen the FreeRTOS in SDK not using the latest version. At least I have not seen it in my port of FreeRTOS. The other thing from the log: would it make a difference if you turn on configUSE_TRACE_FACILITY?
LikeLike
My project is using FreeRTOS v9.0
In FreeRTOSconfig.h (attached to bug report at NXP):
#define configUSE_TRACE_FACILITY 1
Other ideas?
Thanks!
Best Regards, Dave
LikeLike
Hi Dave,
ok, I see now that you have it defined in your FreeRTOSConfig.h. I asked that question because your log indicates that the plugin does not recognize it:
“11:30:20.365 INFO: [FreeRTOS] FreeRTOS macro “configUSE_TRACE_FACILITY” is disabled.”
I still think it could be because of the NXP specific port of FreeRTOS, as the plugin might be very sensitive about changes e.g. affecting the list of active tasks.
The other thought I have: I see that you are using OpenOCD? Have you tried it with a different debug protocol (P&E or Segger) already? I have seen all kind of bad things happening with using OpenOCD :-(.
Other than that: I forwarded the community thread to the engineer I was in touch when I have received that FreeRTOS plugin. I hope he can respond in the community thread to you very soon.
LikeLike
Thanks Erich – I will try again with Segger (a Segger JLink is in the mail to me already, will be a few days). I hope NXP will help; so far NXP support has been very slow and generally poor ;-(
LikeLike
Hello Erich
I’m experiencing some issues with the TAD plugin. On the “HEAP Usage” window it seems that it is detecting correctly the heap implementation type as 4, which is the one I’m using, nevertheless, the 4 has a little “information icon” on its side and when I hover over it, it says;
“TAD will try to determine heap type (memory scheme) from available variables. Please add “static const uint8_t freeRTOSMemoryScheme = ;” (or use macro configFRTOS_MEMORY_SCHEME, if defined) variable into your project for TAD to know which heap type is used.”
If I define the “freeRTOSMemoryScheme” variable then the window does not show anything, the “HEAP Usage” window just stops working. And if I add the “configFRTOS_MEMORY_SCHEME 4” then nothing happens, the information icon does not go away.
Also, in the “Task List” window, I see little yellow warning icons on every element on the columns “Stack Usage” and “Runtime”. The Stack Usage column shows the usage for every task on green and it seems to be working correctly, so, if it’s working correctly, why the warning icons?
On the other hand, the runtime column does not show anything at all.
So my question is, how do I fix this warnings?
LikeLike
Hi Manuel,
lots of questions and good points. Are you using the McuOnEclipse FreeRTOS port? Most of the things are setup there automatically?
I think I should write a short article about your points as the comments section here might not be enough?
LikeLike
Hello Erich
No, I’m using the official FreeRTOS code from the FreeRTOS site, but now that you mention it I will take a look at your version to see the differences. Reading somewhere I found out that I should enable the “configGENERATE_RUN_TIME_STATS” and by doing so I had to implement the “portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()” and “portGET_RUN_TIME_COUNTER_VALUE()” macros. I did that already and the timer is indeed running @ 100us and both functions are being called, nevertheless, I don’t see any change.
Thanks for the suggestion about your FreeRTOS version, I’ll take a look at it!
And by the way, I’d be great if you wrote an article about how to make the TAD work on FreeRTOS from scratch.
LikeLike
Manuel,
to close the loop: I wrote an article at https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/ which hopefully is useful for you.
LikeLike
Manuel,
the v1.0.1 plugin has an issue with using freeRTOSMemoryscheme (see https://mcuoneclipse.com/2017/03/18/better-freertos-debugging-in-eclipse/).
LikeLike
I had to define freeRTOSMemoryScheme =4 and int uxTopUsedPriority = configMAX_PRIORITIES – 1 for FreeRTOS 10 in STM32CubeIDE v1.3.0. It works Great! Had to set it to 4 since the #define is gone – they use USE_FreeRTOS_HEAP_4 now.,
Also, needed to follow this closely:
https://community.st.com/s/question/0D50X0000BVp8RtSQJ/thread-awareness-debugging-in-freertos-stm32cubeide-110-has-a-bug-for-using-rtos-freertos-on-stlinkopenocd
LikeLike
Yes, that setting for FreeRTOS memory scheme is not conistently used by the Si vendors, and afaik the official FreeRTOS still does not have one (even if it would be very useful).
As for OpenOCD and FreeRTOS: https://mcuoneclipse.com/2016/04/09/freertos-thread-debugging-with-eclipse-and-openocd/
LikeLike
Pingback: Better FreeRTOS Debugging in Eclipse | MCU on Eclipse
Thanks Erich for the plugin tip
I added it to my eclipse ( Mars.2 Release (4.5.2) ) which is a custom version from ST (named System workbench for STM32 – sw4stm32) and so far is running nicely, the only downside is that I am still running in FreeRTOS 8.2.3 (the version supllied with ST’s code generation tool) and therefore thread stack meter doesn’t work
LikeLike
Pingback: MCUXPresso IDE: Unified Eclipse IDE for NXPs ARM Cortex-M Microcontrollers | MCU on Eclipse
Pingback: Breathing with Oxygen: DIY ARM Cortex-M C/C++ IDE and Toolchain with Eclipse Oxygen | MCU on Eclipse
Pingback: New FreeRTOS V10.0.0: Amazon, Segger SystemView and Percepio Tracealyzer | MCU on Eclipse
Pingback: Understanding FreeRTOS Task Stack Usage and Kernel Awarness Information | MCU on Eclipse
Pingback: New NXP MCUXpresseo IDE V10.3.0 Release | MCU on Eclipse
Pingback: Running FreeRTOS on the VEGA RISC-V Board | MCU on Eclipse