How to use a UART instead of CDC ACM in Openthread CLI example

Hi, I am using a third party module based on nRF52840. I want to use a standard UART to operate the CLI shell. I am not clear how to do this, any help?

Thanks,

Kaushalya

Parents
  • Hi,

    Could you give me some more information about your project:

    1. What SDK are you using?
    2. Are you basing your application on any existing Nordic Semiconductor firmware samples?
      1. Have you had a look at https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/openthread/cli/README.htmlThe Thread CLI sample supports UART and USB CDC ACM as serial transports. By default, it uses UART transport. To switch to USB transport, activate the USB overlay extension.

    Kind regards,
    Andreas

  • Thanks Andreas,

    1. SDK 2.0.0

    2. Yes this is the /OpenThread/CLI sample

    a. Yes I have. I am not using the overlay_usb.conf, so my assumption is the build should be using the default UART as the transport layer. Now the question is to find how the UART is mapped or which external pins are associated with the default UART. I am using nrf52840dk_nrf52840.dts, so I guess the uart0 is the one used based on

    	chosen {
    		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;
    	};

    Now further below the DTS, I see

    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    I cant find where 'uart0_default' is defined.

    Thanks,

    Kaushalya

Reply
  • Thanks Andreas,

    1. SDK 2.0.0

    2. Yes this is the /OpenThread/CLI sample

    a. Yes I have. I am not using the overlay_usb.conf, so my assumption is the build should be using the default UART as the transport layer. Now the question is to find how the UART is mapped or which external pins are associated with the default UART. I am using nrf52840dk_nrf52840.dts, so I guess the uart0 is the one used based on

    	chosen {
    		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;
    	};

    Now further below the DTS, I see

    &uart0 {
    	compatible = "nordic,nrf-uarte";
    	status = "okay";
    	current-speed = <115200>;
    	pinctrl-0 = <&uart0_default>;
    	pinctrl-1 = <&uart0_sleep>;
    	pinctrl-names = "default", "sleep";
    };

    I cant find where 'uart0_default' is defined.

    Thanks,

    Kaushalya

Children
No Data
Related