cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DgN
Visitor
Visitor
719 Views
Registered: ‎09-14-2020

remote bitstream programing from host machine to Zync Ultrascale board

Jump to solution

Hello,

 

the goal

I'm trying to have the Zync (from a zcu102 board) to interact with a custom hardware through AXI requests. My need is to have this custom hardware (bitstream) programable from a host machine without touching anything on the board (no SDCARD removing to add files, no button pushed or switches manipulated).

Is there a way to do so ?


What I have done

Using the XAPP1305 (PS and PL-based 1G/10GEthernet Solution), I could boot PetaLinux (from sdcard) on the board and communicate with it in SSH. The issue here is I can't program another bitstream :

- If Linux is running, programming another bitstream would crash linux.

- If Linux is not running, or if I force-restart Linux, the board is booting using the BOOT.bin from the sdcard, and thus ignoring the bitstream I wanted to program.


Thanks,

N.

0 Kudos
1 Solution

Accepted Solutions
DgN
Visitor
Visitor
236 Views
Registered: ‎09-14-2020

Hello @rwillis ,

I did not spent much more time on this. The solution I came with is to use XSCT in order to program the board with all necessary Linux files and the bitstream through JTAG (petalinux allows XSCT tcl scripts exporting that I could then customize). The File system is installed on the SD card.

Accessing AXI components through Linux is indeed easier than I thought. I'm using mmap().

DgN

 

View solution in original post

0 Kudos
9 Replies
jrhtech
Voyager
Voyager
693 Views
Registered: ‎10-04-2017

Hello,

 You can use fpga_util on the zynq to load from linux or you can use xsct to run a tcl script from the host to load the bitstream via jtag.

  Note, that if you do have drivers or code accessing the FPGA you have to stop all interactions before you re-load it.

jeff

 

DgN
Visitor
Visitor
672 Views
Registered: ‎09-14-2020

Thank you for your reply,

In my current installation, I do have a driver (to use the Ethernet port). I do not have anything (yet) communicating with PL. In this example, loading the bitstream get the linux system to freeze. Is there a way to restart the board without touching it ? (and without reloading the bitstream from the BOOT.bin of the sdcard)

Meanwhile, I'm investigating fpga_util, this means rebuilding the kernel. I'll check this solution out.


Also, reading about PetaLinux tools, I've read about the command "petalinux-boot --jtag". Is this only a debug solution ? Can it properly program the bitstream additionally to my linux image ?

0 Kudos
jrhtech
Voyager
Voyager
650 Views
Registered: ‎10-04-2017

  You don’t have to use fpga_util to load the bitstream, you can do it via shell commands.

   But you will have to unload/load kernel  driver that touch the PL unless you are just mmapping in the PL address space.  

  It’s not really clear what you are doing with the PL so it’s hard to know what to say.

0 Kudos
DgN
Visitor
Visitor
640 Views
Registered: ‎09-14-2020

Actually, my goal is to load a complex design which have a master slave and then, run some C program that interact with it through AXI requests. The AXI interconnect can be the regular Xilinx AXI interconnect and/or one developed by my company.

The challenge raised by my question is changing this complex design. The need is to be able to load the bitstream without touching the board (a host machine is connected to the board, and all controls are issued by accessing this host remotely through ssh).

When you say this can be done via shell command, what are you suggesting ?

0 Kudos
jrhtech
Voyager
Voyager
626 Views
Registered: ‎10-04-2017

Thanks, but I still don’t understand what you mean about loading the bitstream.  Just build it into the boot.bin

  if you are trying to load a bitstream that has a different addressing mapping than the one that is already loaded then your device meter won’t match and it won’t work unless you use devicetree overlays.

   At one time I looked at the source for fpgautil and for FPGA loading just is shell operations, something like the xdevcfg method in previous versions.

jeff

0 Kudos
kawazome
Adventurer
Adventurer
615 Views
Registered: ‎04-02-2014

Perhaps your wishes come true with FPGA Manager + Device Tree Overlay.
Please refer to the following URL (although the content is a little old).

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841645/Solution+Zynq+PL+Programming+With+FPGA+Manager 

 

I built my own environment to load and run a bitstream into an FPGA after booting Linux running on Ultra96 / UltraZed.
It is published at the following URL. please refer.

 

https://github.com/ikwzm/ZynqMP-FPGA-Linux 

 

I switch and run the following examples in the above environment without rebooting Linux.

 

https://github.com/ikwzm/ZynqMP-FPGA-Linux-Example-2-Ultra96 

https://github.com/ikwzm/QCONV-STRIP-Ultra96 

 

 

DgN
Visitor
Visitor
554 Views
Registered: ‎09-14-2020

For anyone looking for the same  :

- FPGA Manager seems to be the solution, couldn't try it yet, though it allows programing the bitstream without redownloading the linux.

I'll post a feedback about this when I'll get back to it, for now I'm trying to find a way to send AXI request from linux

- The solution I've tested successfully for now is petalinux-boot --jtag. On a petalinux project, we can configure it with our bitstream with

petalinux-config --get-hw-description=<directory where is xsa or hdf file>

then after building, it can be sent to the card with

petalinux-boot --jtag --u-boot --fpga --bitstream <path to .bit>

This sends by JTAG the boot files, the bitstream and the linux image.

0 Kudos
rwillis
Adventurer
Adventurer
263 Views
Registered: ‎08-23-2018

Any progress on this?

BTW, if you are trying to dynamically load additional FPGA configuration in while running Linux AND with Linux requiring other assets already in the FPGA you may want to investigate "Partial Reconfiguration". A YouTube channel "Mohammad S. Sadri" has an excellent series on doing partial reconfiguration using an Ultrascale+ MPSoC device. He called it a dynamic function exchange.

As for accessing AXI from Linux, this is either via a dedicated linux driver, or using UIO and mmap() in your application to access register/ram memory space in the FPGA. UIO can be tricky to start learning with, there are some good threads on this forum for it and you may have to over-ride some device tree nodes to force uio usage, done in your system-user.dtsi

 - Richard

0 Kudos
DgN
Visitor
Visitor
237 Views
Registered: ‎09-14-2020

Hello @rwillis ,

I did not spent much more time on this. The solution I came with is to use XSCT in order to program the board with all necessary Linux files and the bitstream through JTAG (petalinux allows XSCT tcl scripts exporting that I could then customize). The File system is installed on the SD card.

Accessing AXI components through Linux is indeed easier than I thought. I'm using mmap().

DgN

 

View solution in original post

0 Kudos