Skip to content

Commit 9aba2f2

Browse files
committed
de0_nano: Add description of the de0 nano startup
1 parent 40cabba commit 9aba2f2

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

or1k-dev.tcl renamed to de0_nano/de0_nano.cfg

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# If you want to use the VJTAG TAP or the XILINX BSCAN,
2-
# you must set your FPGA TAP ID here
3-
1+
# The de0 nano TAPID
42
set FPGATAPID 0x020f30dd
53

6-
# Choose your TAP core (VJTAG , MOHOR or XILINX_BSCAN)
4+
# Choose your TAP core (VJTAG, VJTAG_VPI or XILINX_BSCAN)
5+
# De0 nano uses VJTAG
76
if { [info exists TAP_TYPE] == 0} {
87
set TAP_TYPE VJTAG
98
}
109

1110
# Set your chip name
12-
set CHIPNAME or1200
11+
set CHIPNAME mor1kx
1312

1413
source [find target/or1k.cfg]
1514

@@ -19,11 +18,6 @@ poll_period 1
1918
# Enable the target description feature
2019
gdb_target_description enable
2120

22-
# Add a new register in the cpu register list. This register will be
23-
# included in the generated target descriptor file.
24-
# format is addreg [name] [address] [feature] [reg_group]
25-
addreg rtest 0x1234 org.gnu.gdb.or1k.group0 system
26-
2721
# Override default init_reset
2822
proc init_reset {mode} {
2923
soft_reset_halt
@@ -48,4 +42,3 @@ set c_blue "\033\[01;34m"
4842
set c_reset "\033\[0m"
4943

5044
puts [format "%sTarget ready...%s" $c_blue $c_reset]
51-

de0_nano/index.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

6060
curl -L -O https://openrisc.io/tutorials/sw/hello/hello.c
6161
curl -L -O https://openrisc.io/tutorials/sw/timer/timer.c
62+
curl -L -O https://openrisc.io/tutorials/de0_nano/de0_nano.cfg
6263

6364
CFLAGS="-mboard=de0_nano -DDE0_NANO"
6465
or1k-elf-gcc -g -Og $CFLAGS -o hello.elf hello.c
@@ -106,7 +107,7 @@ board.
106107

107108
In 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+
125136
You should see the LEDs counting and UART output once a second.

pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ Makefile
88
README.md
99
bootstrap-quick-start.sh
1010
environment.sh
11-
or1k-dev.tcl
1211
sw/hello/hello.c
1312
sw/timer/timer.c
1413
or1ksim/Makefile
@@ -21,6 +20,7 @@ de0_nano/README.md
2120
de0_nano/de0_nano.sof
2221
de0_nano/hello.elf
2322
de0_nano/timer.elf
23+
de0_nano/de0_nano.cfg
2424
docs/Debugging.md
2525
"
2626

0 commit comments

Comments
 (0)