Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add OpenOCD BSCAN configuration file #457

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ flash-prog:
openOCD_epflp:
xterm -e openocd -f ./tb/core-v-mini-mcu-pynq-z2-esl-programmer.cfg;

## Run openOCD w/ BSCAN of the Pynq-Z2 board
openOCD_bscan:
xterm -e openocd -f ./tb/core-v-mini-mcu-pynq-z2-bscan.cfg;

## Start GDB
gdb_connect:
$(MAKE) -C sw gdb_connect
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ The success of the script is not required for merging of a PR.

## Debug

Follow the [Debug](./Debug.md) guide to debug core-v-mini-mcu.
Follow the [Debug](./docs/source/How_to/Debug.md) guide to debug core-v-mini-mcu.

Alternatively, in case you are used to developing using Integrated Development Environments (IDEs), please check [the IDE readme](./IDEs.md).

Expand Down
10 changes: 10 additions & 0 deletions docs/source/How_to/Debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ or with the EPFL Programmer also using this other command (**strongly recommende
make openOCD_epflp
```

or with the BSCAN of the Pynq-Z2 board using this command:
```
openocd -f ./tb/core-v-mini-mcu-pynq-z2-bscan.cfg
```

or with the BSCAN of the Pynq-Z2 board also using this other command (**strongly recommended**):

```
make openOCD_bscan
```

If you get this error:

Expand Down
44 changes: 44 additions & 0 deletions tb/core-v-mini-mcu-pynq-z2-bscan.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
adapter driver ftdi
adapter speed 1000
transport select jtag


# FT2232HQ Adapter Pynq Z2
ftdi vid_pid 0x0403 0x6010

ftdi channel 0
ftdi layout_init 0x0088 0x008b

reset_config none

echo "ftdi setting..."

set _CHIPNAME riscv
jtag newtap $_CHIPNAME cpu -irlen 6 -expected-id 0x23727093
jtag newtap arm_dap_0 tap -irlen 4 -expected-id 0x4ba00477

set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME -coreid 0x000

echo "target created..."

#log_output openocd_fpga.log

riscv set_ir idcode 0x09
riscv set_ir dtmcs 0x22
riscv set_ir dmi 0x23

riscv set_reset_timeout_sec 2000
riscv set_command_timeout_sec 2000

echo "setting preferences..."

scan_chain

init

echo "init routine started"

halt

echo "Ready for Remote Connections"
Loading