GDB debugging and FreeRTOS
What sorts of things would make it so that FreeRTOS runs stand-alone just fine but it gets aborts when you run it with the debugger? For example, I wrote a small app with one task (plus of course the idle task) that blinks a few LEDs. If I run it without the debugger (i.e. just turn it on or push the reset button) it works fine, but if I run it through gdb it does nothing. When I eventually abort it I get:
Program received signal SIGINT, Interrupt.
data_abort () at src/startup.S:83
83 b data_abort
1: /x $pc = 0x8b0
(gdb) print/x $lr
$1 = 0xc0c
It’s fairly consistent about stopping in that same spot, which is in the middle of vPreemptiveTick() as it calls the macro portRESTORE_CONTEXT():
/* The critical nesting depth is the first item on the stack. */
/* Load it into the ulCriticalNesting variable. */
"LDR R0, =ulCriticalNesting
--> "LDMFD LR!, {R1} BLOWS UP HERE
"STR R1, [R0]
(this is based on the LPC2106 GCC port, though mine is an LPC2129).
GDB debugging and FreeRTOS
Hmm. Don’t know. Are you using exactly the same build for the debug and non debug versions? I presume you set the linker script to be correct when converting the LPC2106 demo to run on the LPC2129?
Regards.
GDB debugging and FreeRTOS
>I presume you set the linker script to be correct when converting the LPC2106 demo to run on the LPC2129?
Yep.
>Are you using exactly the same build for the debug and non debug versions?
Yes.
Maybe what I will do is examine vPreemptiveTick on some other ports and see if that helps me figure out what is happening with this one.
GDB debugging and FreeRTOS
My GDB still bombs out in vPreemptiveTick. I am trying to trace through it …when I enter vPreemptiveTick the CPU is in IRQ mode (which makes sense, as it was called from the timer).
portSAVE_CONTEXT() is executed.
vTaskIncrementTick() is executed.
vTaskSwitchContext() is executed, after which pxCurrentTCB is set to the IDLE task:
(gdb) print *pxCurrentTCB
$4 = {pxTopOfStack = 0x400005d8, xGenericListItem = {xItemValue = 0, pxNext = 0x40002244, pxPrevious = 0x40000214,
pvOwner = 0x400003ec, pvContainer = 0x4000223c}, xEventListItem = {xItemValue = 5, pxNext = 0x0, pxPrevious = 0x0,
pvOwner = 0x400003ec, pvContainer = 0x0}, uxPriority = 0, pxStack = 0x40000438, uxTCBNumber = 1,
pcTaskName = "IDLE", ‘