Changes to make unlock and restore more stable

This commit is contained in:
Thomas Roth 2020-11-29 12:16:36 +01:00
parent 4a4ffaed18
commit 34842b6144
5 changed files with 12 additions and 13 deletions

View File

@ -26,7 +26,7 @@ if ! ./scripts/flashloader.sh $ADAPTER new_flash_image.bin; then
echo "Flashloader failed, check debug connection and try again."
fi
echo "Flash flashed. Now do the following procedure:"
echo "Flash successfully flashed. Now do the following procedure:"
echo "- Disconnect power from the device"
echo "- Power it again"
echo "- Press and hold the power button"
@ -53,4 +53,4 @@ fi
rm new_flash_image.bin
echo "Device backed up successful"
echo "Device backed up successfully"

View File

@ -28,9 +28,9 @@ echo "Unlocking device... (Takes up to 30 seconds.)"
if ! openocd -f openocd/interface_"$1".cfg \
-c "init;" \
-c "halt;" \
-f openocd/rdp0.cfg >/dev/null 2>&1; then
-f openocd/rdp0.cfg; then
echo "Unlocking device failed."
exit 1
fi
echo "Congratulations, your device has been unlocked. Please power-cycle it for the changes to take full effect."
echo "Congratulations, your device has been unlocked. Please power-cycle it for the changes to take full effect."

View File

@ -19,13 +19,8 @@ fi
ADAPTER=$1
echo "Ok, restoring original firmware!"
echo "Ok, restoring original firmware! (We will not lock the device, so you won't have to repeat this procedure!)"
echo "Restoring SPI flash..."
if ! ./scripts/flashloader.sh $ADAPTER backups/flash_backup.bin; then
echo "Restoring SPI flash failed. Check debug connection and try again."
exit 1
fi
echo "Restoring internal flash..."
if ! openocd -f openocd/interface_"$1".cfg \
@ -37,4 +32,11 @@ if ! openocd -f openocd/interface_"$1".cfg \
exit 1
fi
echo "Restoring SPI flash..."
if ! ./scripts/flashloader.sh $ADAPTER backups/flash_backup.bin; then
echo "Restoring SPI flash failed. Check debug connection and try again."
exit 1
fi
echo "Success, your device should be running the original firmware again!"

View File

@ -1,7 +1,6 @@
init
echo "Reset and halt"
reset
halt
# mwr

View File

@ -1,7 +1,5 @@
init
echo "Reset and halt"
reset
halt
# mwr