Changes to make unlock and restore more stable
This commit is contained in:
parent
4a4ffaed18
commit
34842b6144
|
@ -26,7 +26,7 @@ if ! ./scripts/flashloader.sh $ADAPTER new_flash_image.bin; then
|
||||||
echo "Flashloader failed, check debug connection and try again."
|
echo "Flashloader failed, check debug connection and try again."
|
||||||
fi
|
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 "- Disconnect power from the device"
|
||||||
echo "- Power it again"
|
echo "- Power it again"
|
||||||
echo "- Press and hold the power button"
|
echo "- Press and hold the power button"
|
||||||
|
@ -53,4 +53,4 @@ fi
|
||||||
|
|
||||||
rm new_flash_image.bin
|
rm new_flash_image.bin
|
||||||
|
|
||||||
echo "Device backed up successful"
|
echo "Device backed up successfully"
|
|
@ -28,7 +28,7 @@ echo "Unlocking device... (Takes up to 30 seconds.)"
|
||||||
if ! openocd -f openocd/interface_"$1".cfg \
|
if ! openocd -f openocd/interface_"$1".cfg \
|
||||||
-c "init;" \
|
-c "init;" \
|
||||||
-c "halt;" \
|
-c "halt;" \
|
||||||
-f openocd/rdp0.cfg >/dev/null 2>&1; then
|
-f openocd/rdp0.cfg; then
|
||||||
echo "Unlocking device failed."
|
echo "Unlocking device failed."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -19,13 +19,8 @@ fi
|
||||||
|
|
||||||
ADAPTER=$1
|
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..."
|
echo "Restoring internal flash..."
|
||||||
if ! openocd -f openocd/interface_"$1".cfg \
|
if ! openocd -f openocd/interface_"$1".cfg \
|
||||||
|
@ -37,4 +32,11 @@ if ! openocd -f openocd/interface_"$1".cfg \
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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!"
|
echo "Success, your device should be running the original firmware again!"
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
init
|
init
|
||||||
echo "Reset and halt"
|
echo "Reset and halt"
|
||||||
reset
|
|
||||||
halt
|
halt
|
||||||
|
|
||||||
# mwr
|
# mwr
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
init
|
init
|
||||||
echo "Reset and halt"
|
|
||||||
reset
|
|
||||||
halt
|
halt
|
||||||
|
|
||||||
# mwr
|
# mwr
|
||||||
|
|
Loading…
Reference in New Issue