Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gdb] target state locked in "running" after step instruction with st-util and gdb #831

Closed
6 tasks done
alexonea opened this issue Sep 14, 2019 · 6 comments · Fixed by #803
Closed
6 tasks done

[gdb] target state locked in "running" after step instruction with st-util and gdb #831

alexonea opened this issue Sep 14, 2019 · 6 comments · Fixed by #803

Comments

@alexonea
Copy link

Dear developers and maintainers of stlink,

I am trying to debug a simple program for the STM32F769I-DISCO board with Stlink/v2. I am using an Ubuntu machine, st-util for the gdb server and gdb-multiarch for the client. The connection to the target and loading of the program are successful, as well as the detection of the target in st-util (at least it seems so). However, when I try to step through the first instruction (stepi in gdb), it hangs, while the target seems to enter into continuous execution mode. Verbose output of st-util reveals that indeed, the core status is running.

Attached version information and output logs.

Ubuntu:

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="19.04 (Disco Dingo)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 19.04"
VERSION_ID="19.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=disco
UBUNTU_CODENAME=disco

$ uname -a
Linux 5.0.0-27-generic #28-Ubuntu SMP Tue Aug 20 19:53:07 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

st-util:

$ st-util --version
v1.5.1

gdb-multiarch:

$ gdb-multiarch --version
GNU gdb (Ubuntu 8.2.91.20190405-0ubuntu3) 8.2.91.20190405-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Target identification:

$ st-info --probe
Found 1 stlink programmers
 serial: 303636394646353735323531373137
openocd: "\x30\x36\x36\x39\x46\x46\x35\x37\x35\x32\x35\x31\x37\x31\x37"
  flash: 2097152 (pagesize: 2048)
   sram: 524288
 chipid: 0x0451
  descr: F76xxx device

STLink Firmware:

(taken from STLinkUpgrade 3.2.12 GUI on Ubuntu)
ST-Link ID: 0669FF575251717867092414
Firmware version: V2J32M22
  • Programmer/board type: e.g Stlink/v1, Stlink/v2, Stlink/v2-onboard
  • Programmer firmware version: e.g STSW-LINK007 2.27.15
  • Operating system: e.g Linux, Mac OS X, Windows (with specific version)
  • Stlink tools version and/or git commit hash: e.g v1.1.0/git-c722056
  • Stlink commandline tool name: e.g st-info, st-flash, st-util
  • Target chip (and optional board): e.g STM32F402VG (STM32Fxxx Discovery)

Reproduction steps:

  1. Run st-util -v99
  2. Run gdb-multiarch program.elf and connect to target, plus load the program into memory

at this point GDB cli looks like this (additional disassemble run)

