From fbb1bc1eec21aaa535062605501dbe703b2d7034 Mon Sep 17 00:00:00 2001 From: Maximilian Deubel Date: Thu, 24 Oct 2024 00:35:18 +0200 Subject: [PATCH] applications: connectivity_bridge: thingy91 debug Add the CMSIS-DAP feature of the thingy91x to the thingy91. Signed-off-by: Maximilian Deubel --- .../connectivity_bridge/boards/thingy91_nrf52840.conf | 11 +++++++++++ .../boards/thingy91_nrf52840_readme.txt | 1 + .../connectivity_bridge/src/modules/CMakeLists.txt | 5 ++++- .../src/modules/usb_bulk_interface.c | 6 +++++- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/applications/connectivity_bridge/boards/thingy91_nrf52840.conf b/applications/connectivity_bridge/boards/thingy91_nrf52840.conf index 14db61ae52ea..65bffe159515 100644 --- a/applications/connectivity_bridge/boards/thingy91_nrf52840.conf +++ b/applications/connectivity_bridge/boards/thingy91_nrf52840.conf @@ -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_HEAP_MEM_POOL_SIZE=6000 diff --git a/applications/connectivity_bridge/boards/thingy91_nrf52840_readme.txt b/applications/connectivity_bridge/boards/thingy91_nrf52840_readme.txt index d2c11ca05be0..3fc3347fada8 100644 --- a/applications/connectivity_bridge/boards/thingy91_nrf52840_readme.txt +++ b/applications/connectivity_bridge/boards/thingy91_nrf52840_readme.txt @@ -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 ==================== diff --git a/applications/connectivity_bridge/src/modules/CMakeLists.txt b/applications/connectivity_bridge/src/modules/CMakeLists.txt index 6a9e15dff7a0..aa16ede709fb 100644 --- a/applications/connectivity_bridge/src/modules/CMakeLists.txt +++ b/applications/connectivity_bridge/src/modules/CMakeLists.txt @@ -21,5 +21,8 @@ target_sources_ifdef(CONFIG_BRIDGE_MSC_ENABLE 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) + +target_sources_ifdef(CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP + app PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/usb_bulk_commands.c) diff --git a/applications/connectivity_bridge/src/modules/usb_bulk_interface.c b/applications/connectivity_bridge/src/modules/usb_bulk_interface.c index ac86c946c3b8..f389ab322c1b 100644 --- a/applications/connectivity_bridge/src/modules/usb_bulk_interface.c +++ b/applications/connectivity_bridge/src/modules/usb_bulk_interface.c @@ -12,6 +12,7 @@ #include #include #include +#include #define MODULE bulk_interface #include "module_state_event.h" @@ -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);