Add scripts for using ch341a programmer
This commit is contained in:
parent
c2a84550eb
commit
b0d4fd3487
15
scripts/_ch341a.sh
Normal file
15
scripts/_ch341a.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ ! -d "models/${MODEL}" ]
|
||||||
|
then
|
||||||
|
echo "model '${MODEL}' not found" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
MODEL_DIR="$(realpath "models/${MODEL}")"
|
||||||
|
|
||||||
|
if [ ! -f "${MODEL_DIR}/chip.txt" ]
|
||||||
|
then
|
||||||
|
echo "model '${MODEL}' does not have chip.txt" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
CHIP="$(cat "${MODEL_DIR}/chip.txt")"
|
18
scripts/ch341a-dump.sh
Executable file
18
scripts/ch341a-dump.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "$0 [model]" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
MODEL="$1"
|
||||||
|
|
||||||
|
source scripts/_ch341a.sh
|
||||||
|
|
||||||
|
flashrom -p ch341a_spi -c "${CHIP}" -r build/dump.rom
|
||||||
|
|
||||||
|
./coreboot/build/cbfstool build/dump.rom read -r CONSOLE -f build/dump.log
|
||||||
|
|
||||||
|
less build/dump.log
|
14
scripts/ch341a-flash.sh
Executable file
14
scripts/ch341a-flash.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "$0 [model]" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
MODEL="$1"
|
||||||
|
|
||||||
|
source scripts/_ch341a.sh
|
||||||
|
|
||||||
|
flashrom -p ch341a_spi -c "${CHIP}" -w "build/${MODEL}/firmware.rom"
|
Loading…
x
Reference in New Issue
Block a user