Hello,
Following a guiding response to a recent post I made, about compiling an nRF9160 at_client sample project for an alternate board, @jaredwolff shared with me the link to his sample projects at Github hosted nrf9160-feather-examples-and-drivers.

In this nfed sample apps collection, the at_client targets an nRF9160 Feather dev board, with
an overlay file. The overlay file refers to UART TX, RX pins 23 and 24, but the on the schematic
the signals TX and RX connect to differently numbered pins on the nRF9160.

Am I missing a net name or pin identifier somewhere? How does this overlay file inform Zephyr’s build process about the correct pin and hardware connections, when nothing on the schematic to which TX and RX connect is labeled as pin 23 or 24?

  • Ted

    tedhavelka66 the overlay is referring to the TX/RX pins connected to the USB to UART chip. 😀 Your an certainly re-map those pins to whatever you want.

    Hi Jared,
    By “USB to UART” are you referring to the CP2102, U2 in the Feather schematic? That part only appears to have twenty pins. The connected TX an RX are numbered 17 and 18. This is part of why I am wondering to what identifiers <23> and <24> from the overlay file map?

    • Ted

      tedhavelka66 uart0 is used for the USB to Serial:

      &uart0 {
      	status = "okay";
      	current-speed = <115200>;
      	tx-pin = <6>;
      	rx-pin = <5>;
      };

      That is determined by the zephyr,console definition earlier in the common device def:

      	chosen {
      		zephyr,console = &uart0;
      		zephyr,shell-uart = &uart0;
      		zephyr,uart-mcumgr = &uart0;
      	};

      If you want to re-map the at_client pins you can re-define uart0 to different pins. If you still want to maintain your console debug output you may have to modify the at_client example itself to use a different serial interface. You can use AT_HOST_UART_X to switch from UART0 to 1 or 2.

      choice
      	prompt "UART for AT Host"
      	default AT_HOST_UART_0
      	depends on AT_HOST_LIBRARY
      	help
      		Sets the UART to use for the AT Host
      		-  UART 0
      		-  UART 1
      		-  UART 2
      	config AT_HOST_UART_0
      		bool "UART 0"
      	config AT_HOST_UART_1
      		bool "UART 1"
      	config AT_HOST_UART_2
      		bool "UART 2"
      endchoice

      So you would need to define CONFIG_AT_HOST_UART_1=y or CONFIG_AT_HOST_UART_2=y in your prj.conf if you want to switch interfaces.

      2 years later

      Hi. Is there a sample for UART1 and UART2. I only found a example for lpwuart and it is not even compiling.

      Thanks.

      @vinifr feel free to make a new post since this one is old. Happy to help you there.

      Terms and Conditions | Privacy Policy