<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Comic Sans MS";
panose-1:3 15 7 2 3 3 2 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal>Hi Noor,</p><p class=MsoNormal>Nice blog entry on the JTAG setup. I ordered the FT232H board like yours to see if I can get the same setup working. I have my Pi 4 running the bare metal OS examples, and I have built your branch, so I hope to start looking at the code.</p><p class=MsoNormal>What needs to be in the MMU table? I see different entries in the Aarch64 BSPs. For example the Xilinx-versal BSP has entries for the GIC, peripherals, and memory. Can you cover RAM and I/O space on the Pi 4 with just one entry?</p><p class=MsoNormal>Looking at the RT-Thread OS, they have the following Pi4/Aarch64 MMU table:</p><p class=MsoNormal><a href="https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi4-64/driver/board.c#L25">https://github.com/RT-Thread/rt-thread/blob/master/bsp/raspberry-pi/raspi4-64/driver/board.c#L25</a></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Alan</p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:nooraman5718@gmail.com">Noor Aman</a><br><b>Sent: </b>Friday, September 2, 2022 2:18 PM<br><b>To: </b><a href="mailto:alan.cudmore@gmail.com">Alan Cudmore</a><br><b>Cc: </b><a href="mailto:heshamelmatary@gmail.com">Hesham Moustafa</a>; <a href="mailto:WKMoore@gmail.com">William Moore</a>; <a href="mailto:devel@rtems.org">rtems-devel@rtems.org</a><br><b>Subject: </b>Re: RPi 4B MMU seems to be enabled but throwing aarch64-default-exception error</p></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>Openocd connection is on my website. Here's the link to that. <a href="https://0xnoor.hashnode.dev/setup-openocd-with-jtag-uart-on-raspberry-pi-4-using-ft232h">https://0xnoor.hashnode.dev/setup-openocd-with-jtag-uart-on-raspberry-pi-4-using-ft232h</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I pushed the code to my github repo. Be sure to checkout noor-dev branch. Here's the link for that. <a href="https://github.com/0xnoor/rtems">https://github.com/0xnoor/rtems</a></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>And yes the code looks bad as of now, I'll do optimization and everything soon. </p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks</p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, 2 Sept 2022 at 23:31, Alan Cudmore <<a href="mailto:alan.cudmore@gmail.com">alan.cudmore@gmail.com</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><p class=MsoNormal>Hi Noor,</p></div><div><p class=MsoNormal>Can you describe the setup you use for testing the BSP?</p></div><div><p class=MsoNormal>I can set up my Pi 4 to try running your code as you update it. How do you setup the OCD connection?</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thanks,</p></div><div><p class=MsoNormal>Alan</p></div><div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>On Fri, Sep 2, 2022 at 11:48 AM Noor Aman <<a href="mailto:nooraman5718@gmail.com">nooraman5718@gmail.com</a>> wrote:</p></div><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal>Hey all,</p></div><div><p class=MsoNormal>Raspberry Pi 4B MMU seems to be enabled, as reported by openocd but gdb is showing to run in a loop from aarch64-defaulit-exception.S file starting from code line number 143 to 220.</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>From what I can gather, it is being caused by the wrong MMU address.</p></div><div><p class=MsoNormal> Here's a RAM and MMU allocation sizes and base</p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Comic Sans MS"'> MEMORY {<br> RAM_MMU : ORIGIN = 0x0, LENGTH = (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES})<br> RAM : ORIGIN = 0x80000, LENGTH = 1024M<br> }</span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Arial",sans-serif'>Relevant Openocd info </span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Comic Sans MS"'>bcm2711.cpu0 halted in AArch64 state due to debug-request, current mode: EL1T<br>cpsr: 0x200003c4 pc: 0x8e208<br>MMU: enabled, D-Cache: enabled, I-Cache: enabled<br>Info : New GDB Connection: 1, Target bcm2711.cpu0, state: halted</span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Comic Sans MS"'>Any ideas?</span></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><span style='font-family:"Comic Sans MS"'>Thanks,</span></p></div></div></blockquote></div></div></blockquote></div><p class=MsoNormal style='margin-left:9.6pt'><span style='font-family:"Comic Sans MS"'>Noor</span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>