-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
13 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,10 @@ | ||
# The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 | ||
# OpenOCD on-chip debugger configuration file for SINGLE-CORE configuration | ||
|
||
echo "NEORV32 single-core openOCD configuration." | ||
echo "*****************************************" | ||
echo "NEORV32 single-core openOCD configuration" | ||
echo "*****************************************" | ||
|
||
# ------------------------------------------------------------------- | ||
# Physical interface configuration; ADJUST THIS FOR YOUR ADAPTER | ||
# ------------------------------------------------------------------- | ||
adapter driver ftdi | ||
ftdi vid_pid 0x0403 0x6010 | ||
ftdi channel 0 | ||
ftdi layout_init 0x0038 0x003b | ||
adapter speed 4000 | ||
transport select jtag | ||
|
||
# ------------------------------------------------------------------- | ||
# Target configuration | ||
# ------------------------------------------------------------------- | ||
set _CHIPNAME neorv32 | ||
jtag newtap $_CHIPNAME cpu -irlen 5 | ||
|
||
set _TARGETNAME $_CHIPNAME.cpu | ||
|
||
target create $_TARGETNAME riscv -chain-position $_TARGETNAME | ||
|
||
# expose NEORV32-specific CSRs | ||
riscv expose_csrs 2048=cfureg0 | ||
riscv expose_csrs 2049=cfureg1 | ||
riscv expose_csrs 2050=cfureg2 | ||
riscv expose_csrs 2051=cfureg3 | ||
riscv expose_csrs 4032=mxisa | ||
|
||
# ------------------------------------------------------------------- | ||
# Server configuration | ||
# ------------------------------------------------------------------- | ||
gdb report_data_abort enable | ||
|
||
# ------------------------------------------------------------------- | ||
# Initialize target | ||
# ------------------------------------------------------------------- | ||
init | ||
|
||
# ------------------------------------------------------------------- | ||
# Authenticate; ADJUST THIS FOR YOUR AUTHENTICATOR | ||
# ------------------------------------------------------------------- | ||
set challenge [riscv authdata_read] | ||
riscv authdata_write [expr {$challenge | 1}] | ||
|
||
# ------------------------------------------------------------------- | ||
# Check if device is authenticated (bit 7 in dmstatus) | ||
# ------------------------------------------------------------------- | ||
set dmstatus [riscv dmi_read 0x11] | ||
if { [expr {$dmstatus & (1<<7)}] } { | ||
echo "Authentication passed." | ||
} else { | ||
echo "AUTHENTICATION FAILED!" | ||
exit | ||
} | ||
|
||
# ------------------------------------------------------------------- | ||
# Target should be halted and ready now | ||
# ------------------------------------------------------------------- | ||
halt | ||
echo "Target HALTED. Ready for remote connections." | ||
set PATH [ file dirname [ file normalize [ info script ] ] ] | ||
source [file join $PATH target.cfg] | ||
target_setup 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,10 @@ | ||
# The NEORV32 RISC-V Processor - https://github.com/stnolting/neorv32 | ||
# OpenOCD on-chip debugger configuration file for DUAL-CORE configuration | ||
# OpenOCD on-chip debugger configuration file for DUAL-CORE SMP configuration | ||
|
||
echo "NEORV32 dual-core openOCD configuration." | ||
echo "*******************************************" | ||
echo "NEORV32 SMP dual-core openOCD configuration" | ||
echo "*******************************************" | ||
|
||
# ------------------------------------------------------------------- | ||
# Physical interface configuration; ADJUST THIS FOR YOUR ADAPTER | ||
# ------------------------------------------------------------------- | ||
adapter driver ftdi | ||
ftdi vid_pid 0x0403 0x6010 | ||
ftdi channel 0 | ||
ftdi layout_init 0x0038 0x003b | ||
adapter speed 4000 | ||
transport select jtag | ||
|
||
# ------------------------------------------------------------------- | ||
# Target configuration | ||
# ------------------------------------------------------------------- | ||
set _CHIPNAME neorv32 | ||
jtag newtap $_CHIPNAME cpu -irlen 5 | ||
|
||
set _TARGETNAME_0 $_CHIPNAME.cpu0 | ||
set _TARGETNAME_1 $_CHIPNAME.cpu1 | ||
|
||
target create $_TARGETNAME_0 riscv -chain-position $_CHIPNAME.cpu -rtos hwthread | ||
target create $_TARGETNAME_1 riscv -chain-position $_CHIPNAME.cpu -coreid 1 | ||
target smp $_TARGETNAME_0 $_TARGETNAME_1 | ||
|
||
# expose NEORV32-specific CSRs to debugger | ||
riscv expose_csrs 2048=cfureg0 | ||
riscv expose_csrs 2049=cfureg1 | ||
riscv expose_csrs 2050=cfureg2 | ||
riscv expose_csrs 2051=cfureg3 | ||
riscv expose_csrs 4032=mxisa | ||
|
||
# ------------------------------------------------------------------- | ||
# Server configuration | ||
# ------------------------------------------------------------------- | ||
gdb report_data_abort enable | ||
|
||
# ------------------------------------------------------------------- | ||
# Initialize target | ||
# ------------------------------------------------------------------- | ||
init | ||
|
||
# ------------------------------------------------------------------- | ||
# Authenticate; ADJUST THIS FOR YOUR AUTHENTICATOR | ||
# ------------------------------------------------------------------- | ||
set challenge [riscv authdata_read] | ||
riscv authdata_write [expr {$challenge | 1}] | ||
|
||
# ------------------------------------------------------------------- | ||
# Check if device is authenticated (bit 7 in dmstatus) | ||
# ------------------------------------------------------------------- | ||
set dmstatus [riscv dmi_read 0x11] | ||
if { [expr {$dmstatus & (1<<7)}] } { | ||
echo "Authentication passed." | ||
} else { | ||
echo "AUTHENTICATION FAILED!" | ||
exit | ||
} | ||
|
||
# ------------------------------------------------------------------- | ||
# Target should be halted and ready now | ||
# ------------------------------------------------------------------- | ||
halt | ||
echo "Target HALTED. Ready for remote connections." | ||
set PATH [ file dirname [ file normalize [ info script ] ] ] | ||
source [file join $PATH target.cfg] | ||
target_setup 2 |