Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v2.8-branch] applications: connectivity_bridge: thingy91 debug #18895

Open
wants to merge 1 commit into
base: v2.8-branch
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions applications/connectivity_bridge/boards/thingy91_nrf52840.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@ CONFIG_USB_DEVICE_PRODUCT="Thingy:91 UART"

CONFIG_USB_DEVICE_VID=0x1915
CONFIG_USB_DEVICE_PID=0x9100

CONFIG_USB_MAX_NUM_TRANSFERS=8
CONFIG_BRIDGE_CMSIS_DAP_BULK_ENABLE=y

CONFIG_DAP=y
CONFIG_DP_DRIVER=y

CONFIG_CMSIS_DAP_DEVICE_VENDOR="Nordic Semiconductor ASA"
CONFIG_CMSIS_DAP_DEVICE_NAME="nrf91"

CONFIG_USB_CDC_ACM_RINGBUF_SIZE=15360
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ https://nordicsemi.com/thingy91
This USB interface has the following functions:
* Disk drive containing this file and others
* COM ports for nRF91 debug, trace, and firmware update
* CMSIS-DAP 2.1 compliant debug probe interface for accessing the nRF91 SiP

COM Ports
====================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ CONFIG_DP_DRIVER=y

CONFIG_CMSIS_DAP_DEVICE_VENDOR="Nordic Semiconductor ASA"
CONFIG_CMSIS_DAP_DEVICE_NAME="nrf91"

CONFIG_BRIDGE_CMSIS_DAP_NORDIC_COMMANDS=y
7 changes: 4 additions & 3 deletions applications/connectivity_bridge/src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ target_sources_ifdef(CONFIG_BRIDGE_MSC_ENABLE
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/fs_handler.c)

target_sources_ifdef(CONFIG_BRIDGE_CMSIS_DAP_BULK_ENABLE
app PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_commands.c
${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_interface.c)
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_interface.c)

target_sources_ifdef(CONFIG_BRIDGE_CMSIS_DAP_NORDIC_COMMANDS
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_commands.c)
7 changes: 7 additions & 0 deletions applications/connectivity_bridge/src/modules/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ config BRIDGE_CMSIS_DAP_BULK_ENABLE
depends on USB_DEVICE_STACK
select USB_DEVICE_BOS

config BRIDGE_CMSIS_DAP_NORDIC_COMMANDS
bool "Enable Nordic specific commands"
depends on BRIDGE_CMSIS_DAP_BULK_ENABLE
help
This option enables Nordic specific commands for CMSIS-DAP Bulk.
Currently, these are only relevant for the Thingy:91 X board.

if BRIDGE_CMSIS_DAP_BULK_ENABLE

module = BRIDGE_BULK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <zephyr/usb/msos_desc.h>
#include <zephyr/net_buf.h>
#include <usb_descriptor.h>
#include <cmsis_dap.h>

#define MODULE bulk_interface
#include "module_state_event.h"
Expand Down Expand Up @@ -173,8 +174,11 @@ static int dap_usb_process(void)
static uint8_t tx_buf[USB_BULK_PACKET_SIZE];
struct net_buf *buf = k_fifo_get(&dap_rx_queue, K_FOREVER);
uint8_t ep = dapusb_config.endpoint[DAP_USB_EP_IN_IDX].ep_addr;

#if defined(CONFIG_BRIDGE_CMSIS_DAP_NORDIC_COMMANDS)
len = dap_execute_vendor_cmd(buf->data, tx_buf);
#else
len = dap_execute_cmd(buf->data, tx_buf);
#endif /* defined(CONFIG_BRIDGE_CMSIS_DAP_NORDIC_COMMANDS) */
LOG_DBG("response length %u, starting with [0x%02X, 0x%02X]", len, tx_buf[0], tx_buf[1]);
net_buf_unref(buf);

Expand Down
Loading