Debugging RTEMS application for zedboard

Chris Johns chrisj at
Thu May 25 04:44:41 UTC 2017

On 24/05/2017 21:53, Gabriel Brusq wrote:
>>>>> I've heard GDB does not support dynamic positioning of breakpoint
>>>>> which means that breakpoint must be set before compiling, with function breakpoint()
>>>> This is not the case. The CortexA9 supports break point instructions as
>>>> well as a hardware break and watch points.
>>> Well if I understand I should compile rtems-gdb and I could easily debug
>>> source-level ?
>> The RSB will build a suitable GDB for you.
> I compiled rtems-4.11-gdb and I am able to use XMD with gdb (target remote)

Excellent. I have not used XMD.

> I can debug step by step rtems' helloworld example and continuing until relatively near breakpoints

I am not sure I understand.

After loading the executable you get a gdb prompt at the entry point to 
the RTEMS executable? Do the instructions at the entry point match what 
you expect to see?

If you then ...

(gdb) display /x $pc
(gdb) si
(gdb) si

.. you can step the instructions?

> But when I try to continue until far breakpoints there is a target crash which seems to be linked to JTAG buffer.

The JTAG hardware does not have a buffer anywhere in the chain so this 
must be something in the XDM software.

> -- What I've done
> - xmd side:
> XMD% connect arm hw
> XMD% rst -system
> XMD% fpga -f /root/workspace_brusq/xsdk/hw_platform/zynq_design_wrapper.bit
> XMD% source /root/workspace_brusq/xsdk/hw_platform/ps7_init.tcl
> XMD% ps7_init
> XMD% ps7_post_config
> XMD% ps7_debug
> XMD% dow /root/workspace_brusq/rtems_gdb_hello_C_CortexA9_RTEMS.exe
> - gdb side:
> $> cd $EXE_DIR
> $> arm-rtems4.11-gdb rtems_gdb_hello_C_CortexA9_RTEMS.exe
> (gdb) target remote tcp:
> (gdb) load $EXE_DIR/rtems_gdb_hello_C_CortexA9_RTEMS.exe

Does GDB load the executable, if so do you need the XDM dow command?

> -- Whet I get when continuing without breakpoint
> - xmd side:
> Processor Stop Condition Unknown
> Error:
>         Cannot access JTAG-DP: invalid ACK value (0x04, expected=0x02)
> OR
> Cannot flush JTAG buffers

Do you have any watchdogs enabled?

If there is a memory map, MMU or something similar an early crash can be 
fatal and JTAG will not be able to recover if something low level on the 
bus has locked up.

> - gdb side:
> Continuing.
> Remote failure reply: E01
> Remote failure reply: E01
> Remote failure reply: E01
> Can this error be linked to RTEMS
> or should I continue this topic on Xilinx page ?

It seems sort of normal for a low level bring up of new tools and hardware.

I suggest you test the stepping as I listed before for say 20 
instructions and then reset reload and issue:

(gdb) x /100i $pc

and setting a breakpoint inside the range of instructions you stepped 
before. To set a break point at a specific address use:

(gdb) b *0x12345

where 0x12345 is the address you want to stop at. If the board fails on 
the continue and does not break it would seem XDM related. If the 
breakpoint is hit and gdb stops then it is something further in the 
start up sequence you need to find.


More information about the users mailing list