From 718ff9c1a43e9cab609e80ff82720b095055ea6f Mon Sep 17 00:00:00 2001 From: al3x10m Date: Tue, 29 Dec 2020 12:49:56 +0200 Subject: [PATCH] updated readme and scripts usage --- 2_backup_flash.sh | 2 +- README.md | 8 ++++++-- config.sh | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/2_backup_flash.sh b/2_backup_flash.sh index aac8032..b1756ed 100755 --- a/2_backup_flash.sh +++ b/2_backup_flash.sh @@ -3,7 +3,7 @@ source config.sh $1 if [[ $# -ne 1 ]]; then - echo "Usage: backup_flash.sh " + echo "Usage: backup_flash.sh " exit 1 fi diff --git a/README.md b/README.md index 2a5a65e..023df89 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains pre-built tools for backing up & restoring the original What you'll need: - A Game & Watch in original state -- An ARM debug probe (Tested with J-Link and ST-Link compatible devices) +- An ARM debug probe (Tested with J-Link and ST-Link compatible devices) or a Raspberry Pi - Connections to the [debug port](https://twitter.com/ghidraninja/status/1326860677353512960) - testclips or soldered wires work well! - A computer with Ubuntu 20.04 or compatible. @@ -33,6 +33,10 @@ Please either use an official ST-Link (not one of the small USB stick clones) or Programmers we had a lot of trouble with: J-Link EDU Mini (does not work), cheap ST-Link clones. +### Raspberry Pi host + +You can use a Raspberry Pi to back up your Game and Watch. In this case you should use a Raspbian install and follow the steps in the Ubuntu setup section but on Raspberry Pi. You need to use 3 wires: GPIO25 for SWCLK,GPIO24 for SWDIO and GND for GND (in BCM pinout notation) or you can hardcode your own gpios in openocd/rpi.cfg. A quick pinout reference on RPi can be seen by opening a terminal and running `pinout`. + ### Ubuntu setup Install the required tools: @@ -104,7 +108,7 @@ Your device was not modified by the scripts, so it should just continue to work Step 3 will change the internal flash of the device. If this step fails it will leave your device in a bricked state. To recover from it run: ``` -./scripts/flashloader.sh ./backups/flash_backup.bin +./scripts/flashloader.sh ./backups/flash_backup.bin ``` If the script can't connect to the device, press & hold down power on the device while running flashloader & try to FULLY powercycle the target between attempts. diff --git a/config.sh b/config.sh index 0e341de..18f3abb 100755 --- a/config.sh +++ b/config.sh @@ -13,6 +13,6 @@ ADAPTER=$1 mkdir -p logs backups if [[ $# -ne 1 ]] && [[ ! "$0" =~ .*"config.sh" ]]; then - echo "Usage: $0 " + echo "Usage: $0 " exit 1 fi