How to 'unbrick' a GNSE? - SOLVED

Hi,

I believe I bricked my GN, it won’t connect to the debugger anymore.

erwin@Erwins-Macbook ~ % /usr/local/bin/openocd -f interface/stlink.cfg -f target/stm32wlx.cfg
Open On-Chip Debugger 0.11.0
...
Info : STLINK V3J8M3B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 2.735399
Error: init mode failed (unable to connect to the target)

When I hold the reset button pressed I get a tad further and I can see there are 6 breakpoints set …

erwin@Erwins-Macbook ~ % /usr/local/bin/openocd -f interface/stlink.cfg -f target/stm32wlx.cfg
Open On-Chip Debugger 0.11.0
...
Info : STLINK V3J8M3B5S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 2.754384
Info : stm32wlx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wlx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Error: jtag status contains invalid mode value - communication failure
Polling target stm32wlx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 100ms

… I suspect those are the (a) problem but I don’t know how to get rid of them. I think I read instructions on how to re-install a boot loader somewhere but I can’t find that anymore either :slight_smile:

Any help will be greatly appreciated.

Cheers,

Erwin

Have you tried putting the BOOT0 jumper on (or short it out with a screwdriver) and then press the reset button - that should force it in to the internal ST boot loader …

Hi Nick,

Yes, I tried that after I posted. I get a bit further then, the debugging starts, it hits the breakpoint in main() and when I click run, or step, the session crashes with a lot of log msgs.

After that the communication is dead again and the only way (so far) to get it working again is to force the internal ST boot loader.

It complains about a communication failure but as far as I know nothing has changed in ST connections.

I wonder if something really died or some HW issue in either the GN or the ST.

openocd: Polling target stm32wlx.cpu failed, trying to reexamine

Here are some more log msgs.

...
Program stopped.
1: (57139) ->~"main () at /Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c:41\n"
1: (57140) ->~"41\t  HAL_Init();\n"
1: (57140) ->*stopped,reason="signal-received",signal-name="0",signal-meaning="Signal 0",frame={addr="0x08000d1a",func="main",args=[],file="/Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c",fullname="/Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c",line="41",arch="armv7e-m"},thread-id="1",stopped-threads="all"
main () at /Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c:41
41	  HAL_Init();
1: (57140) <-1023-stack-list-frames 0 1000
1: (57140) ->1023^done,stack=[frame={level="0",addr="0x08000d1a",func="main",file="/Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c",fullname="/Users/erwin/work/generic-node-se/Software/app/basic_lorawan/main.c",line="41",arch="armv7e-m"}]
1: (57140) ->(gdb)
1: (57140) 1023: elapsed time 0
1: (57148) Send Event AD7ExceptionEvent
<--   C (threads-13): {"command":"threads","type":"request","seq":13}
<--   C (stackTrace-14): {"command":"stackTrace","arguments":{"threadId":-2,"startFrame":0,"levels":20},"type":"request","seq":14}
1: (57158) <-1024-stack-list-arguments 0 0 0
1: (57158) ->1024^done,stack-args=[frame={level="0",args=[]}]
1: (57159) ->(gdb)
1: (57159) 1024: elapsed time 0
openocd: Info : Previous state query failed, trying to reconnect
openocd: Error: jtag status contains invalid mode value - communication failure
openocd: Polling target stm32wlx.cpu failed, trying to reexamine
openocd: Examination failed, GDB will be halted. Polling again in 300ms
<--   C (scopes-15): {"command":"scopes","arguments":{"frameId":1000},"type":"request","seq":15}
<--   C (variables-16): {"command":"variables","arguments":{"variablesReference":1000},"type":"request","seq":16}
1: (57591) <-1025-stack-list-variables 0
1: (57591) ->1025^done,variables=[]
1: (57591) ->(gdb)
1: (57591) 1025: elapsed time 0

SOLVED!

Total user error of course. Note to self. Do NOT set DEBUGGER_ON to 0 when debugging. <Sigh…>

Thanks for reading.

Erwin

2 Likes