Problem debugging FreeRTOS with GDB in KDS

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

Problem debugging FreeRTOS with GDB in KDS

1,114 Views
amprel
Contributor I

Hello everybody,

I have the following problem. The scenario first:

  • Custom board with Kinetis K10
  • KDS 3.0.0
  • Pemicro Multilink Universal debugger
  • FreeRTOS 9.0.0 (I'm using the GCC / Cortex M3 port)
  • I'm not using Processor Expert

The problem: when debugging a program with FreeRTOS, I can set breakpoints and step through code, but when I try to return from a function by stepping on its last instruction (i.e. closing curly bracket), gdb crashes. In the console I get the following errors:

 

Unable to go into background mode.

Error communicating to target processor - try a RESET.

PE-ERROR: TARGET IS RUNNING

 

It looks like something in the stack frame confuses gdb. The same program works as expected if I let it run without debugging. Please note that when I debug a program without FreeRTOS everything works like a charm.

Also, in FreeRTOSConfig.h, I have added the following line:

 

#define configTASK_RETURN_ADDRESS   0  /* return address of task is zero */

 

as suggested in the post 'GDB PEMicro Interface Debugging' (nov. 2014).

 

Thank you in advance for your help, which would be greatly appreciated.

Alex

Labels (1)
0 Kudos
Reply
1 Reply

533 Views
soledad
NXP Employee
NXP Employee

Hello,

could you please try creating a new project according the following document: Creating a FreeRTOS project using KDS and Kinetis SDK Project V2.0

Then please follow the below document:

GDB Debugging with Kinetis Design Studio

Please let me know if this helps.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply