How to program FPGA from HPS (de10-nano)

I’m really trying to avoid reboots: I’m designing a coprocessor which will do various various functions, so need to be able to reprogram it swiftly.

However, @Fabian_red has posted this Load fpga rbf from device tree overlay example? - #5 by Fabian_red which look very promising. It appears that the HPS can definitely do it through the fpga_manager: Cyclone V manual says:

The FPGA manager provides the following functionality and features:

  • Full configuration and partial reconfiguration of the FPGA portion of the SoC device
  • Drives 32 general-purpose output signals to the FPGA fabric
  • Receives 32 general-purpose input signals from the FPGA fabric

I’ve also found a thing which appears to be this exact thing:

root@de10-nano:~# cat /sys/class/fpga_manager/fpga0/state
operating

So I’m optimistic! Will post any results I get.

Kind regards,

Jonathan.