fw: Add second pre-loaded app slot in flash

This commit is contained in:
Mikael Ågren 2025-03-18 13:18:33 +01:00
parent 1c4d11f49e
commit ac5c2aef86
No known key found for this signature in database
GPG key ID: E02DA3D397792C46
6 changed files with 73 additions and 35 deletions

View file

@ -1,12 +1,24 @@
#!/bin/bash -e
if [ $# != 1 ]
if [ $# != 2 ]
then
echo "Usage: $0 app_file"
echo "Usage: $0 slot_num app_file"
echo ""
echo "Where slot_num is 0 or 1."
exit
fi
APP="$1"
SLOT_NUM="$1"
APP="$2"
if [ "$SLOT_NUM" = "0" ]; then
START_ADDRESS=0x30000
elif [ "$SLOT_NUM" = "1" ]; then
START_ADDRESS=0x50000
else
echo "Invalid slot_num"
exit 1
fi
echo "WARNING: Will erase entire partition table."
read -p "Press CTRL-C to abort. Press key to continue." -n1 -s
@ -15,7 +27,7 @@ read -p "Press CTRL-C to abort. Press key to continue." -n1 -s
tillitis-iceprog -o 0x20000 -e 64k
# Erase existing pre loaded app
tillitis-iceprog -o 0x30000 -e 128k
tillitis-iceprog -o "$START_ADDRESS" -e 128k
# Write pre loaded app
tillitis-iceprog -o 0x30000 "$APP"
tillitis-iceprog -o "$START_ADDRESS" "$APP"