Posted 2017-04-11 11:49:17 +0200

blogs->nordicers

Short note how to make FreeRTOS program debugging with eclipse little simpler.

If you are looking the information how to configure the whole environment see this post: https://devzone.nordicsemi.com/tutorials/7/development-with-gcc-and-eclipse/

## What we get out of the box

Most low power applications stays most of the timer in idle. Ideally it would be tickless-idle. The problem begins if our program behaves strangely and we would like to stop it and check what is going on.

Lets get blinky_freertos example. Run it and halt just in random moment. Until you are very lucky you would stop somewhere in the FreeRTOS files:

The problem is that in most cases we would land in IDLE task. And there is no easy way to see the state of the task of our interest. Or is there?

J-link server provides proper support for info thread gdb command by special rtos plugin. To enable it just add an option to command line:

-rtos GDBServer\RTOSPlugin_FreeRTOS


See debug configuration below as a template:

Now when you run the debug and pause it, you would probably stop in idle task anyway. But all the tasks would be listed and you can easily go to the source where it waits just by clicking in the thread backtrace:

In the image above you may see that simple freertos_blinky example utilizes 3 Threads:

• IDL - Idle
• LED - our LED loop
• Tmr - Thread that processes the timers

I have experienced some issues with the -rtos option when program was compiled with -03 optimisation option - the debugger often crashes, inside RTOSPlugin_FreeRTOS.dll library, when trying to stop inside a FreeRTOS task. With -00 there was no such issue.

## Recent blog posts

• ### Introducing nRF5 SDK for Mesh

Posted 2017-07-20 09:42:44 by Pär H

Posted 2017-07-19 06:53:42 by Mohammad Afaneh
• ### Unique Thread/Bluetooth multiprotocol solution with nRF5 SDK for Thread and nRF52840 SoC by Nordic

Posted 2017-07-14 10:31:56 by Krzysztof Loska
• ### nRF Connect macros (currently Android only)

Posted 2017-07-14 13:29:14 by Aleksander Nowakowski
• ### Power Optimization — From 3 to 7 Months on a Single Charge

Posted 2017-07-10 14:34:39 by Yaniv Nis

## Recent questions

• ### Purchase CBD Oil From Hemp For Health Impovement

Posted 2017-07-23 19:59:11 by Jina Calhoun
• ### I am in the nrf52-DK board, download S332 SoftDevice v2.0.0 and SDK12.3 in the experimental_ant_bootloader routine, can not enter the DFU mode. How can I operate to enter the Bluetooth DFU state？

Posted 2017-07-23 18:12:06 by bugg
• ### Does "nRF5 SDK for Mesh Alpha 0.9.1" support nRF52840-PDK?

Posted 2017-07-23 16:58:14 by Tao