@@ -10,7 +10,7 @@ parent: FuseSoC
1010
1111 * An x86 Linux workstation
1212 * The ` curl ` command line utilities
13- * OpenOCD
13+ * OpenOCD 0.10.0 (As of 2025, versions 0.11.0 and 0.12.0 have jtag timing issues)
1414 * The quartus FPGA design software
1515 * ` fusesoc ` - The [ FuseSoC build system] ( ../fusesoc.html ) .
1616 * ` or1k-elf- ` Toolchain as installed in our [ newlib tutorial] ( ../newlib.html ) .
@@ -59,6 +59,7 @@ cd /tmp/or1k-de0nano
5959
6060curl -L -O https://openrisc.io/tutorials/sw/hello/hello.c
6161curl -L -O https://openrisc.io/tutorials/sw/timer/timer.c
62+ curl -L -O https://openrisc.io/tutorials/de0_nano/de0_nano.cfg
6263
6364CFLAGS=" -mboard=de0_nano -DDE0_NANO"
6465or1k-elf-gcc -g -Og $CFLAGS -o hello.elf hello.c
@@ -106,7 +107,7 @@ board.
106107
107108In one terminal execute the following command:
108109
109- openocd -s ${OPENOCD}/share/openocd/scripts/ - f interface/altera-usb-blaster.cfg -f ../or1k-dev.tcl
110+ openocd -f interface/altera-usb-blaster.cfg -f de0_nano.cfg
110111
111112### Run software with gdb
112113
@@ -122,4 +123,14 @@ In gdb execute the following steps:
122123 set $npc=0x100
123124 continue
124125
126+ This will:
127+
128+ - Connect GDB to the GDB server hosted in the openocd process.
129+ - The ` load ` command will load the ` timer.elf ` binary onto the de0 nano
130+ board.
131+ - The ` set $npc=0x100 ` command will set the mor1kx CPU program counter to
132+ ` 0x100 ` the default reset verctor.
133+ - Finally ` continue ` will resume the program. In this case it will resume
134+ from reset starting the program.
135+
125136You should see the LEDs counting and UART output once a second.
0 commit comments