This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRf9160 UART_1 binding failure.

Hello All,

I am facing binding error if I use UART1 for binding but UART0 is working fine. Refer the below error. 

Please let me know the solution to solve this error. 

Error: 

*** Booting Zephyr OS build v2.6.0-rc1-ncs1 ***
uart device binding failed! LTE Link Connecting...
[00:00:00.206,024] <err> at_host: Cannot bind UART_1

[00:00:00.206,054] <err> at_host: UART could not be initialized: -22
[00:00:00.211,029] <dbg> fs_nvs.nvs_recover_last_ate: Recovering last ate from sector 0
[00:00:00.217,254] <inf> fs_nvs: 3 Sectors of 4096 bytes
[00:00:00.217,254] <inf> fs_nvs: alloc wra: 0, ff0
[00:00:00.217,254] <inf> fs_nvs: data wra: 0, 0
[00:00:01.328,094] <err> os: Exception occurred in Secure State
[00:00:01.328,125] <err> os: ***** HARD FAULT *****
[00:00:01.328,125] <err> os: Fault escalation (see below)
[00:00:01.328,125] <err> os: ***** BUS FAULT *****
[00:00:01.328,155] <err> os: Precise data bus error
[00:00:01.328,155] <err> os: BFAR Address: 0x50008158
[00:00:01.328,155] <err> os: r0/a1: 0x00000000 r1/a2: 0x0000002b r2/a3: 0x000234a9
[00:00:01.328,155] <err> os: r3/a4: 0x20019b70 r12/ip: 0x0002458b r14/lr: 0x0007d11
[00:00:01.328,155] <err> os: xpsr: 0x21000000
[00:00:01.328,186] <err> os: Faulting instruction address (r15/pc): 0x00017dd0
[00:00:01.328,186] <err> os: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
[00:00:01.328,186] <err> os: Current thread: 0x20018c18 (unknown)

Code: 

#define UART_DEVICE_NAME "UART_1"

struct k_msgq* uart_init(void)
{
    /* uart setup */
    uart = device_get_binding(UART_DEVICE_NAME);
    if(!uart){
        return NULL; //-ENXIO
    }
}

 

UART configuration in nrf9160dk_nrf9160_common.dts file.

&uart0 {
        status = "okay";
        current-speed = <115200>;
        tx-pin = <29>;
        rx-pin = <28>;
        rts-pin = <27>;
        cts-pin = <26>;
};

&uart1 {
        status = "okay";
        current-speed = <115200>;
        tx-pin = <1>;
        rx-pin = <0>;
        rts-pin = <14>;
        cts-pin = <15>;
};

&uart2 {
        tx-pin = <24>;
        rx-pin = <23>;
};

Thanks in advance!

Regards,

Chetan

Related