Skip to content
Snippets Groups Projects
Commit d1d34c97 authored by BRONES Romain's avatar BRONES Romain
Browse files

feat(fpgainit):Add a startup script to load FPGA

* This parse a configuration file and then load the FPGA with the
  correct bitstream (centralnode or cellnode)
parent 961c3794
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
PATH_CONF="/opt/fofb/cfg/configuration"
logger -t "fofb-fpgainit" "Reading configuration file ${PATH_CONF}"
if [ ! -f ${PATH_CONF} ]; then
logger -s -t "fofb-fpgainit" "Configuration file not found: ${PATH_CONF}"
exit 1
fi
source ${PATH_CONF}
case $FOFB_APP in
cellnode|centralnode)
logger -t "fofb-fpgainit" "Found configuration ${FOFB_APP}"
;;
*)
logger -s -t "fofb-fpgainit" "Could not establish FOFB application"
exit 1
;;
esac
# Taking the last binary fil in the sorted list (higher tag)
PATH_FPGABIN=$(ls -S /lib/firmware/base/${FOFB_APP}/*.bin | tail -n 1)
logger -t "fofb-fpgainit" "Loading FPGA image ${PATH_FPGABIN}"
fpgautil -b ${PATH_FPGABIN}
SUMMARY = "Program the FPGA depending on the configuration CellNode/CentralNode"
SECTION = "opt"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# RC script
INITSCRIPT_NAME = "fofb-fpgainit.sh"
INITSCRIPT_PARAMS = "defaults 50"
inherit update-rc.d
SRC_URI = " file://fofb-fpgainit.sh"
RDEPENDS_${PN}=" fpga-manager-script bash"
FILES_${PN}+="/etc/init.d/fofb-fpgainit.sh"
do_install() {
install -d ${D}/etc/init.d/
install -m 0755 ${WORKDIR}/fofb-fpgainit.sh ${D}/etc/init.d/fofb-fpgainit.sh
}
......@@ -27,12 +27,14 @@ IMAGE_INSTALL_append = " python3-asyncua"
IMAGE_INSTALL_append = " deviceaccess"
IMAGE_INSTALL_append = " deviceaccess-python-bindings"
IMAGE_INSTALL_append = " fofb-opcua-server"
IMAGE_INSTALL_append = " fofb-fpgainit"
IMAGE_INSTALL_append = " xilinx-xvc-server"
IMAGE_FEATURES_append = " fpga-manager"
#IMAGE_INSTALL_append = " python3-pytango"
# We do not need that
IMAGE_INSTALL_remove = " git python3-pip sudo"
IMAGE_INSTALL_remove = " fpgautil-init"
# Remove graphical features
DISTRO_FEATURES_remove = " x11 wayland opengl qt jupyter"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment