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

Can not config UART 1, if using UART 2 or 3 the program works fine

Hey all,

I have started working with this board around a month ago, and start to understand it little by little. I have a program that communicates with a display over UART. It works well when it is configured with UART 2 or 3. But when I try to configure with UART 1 it does not work. I did some reading on the forum and I found that you should add CONFIG_BSD_LIBRARY_TRACE_ENABLED=n in prj.conf but this also did nothing.  So I would have just used UART 2 or 3 for the display, but this is also not an option because I have two other devices that use UART. And need 3 UART for the final system. The config file and overlay file are listed beneath. (UART 2 and 3 are config the same but I just change the number). Do you maybe know how to configure UART 1, or what I am doing wrong? NCS version: 1.3.0, Board: nrf9160dk_nrf9160 and I use SES V4.52.

.prj file:

CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

CONFIG_SPI_1=n
CONFIG_I2C_1=n

overlay file:

&uart1 {
    current-speed = <57600>;
    status = "okay";
    tx-pin = <19>;
    rx-pin = <17>;
    rts-pin = <0xFFFFFFFF>;
    cts-pin = <0xFFFFFFFF>;
};

Thanks in advance for your time

Parents Reply
  • Thanks again for your reply, you are a great help. If that is the case, it is definitely was still using UART to log because RTT viewer didn't receive anything. After adding some lines to config, it is using RTT now. But UART 1 still does not receive any data from the sensor(Plugged sensor in so I could easily see if it is working or not, instead of display). What am I doing wrong?

    My config file is right now:

    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y

    CONFIG_SPI_1=n
    CONFIG_I2C_1=n


    CONFIG_TRUSTED_EXECUTION_NONSECURE=y

    CONFIG_PRINTK=y
    CONFIG_CONSOLE=y
    CONFIG_STDOUT_CONSOLE=y

    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y

    CONFIG_USE_SEGGER_RTT=y

    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_UART=n
    CONFIG_LOG_PRINTK=n

    and overlay file:

    &uart1 {
        current-speed = <9600>;
        status = "okay";
        tx-pin = <0xFFFFFFFF>;
        rx-pin = <17>;
        rts-pin = <0xFFFFFFFF>;
        cts-pin = <0xFFFFFFFF>;    
    };

Children
Related