How to debug rtems on ZedBoard

xuelin.tian at qkmtech.com xuelin.tian at qkmtech.com
Wed Jan 20 03:08:54 UTC 2016







Hi Chris, the version of OpenOCD I use is 0.9.0, and the patch from Gerrit hasn't been merged onto it. So, I added it by myself. However, many warnings came up during make process, and it took me some time to correct some of them, but it still didn't go well. So, I tried to initialize my PS within ZedBoard via XMD, instead of OpenOCD. The above process I posted were both under XMD. So, do you have some experience with debugging under XMD, in my case, some commands didn't work. I don't know how to continue my work. Thank you. 


Best,TianQ.K.M Technology Co., Ltd.xuelin.tian at qkmtech.com
 From: Chris JohnsDate: 2016-01-15 05:30To: xuelin.tian at qkmtech.com; usersSubject: Re: How to debug rtems on ZedBoardOn 14/01/2016 15:38, xuelin.tian at qkmtech.com wrote:
> Hi all,
> I'm recently working on a project on Zynq platform. And now I get stuck
> at how to debug tasks on my board. Connecting to Zynq via OpenOCD or
> Xilinx XMD works fine, but when I move to next step---debug tasks using
> GDB, something goes wrong.
>
> In this case, I may connect to a wrong target...
 
Have you seen ..
 
  https://devel.rtems.org/wiki/Debugging/OpenOCD/Xilinx_Zynq
 
What is the version of OpenOCD?
 
I am running a patch set from Gerrit 
(http://openocd.zylin.com/#/c/3107/) which may or may not have been 
merged onto OpenOCD's git master. You need this to get stepping and 
resume working with the L1 and L2 caches enabled.
 
> root at ubuntu:/home/Development/examples-v2-master/hello/hello_world_c/o-optimize#
> arm-rtems4.11-gdb hello.exe
> GNU gdb (GDB) 7.9
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=x86_64-linux-gnu
> --target=arm-rtems4.11".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from hello.exe...done.
> (gdb) target remote localhost:1239
> Remote debugging using localhost:1239
> 0xffffff28 in ?? ()
> (gdb) load
 
You need to configure the hardware to enable the DDR memory to load the 
code into. See the wiki page, it shows how to use your ps7_init TCL file.
 
> Loading section .start, size 0x3ec lma 0x104000
> Loading section .text, size 0xd040 lma 0x104400
> Loading section .init, size 0xc lma 0x111440
> Loading section .fini, size 0xc lma 0x11144c
> Loading section .rodata, size 0xc6c lma 0x111458
> Loading section .ARM.exidx, size 0x8 lma 0x1120c4
> Loading section .eh_frame, size 0x74 lma 0x1120cc
> Loading section .init_array, size 0x4 lma 0x112140
> Loading section .fini_array, size 0x4 lma 0x112144
> Loading section .jcr, size 0x4 lma 0x112148
> Loading section .rtemsroset, size 0x20 lma 0x11214c
> Loading section .data, size 0x660 lma 0x201400
> Start address 0x104040, load size 59320
> Transfer rate: 14 KB/sec, 94 bytes/write.
> (gdb) r
 
You do not run, the connection and then the loading has created the 
"process" for gdb so it is equivalent to the run command.
 
> The "remote" target does not support "run". Try "help target" or
> "continue".
> (gdb) exit
> Undefined command: "exit". Try "help".
>
> And this time, everything goes well before some internal errors comes up...
> root at ubuntu:/home/Development/examples-v2-master/hello/hello_world_c/o-optimize#
> arm-rtems4.11-gdb -e hello.exe
> GNU gdb (GDB) 7.9
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law. Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "--host=x86_64-linux-gnu
> --target=arm-rtems4.11".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word".
> (gdb) l
> No symbol table is loaded. Use the "file" command.
> (gdb) target extended-remote localhost:1239
> Remote debugging using localhost:1239
> warning: Remote failure reply: E01
> qTStatus: Target returns error code '01'.
> warning: Remote failure reply: E01
> warning: Remote failure reply: E01
> Remote failure reply: E01
> (gdb) target extended-remote localhost:1240
> Remote debugging using localhost:1240
> 0x1ff93900 in ?? ()
> (gdb) load
> Loading section .start, size 0x3ec lma 0x104000
> Loading section .text, size 0xd040 lma 0x104400
> Loading section .init, size 0xc lma 0x111440
> Loading section .fini, size 0xc lma 0x11144c
> Loading section .rodata, size 0xc6c lma 0x111458
> Loading section .ARM.exidx, size 0x8 lma 0x1120c4
> Loading section .eh_frame, size 0x74 lma 0x1120cc
> Loading section .init_array, size 0x4 lma 0x112140
> Loading section .fini_array, size 0x4 lma 0x112144
> Loading section .jcr, size 0x4 lma 0x112148
> Loading section .rtemsroset, size 0x20 lma 0x11214c
> Loading section .data, size 0x660 lma 0x201400
> Start address 0x104040, load size 59320
> Transfer rate: 8 KB/sec, 94 bytes/write.
> (gdb) r
> The program being debugged has been started already.
> Start it from the beginning? (y or n) y
> ../../gdb-7.9/gdb/thread.c:89: internal-error: inferior_thread:
> Assertion `tp' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Quit this debugging session? (y or n) y
 
It is best if you have JTAG reset the board each debugging run.
 
>
> This is a bug, please report it. For instructions, see:
> <http://www.gnu.org/software/gdb/bugs/>.
>
> ../../gdb-7.9/gdb/thread.c:89: internal-error: inferior_thread:
> Assertion `tp' failed.
> A problem internal to GDB has been detected,
> further debugging may prove unreliable.
> Create a core file of GDB? (y or n) y
> Aborted (core dumped)
>
>
> Any hints on this? Thank you.
 
Check out the Wiki page on JTAG Zynq debugging.
 
Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20160120/36c8d1be/attachment-0002.html>


More information about the users mailing list