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
  • Hi,

    Are you building for target nrf9160_pca10090 or nrf9160_pca10090ns ?

    Are you on the v0.4.0 tag ?

    Did you make any changes to prj.conf ? Is CONFIG_TRUSTED_EXECUTION_NONSECURE set to n or y ?

    Since spm(previously called “secure boot”) also uses UART0, you might need set the overlay for the spm project for the changes to take effect. I.e. add the uart0 changes to the nrf9160_pca10090.overlay in folder \ncs\nrf\samples\nrf9160\spm

  • HI,

    I am building fnrf9160_pca10090 which is the only board available in my SDK as I am using v0.3.0 tag. I had some difficulties importing project when I used v0.4.0 tag, and I already had v0.3.0 setup so I just kept using that.

    I did not make any changes to prj.conf and CONFIG_TRUSTED_EXECUTION_NONSECURE=y.

    I am using secure boot project instead of spm which is the option in v0.3.0. I did reload the secure boot to make the changes effective for UART0 there too.

Reply
  • HI,

    I am building fnrf9160_pca10090 which is the only board available in my SDK as I am using v0.3.0 tag. I had some difficulties importing project when I used v0.4.0 tag, and I already had v0.3.0 setup so I just kept using that.

    I did not make any changes to prj.conf and CONFIG_TRUSTED_EXECUTION_NONSECURE=y.

    I am using secure boot project instead of spm which is the option in v0.3.0. I did reload the secure boot to make the changes effective for UART0 there too.

Children
Related