mirror of
https://github.com/tillitis/tillitis-key1.git
synced 2025-04-21 15:46:31 -04:00
tool: Add script to load pre-loaded app into flash
This commit is contained in:
parent
6e793bea26
commit
8e7108f7ee
34
hw/application_fpga/tools/load_preloaded_app.sh
Executable file
34
hw/application_fpga/tools/load_preloaded_app.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
if [ $# != 2 ]
|
||||
then
|
||||
echo "Usage: $0 slot_num app_file"
|
||||
echo ""
|
||||
echo "Where slot_num is 0 or 1."
|
||||
exit
|
||||
fi
|
||||
|
||||
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 install default partition table."
|
||||
read -p "Press CTRL-C to abort. Press key to continue." -n1 -s
|
||||
|
||||
# Write both copies of the partition table
|
||||
tillitis-iceprog -o 128k default_partition.bin
|
||||
tillitis-iceprog -o 0xf0000 default_partition.bin
|
||||
|
||||
# Erase existing pre loaded app
|
||||
tillitis-iceprog -o "$START_ADDRESS" -e 128k
|
||||
|
||||
# Write pre loaded app
|
||||
tillitis-iceprog -o "$START_ADDRESS" "$APP"
|
Loading…
x
Reference in New Issue
Block a user