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

UART pin routing error on custom board

We are using NRF9160 in custom designed hardware board. We basically need 2 UARTs in this project one for the communication with host MCU and other just as a debug UART which will be used during development phase only. I am using UART example from https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/uart. The configuration I want is

&uart0 {
	status = "ok";
	current-speed = <115200>;
	tx-pin = <18>;
	rx-pin = <19>;
};

&uart1 {
	status = "ok";
	current-speed = <115200>;
	tx-pin = <3>;
	rx-pin = <2>;
	rts-pin = <1>;
	cts-pin = <0>;
};

where UART0 will be used for debugging console and UART1 will be used for host MCU interface.

When I try to route UART0 to those pins it does not work but it is working if I use routing as

&uart0 {
	status = "ok";
	current-speed = <115200>;
	tx-pin = <3>;
	rx-pin = <18>;
};

which is pretty much mixture of my 2-different UARTS. Even in this case if I  just change rx-pin to 19 rx does not work. After boot from the secure boot when it goes to the main application it starts putting some garbage data. It does not receive the text I am typing by the terminal. If I  disconnect my FTDI UART Tx and restarts I don't see garbage data anymore, if I connect FTDI tx again it still does not receive any text input from the putty console.

Routing tx-pin to 18 for UART0 does not work at all.

Also, I am unable to use UART1. I assigned the pins according to use and change 

struct device *uart = device_get_binding("UART_1");

but once I load this program hits the hard fault

#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
	/* force unlock interrupts */
	eors.n r0, r0
	msr BASEPRI, r0

Parents Reply Children
No Data
Related