From cc4f0d4afb66dae10e811a8b7f10abbaefa3fecf Mon Sep 17 00:00:00 2001 From: Angus Ainslie Date: Thu, 23 Dec 2021 11:02:58 -0800 Subject: [PATCH] scripts/write_flash.sh: add an offset for the write The firmware jail needs to be writen after the TPS firmware so add an offset for the write. libusb times out if we try and wait for the command to complete so the timeouts needed to be extended. Signed-off-by: Angus Ainslie --- scripts/write_flash.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/write_flash.sh b/scripts/write_flash.sh index 5b545ab..70f7dad 100755 --- a/scripts/write_flash.sh +++ b/scripts/write_flash.sh @@ -3,11 +3,17 @@ set -e if [ $# -lt 1 ]; then - echo "Usage: $0 " + echo "Usage: $0 [offset]" echo "\tWrites a file to the NOR flash" exit 1 fi +if [ $# -gt 1 ]; then + OFFSET=$2 +else + OFFSET=0 +fi + cleanup() { [ -z "${UUU_SCRIPT}" ] || rm -f "${UUU_SCRIPT}" @@ -46,13 +52,15 @@ SDPV: jump FB: ucmd setenv fastboot_buffer 0x43000000 FB: download -f ${FILE} FB: ucmd sf probe -FB: ucmd sf erase 0 ${HEX_SIZE} -FB: delay 2000 -FB: ucmd sf write 0x43000000 0 ${HEX_SIZE} -FB: delay 2000 -FB: ucmd sf read 0x44000000 0 ${HEX_SIZE} FB: delay 2000 +FB: acmd sf erase ${OFFSET} ${HEX_SIZE} +FB: delay 9000 +FB: acmd sf write 0x43000000 ${OFFSET} ${HEX_SIZE} +FB: delay 12000 +FB: acmd sf read 0x44000000 ${OFFSET} ${HEX_SIZE} +FB: delay 9000 FB: ucmd cmp 0x43000000 0x44000000 ${HEX_WORDS} +FB: delay 2000 FB: Done EOF -- GitLab