Debugging Electron

I am trying to setup the hardware debugger on an Electron.
I am testing using tinkerbreak.cpp and following the tutorial at https://docs.particle.io/tutorials/developer-tools/workbench/#debugging-3rd-generation-
and I have manually linked the pins for a gen2 device…

I get as far as the processor halting and the led turning off.
But nothing happens when I click continue on the VS workbench debugger toolbar.
I notice in the logs (attached below) that I am getting various errors starting with
“Error: stm32f2x.cpu – clearing lockup after double fault”
and other errors such as “Error: Failed to read memory at 0x1fff7a24” and “Warn : STM32 flash size failed, probe inaccurate - assuming 1024k flash”

Any suggestions much appreciated!

Terminal Output

Resuming connection to gdb server…
[2021-11-26T15:26:17.419Z] SERVER CONSOLE DEBUG: onBackendConnect: gdb-server session connected. You can switch to “DEBUG CONSOLE” to see GDB interactions.
Open On-Chip Debugger 0.10.0+dev-00920-g6ea43726 (2019-07-02-23:12)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : auto-selecting first available session transport “swd”. To override use 'transport select '.
Info : Listening on port 50004 for tcl connections
Info : Listening on port 50005 for telnet connections
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: FW Version = 0254.2
Info : CMSIS-DAP: Serial# = 310436023538fa6a0433363639323946a5a5a5a597969908
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: stm32f2x.cpu – clearing lockup after double fault
Polling target stm32f2x.cpu failed, trying to reexamine
Info : stm32f2x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 50003 for gdb connections
Info : accepting ‘gdb’ connection on tcp/50003
Info : device id = 0x201f6411
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0x1fff7a24
Warn : STM32 flash size failed, probe inaccurate - assuming 1024k flash
Info : flash size = 1024 kbytes
Info : flash size = 512 bytes
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0x00000002
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0x0800391c

Debug Console Output

Launching server: “…particle\toolchains\openocd\0.11.2-adhoc6ea4372.0\bin\openocd.exe” “-c” “gdb_port 50003” “-c” “tcl_port 50004” “-c” “telnet_port 50005” “-s” “…particle\toolchains\openocd\0.11.2-adhoc6ea4372.0\share\openocd\scripts” “-f” “interface\cmsis-dap.cfg” “-f” “target\stm32f2x.cfg”
Launching GDB: “…particle\toolchains\gcc-arm\9.2.1\bin\arm-none-eabi-gdb.exe” “-q” “–interpreter=mi2”
"…\Particle\projects\tinkerbreak\target\2.1.0\electron\tinkerbreak.elf"Set “showDevDebugOutput”: true in your “launch.json” to see verbose GDB transactions here. Helpful to debug issues or report problems undefined…particle\toolchains\gcc-arm\9.2.1\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
Reading symbols from …\Particle\projects\tinkerbreak\target\2.1.0\electron\tinkerbreak.elf…
0xfffffffe in ?? ()
Program stopped, probably due to a reset and/or halt issued by debugger
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
stm32f2x.cpu – clearing lockup after double fault

Program
received signal SIGINT, Interrupt.
0xfffffffe in ?? ()
stm32f2x.cpu – clearing lockup after double fault

Update for anyone else experiencing the same issues:

The above problems were found when I was testing using the Electron with SARA-G350 chip,
In order to check that this was not a board problem, I tried another board which happened to use the SARA -U270 chip.
With the U270 chip, debugging worked perfectly.

I tested both boards using a non debug build and flash of a basic test program and they both worked so I do not think my initial result was due to a faulty board.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.