From d9cca5c61a7fe0fd6a86e369d43880e84fe93b39 Mon Sep 17 00:00:00 2001 From: Johann Fischer Date: Tue, 17 Dec 2024 12:54:05 +0100 Subject: [PATCH] boards: decawave_dwm3001cdk: remove CDC ACM configuration This board has a built-in debug adapter that provides a serial connection to the host. This is mentioned in the board documentation. The SoC pins P0.15 (RX) and P0.19 (TX) are connected to the debug adapter pins TXD and RXD, respectively. This board should not configure any other serial connection by default. Update the board documentation accordingly. Signed-off-by: Johann Fischer --- boards/qorvo/decawave_dwm3001cdk/Kconfig | 12 ---- .../decawave_dwm3001cdk/Kconfig.defconfig | 56 ------------------- .../decawave_dwm3001cdk-pinctrl.dtsi | 15 +++++ .../decawave_dwm3001cdk.dts | 23 +++++--- .../decawave_dwm3001cdk_defconfig | 7 +++ .../qorvo/decawave_dwm3001cdk/doc/index.rst | 28 ++++------ 6 files changed, 47 insertions(+), 94 deletions(-) delete mode 100644 boards/qorvo/decawave_dwm3001cdk/Kconfig diff --git a/boards/qorvo/decawave_dwm3001cdk/Kconfig b/boards/qorvo/decawave_dwm3001cdk/Kconfig deleted file mode 100644 index b7e308ed70d..00000000000 --- a/boards/qorvo/decawave_dwm3001cdk/Kconfig +++ /dev/null @@ -1,12 +0,0 @@ -# DecaWave DWM3001CDK board configuration - -# Copyright (c) 2024 The Zephyr Project Contributors -# # SPDX-License-Identifier: Apache-2.0 - -if BOARD_DECAWAVE_DWM3001CDK - -config BOARD_SERIAL_BACKEND_CDC_ACM - bool "Use USB CDC as serial console backend" - default y - -endif # BOARD_DECAWAVE_DWM3001CDK diff --git a/boards/qorvo/decawave_dwm3001cdk/Kconfig.defconfig b/boards/qorvo/decawave_dwm3001cdk/Kconfig.defconfig index e645316caae..c814a6c8994 100644 --- a/boards/qorvo/decawave_dwm3001cdk/Kconfig.defconfig +++ b/boards/qorvo/decawave_dwm3001cdk/Kconfig.defconfig @@ -8,60 +8,4 @@ if BOARD_DECAWAVE_DWM3001CDK config I2C default SENSOR -if BOARD_SERIAL_BACKEND_CDC_ACM - -config USB_DEVICE_STACK - default y - -config USB_CDC_ACM - default SERIAL - -config CONSOLE - default y - -config UART_CONSOLE - default CONSOLE - -config USB_DEVICE_INITIALIZE_AT_BOOT - default y if !MCUBOOT && CONSOLE - -config SHELL_BACKEND_SERIAL_CHECK_DTR - default SHELL - depends on UART_LINE_CTRL - -config UART_LINE_CTRL - default y - -config USB_DEVICE_REMOTE_WAKEUP - default n - -if LOG - -# Logger cannot use itself to log -choice USB_CDC_ACM_LOG_LEVEL_CHOICE - default USB_CDC_ACM_LOG_LEVEL_OFF -endchoice - -# Set USB log level to error only -choice USB_DEVICE_LOG_LEVEL_CHOICE - default USB_DEVICE_LOG_LEVEL_ERR -endchoice - -endif # LOG - -if USB_DEVICE_STACK - -# Enable UART driver, needed for CDC ACM -config SERIAL - default y - -endif # USB_DEVICE_STACK - -endif # BOARD_SERIAL_BACKEND_CDC_ACM - -DT_CHOSEN_ZEPHYR_CONSOLE := zephyr,console - -config UART_CONSOLE - default y if $(dt_chosen_enabled,$(DT_CHOSEN_ZEPHYR_CONSOLE)) && CONSOLE - endif # BOARD_DECAWAVE_DWM3001CDK diff --git a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk-pinctrl.dtsi b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk-pinctrl.dtsi index 4bbfe055497..b68c634870a 100644 --- a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk-pinctrl.dtsi +++ b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk-pinctrl.dtsi @@ -4,6 +4,21 @@ */ &pinctrl { + uart0_default: uart0_default { + group1 { + psels = , + ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + i2c0_default: i2c0_default { group1 { psels = , diff --git a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts index a616dbf2be7..88f85efbde5 100644 --- a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts +++ b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk.dts @@ -14,11 +14,11 @@ compatible = "decawave,dwm3001"; chosen { - zephyr,console = &cdc_acm_uart0; - zephyr,shell-uart = &cdc_acm_uart0; - zephyr,uart-mcumgr = &cdc_acm_uart0; - zephyr,bt-mon-uart = &cdc_acm_uart0; - zephyr,bt-c2h-uart = &cdc_acm_uart0; + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,uart-mcumgr = &uart0; + zephyr,bt-mon-uart = &uart0; + zephyr,bt-c2h-uart = &uart0; zephyr,sram = &sram0; zephyr,flash = &flash0; zephyr,code-partition = &slot0_partition; @@ -84,6 +84,15 @@ status = "okay"; }; +&uart0 { + status = "okay"; + compatible = "nordic,nrf-uart"; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; +}; + &gpio1 { status = "okay"; }; @@ -145,10 +154,6 @@ zephyr_udc0: &usbd { compatible = "nordic,nrf-usbd"; status = "okay"; - - cdc_acm_uart0: cdc_acm_uart0 { - compatible = "zephyr,cdc-acm-uart"; - }; }; ®1 { diff --git a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk_defconfig b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk_defconfig index c115d16a9d0..7b06dae9085 100644 --- a/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk_defconfig +++ b/boards/qorvo/decawave_dwm3001cdk/decawave_dwm3001cdk_defconfig @@ -8,3 +8,10 @@ CONFIG_HW_STACK_PROTECTION=y # Enable GPIO CONFIG_GPIO=y + +# Enable UART controller +CONFIG_SERIAL=y + +# Enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/qorvo/decawave_dwm3001cdk/doc/index.rst b/boards/qorvo/decawave_dwm3001cdk/doc/index.rst index 278699aa1b1..ada232518fe 100644 --- a/boards/qorvo/decawave_dwm3001cdk/doc/index.rst +++ b/boards/qorvo/decawave_dwm3001cdk/doc/index.rst @@ -31,30 +31,24 @@ found in :ref:`nordic_segger_flashing`. Then build and flash applications as usual (see :ref:`build_an_application` and :ref:`application_run` for more details). -There are two USB ports, the one farthest from the DWM3001C is connected to the -J-Link debugger and the closer one is connected to the nRF52833, though you need -to use CDC ACM USB to get output over it +Here is an example for the :zephyr:code-sample:`hello_world` application. -Here is an example for the :zephyr:code-sample:`usb-cdc-acm` application. - -Connect to the bottom USB port, and flash the sample - -.. zephyr-app-commands:: - :zephyr-app: samples/subsys/usb/console - :board: decawave_dwm3001cdk - :goals: build flash - - -Then, connect the top USB port and open run your favorite terminal program to -listen for output. +Connect to the bottom micro-USB port labeled as J-Link and run your favorite +terminal program to listen for console output. .. code-block:: console $ minicom -D -b 115200 -Replace :code:`` with the port where the board nRF52 DK -can be found. For example, under Linux, :code:`/dev/ttyACM0`. +Replace :code:`` with the port where the DWM3001CDK board can be +found. For example, under Linux, :code:`/dev/ttyACM0`. +Then build and flash the application in the usual way. + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :board: decawave_dwm3001cdk + :goals: build flash References **********