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