Skip to content

Commit 9df66e6

Browse files
sasatakucfriedt
authored andcommitted
boards: scobc_a1: Cleanup OpenOCD script
The default OpenOCD interface for the SC-OBC Module A1 has changed to CMSIS-DAP, with standard interfaces such as the Raspberry Pi Pico Debug Probe. To accommodate multiple debug interfaces, the OpenOCD scripts have been cleaned up. If you still wish to use FT2232D or FT232R interface, please set the following environment variable before running `west flash`: $ export OPENOCD_INTERFACE=FT2232D $ west flash $ export OPENOCD_INTERFACE=FT232R $ west flash Signed-off-by: Takuya Sasaki <[email protected]> Signed-off-by: Gaetan Perrot <[email protected]>
1 parent 633c0fe commit 9df66e6

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

boards/sc/scobc_a1/board.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-License-Identifier: Apache-2.0
22

3-
board_runner_args(openocd "--use-elf" "--config=${BOARD_DIR}/support/openocd-ftdi.cfg")
3+
board_runner_args(openocd "--use-elf" "--config=${BOARD_DIR}/support/scobc-a1.cfg")
44

55
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)

boards/sc/scobc_a1/support/openocd-ft232r.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

boards/sc/scobc_a1/support/openocd-ftdi.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

boards/sc/scobc_a1/support/openocd.cfg

Lines changed: 0 additions & 21 deletions
This file was deleted.

boards/sc/scobc_a1/support/scobc-a1.cfg

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Copyright (C) 2021 Space Cubics, LLC.
22
# Yasushi SHOJI <[email protected]>
33

4+
if {[info exists env(OPENOCD_INTERFACE)]} {
5+
set _INTERFACE $env(OPENOCD_INTERFACE)
6+
} else {
7+
# Default CMIS-DAP
8+
set _INTERFACE "CMSIS-DAP"
9+
}
10+
11+
if { $_INTERFACE == "FT2232D" } {
12+
source [find akizuki-m-02990.cfg]
13+
} elseif { $_INTERFACE == "FT232R" } {
14+
source [find interface/ft232r.cfg]
15+
} else {
16+
source [find interface/cmsis-dap.cfg]
17+
source [find target/swj-dp.tcl]
18+
}
19+
420
if { [info exists CHIPNAME] } {
521
set _CHIPNAME $CHIPNAME
622
} else {
@@ -19,7 +35,13 @@ if { [info exists WORKAREASIZE] } {
1935
set _WORKAREASIZE 0x4000
2036
}
2137

22-
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
38+
adapter speed 5000
39+
40+
if [using_swd] {
41+
swj_newdap $_CHIPNAME cpu -expected-id $_CPUTAPID
42+
} else {
43+
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
44+
}
2345
dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu
2446

2547
set _TARGETNAME $_CHIPNAME.cpu

0 commit comments

Comments
 (0)