cancel
Showing results for 
Search instead for 
Did you mean: 

M4 can only be debugged when switches in 'Reserved' mode - why?

AStev.2
Associate III

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

5 REPLIES 5
Olivier GALLIEN
ST Employee

Hi @Community member​ ,

Where did you read that Boot 0 = 0, Boot2 = 1 stand for "Reserved" and Boot0 = 0, Boot2 = 0 for "Engi" ?

Reading here :

https://wiki.st.com/stm32mpu/wiki/STM32MP157x-DKx_-_hardware_description#Boot_related_switches

Boot0 = 0, Boot2 = 0 -> Forced USB boot for flashing

Boot0 = 0, Boot2 = 1 -> Engineering boot

Consistent with behavior you noticed.

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
AStev.2
Associate III

Hi Olivier,

I read it in the ST document UM2534 "Discovery kits with STM32MP157 MPUs" which describes the STM32MP157C-DK2 boot switches in Figure 7.

I think your WIKI could be clearer in places too, for example in section 5.2 'Introduction to boot mode', it states 'The STM32MP1 can be run in 2 differents (sic) boot modes', which I think could reasonably mislead the reader into believing there are only two valid positions for the boot switches.

Regards,

Andrew.

AStev.2
Associate III

Hi Olivier,

Please can you confirm you will resolve this documentation error?

Regards,

Andrew.

OKoko.1
Associate II

yes, I confirm AStev.2

to make STM32MP157 onboard F4 debugging working will require to set:

Boot0 = 0 (has switch number 1), Boot2 = 1 (has switch number 2) -> (whatever mode you name it) is set

thanks a lot AStev.2!

Olivier GALLIEN
ST Employee

Hi @Community member​ ,

Sorry for the confusion in naming.

Ideally UM2534 should be aligned on "engineering mode" naming. Request done but will wait for next document revision; ( not planned yet)

Could you please give link of WIKI where you you find misleading sentence. I didn't find it ...

Olivier

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.