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

device_get_binding device name of the device changes

What I want to do is do UART communication (UART_1) between nRF52840 and nRF9160.

From the nRF52840 side, uart_poll_out is OK,
From the nRF9160 side, uart_poll_out examined because it was not.

Binding is performed on both:
uart_dev = device_get_binding("UART_1");

z_impl_device_get_binding the device name of the device is stopped with a matching for statement,
On the nRF52840 side UART_1 remains intact.
On the nRF9160 side, UART_0 possible.

On the nRF 52840 side, if it continues, it becomes RNG.
Continuing on the nRF9160 side I2C_2 operation.

Is prj.conf set up wrong?

Parents
  • Hi!

    Thanks for reaching out. Are you getting any error messages from device_get_binding("UART_1") on the nRF9160? In addition to configuring the UART in prj.conf you must also enable it in thingy91_nrf9160ns.overlay file. You can see an example on how this is done in the boards folder lte_ble_gateway sample.

    Best regards,
    Carl Richard

  • Lte_ble_gateway the following six line to prj.conf, referring to the sample

    UART_2 -> UART_1 changed to 4 locations

    CONFIG_NRF_SW_LPUART=y
    CONFIG_NRF_SW_LPUART_INT_DRIVEN=y
    CONFIG_UART_1_ASYNC=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=n
    CONFIG_UART_1_NRF_HW_ASYNC=y
    CONFIG_UART_1_NRF_HW_ASYNC_TIMER=2

    thingy91_nrf9160ns.overlay files in at_client folder and moved them.

    uart2 -> uart1
    Changed 4 pin numbers.

    / {
    chosen {
    zephyr,bt-uart=&lpuart;
    };
    };

    &uart1 {
    current-speed = <1000000>;
    status = "okay";
    tx-pin = <22>;
    rx-pin = <23>;
    /delete-property/ rts-pin;
    /delete-property/ cts-pin;
    /delete-property/ hw-flow-control;

    lpuart: nrf-sw-lpuart {
    compatible = "nordic,nrf-sw-lpuart";
    status = "okay";
    label = "LPUART";
    req-pin = <24>;
    rdy-pin = <25>;
    };
    };

    As a result of moving, the system went down.

    What's wrong with that?

  • UART moved on the nRF9160 side.

    prj.conf:
    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_UART_1_ASYNC=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=y

    thingy91_nrf9160ns.overlay
    / {
    chosen {
    zephyr,console = &uart0;
    zephyr,shell-uart = &uart0;
    zephyr,uart-mcumgr = &uart0;
    };
    };

    &uart1 {
    current-speed = <1000000>;
    status = "okay";
    tx-pin = <22>;
    rx-pin = <23>;
    rts-pin = <24>;
    cts-pin = <25>;
    };

    Thank you very much.

Reply
  • UART moved on the nRF9160 side.

    prj.conf:
    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    CONFIG_UART_1_ASYNC=y
    CONFIG_UART_1_INTERRUPT_DRIVEN=y

    thingy91_nrf9160ns.overlay
    / {
    chosen {
    zephyr,console = &uart0;
    zephyr,shell-uart = &uart0;
    zephyr,uart-mcumgr = &uart0;
    };
    };

    &uart1 {
    current-speed = <1000000>;
    status = "okay";
    tx-pin = <22>;
    rx-pin = <23>;
    rts-pin = <24>;
    cts-pin = <25>;
    };

    Thank you very much.

Children
Related