Skip to content

BMP hangs if flashing "connect under reset" MCU #1333

@Azq2

Description

@Azq2

My MCU in deep sleep and flashing only with monitor connect_rst enable
On fresh firmware 567b670 now hangs after one flashing. :(

BMP hardware: bluepill

bmp.scr

monitor debug_bmp enable
monitor connect_rst enable
monitor swdp_scan
attach 1
load
kill

First flashing (success)

INSTALL /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.9.0-rc0-13-g567b670c-dirty_C0D5DBD2-if00 stm32f0-pmic-with-rtc.elf (flash)
arm-none-eabi-gdb -nx --batch \
	-ex 'target extended-remote /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.9.0-rc0-13-g567b670c-dirty_C0D5DBD2-if00' \
	-x bmp.scr \
	stm32f0-pmic-with-rtc.elf
Assert nRST during connect: enabled
Target voltage: 0.00V
Available Targets:
No. Att Driver
 1      STM32F03 M0
reset_handler () at lib/libopencm3/lib/stm32/f0/../../cm3/vector.c:67
67		for (src = &_data_loadaddr, dest = &_data;
Loading section .text, size 0x1eec lma 0x8000000
Loading section .init_array, size 0x4 lma 0x8001eec
Loading section .ARM.exidx, size 0x8 lma 0x8001ef0
Start address 0x080015a4, load size 7928
Transfer rate: 15 KB/sec, 720 bytes/write.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[Inferior 1 (Remote target) killed]

Debug:

scan_multidrop: false
DP DPIDR 0x0bb11477 (v1 MINDP rev0) designer 0x43b partno 0xbb
RESET_SEQ failed
AP   0: IDR=04770021 CFG=00000000 BASE=e00ff003 CSW=03000040 (AHB-AP var2 rev0)
Halt via DHCSR: success 02000003 after 0ms
ROM: Table BASE=0xe00ff000 SYSMEM=0x00000001, Manufacturer  20 Partno 440
0 0xe000e000: Generic IP component - Cortex-M0 SCS (System Control Space) (PIDR = 0x00000004000bb008  DEVTYPE = 0x00 ARCHID = 0x0000)
-> cortexm_probe
CPUID 0x410cc200 (M0 var 0 rev 0)
1 0xe0001000: Generic IP component - Cortex-M0 DWT (Data Watchpoint and Trace) (PIDR = 0x00000004000bb00a  DEVTYPE = 0x00 ARCHID = 0x0000)
2 0xe0002000: Generic IP component - Cortex-M0 BPU (Breakpoint Unit) (PIDR = 0x00000004000bb00b  DEVTYPE = 0x00 ARCHID = 0x0000)
ROM: Table END

Second flashing (not success, bmp not responding to BMP)

INSTALL /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.9.0-rc0-13-g567b670c-dirty_C0D5DBD2-if00 stm32f0-pmic-with-rtc.elf (flash)
arm-none-eabi-gdb -nx --batch \
	-ex 'target extended-remote /dev/serial/by-id/usb-Black_Magic_Debug_Black_Magic_Probe__ST-Link_v2__v1.9.0-rc0-13-g567b670c-dirty_C0D5DBD2-if00' \
	-x bmp.scr \
	stm32f0-pmic-with-rtc.elf
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Ignoring packet error, continuing...
Malformed response to offset query, timeout
bmp.scr:1: Error in sourced command file:
"monitor" command not supported by this target.
make: *** [Makefile:60: install] Error 1

Debug:

SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting
SWD access resulted in wait, aborting

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugConfirmed bugCan't reproduceMaintainers can't reproduce this problem

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions