Skip to content

Commit 335c135

Browse files
committed
Testing debugger
1 parent adb5108 commit 335c135

File tree

4 files changed

+42
-32
lines changed

4 files changed

+42
-32
lines changed

.vscode/launch-gd32vf103.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"target remote | openocd/bin/openocd -c \"gdb_port pipe; log_output openocd.log\" -f scripts/gd32vf103/flash-init.ocd -f interface/cmsis-dap.cfg -f scripts/gd32vf103/gd32vf103.ocd -f scripts/gd32vf103/debug.ocd ",
2424

2525
// After loading the Application, run these gdb commands. The Application ELF image does not contain a valid Image Header.
26-
"monitor reset halt",
27-
"flushregs",
26+
// "monitor reset halt",
27+
// "flushregs",
2828

2929
// If not using the Stub Bootloader boot_stub, we need to bypass the Bootloader and jump to the Application directly:
3030
// "stepi", // Must step before setting PC
3131
// "set $pc = Reset_Handler", // Prepare to jump to the Application's Reset Handler
3232
// "stepi", // Execute the Reset Handler
3333
"break main", // Break at main()
3434
"break __assert_func", // Break for any assert failures
35-
"break os_default_irq" // Break for any unhandled interrupts
35+
"break os_default_irq", // Break for any unhandled interrupts
3636

37-
// "thb main",
38-
// "continue",
37+
// "thb main",
38+
// "continue",
3939
]
4040
// "valuesFormatting": "parseText"
4141
},

.vscode/launch.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323
"target remote | openocd/bin/openocd -c \"gdb_port pipe; log_output openocd.log\" -f scripts/gd32vf103/flash-init.ocd -f interface/cmsis-dap.cfg -f scripts/gd32vf103/gd32vf103.ocd -f scripts/gd32vf103/debug.ocd ",
2424

2525
// After loading the Application, run these gdb commands. The Application ELF image does not contain a valid Image Header.
26-
"monitor reset halt",
27-
"flushregs",
26+
// "monitor reset halt",
27+
// "flushregs",
2828

2929
// If not using the Stub Bootloader boot_stub, we need to bypass the Bootloader and jump to the Application directly:
3030
// "stepi", // Must step before setting PC
3131
// "set $pc = Reset_Handler", // Prepare to jump to the Application's Reset Handler
3232
// "stepi", // Execute the Reset Handler
3333
"break main", // Break at main()
3434
"break __assert_func", // Break for any assert failures
35-
"break os_default_irq" // Break for any unhandled interrupts
35+
"break os_default_irq", // Break for any unhandled interrupts
3636

37-
// "thb main",
38-
// "continue",
37+
// "thb main",
38+
// "continue",
3939
]
4040
// "valuesFormatting": "parseText"
4141
},

openocd.log

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
Open On-Chip Debugger 0.10.0
2-
Licensed under GNU GPL v2
3-
For bug reports, read
4-
http://openocd.org/doc/doxygen/bugs.html
5-
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
6-
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
1+
debug_level: 2
72
adapter speed: 1000 kHz
8-
adapter_nsrst_delay: 100
9-
none separate
10-
Info : Unable to match requested speed 1000 kHz, using 950 kHz
11-
Info : Unable to match requested speed 1000 kHz, using 950 kHz
12-
Info : clock speed 950 kHz
13-
Info : STLINK v2 JTAG v17 API v2 SWIM v4 VID 0x0483 PID 0x3748
14-
Info : using stlink api v2
15-
Info : Target voltage: 3.225943
16-
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
17-
Info : accepting 'gdb' connection on tcp/3333
18-
Info : device id = 0x20036410
19-
Warn : STM32 flash size failed, probe inaccurate - assuming 128k flash
20-
Info : flash size = 128kbytes
21-
target halted due to debug-request, current mode: Thread
22-
xPSR: 00000000 pc: 0x00000024 msp: 0x96f3b83c
23-
3+
srst_only separate srst_gates_jtag srst_open_drain connect_deassert_srst
4+
adapter_nsrst_assert_width: 100
5+
riscv.flash
6+
debug_level: 2
7+
Warn : Transport "jtag" was already selected
8+
Info : Listening on port 6666 for tcl connections
9+
Info : Listening on port 4444 for telnet connections
10+
Info : CMSIS-DAP: SWD Supported
11+
Info : CMSIS-DAP: JTAG Supported
12+
Info : CMSIS-DAP: FW Version = 2.0.0
13+
Info : CMSIS-DAP: Interface Initialised (JTAG)
14+
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 0 nTRST = 0 nRESET = 1
15+
Info : CMSIS-DAP: Interface ready
16+
Info : clock speed 1000 kHz
17+
Info : cmsis-dap JTAG TLR_RESET
18+
Info : cmsis-dap JTAG TLR_RESET
19+
Info : JTAG tap: riscv.cpu tap/device found: 0x1000563d (mfg: 0x31e (Andes Technology Corporation), part: 0x0005, ver: 0x1)
20+
Info : JTAG tap: auto0.tap tap/device found: 0x790007a3 (mfg: 0x3d1 (GigaDevice Semiconductor (Beijing)), part: 0x9000, ver: 0x7)
21+
Warn : AUTO auto0.tap - use "jtag newtap auto0 tap -irlen 5 -expected-id 0x790007a3"
22+
Info : datacount=4 progbufsize=2
23+
Info : Examined RISC-V core; found 1 harts
24+
Info : hart 0: XLEN=32, misa=0x40901105
25+
Info : accepting 'gdb' connection from pipe
26+
Info : dropped 'gdb' connection

scripts/gd32vf103/debug.ocd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,10 @@ transport select jtag
88

99
$_TARGETNAME configure -event reset-init {
1010
}
11+
12+
# Connect to the MCU
13+
# init
14+
15+
# Restart the device and halt
16+
# echo "Restarting..."
17+
# reset halt

0 commit comments

Comments
 (0)