How to Debug RTEMS

Chris Johns chrisj at
Tue Jul 18 23:40:46 UTC 2017

On 17/07/2017 21:05, mfg wrote:
> Hello,
> It's my first message and I'm not sure how this maillist works.
> I would like to know if anyone has been able to debug an aplication of RTEMS
> (one simple hello world) in a Zedboard and how to do it.
> I have tried many things and all have failed for one reason or another,Qemu,
> openOCD-GDB, Xilinx SDK, XSDK XMD console-GDB.

Have you reviewed the following wiki pages:

Which version of OpenOCD are you using? There have been a number of issues
related to cache and MMU that have patches in Gerrit however I am not sure how
many of these are in the master source or have made it to a release.

For RTEMS you may also need something like:

 proc zynq_rtems_setup { } {
     global _SMP
     global _TARGETNAME_0
     global _TARGETNAME_1
     set target0 $_TARGETNAME_0
     set target1 $_TARGETNAME_1
     targets $target0
     $target0 cache_config l2x 0xF8F02000 8
     $target0 cortex_a maskisr on
     if { $_SMP } {
         targets $target1
         $target1 cortex_a maskisr on
     targets $target0

The 'cache_config' and 'maskisr' are important.

> The closest thing I've been debugging it is when I've put breakpoints in the
> start.S file (rtems/c/src/lib/libbsp/arm/shared/start/start.S) and the code has
> reached the 350 line. 

Is this the instruction:

> At that time the blue led goes out, the orange led comes
> on (Something is sent by UART, but nothing is received.) And it crashes.

It could be the cache config for OpenOCD as above or it will be something in the
initialisation of board before you load the application.

> I can run a program using the SD (with SD Card boot), but I do not know how to
> debug with a JTAG.

This is good to know. It means there is something in OpenOCD set up, the memory
configuration of the board or the state of the MMU or cache that is causing the


More information about the users mailing list