$ gdb-multiarch --command scripts/debug.gdb template.elf
GNU gdb (Ubuntu 8.2.91.20190405-0ubuntu3) 8.2.91.20190405-git
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from template.elf...
0x08000008 in ?? ()
Loading section .text, size 0x2c lma 0x20000000
Start address 0x20000008, load size 44
Transfer rate: 505 bytes/sec, 44 bytes/write.
(gdb)  disassemble
Dump of assembler code for function _start:
=> 0x20000008 <+0>:	movs	r0, #5
   0x2000000a <+2>:	ldr	r0, [pc, #28]	; (0x20000028 <loop+2>)
   0x2000000c <+4>:	ldr	r1, [r0, #4]
   0x2000000e <+6>:	mvn.w	r2, #15
   0x20000012 <+10>:	ands	r1, r2
   0x20000014 <+12>:	mov.w	r2, #2
   0x20000018 <+16>:	orrs	r1, r2
   0x2000001a <+18>:	str	r1, [r0, #4]
   0x2000001c <+20>:	ldr	r1, [r0, #12]
   0x2000001e <+22>:	mov.w	r2, #256	; 0x100
   0x20000022 <+26>:	orrs	r1, r2
   0x20000024 <+28>:	str	r1, [r0, #12]
End of assembler dump.
  1. Run nexti GDB command

expected result: the target executes one instruction and gdb regains control afterwards
observed result: the target enters some kind of continuous execution mode, GDB never gains control again.

Moreover, if I stop the execution with ^C in GDB, PC is shown to point to 0x00000000 or, in other cases to random addresses.

Output from st-util (clipped):

$ st-util -v99
st-util 1.5.1
2019-09-14T11:47:22 DEBUG common.c: stlink current mode: mass
2019-09-14T11:47:22 DEBUG common.c: stlink current mode: mass
2019-09-14T11:47:22 DEBUG common.c: *** stlink_enter_swd_mode ***
2019-09-14T11:47:22 DEBUG common.c: *** looking up stlink version
2019-09-14T11:47:22 DEBUG common.c: st vid         = 0x0483 (expect 0x0483)
2019-09-14T11:47:22 DEBUG common.c: stlink pid     = 0x374b
2019-09-14T11:47:22 DEBUG common.c: stlink version = 0x2
2019-09-14T11:47:22 DEBUG common.c: jtag version   = 0x20
2019-09-14T11:47:22 DEBUG common.c: swim version   = 0x16
2019-09-14T11:47:22 DEBUG common.c: *** stlink_jtag_reset ***
2019-09-14T11:47:22 DEBUG common.c: *** stlink_reset ***
2019-09-14T11:47:22 DEBUG common.c: *** stlink_write_debug32 5fa0004 to 0xe000ed0c
2019-09-14T11:47:22 INFO common.c: Loading device parameters....
2019-09-14T11:47:22 DEBUG common.c: *** stlink_core_id ***
2019-09-14T11:47:22 DEBUG common.c: core_id = 0x5ba02477
2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 10016451 is 0xe0042000
2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 800c000 is 0x1ff0f440
2019-09-14T11:47:22 INFO common.c: Device connected is: F76xxx device, id 0x10016451
2019-09-14T11:47:22 INFO common.c: SRAM size: 0x80000 bytes (512 KiB), Flash: 0x200000 bytes (2048 KiB) in pages of 2048 bytes
2019-09-14T11:47:22 DEBUG common.c: *** set_swdclk ***
2019-09-14T11:47:22 DEBUG common.c: *** stlink_reset ***
2019-09-14T11:47:22 DEBUG common.c: *** stlink_write_debug32 5fa0004 to 0xe000ed0c
2019-09-14T11:47:22 INFO gdb-server.c: Chip ID is 00000451, Core ID is  5ba02477.
2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 5fa0004 is 0xe000ed78
2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 40200 is 0xe000ed14
2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 8303c003 is 0xe000ed7c
2019-09-14T11:47:22 INFO gdb-server.c: Chip clidr: 05fa0004, I-Cache: off, D-Cache: off
2019-09-14T11:47:22 INFO gdb-server.c:  cache: LoUU: 0, LoC: 5, LoUIS: 7
2019-09-14T11:47:22 INFO gdb-server.c:  cache: ctr: 8303c003, DminLine: 32 bytes, IminLine: 32 bytes
2019-09-14T11:47:22 DEBUG common.c: *** stlink_write_debug32 0 to 0xe000ed84
2019-09-14T11:47:22 INFO gdb-server.c: D-Cache L0: 2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 f00fe019 is 0xe000ed80
2019-09-14T11:47:22 INFO gdb-server.c: f00fe019 LineSize: 8, ways: 4, sets: 128 (width: 12)
2019-09-14T11:47:22 DEBUG common.c: *** stlink_write_debug32 a to 0xe000ed84
2019-09-14T11:47:22 INFO gdb-server.c: D-Cache L5: 2019-09-14T11:47:22 DEBUG common.c: *** stlink_read_debug32 f00fe019 is 0xe000ed80
2019-09-14T11:47:22 INFO gdb-server.c: f00fe019 LineSize: 8, ways: 4, sets: 128 (width: 12)
2019-09-14T11:47:22 INFO gdb-server.c: Listening at *:4242...
2019-09-14T11:49:26 DEBUG common.c: *** stlink_force_debug_mode ***
2019-09-14T11:49:26 DEBUG common.c: *** stlink_reset ***
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 5fa0004 to 0xe000ed0c
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 3 to 0xe0002000
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_debug32 10000081 is 0xe0002000
2019-09-14T11:49:26 INFO gdb-server.c: Found 8 hw breakpoint registers
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002008
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe000200c
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002010
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002014
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002018
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe000201c
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002020
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0002024
2019-09-14T11:49:26 DEBUG gdb-server.c: init watchpoints
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_debug32 1 is 0xe000edfc
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 1000001 to 0xe000edfc
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0001028
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0001038
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0001048
2019-09-14T11:49:26 DEBUG common.c: *** stlink_write_debug32 0 to 0xe0001058
2019-09-14T11:49:26 INFO gdb-server.c: GDB connected.
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qSupported:multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Supported;multiprocess+;swbreak+;hwbreak+;qRelocInsn+;fork-events+;vfork-events+;exec-events+;vContSupported+;QThreadEvents+;no-resumed+;xmlRegisters=i386
2019-09-14T11:49:26 DEBUG gdb-server.c: send: PacketSize=3fff;qXfer:memory-map:read+;qXfer:features:read+
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: vMustReplyEmpty
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: Hg0
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qXfer:features:read:target.xml:0,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Xfer;features:read:target.xml:0,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: Xfer: type:features;op:read;annex:target.xml;addr:0;length:4096
2019-09-14T11:49:26 DEBUG gdb-server.c: send: m<?xml version="1.0"?><!DOCTYPE target SYSTEM "gdb-target.dtd"><target version="1.0">   <architecture>arm</architecture>   <feature name="org.gnu.gdb.arm.m-profile">       <reg name="r0" bitsize="32"/>       <reg name="r1" bitsize="32"/>       <reg name="r2" bitsize="32"/>       <reg name="r3" bitsize="32"/>       <reg name="r4" bitsize="32"/>       <reg name="r5" bitsize="32"/>       <reg name="r6" bitsize="32"/>       <reg name="r7" bitsize="32"/>       <reg name="r8" bitsize="32"/>       <reg name="r9" bitsize="32"/>       <reg name="r10" bitsize="32"/>       <reg name="r11" bitsize="32"/>       <reg name="r12" bitsize="32"/>       <reg name="sp" bitsize="32" type="data_ptr"/>       <reg name="lr" bitsize="32"/>       <reg name="pc" bitsize="32" type="code_ptr"/>       <reg name="xpsr" bitsize="32" regnum="25"/>       <reg name="msp" bitsize="32" regnum="26" type="data_ptr" group="general" />       <reg name="psp" bitsize="32" regnum="27" type="data_ptr" group="general" />       <reg name="control" bitsize="8" regnum="28" type="int" group="general" />       <reg name="faultmask" bitsize="8" regnum="29" type="int" group="general" />       <reg name="basepri" bitsize="8" regnum="30" type="int" group="general" />       <reg name="primask" bitsize="8" regnum="31" type="int" group="general" />       <reg name="s0" bitsize="32" regnum="32" type="float" group="float" />       <reg name="s1" bitsize="32" type="float" group="float" />       <reg name="s2" bitsize="32" type="float" group="float" />       <reg name="s3" bitsize="32" type="float" group="float" />       <reg name="s4" bitsize="32" type="float" group="float" />       <reg name="s5" bitsize="32" type="float" group="float" />       <reg name="s6" bitsize="32" type="float" group="float" />       <reg name="s7" bitsize="32" type="float" group="float" />       <reg name="s8" bitsize="32" type="float" group="float" />       <reg name="s9" bitsize="32" type="float" group="float" />       <reg name="s10" bitsize="32" type="float" group="float" />       <reg name="s11" bitsize="32" type="float" group="float" />       <reg name="s12" bitsize="32" type="float" group="float" />       <reg name="s13" bitsize="32" type="float" group="float" />       <reg name="s14" bitsize="32" type="float" group="float" />       <reg name="s15" bitsize="32" type="float" group="float" />       <reg name="s16" bitsize="32" type="float" group="float" />       <reg name="s17" bitsize="32" type="float" group="float" />       <reg name="s18" bitsize="32" type="float" group="float" />       <reg name="s19" bitsize="32" type="float" group="float" />       <reg name="s20" bitsize="32" type="float" group="float" />       <reg name="s21" bitsize="32" type="float" group="float" />       <reg name="s22" bitsize="32" type="float" group="float" />       <reg name="s23" bitsize="32" type="float" group="float" />       <reg name="s24" bitsize="32" type="float" group="float" />       <reg name="s25" bitsize="32" type="float" group="float" />       <reg name="s26" bitsize="32" type="float" group="float" />       <reg name="s27" bitsize="32" type="float" group="float" />       <reg name="s28" bitsize="32" type="float" group="float" />       <reg name="s29" bitsize="32" type="float" group="float" />       <reg name="s30" bitsize="32" type="float" group="float" />       <reg name="s31" bitsize="32" type="float" group="float" />       <reg name="fpscr" bitsize="32" type="int" group="float" />   </feature></target>
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qXfer:features:read:target.xml:d98,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Xfer;features:read:target.xml:d98,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: Xfer: type:features;op:read;annex:target.xml;addr:3480;length:4096
2019-09-14T11:49:26 DEBUG gdb-server.c: send: l
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qTStatus
2019-09-14T11:49:26 DEBUG gdb-server.c: query: TStatus;
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: ?
2019-09-14T11:49:26 DEBUG gdb-server.c: send: S05
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qfThreadInfo
2019-09-14T11:49:26 DEBUG gdb-server.c: query: fThreadInfo;
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qL1200000000000000000
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: Hc-1
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qC
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qAttached
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Attached;
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qOffsets
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Offsets;
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: g
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_all_regs ***
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100020ffffffff08000008
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qL1200000000000000000
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qXfer:memory-map:read::0,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Xfer;memory-map:read::0,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: Xfer: type:memory-map;op:read;annex:;addr:0;length:4096
2019-09-14T11:49:26 DEBUG gdb-server.c: send: m<?xml version="1.0"?><!DOCTYPE memory-map PUBLIC "+//IDN gnu.org//DTD GDB Memory Map V1.0//EN"     "http://sourceware.org/gdb/gdb-memory-map.dtd"><memory-map>  <memory type="ram" start="0x00000000" length="0x4000"/>  <memory type="rom" start="0x00200000" length="0x100000"/>  <memory type="ram" start="0x20000000" length="0x80000"/>  <memory type="flash" start="0x08000000" length="0x20000">    <property name="blocksize">0x8000</property>  </memory>  <memory type="flash" start="0x08020000" length="0x20000">    <property name="blocksize">0x20000</property>  </memory>  <memory type="flash" start="0x08040000" length="0xC0000">    <property name="blocksize">0x40000</property>  </memory>  <memory type="ram" start="0x40000000" length="0x1fffffff"/>  <memory type="ram" start="0x60000000" length="0x7fffffff"/>  <memory type="ram" start="0xe0000000" length="0x1fffffff"/>  <memory type="rom" start="0x00100000" length="0xEDC0"/>  <memory type="rom" start="0x1fff0000" length="0x20"/></memory-map>
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: qXfer:memory-map:read::3e4,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: query: Xfer;memory-map:read::3e4,1000
2019-09-14T11:49:26 DEBUG gdb-server.c: Xfer: type:memory-map;op:read;annex:;addr:996;length:4096
2019-09-14T11:49:26 DEBUG gdb-server.c: send: l
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: m8000004,4
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 08000008
2019-09-14T11:49:26 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:26 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:26 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000004,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 08000008
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000006,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0008
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000004,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0800
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000006,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0008
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000004,2
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0800
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000004,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 08000008
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000004,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 08000008
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: m8000008,4
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 0130fde7
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: p19
2019-09-14T11:49:27 DEBUG common.c: *** stlink_read_reg
2019-09-14T11:49:27 DEBUG common.c:  (16) ***
2019-09-14T11:49:27 DEBUG usb.c: r_idx (16) = 0x00000000
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 00000000
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: qSymbol::
2019-09-14T11:49:27 DEBUG gdb-server.c: query: Symbol;:
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: X20000000,0:
2019-09-14T11:49:27 DEBUG gdb-server.c: send: 
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: M20000000,2c:00100020080000200520074841686ff00f0211404ff0020211434160c1684ff480721143c160fee700100140
2019-09-14T11:49:27 DEBUG common.c: *** stlink_write_mem32 44 bytes to 0x20000000
2019-09-14T11:49:27 DEBUG gdb-server.c: send: OK
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: Pf=08000020
2019-09-14T11:49:27 DEBUG common.c: *** stlink_write_reg
2019-09-14T11:49:27 DEBUG gdb-server.c: send: OK
2019-09-14T11:49:27 DEBUG gdb-server.c: recv: P19=00000001
2019-09-14T11:49:27 DEBUG common.c: *** stlink_write_reg
2019-09-14T11:49:27 DEBUG gdb-server.c: send: OK
2019-09-14T11:50:44 DEBUG gdb-server.c: recv: m20000000,40
2019-09-14T11:50:44 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:50:44 DEBUG gdb-server.c: send: 00100020080000200520074841686ff00f0211404ff0020211434160c1684ff480721143c160fee70010014098992d0756853248706e2e42bb9dfce0240902ba
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000004,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 08000020
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000004,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 08000020
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000006,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0020
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000004,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0800
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000006,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0020
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000004,2
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 0800
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000004,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 08000020
2019-09-14T11:53:07 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:07 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:07 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000004,4
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 08000020
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m2000000a,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m2000000a,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,4
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 05200748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m20000008,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0520
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m2000000a,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: Z0,2000000a,2
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: m2000000a,2
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 0748
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: M2000000a,2:01de
2019-09-14T11:53:08 DEBUG common.c: *** stlink_write_mem8 ***
2019-09-14T11:53:08 DEBUG gdb-server.c: send: OK
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: vCont?
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: Hc0
2019-09-14T11:53:08 DEBUG gdb-server.c: send: 
2019-09-14T11:53:08 DEBUG gdb-server.c: recv: c
2019-09-14T11:53:08 DEBUG common.c: *** stlink_read_debug32 40200 is 0xe000ed14
2019-09-14T11:53:08 DEBUG common.c: *** stlink_run ***
2019-09-14T11:53:08 DEBUG common.c: *** stlink_status ***
2019-09-14T11:53:08 DEBUG common.c:   core status: running
[ . . . ]
2019-09-14T11:53:12 DEBUG common.c: *** stlink_status ***
2019-09-14T11:53:12 DEBUG common.c:   core status: running
2019-09-14T11:53:12 DEBUG common.c: *** stlink_force_debug_mode ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: S05
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: g
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_all_regs ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 05000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e00f0020f9ffffff00000000
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: M2000000a,2:0748
2019-09-14T11:53:12 DEBUG common.c: *** stlink_write_mem8 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: OK
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,2
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 9263
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,2
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 9263
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:12 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:12 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:12 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:13 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:13 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:13 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:13 DEBUG gdb-server.c: recv: m0,4
2019-09-14T11:53:13 DEBUG common.c: *** stlink_read_mem32 ***
2019-09-14T11:53:13 DEBUG gdb-server.c: send: 92635738
2019-09-14T11:53:13 DEBUG gdb-server.c: recv: p19
2019-09-14T11:53:13 DEBUG common.c: *** stlink_read_reg
2019-09-14T11:53:13 DEBUG common.c:  (16) ***
2019-09-14T11:53:13 DEBUG usb.c: r_idx (16) = 0x00000003
2019-09-14T11:53:13 DEBUG gdb-server.c: send: 03000000
2019-09-14T11:53:13 DEBUG gdb-server.c: recv: qL1200000000000000000
2019-09-14T11:53:13 DEBUG gdb-server.c: send: 

Please note that at line 2019-09-14T11:53:12 DEBUG common.c: *** stlink_force_debug_mode *** of output, I pressed ^C to stop execution in GDB.

This seems to be in connection to issue #627 however, premises differ since now we are using a Stlinkv2 with a STM32F7x. I also managed to reproduce the same issue on a STM32VLDISCOVERY. This started happening after updating the firmware to the specified version above. Before the update, the step instruction command worked fine.

@Nightwalker-87
Copy link
Member

@alexonea: Please verify if the problem still exists in Release v1.6.0.

@Nightwalker-87 Nightwalker-87 modified the milestones: v1.7.0, Feedback required Mar 19, 2020
@Nightwalker-87
Copy link
Member

ping @alexonea

@alexonea
Copy link
Author

I don't have the (hardware) resources to test at the moment. I will try in a few days time. If waiting is no longer an option, the issue can be closed and re-opened in case the problem is rediscovered during testing.

@Nightwalker-87
Copy link
Member

That should be fine, thx.

@alexonea
Copy link
Author

alexonea commented Jun 30, 2020

I checked with release v1.6.0 of st-util and the same firmware version of the STLinkv2 as mentioned in the issue body. No issues detected. Seems fine.

@Nightwalker-87
Copy link
Member

Great, so this problem seems to be resolved. Thanks for reporting and for the feedback! 👍

@Nightwalker-87 Nightwalker-87 modified the milestones: a) Old issues, v1.6.0 Jul 1, 2020
@Nightwalker-87 Nightwalker-87 linked a pull request Jul 4, 2020 that will close this issue
@stlink-org stlink-org locked as resolved and limited conversation to collaborators Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.