forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: subsys: usb: add dapusb sample
Signed-off-by: Maximilian Deubel <[email protected]>
- Loading branch information
1 parent
8837a59
commit 730e783
Showing
14 changed files
with
608 additions
and
139 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,9 +1,10 @@ | ||
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
cmake_minimum_required(VERSION 3.20.0) | ||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) | ||
project(dap) | ||
project(webusb) | ||
|
||
target_include_directories(app PRIVATE ${ZEPHYR_BASE}/subsys/usb) | ||
|
||
FILE(GLOB app_sources src/*.c) | ||
target_sources(app PRIVATE ${app_sources}) |
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
CONFIG_SWDP_BITBANG_DRIVER_SEPARATE_IN_OUT=n | ||
|
||
CONFIG_CMSIS_DAP_DEVICE_VENDOR="Raspberry Pi" | ||
CONFIG_CMSIS_DAP_DEVICE_NAME="rp2040" |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
/ { | ||
dp0 { | ||
compatible = "zephyr,swdp-gpio"; | ||
status = "okay"; | ||
clk-gpios = <&arduino_header 10 GPIO_ACTIVE_HIGH>; /* D4 */ | ||
dout-gpios = <&arduino_header 9 GPIO_ACTIVE_HIGH>; /* D3 */ | ||
din-gpios = <&arduino_header 8 GPIO_PULL_UP>; /* D2 */ | ||
dio-gpios = <&arduino_header 8 GPIO_PULL_UP>; /* D2 */ | ||
dnoe-gpios = <&arduino_header 12 GPIO_ACTIVE_HIGH>; /* D6 */ | ||
noe-gpios = <&arduino_header 11 GPIO_ACTIVE_HIGH>; /* D5 */ | ||
reset-gpios = <&arduino_header 13 GPIO_ACTIVE_HIGH>; /* D7 */ | ||
port-write-cycles = <2>; | ||
}; | ||
}; | ||
|
||
&zephyr_udc0 { | ||
cdc_acm_uart0 { | ||
compatible = "zephyr,cdc-acm-uart"; | ||
}; | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CONFIG_SWDP_BITBANG_DRIVER_SEPARATE_IN_OUT=n | ||
CONFIG_CMSIS_DAP_DEVICE_VENDOR="Nordic Semiconductor" | ||
CONFIG_CMSIS_DAP_DEVICE_NAME="nrf9160_xxaa" |
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
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CONFIG_USB_DEVICE_STACK=y | ||
CONFIG_USB_DEVICE_REMOTE_WAKEUP=n | ||
CONFIG_USB_MAX_POWER=250 | ||
CONFIG_CMSIS_DAP_DEVICE_VENDOR="Nordic Semiconductor" | ||
CONFIG_CMSIS_DAP_DEVICE_NAME="nrf9160_xxaa" |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright (c) 2023 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
/ { | ||
dp0 { | ||
compatible = "zephyr,swdp-gpio"; | ||
status = "okay"; | ||
clk-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>; | ||
dio-gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>; | ||
noe-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>; | ||
port-write-cycles = <2>; | ||
}; | ||
}; |
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,19 +1,21 @@ | ||
CONFIG_STDOUT_CONSOLE=y | ||
CONFIG_USB_DEVICE_STACK=y | ||
CONFIG_USB_DEVICE_BOS=y | ||
CONFIG_SERIAL=y | ||
CONFIG_USB_DEVICE_PRODUCT="Zephyr CMSIS-DAP" | ||
CONFIG_USB_DEVICE_PID=0x0204 | ||
CONFIG_UART_INTERRUPT_DRIVEN=y | ||
CONFIG_UART_LINE_CTRL=y | ||
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n | ||
|
||
CONFIG_USB_DEVICE_HID=y | ||
CONFIG_ENABLE_HID_INT_OUT_EP=y | ||
CONFIG_HID_INTERRUPT_EP_MPS=64 | ||
CONFIG_USB_HID_POLL_INTERVAL_MS=1 | ||
CONFIG_LOG=y | ||
|
||
# Change to VID/PID from a known HIC or it will not be recognized. | ||
CONFIG_USB_DEVICE_VID=0x2fe3 | ||
CONFIG_USB_DEVICE_PID=0x0204 | ||
CONFIG_USB_COMPOSITE_DEVICE=y | ||
|
||
CONFIG_DAP=y | ||
CONFIG_NET_BUF=y | ||
|
||
CONFIG_LOG=y | ||
CONFIG_USB_DRIVER_LOG_LEVEL_INF=y | ||
CONFIG_USB_DEVICE_LOG_LEVEL_INF=y | ||
CONFIG_DAP_LOG_LEVEL_INF=y | ||
CONFIG_DP_DRIVER_LOG_LEVEL_INF=y | ||
CONFIG_DAP=y | ||
CONFIG_GPIO=y | ||
CONFIG_NET_BUF=y |
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,5 +1,5 @@ | ||
sample: | ||
name: DAP HID | ||
name: DAP USB | ||
tests: | ||
sample.dap.hid: | ||
build_only: true | ||
|
Oops, something went wrong.