Automatically load fpga_0.94.bit on system startup

Applications, development tools, FPGA, C, WEB
Post Reply
mikhail.zakharov
Posts: 1
Joined: Wed Jan 02, 2019 11:55 pm

Automatically load fpga_0.94.bit on system startup

Post by mikhail.zakharov » Mon Mar 04, 2019 7:15 am

Problem:
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
. When I do it from command line (e.g. console) everything works. When I do not do it, the code crashes with SIGBUS.
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
The unit file is as follows:

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
however every other boot the system hangs, blue light is off.

I thought to replace the cat with

Code: Select all

dd if=/opt/redpitaya/fpga/fpga_0.94.bit of=/dev/xdevcfg ibs=1M
so that the entire file is first read then dumped to FPGA. This did not help.

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?

jmadsenee
Posts: 43
Joined: Fri Apr 17, 2015 7:38 pm
Location: Richmond, VA, USA

Re: Automatically load fpga_0.94.bit on system startup

Post by jmadsenee » Thu Jul 11, 2019 3:01 pm

Hi Mikhail,

I load my fpga image at the beginning of my C code:

Code: Select all

system("cat /opt/redpitaya/fpga/UscopeV0.04.bit > /dev/xdevcfg");
John

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 0 guests