My GDB commands:
Before connection:
------------------
set mem inaccessible-by-default off
monitor speed auto
monitor endian little
monitor flash device=stm32f103rb
monitor flash breakpoints = 1
monitor flash download = 1
file "$(TARGET_OUTPUT_FILE)"
monitor reg r13 = (0x00000000)
monitor reg pc = (0x00000004)
After connection:
-----------------
load
thbreak main
Segger GDB-Server Log:
-----------------------
SEGGER J-Link GDB Server V4.12
JLinkARM.dll V4.12 (DLL compiled Feb 26 2010 19:22:53)
WARNING: Out of sync , resynchronising...
Listening on TCP/IP port 2331
J-Link connected
Firmware: J-Link ARM V8 compiled Dec 1 2009 11:42:48
Hardware: V8.00
S/N: 268000132
OEM: SEGGER-EDU
Feature(s): FlashBP
J-Link found 2 JTAG devices, Total IRLen = 9
JTAG ID: 0x3BA00477 (Cortex-M3)
Free mode: To be used for non-commercial and evaluation purposes only.
Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)
Read 2 bytes @ address 0x08000110 (Data = 0xF000)
Read 2 bytes @ address 0x08000110 (Data = 0xF000)
Setting breakpoint @ address 0x08000110, Size = 2, BPHandle = 0x0001
Starting target CPU...
WARNING: T-bit of XPSR is 0 but should be 1. Changed to 1.
...Target halted (PC = 0x00000000)
Reading all registers
Removing breakpoint @ address 0x08000110, Size = 2
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)
Setting breakpoint @ address 0x08000110, Size = 2, BPHandle = 0x0002
Starting target CPU...
...Target halted (PC = 0x00000000)
Reading all registers
Removing breakpoint @ address 0x08000110, Size = 2
Read 4 bytes @ address 0x00000000 (Data = 0x20005000)
The Program do not stopped at the address of main, and so I can not execute a single step.