Skip to content
Snippets Groups Projects
Commit 1c56e2d3 authored by Stefan Schmidt's avatar Stefan Schmidt
Browse files

zephyr-flash-bossac.bbclass: Use internal bossac tool instead looking up PATH

Instead of looking in PATH on the host to find bossac we now depend on the
native variant we build and set the path to our yocto build tool.

Closes: https://git.ostc-eu.org/OSTC/planning/core-os/-/issues/240



Signed-off-by: default avatarStefan Schmidt <stefan.schmidt@huawei.com>
parent 8dcab069
No related branches found
No related tags found
No related merge requests found
#@DESCRIPTION: class file to flash boards like Arduino Nano BLE which depends on bossac for flashing #@DESCRIPTION: class file to flash boards like Arduino Nano BLE which depends on bossac for flashing
DEPENDS += "bossa-native"
python do_flash_usb() { python do_flash_usb() {
import shutil import shutil
import subprocess import subprocess
import serial.tools.list_ports import serial.tools.list_ports
# Note: make sure the installed bossac is set to PATH before running flash_usb()
# Check if bossac is avaiable for flashing # Check if bossac is avaiable for flashing
origbbenv = d.getVar("BB_ORIGENV", False) bossac_path = shutil.which("bossac")
bossac_path = shutil.which("bossac", path=origbbenv.getVar('PATH'))
if not bossac_path: if not bossac_path:
bb.fatal("ERROR: bossac not found, please install first and add to PATH") bb.fatal("ERROR: bossac not found.")
board = d.getVar('BOARD') board = d.getVar('BOARD')
...@@ -47,4 +47,3 @@ python do_flash_usb() { ...@@ -47,4 +47,3 @@ python do_flash_usb() {
addtask do_flash_usb after do_deploy addtask do_flash_usb after do_deploy
do_flash_usb[nostamp] = "1" do_flash_usb[nostamp] = "1"
do_flash_usb[vardepsexclude] = "BB_ORIGENV"
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