From 158e3edbe74f5de53dfb9c0ebc2db4242aa1d1af Mon Sep 17 00:00:00 2001 From: geeksville Date: Mon, 28 Sep 2020 15:21:54 -0700 Subject: [PATCH] eink generate full image --- bin/install-bootloader.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/bin/install-bootloader.sh b/bin/install-bootloader.sh index 4d99af45b..842a64bc3 100755 --- a/bin/install-bootloader.sh +++ b/bin/install-bootloader.sh @@ -6,13 +6,6 @@ BOOTDIR=/home/kevinh/development/meshtastic/Adafruit_nRF52_Bootloader nrfjprog --eraseall -f nrf52 -#echo Programming soft device -#nrfjprog --program $BOOTDIR/lib/softdevice/s140_nrf52_6.1.1/s140_nrf52_6.1.1_softdevice.hex -f nrf52 - -echo Programming bootloader and soft device -# the following ling incorrectly enables reset pin, because the running code rewrites it -nrfjprog --program $BOOTDIR/_build/build-ttgo_eink/ttgo_eink_bootloader-0.3.2-123-g4f9022d-dirty_s140_6.1.1.hex -f nrf52 - # this generates an intel hex file that can be programmed into a NRF52 to tell the adafruit bootloader that the current app image is valid # Bootloader settings are at BOOTLOADER_SETTINGS (rw) : ORIGIN = 0xFF000, LENGTH = 0x1000 # first 4 bytes should be 0x01 to indicate valid app image @@ -20,12 +13,10 @@ nrfjprog --program $BOOTDIR/_build/build-ttgo_eink/ttgo_eink_bootloader-0.3.2-12 echo "01 00 00 00 00 00 00 00" | xxd -r -p - >/tmp/bootconf.bin srec_cat /tmp/bootconf.bin -binary -offset 0xff000 -output /tmp/bootconf.hex -intel -echo Programming meshtastic app load -nrfjprog --program .pio/build/eink/firmware.hex -f nrf52 +echo Generating merged hex file +mergehex -m $BOOTDIR/_build/build-ttgo_eink/ttgo_eink_bootloader-0.3.2-123-g4f9022d-dirty_s140_6.1.1.hex .pio/build/eink/firmware.hex /tmp/bootconf.hex -o ttgo_eink_full.hex echo Telling bootloader app region is valid and telling CPU to run -nrfjprog --program /tmp/bootconf.hex -f nrf52 --reset +nrfjprog --program ttgo_eink_full.hex -f nrf52 --reset # nrfjprog --readuicr /tmp/uicr.hex; objdump -s /tmp/uicr.hex | less - -echo FIXME use hexmerge