<div dir="ltr">Hi again, i have finally achieved something<div><br></div><div>Apparently the problems i had when connecting with GDB derived from the OpenOCD version i had installed. I first tried to compile the code from source but i got compilation errors and afer a while looking for the error i gave up and install the binaries from apt. The versión of apt is a little old and gave me some errors with some newer commands so I installed the xpack version. That one was up to date but gave me the error i mentioned with GDB. </div><div>In order to apply some patched the openOCD users recommended me i had to solve the compilation issue. In the end the problem was that i had the RTEMS toolchain path the at the beggining of my PATH env variable. Since openOCD requires autotools for compiling, it was using the first automake it encunters on that, the one generated by the RSB and that automake version is too old for the compilaiton of OpenOCD. So in case anybody tires, add the RTEMS toolchain path at the end.</div><div><br></div><div>Don´t know why but the autocompiled openOCD version (even without the patches) works well with GDB and the connection is established correctly. I have debugged some bare metal programs without problems. But there is just one problem/limitaiton, in the case of RTEMS executables, i am only able to debug the program with Hardware Breakpoints but software breakpoints won´t be established. The difference bettwen the RTEMS executable and my bare metal programs is that i don´t switch back to SVC mode (i stay in HYP mode), and obiously i don´t have an operating system. So right know i don´t know if there is some kind of memory protection by RTEMS or if there is some limitation in OpenOCD with boards in SVC mode (i have asked there but i got no answer).</div><div><br></div><div>If anyone knows i would appreciate some help.</div><div><br></div><div>I have seen that Pavel managed to get this debuging environment back in 2016 <a href="https://devel.rtems.org/wiki/Debugging/OpenOCD/Raspberry_Pi">https://devel.rtems.org/wiki/Debugging/OpenOCD/Raspberry_Pi</a>, i am wondering if i sould write him directly.</div><div><br></div><div>Regards,</div><div>Mario</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 18 may. 2020 a las 20:49, Mario Palomares (<<a href="mailto:palomares.mario14@gmail.com">palomares.mario14@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Alan, <div><br></div><div>I have been asking on the openOCD mailing list and it seems that armv8-a cores on 32 bit mode is currently under development. Actually it is supposed to work but they still have to apply some patches. Right now i am trying one patch they told me, let´s see how it works. I will tell you in case i achieve something.</div><div><br></div><div>Regarding the building of rtems-libbsd i though it could be compiled for RPI since some GSOC students did that on 2016 (the were working in improving the BSP)</div><div><a href="https://devel.rtems.org/wiki/GSoC/2016" target="_blank">https://devel.rtems.org/wiki/GSoC/2016</a>.</div><div><br></div><div>Regards,</div><div>Mario</div><div><br></div><div> </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El lun., 18 may. 2020 a las 18:38, Alan Cudmore (<<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-US"><div><p class="MsoNormal">Hi Mario,</p><p class="MsoNormal">Yes, what you said makes sense. I don’t have enough experience with the GDB and OpenOCD to know if your use case can be made to work. Perhaps someone on the <a href="http://raspberrypi.org" target="_blank">raspberrypi.org</a> bare metal forum would know?</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">For your inquiry about libdebugger and rtems-libbsd on the Pi: to my knowledge there is not complete libbsd support for the Pi models yet. I would not expect it to compile right now.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Please let us know if you make any progress! If you get openOCD debugging to work with the Pi2 1.2 (A53), it will also probably work with the Pi 3 models.</p><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Alan</p><p class="MsoNormal"><u></u> <u></u></p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal" style="border:none;padding:0in"><b>From: </b><a href="mailto:palomares.mario14@gmail.com" target="_blank">Mario Palomares</a><br><b>Sent: </b>Sunday, May 17, 2020 12:38 PM<br><b>To: </b><a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br><b>Cc: </b><a href="mailto:alan.cudmore@gmail.com" target="_blank">Alan Cudmore</a><br><b>Subject: </b>Fwd: JTAG error with arm-rtems-gdb</p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p><div><div><p class="MsoNormal">---------- Forwarded message ---------<br>De: <strong><span style="font-family:Calibri,sans-serif">Mario Palomares</span></strong> <<a href="mailto:palomares.mario14@gmail.com" target="_blank">palomares.mario14@gmail.com</a>><br>Date: dom., 17 may. 2020 a las 18:33<br>Subject: Re: JTAG error with arm-rtems-gdb<br>To: Alan Cudmore <<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</a>></p></div><p class="MsoNormal" style="margin-bottom:12pt"><u></u> <u></u></p><div><p class="MsoNormal">Hi Alan,</p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I have done what you told me (set up the whole environment) and it worked. </p></div><div><p class="MsoNormal">First i have to configure the RPI to boot on 64 bit mode (just setting a parameter on config.txt) and later on could establish GDB connection with the gdb the aaarch64 toolchain offers. Gdb-multiarch also worked.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It seems the problem is on that amrv8-a53 clusters working in 32 bit mode. I don´t know if openOCD has support for amv8-a cores working in 32 bit or if i have to change my configuration file.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Does this make sense to you?</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">As an alternative in case this doesn´t work i am currently trying to use the remote debugging through libdebugger but i am experiencing some problems when building the rtems-libbsd library. Should i ask here or create another subject?.</p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Regards, </p></div><div><p class="MsoNormal">Mario</p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">El sáb., 16 may. 2020 a las 15:58, Alan Cudmore (<<a href="mailto:alan.cudmore@gmail.com" target="_blank">alan.cudmore@gmail.com</a>>) escribió:</p></div><blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in"><div><div><p class="MsoNormal">Hello Mario,</p><p class="MsoNormal">Did you try bringing up the complete bare metal environment in the Bare Metal Raspberry Pi 3b JTAG blog entry?</p><p class="MsoNormal">I would verify that that environment with the bare metal Aarch64 examples work before trying to get the 32 bit RTEMS binaries to work.</p><p class="MsoNormal">It seems like these should work on the Pi2 with the A53 cores</p><p class="MsoNormal"><a href="https://metebalci.com/blog/bare-metal-rpi3-programming/" target="_blank">https://metebalci.com/blog/bare-metal-rpi3-programming/</a></p><p class="MsoNormal">But the UART example might not work due to the differences between how the uarts are used on the Pi2 and 3.</p><p class="MsoNormal"> </p><p class="MsoNormal">Does the ARM multiarch GDB work with Aarch64? Maybe try the Aarch64 GDB mentioned in the bare metal RPI3 blog entry?</p><p class="MsoNormal"> </p><p class="MsoNormal">Alan</p><p class="MsoNormal"> </p><p class="MsoNormal"> </p><div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in"><p class="MsoNormal"><b>From: </b><a href="mailto:palomares.mario14@gmail.com" target="_blank">Mario Palomares</a><br><b>Sent: </b>Saturday, May 16, 2020 7:41 AM<br><b>To: </b><a href="mailto:users@rtems.org" target="_blank">users@rtems.org</a><br><b>Subject: </b>JTAG error with arm-rtems-gdb</p></div><p class="MsoNormal"> </p><div><div><p class="MsoNormal">I am tryining to debug RTEMS programs on mi RPI2 through a JTAG conexion with OpenOCD. Right now i have the connection correctly established and i can connect through a telnet client. Whenever I try to connect through arm-rtems5-gdb i get the following error</p></div><div><p class="MsoNormal"> </p></div><p class="MsoNormal">warning: while parsing target description (at line 4): Target description specified unknown architecture "aarch64"<br>warning: Could not load XML target description; ignoring<br>Truncated register 16 in remote 'g' packet</p><div><p class="MsoNormal"> </p><div><p class="MsoNormal">The configuration file i use for the RPI can be found in this page </p></div><div><p class="MsoNormal"><a href="https://metebalci.com/blog/bare-metal-raspberry-pi-3b-jtag/" target="_blank">https://metebalci.com/blog/bare-metal-raspberry-pi-3b-jtag/</a>. :</p></div><div><p class="MsoNormal">I can´t use the configuration file proposed here:</p></div><div><p class="MsoNormal"><a href="https://github.com/ppisa/rpi-utils/blob/master/jtag-debug/rpi2/rpi-jt_usb5.cfg" target="_blank">https://github.com/ppisa/rpi-utils/blob/master/jtag-debug/rpi2/rpi-jt_usb5.cfg</a> by Pavel because my RPI is a RPI2 v1.2 which has the same SoC that the RPI3. If i try Pavels configuration file the connection fails.</p></div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">I have installed gdb multiarch and tried with it but no luck, when i set the architecture to aarch64 i get:</p></div><div><div><p class="MsoNormal"> </p></div><div><p class="MsoNormal">warning: Architecture rejected target-supplied description<br>Truncated register 8 in remote 'g' packet</p></div><div><p class="MsoNormal"> </p></div></div></div></div><p class="MsoNormal">Any ideas how to get arround this ?</p></div></div></blockquote></div></div></div><p class="MsoNormal" style="margin-left:4.8pt"> </p><p class="MsoNormal"><u></u> <u></u></p></div></div>
</blockquote></div>
</blockquote></div>