Skip to content

Commit

Permalink
Add suport for xvc probe
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosr8 committed Oct 5, 2023
1 parent 1d3c051 commit a1d4986
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=jlink -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=cmsis-dap -DOPENOCD_TRANSPORT=swd }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=digilent_jtag_hs3 -DOPENOCD_TRANSPORT=jtag }
- { flags: -DBOARD=afc -DVERSION=4.0 -DDEBUG_PROBE=xvc -DOPENOCD_TRANSPORT=jtag -DXVC_HOST=host -DXVC_PORT=0000}
steps:
- uses: actions/checkout@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion probe/openocd.cfg.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
source [find ${OPENOCD_DEBUG_PROBE_FILE}]
${OPENOCD_DEBUG_PROBE_CMD}

transport select ${OPENOCD_TRANSPORT}

Expand Down
18 changes: 15 additions & 3 deletions probe/openocd.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,26 @@ else()

# Selects the OpenOCD debug probe file
if(${DEBUG_PROBE} STREQUAL "digilent_jtag_hs3")
set(OPENOCD_DEBUG_PROBE_FILE "interface/ftdi/digilent_jtag_hs3.cfg")
set(OPENOCD_DEBUG_PROBE_CMD "source [find interface/ftdi/digilent_jtag_hs3.cfg]")
check_probe_transport("jtag" ${OPENOCD_TRANSPORT})
elseif(${DEBUG_PROBE} STREQUAL "cmsis-dap")
set(OPENOCD_DEBUG_PROBE_FILE "interface/cmsis-dap.cfg")
set(OPENOCD_DEBUG_PROBE_CMD "source [find interface/cmsis-dap.cfg]")
check_probe_transport("jtag;swd" ${OPENOCD_TRANSPORT})
elseif(${DEBUG_PROBE} STREQUAL "jlink")
set(OPENOCD_DEBUG_PROBE_FILE "interface/jlink.cfg")
set(OPENOCD_DEBUG_PROBE_CMD "source [find interface/jlink.cfg]")
check_probe_transport("jtag;swd" ${OPENOCD_TRANSPORT})
elseif(${DEBUG_PROBE} STREQUAL "xvc")
if(NOT XVC_HOST)
message(FATAL_ERROR "No xvc host selected, use the -DXVC_HOST=<host_name> to select it.")
elseif(NOT XVC_PORT)
message(FATAL_ERROR "No xvc port selected, use the -DXVC_PORT=<port_name> to select it.")
else()
set(OPENOCD_DEBUG_PROBE_CMD "adapter driver xvc
xvc_host ${XVC_HOST}
xvc_port ${XVC_PORT}
reset_config none")
check_probe_transport("jtag" ${OPENOCD_TRANSPORT})
endif()
else()
message(FATAL_ERROR "${DEBUG_PROBE} not supported!")
endif()
Expand Down

0 comments on commit a1d4986

Please sign in to comment.