I have several C/C++ applications built for the RedPitaya which use the API (rp.so).The manual says, that in order to use the API, I have to load an FPGA image by doing
Code: Select all
cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg
I need to load it automatically, before my program starts.
What did I do to solve it
I am starting my program as a linux systemd daemon. A file was created
Code: Select all
#!/bin/bash
cat /opt/redpitaya/fpga/fpga_0.94.bit > /dev/xdevcfg
sleep 2
exec /root/XXX/YYY
Code: Select all
[Unit]
Description = RedPitaya WaveformGenerator
After = network.target
Requires=ZZZZ
[Service]
Environment="LD_LIBRARY_PATH=/opt/redpitaya/lib"
ExecStart = /root/XXX/YYY.sh
[Install]
WantedBy = multi-user.target
I thought to replace the cat with
Code: Select all
dd if=/opt/redpitaya/fpga/fpga_0.94.bit of=/dev/xdevcfg ibs=1M
Other system information
RedPitaya 1.1, Latest stable image from
Ecosystem 0.98
Questions
How do I load the bitfile automatically before my application start so that everything does not crash?
I attempted to load it right after local-fs.target is reached (early in the boot process) as well as after multi-user.target is reached (late in the boot process) with the same results.
Should I look instead into configuring FSBL to load the fpga_0.94.bit instead whatever it is loading now?
Or can U-Boot do it?
Is it OK for FSBL to load that bitfile (version 0.94) although the ecosystem is 0.98?