LPUART in Thingy91 upgrade to nRF Connect 2.1.2

I've been using the LPUART for comms between the 52840 and 9160 in a Thingy91; this was going well until I changed the nRF Connect version from 1.9.1 to 2.1.2, to resolve a memory leak issue.  I saw that I had to make a few changes to the devicetree overlays, that wasn't too painful.  However, I've been unable to get the LPUART to work.  The 840 side seems ok, it works with an older version of the 9160 firmware, but the 9160 side doesn't seem to work.

To try to identify the source of the problem I build the lpuart example for nRF9160DK (this works) and then for Thing91ns (which I know isn't a supported board for the example).

The problem (or at least the problem I'm currently looking at) is that the RDY line isn't being configured properly, so the whole cascade of events that make the LPUART work aren't happening.

Stepping through the initialisation code I believe I found an issue where z_sys_init_run_level calls lpuart_init with a pointer to a 'device' - the device appears to be valid except that dev->data seems to be incomplete.  data->uart points to the uart device but req_pin and rdy_pin are both zero.  However, when I inspect 'data' later in api_rx_enable the req_pin and rdy_pin values are correct.

In my code I had to change device_get_binding("LPUART") to DEVICE_DT_GET(DT_NODELABEL(lpuart)) so I wonder if that's a clue to someone who's more familiar with the devicetree?

Any suggestions on how to continue?

In the overlay I have this:

&uart1 {
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart1_default_alt>;
    pinctrl-1 = <&uart1_sleep_alt>;
    pinctrl-names = "default", "sleep";
    lpuart: nrf-sw-lpuart {
        compatible = "nordic,nrf-sw-lpuart";
        status = "okay";
        label = "LPUART";
        req-pin = <24>;
        rdy-pin = <25>;
    };
};

&uart0 {
    status = "disabled";
};

&gpio0 {
    status = "okay";
};

&gpiote {
    interrupts = <49 NRF_DEFAULT_IRQ_PRIORITY>;
};

&pinctrl {
    uart1_default_alt: uart1_default_alt {
        group1 {
            psels = <NRF_PSEL(UART_RX, 0, 23)>,
                <NRF_PSEL(UART_TX, 0, 22)>;
        };
    };

    uart1_sleep_alt: uart1_sleep_alt {
        group1 {
            psels = <NRF_PSEL(UART_RX, 0, 23)>,
                <NRF_PSEL(UART_TX, 0, 22)>;
            low-power-enable;
        };
    };
};
Parents Reply Children
No Data
Related