Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Last active September 1, 2021 02:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bahamas10/a957a6b817791622447b419dfe684bda to your computer and use it in GitHub Desktop.
Save bahamas10/a957a6b817791622447b419dfe684bda to your computer and use it in GitHub Desktop.
game and watch step 5

Running through the steps of https://github.com/ghidraninja/game-and-watch-backup

steps 1 - 4 were a success, step 5 gives me this:

$ OPENOCD=/opt/openopcd-git/bin/openocd ./5_restore.sh jlink
Ok, restoring original firmware! (We will not lock the device, so you won't have to repeat this procedure!)
Restoring internal flash...
Open On-Chip Debugger 0.11.0+dev-00331-g53556fcde-dirty (2021-08-16-17:30)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : J-Link ARM V8 compiled Dec  1 2009 11:42:48
Info : Hardware version: 8.00
Info : VTarget = 3.326 V
Info : clock speed 1800 kHz
Info : SWD DPIDR 0x6ba02477
Info : stm32h7x.cpu0: hardware has 8 breakpoints, 4 watchpoints
Info : gdb port disabled
Info : starting gdb server for stm32h7x.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Error: Error connecting DP: cannot read IDR
Error: Error connecting DP: cannot read IDR
Error: Error connecting DP: cannot read IDR
Info : AP write error, reset will not halt
Info : SWD DPIDR 0x6ba02477
Error: stm32h7x.cpu0 -- clearing lockup after double fault
target halted due to debug-request, current mode: Handler HardFault
xPSR: 0x01000003 pc: 0xfffffffe msp: 0xffffffd8
Polling target stm32h7x.cpu0 failed, trying to reexamine
Error: Error connecting DP: cannot read IDR
Examination failed, GDB will be halted. Polling again in 100ms
** Programming Started **
Error: Error connecting DP: cannot read IDR
Polling target stm32h7x.cpu0 failed, trying to reexamine
Error: Error connecting DP: cannot read IDR
Examination failed, GDB will be halted. Polling again in 300ms
Error: Error connecting DP: cannot read IDR
Error: Error connecting DP: cannot read IDR
Error: Failed to read memory and, additionally, failed to find out where
Error: auto_probe failed
embedded:startup.tcl:1070: Error: ** Programming Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 1135
at file "embedded:startup.tcl", line 1070
Restoring internal flash failed. Check debug connection and try again.
$ echo $?
1
@bahamas10
Copy link
Author

if any poor soul comes across this error message it was caused by 2 things!

  • shorts in my debug wires - i needed to solder the debug pins and not just use test clips
  • a crappy knock off jtag debugger - invest in a good one or similar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment