Add jlink config.

This commit is contained in:
colin 2022-03-20 09:03:38 +00:00
parent 68653daa2c
commit cdd2f57902
2 changed files with 48 additions and 0 deletions

View File

@ -77,6 +77,9 @@ program.hex: $(TEST).o $(LINK)
openocd:
openocd -f swerv.cfg
jlink:
openocd -f jlink.cfg
gdb:
$(GDB_PREFIX) -x gdbinit ./build/jtag.bin

45
demo/jlink.cfg Normal file
View File

@ -0,0 +1,45 @@
#
# SEGGER J-Link
#
# http://www.segger.com/jlink.html
#
adapter driver jlink
transport select jtag
adapter speed 200
# Target configuration for the riscv chip
set _CHIPNAME riscv
set _TARGETNAME $_CHIPNAME.cpu
jtag newtap $_CHIPNAME tap -irlen 5 -expected-id 0x1000008b
set _TARGETNAME $_CHIPNAME.tap
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
# Configure work area in on-chip SRAM
# $_TARGETNAME configure -work-area-phys 0x1000e000 -work-area-size 1000 -work-area-backup 0
riscv expose_csrs 1988
# Be verbose about GDB errors
gdb_report_data_abort enable
gdb_report_register_access_error enable
# Increase timeouts in simulation
riscv set_command_timeout_sec 1200
# Conclude OpenOCD configuration
init
# Halt the target
halt
# The serial number can be used to select a specific device in case more than
# one is connected to the host.
#
# Example: Select J-Link with serial number 123456789
#
# adapter serial 123456789