<div dir="ltr"><div>Hi Florian,</div><div><br></div><div>Thanks for asking. I am not working on that project anymore. We definitely brought up RTEMS to run on ARTY with some tinkering behind it, but we could not open-source our setup due to lack of time. I am most certain that we used the xilinx_zynq_zc702 configuration as a base. Now I don't have access to the working code but only some memories. I am working on another Xilinx part now, and since the setups are in a way similar, let me share what I can.</div><div><br></div><div>As already indicated in the original RTEMS thread, there are two workflows possible:</div><div><br></div><div>1) Vivado/Vitis/XSDB/GDB</div><div><br></div><div>1.1) Create FPGA design in Vivado, export design file.<br></div><div>1.2) Create Platform project in Vitis from the exported design file from step 1.1.</div><div>1.3) Create a SW project in Vitis based on the Platform project in step 1.2.</div><div>1.4) Use Vitis to Flash and Debug the software in IDE.</div><div>1.5) When the setup is stable, check the log panels of Vitis to understand:</div><div>- Which TCL commands Vitis runs to configure the board and flash the software.</div><div>- See the logs that those commands themselves produce to get a better understanding of the board startup sequence.</div><div><br></div><div>From here on, you copy what Vitis does in the IDE to your command-line workflow to automate things and not be dependent on the IDE workflow (if you want).</div><div><br></div><div>1.6) Copy the TCL commands that Vitis does to TCL files on your file system and run the Xilinx XSDB from the command line to reproduce exactly the steps of what Vitis does during the IDE flash&debug workflow. The result of this step is that you can do 100% the same things compared to what Vitis does, but from your own command-line scripts. I am attaching our current top-level file that does the flashing but the related details of how to source the TCL files you should figure out yourself, following the Vitis logs from 1.5.<br></div><div>1.7) Once you can flash with XSDB, you can also connect to it with GDB because XSDB has a GDB server.<br></div><div><br></div><div>*) Note that there are two ways of starting the SW: with and without the Xilinx First-Stage Bootloader (FSBL) run in the process. If you just Flash with your debugger and not boot from Flash memory, running of something like $VITIS_PATH/scripts/vitis/util/fsbl.tcl should be part of your scripts or if you include the "FSBL" checkbox in Vitis, also the fsbl binary to be run before you flash your image. The main point to remember the FSBL startup sequence has to be run either by the FSBL itself if it gets flashed or by a corresponding FSBL TCL script. Following the Vitis logs, you should notice exactly those lines.<br></div><div><br></div><div>This is the workflow that we are using now and everything pretty much works. In 2021, my colleague skipped the steps 1.6-1.7 and implemented workflow #2, see below.<br></div><div><br></div><div>2) OpenOCD/GDB<br></div><div><br></div><div>To enable OpenOCD, you should anyway familiarize yourself with the steps from 1.1-1.6. Instead of copying the Vitis logs commands to TCL files like in step 1, the action here is to configure OpenOCD and GDB to reproduce exactly those steps but using OpenOCD/GDB syntax and commands.</div><div><br></div><div>You will likely need at least two files:</div><div><br></div><div>- OpenOCD config file, something like arty.cfg which you will run with openocd, like "openocd -f arty.cfg"</div><div>- GDB init file which you can run source when you run GDB: gdb -x rtems.gdb. In that GDB file you can have a function like "flash" which will reproduce the necessary TCL scripts commands from Vitis.<br></div><div><br></div><div>A general guidance for setting up the workflow #2 can be found here but you will have to adapt it to your needs: <a href="https://devel.rtems.org/wiki/Debugging/OpenOCD/Xilinx_Zynq">https://devel.rtems.org/wiki/Debugging/OpenOCD/Xilinx_Zynq</a>.</div><div><br></div><div>In the attached Python file, you see our existing Flash routine. All the TCL and settings files have been recreated from Vitis logs. We are following workflow #1 only and have not implemented workflow 2 for this part yet. As a side note, we are using <a href="https://www.pyinvoke.org/">https://www.pyinvoke.org/</a> to automate tasks which helps us to write more Python instead of Bash.<br></div><div><br></div><div>I do believe that all these things must be much better documented, so that we spend time somewhere else. When our current workflow is stable, we will try to open source as much as we can.<br></div><div><div><br></div><div>Good luck with porting and let me know if you have any questions.</div><div><br></div></div><div>Stanislav<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 8, 2023 at 3:36 PM Florian Sommerfeld <<a href="mailto:fsommerfeld@stud.hs-bremen.de" target="_blank">fsommerfeld@stud.hs-bremen.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Stanislav,<br>
I am currently researching on how to get RTEMS up and running on a Zybo <br>
Z7-20 Zynq-7000 ARM/FPGA Board (should be rather similar to your Arty <br>
Z7) and found your question in the RTEMS users mail archive: <br>
<a href="https://www.mail-archive.com/users@rtems.org/msg03248.html" rel="noreferrer" target="_blank">https://www.mail-archive.com/users@rtems.org/msg03248.html</a><br>
Did you ever manage to run RTEMS on your Z7-20 board? I was able to use <br>
the xilinx_zynq_zedboard BSP to build the RTEMS 5 hello world program, <br>
but I am having a hard time on how to actually get it onto the board.<br>
Any help is highly appreciated.<br>
<br>
Sincerely,<br>
Florian<br>
</blockquote></div>