Skip to content

Commit fbd8572

Browse files
committed
gdbinit now also flashes the binary over JTAG
1 parent ef26955 commit fbd8572

File tree

4 files changed

+17
-7
lines changed

4 files changed

+17
-7
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,11 @@ To debug the examples using JTAG and GDB, follow these steps:
102102
2. Add openocd to `PATH`
103103
3. Build one of the examples (for instance, `blink`), then launch GDB like this:
104104
```
105-
riscv-none-elf-gdb -x ../../gdbinit build/blink
105+
riscv-none-elf-gdb -x gdbinit build/blink
106106
```
107-
This will use the provided [gdbinit](gdbinit) file to:
107+
This will use the provided gdbinit file to:
108108
- Launch OpenOCD in pipe mode. Adjust the `gdbinit` file if you need to change OpenOCD launch configuration. You can also launch OpenOCD manually, in that case use `target extended-remote :3333` in `gdbinit`.
109+
- Flash the program over JTAG
109110
- Reset the target
110111
- Set a temporary breakpoint at `main`
111112
- Run until the breakpoint

examples/blink/gdbinit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set remotetimeout 10
2+
target extended-remote | openocd -c "gdb_port pipe" -c "set ESP_RTOS none" -f "board/esp32c3-builtin.cfg" -c "init; reset halt"
3+
mon gdb_breakpoint_override hard
4+
mon flash write_image build/blink.bin 0 bin
5+
mon reset halt
6+
tb main
7+
c

examples/hello_world/gdbinit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set remotetimeout 10
2+
target extended-remote | openocd -c "gdb_port pipe" -c "set ESP_RTOS none" -f "board/esp32c3-builtin.cfg" -c "init; reset halt"
3+
mon gdb_breakpoint_override hard
4+
mon flash write_image build/hello_world.bin 0 bin
5+
mon reset halt
6+
tb main
7+
c

gdbinit

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)