This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 DK UART configuration

I'm trying to understand how the UARTs are configured on the nRF9160 DK.

The spec mentions that there are two UARTs, a primary and a secondary.  https://infocenter.nordicsemi.com/topic/ug_nrf91_dk/UG/nrf91_DK/if_connector.html

And I see these being configured in the DTS file for the DK:

			uart0: uart@8000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0x8000 0x1000 >;
				interrupts = < 0x08 0x01 >;
				status = "ok";
				label = "UART_0";
				current-speed = < 0x1c200 >;
				tx-pin = < 0x1d >;
				rx-pin = < 0x1c >;
				rts-pin = < 0x1b >;
				cts-pin = < 0x1a >;
			};

			uart1: uart@9000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0x9000 0x1000 >;
				interrupts = < 0x09 0x01 >;
				status = "ok";
				label = "UART_1";
				current-speed = < 0x1c200 >;
				tx-pin = < 0x01 >;
				rx-pin = < 0x00 >;
				rts-pin = < 0x0e >;
				cts-pin = < 0x0f >;
			};

			uart2: uart@a000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0xa000 0x1000 >;
				interrupts = < 0x0a 0x01 >;
				status = "disabled";
				label = "UART_2";
			};

			uart3: uart@b000 {
				compatible = "nordic,nrf-uarte";
				reg = < 0xb000 0x1000 >;
				interrupts = < 0x0b 0x01 >;
				status = "disabled";
				label = "UART_3";
			};

So it looks like since the primary UART uses pins P0.26, P0.27, P0.28, and P0.29  and those pins are for UART0, UART0 is the primary.  UART1 is secondary.

Looking at the asset tracker application, when I look at the project configuration for the Zephyr kernel, I see that UART0 is configured for AT commands and also for Console:

So console is UART0 and apparently it will look for AT commands there too.

But I don't see the secondary UART! configured.  Is it used for anything on the DK for the asset tracker?

Now, if I open the LTE Gateway project, it has UART2 configured as well:

So AT_HOST and Console are still UART0, I still don't see UART1 configured, and now we have UART2.  So, with the LTE Gateway are we using the secondary UART1?  And is UART2 being used to communicate BLE data from the nRF52 to the nRF91 for this application?

One additional question.  I see in the product spec that we can set a UART to not have hardware flow control, if I understand right.  To configure in that way, would we leave this box unchecked

and then also leave the rts and cts pins undefined in the device tree specification?

Thanks!

Erik

Related