M4 can only be debugged when switches in 'Reserved' mode - why?
I am using STM32CubeIDE v1.4.2 on Ubuntu 18.04.05 with an STM32MP157C-DK2. The board is running the V2 Starter Kit image. If I set the boot switches to 'Reserved' (Boot 0 = 0, Boot2 = 1) I can program the M4 and step through the code. However, if I set the switches to 'Engineering Mode' (Boot0 = 0, Boot2 = 0) as ST suggests I cannot.
Does anyone have any idea why I cannot run M4 code in 'Engineering Mode'? The issue seems to be 'external reset detected'. After this message there are timeout messages. This is the console output when I attempt to load and debug M4 code in 'Engineering Mode':
Open On-Chip Debugger 0.10.0+dev-g30d1303 (2020-06-18-09:11)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J37M26 (API v2) VID:PID 0483:3752
Info : Target voltage: 3.219974
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : STM32MP157CACx.cm4: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157CACx.cpu0: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157CACx.cpu1: hardware has 6 breakpoints, 4 watchpoints
Info : STM32MP157CACx.cm4: external reset detected
Info : starting gdb server for STM32MP157CACx.cpu0 on 3334
Info : Listening on port 3334 for gdb connections
Info : starting gdb server for STM32MP157CACx.cm4 on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Error executing event gdb-attach on target STM32MP157CACx.cm4:
Info : New GDB Connection: 1, Target STM32MP157CACx.cm4, state: reset
Warn : negative reply, retrying
Warn : negative reply, retrying
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x6ba02477
Info : Deferring arp_examine of STM32MP157CACx.cm4
Info : Use arp_examine command to examine it manually!
Info : stlink_dap_op_connect(connect)
Info : stlink_dap_op_connect(reconnect)
Info : SWD DPIDR 0x6ba02477
Info : SWD DPIDR 0x6ba02477
Info : STM32MP157CACx.cm4: hardware has 6 breakpoints, 4 watchpoints
Info : Halt timed out, wake up GDB.
Error: timed out while waiting for target halted
Warn : target STM32MP157CACx.cm4 is not halted (add breakpoint)
Error: can't add breakpoint: target running
