summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot <root@lab2.panaceas.james.internal>2023-05-02 11:31:36 +0100
committerroot <root@lab2.panaceas.james.internal>2023-05-02 11:31:36 +0100
commitce27877473d41592b7bc3be515c074acb3a257c0 (patch)
tree659aefb5bb2a2fa762bc5e152545ea8a7b557d2f
parent96e66647cfa311e9b21c8086dfebd08724e37061 (diff)
downloadtim_ac3rf_fpga_kit-ce27877473d41592b7bc3be515c074acb3a257c0.tar.gz
tim_ac3rf_fpga_kit-ce27877473d41592b7bc3be515c074acb3a257c0.tar.bz2
tim_ac3rf_fpga_kit-ce27877473d41592b7bc3be515c074acb3a257c0.zip
add flash script
-rwxr-xr-xbin/flash19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/flash b/bin/flash
new file mode 100755
index 0000000..42910a9
--- /dev/null
+++ b/bin/flash
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+SOURCE=${BASH_SOURCE[0]}
+while [ -L "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
+ DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
+ SOURCE=$(readlink "$SOURCE")
+ [[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
+done
+DIR=$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )
+
+F="$1"
+CHIP_SIZE=2048
+
+dd if=/dev/zero ibs=1k count=${CHIP_SIZE} | tr "\000" "\377" | cat $F - | dd ibs=1k count=${CHIP_SIZE} | ${DIR}/../sbin/flashrom --programmer ft2232_spi:type=tumpalite,gpiol0=L -w -
+
+
+#${DIR}/sbin/flashrom --programmer ft2232_spi:type=tumpalite,gpiol0=L -w padded.bin
+
+