diff options
| author | s-ol <s+removethis@s-ol.nu> | 2024-10-12 17:33:39 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2024-10-12 17:33:39 +0000 |
| commit | 2b1ec5fa2a4075ef7ae9bb4a18936af669c15cf9 (patch) | |
| tree | 355da96a3d04858e50c7ea4b0dd6f038f374d232 | |
| parent | scripts: more options for flashing (diff) | |
| download | firmware-2b1ec5fa2a4075ef7ae9bb4a18936af669c15cf9.tar.gz firmware-2b1ec5fa2a4075ef7ae9bb4a18936af669c15cf9.zip | |
scripts: support specifying drive, other configs
| -rw-r--r-- | .scripts/config.dev.py | 15 | ||||
| -rwxr-xr-x | .scripts/flash | 29 |
2 files changed, 35 insertions, 9 deletions
diff --git a/.scripts/config.dev.py b/.scripts/config.dev.py new file mode 100644 index 0000000..b5b332d --- /dev/null +++ b/.scripts/config.dev.py @@ -0,0 +1,15 @@ +from hex33board.boards.r4_5e4bf5c import * + + +''' boot in dev_mode by default + +When active, the firmware drive will be writable on boot. +''' +dev_mode = True + +''' forward Key events via USB MIDI + +This can be useful to control a simulator instance running on a computer +using the physical buttons on a hardware unit. +''' +sysex_key_sync = False diff --git a/.scripts/flash b/.scripts/flash index ead035f..1c5f99e 100755 --- a/.scripts/flash +++ b/.scripts/flash @@ -6,6 +6,9 @@ CPY= CONFIG= TTY= +UF2_DISK= +CPY_DISK= + set -e while test $# -gt 0 @@ -14,14 +17,22 @@ do --cpy) CPY=1 ;; - --config=testing) - CONFIG=config.testing.py + --config=*) + CONFIG="${1#*=}" + ;; + --uf2-disk=*) + UF2_DISK="${1#*=}" + ;; + --cpy-disk=*) + CPY_DISK="${1#*=}" ;; --help) echo "USAGE:" - echo " --cpy (also) flash circuitpython" - echo " --config=testing copy testing config" - echo " --tty open tty in tio" + echo " --cpy (also) flash circuitpython" + echo " --uf2-disk=/dev/sda1 path to UF2 bootloader disk for flashing CPy" + echo " --cpy-disk=/dev/sda1 path to CircuitPython code disk for flashing firmware" + echo " --config=config.testing.py copy a different config" + echo " --tty open tty in tio" exit ;; esac @@ -44,16 +55,16 @@ wait_disk() { } if [ -n "$CPY" ]; then - disk=$(wait_disk /dev/disk/by-label/RPI-RP2) - sudo mount $disk $MOUNT -o sync,rw,uid=$(id -u),gid=$(id -g) + [ -z "$UF2_DISK"] && UF2_DISK=$(wait_disk /dev/disk/by-label/RPI-RP2) + sudo mount "$UF2_DISK" $MOUNT -o sync,rw,uid=$(id -u),gid=$(id -g) echo -n "flashing CircuitPython..." cp adafruit-circuitpython-solderparty_rp2040_stamp-en_US-*.uf2 $MOUNT/ echo " done" echo fi -disk=$(wait_disk /dev/disk/by-label/{CIRCUITPY,HEX33BOARD}) -sudo mount $disk $MOUNT -o sync,rw,uid=$(id -u),gid=$(id -g) +[ -z "$CPY_DISK" ] && CPY_DISK=$(wait_disk /dev/disk/by-label/{CIRCUITPY,HEX33BOARD}) +sudo mount "$CPY_DISK" $MOUNT -o sync,rw,uid=$(id -u),gid=$(id -g) echo -n "copying Code..." rsync -r $REPO/* $MOUNT/ echo " done" |
