Skip to content

Commit

Permalink
applications: connectivity_bridge: thingy91 debug
Browse files Browse the repository at this point in the history
Add the CMSIS-DAP feature of the thingy91x to the thingy91.

Signed-off-by: Maximilian Deubel <[email protected]>
  • Loading branch information
maxd-nordic committed Nov 8, 2024
1 parent c10f5cd commit 209ef9b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
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
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_BOARD_THINGY91X_NRF5340_CPUAPP
app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_commands.c)
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_BOARD_THINGY91X)
len = dap_execute_vendor_cmd(buf->data, tx_buf);
#else
len = dap_execute_cmd(buf->data, tx_buf);
#endif /* defined(CONFIG_BOARD_THINGY91X) */
LOG_DBG("response length %u, starting with [0x%02X, 0x%02X]", len, tx_buf[0], tx_buf[1]);
net_buf_unref(buf);

Expand Down

0 comments on commit 209ef9b

Please sign in to comment.