v2x: added recipe (moved from meta-netmodule-om)

BugzID: 72787

Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-05-18 11:36:40 +02:00
parent 3cfed374e5
commit 0b52ba81d1
4 changed files with 79 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#!/bin/sh
HUB_RST=/sys/class/leds/hub_rst/brightness
V2X_RST=/sys/class/leds/v2x_rst/brightness
if [ ! -f $HUB_RST ]; then
echo Reset lines not available
return 1
fi
echo 0 > $HUB_RST
echo 0 > $V2X_RST
timeout 30 bash -c -- 'while true; do lsusb | grep "0483:df11"; if [ $? == 0 ]; then break; fi; done'
output=$(dfu-util -d 0483:df11 -s 0x10000000 -D /lib/firmware/v2x/SECTON.packed_bin.rom 2>&1)
err=$?
if [ $err != 0 ]; then
echo "Something went wrong while uploading firmware"
if echo "$output" | grep -i "Error during abort get_status"; then
echo "get_status error: ignoring"
exit 0
else
echo "Unexpected error"
echo "$output"
exit 1
fi
fi
exit 0

View File

@ -0,0 +1,12 @@
[Unit]
Description=V2X Firmware loader
Before=gpsd.service
[Service]
Type=oneshot
ExecStart=/usr/bin/v2x-fw-load
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
RequiredBy=multi-user.target

View File

@ -0,0 +1,35 @@
# Copyright (C) 2019 Ramon Moesching <ramon.moesching@netmodule.com>
# Released under the MIT license (see COPYING.MIT for the terms)
DESCRIPTION = "Murata v2x module firmware loader service"
HOMEPAGE = "www.netmodule.com"
LICENSE = "MIT"
SECTION = "bsp/firmware"
RDEPENDS_${PN} = "dfu-util usbutils coreutils"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
inherit systemd
SRC_URI = " \
file://v2x-ieee802.11p.service \
file://v2x-fw-load \
file://v2x_dummy.rom "
S = "${WORKDIR}"
SYSTEMD_SERVICE_${PN} = " \
v2x-ieee802.11p.service \
"
FILES_${PN} = "${systemd_unitdir}/system ${bindir} ${nonarch_base_libdir}/firmware/v2x "
do_install() {
install -d ${D}${systemd_unitdir}/system
install -m 644 ${WORKDIR}/v2x-ieee802.11p.service ${D}${systemd_unitdir}/system/
install -d ${D}${nonarch_base_libdir}/firmware/v2x
install -m 644 ${WORKDIR}/v2x_dummy.rom ${D}${nonarch_base_libdir}/firmware/v2x/SECTON.packed_bin.rom
install -d ${D}${bindir}
install -m 744 ${WORKDIR}/v2x-fw-load ${D}${bindir}
}