nRF52840 DK dual UARTs: Debug on UART1, sensor on UART0

Hi, I’m working with an nRF52840 DK and trying to use two UARTs simultaneously. I’ve configured UART1 for debugging (console and shell output) and want to use the default UART0 pins for communicating with a CO₂, temp, and humidity sensor. I want to send a Q command every ~5 seconds and receive the sensor’s response back. I’ve verified my hardware setup with an FTDI cable — I can see the Q being printed at one point, and I can talk back and forth with the MCU, but now the Q doesn’t appear on the pins anymore. I suspect there may be a conflict with the UART configuration or a mismatch in the baud rate. I’ve attached my full zip file— could you please help me identify what might be wrong with my multi-UART setup or any recommended settings to ensure reliable TX/RX on UART0 for the sensor?

TX- P0.06

RX- P0.08

Overlay- 

/ {
    chosen {
        zephyr,console = &uarte1;
        zephyr,shell-uart = &uarte1;
    };
};


&pinctrl {
    uart0_default: uart0_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>;
        };
        group2 {
            psels = <NRF_PSEL(UART_RX, 0, 8)>;
        };

    };
    /* required if CONFIG_PM_DEVICE=y */
    uart0_sleep: uart0_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 6)>,
                    <NRF_PSEL(UART_RX, 0, 8)>;
            low-power-enable;
        };
    };
};

&uart0 {
    compatible = "nordic,nrf-uarte";
    current-speed = <9600>;
    status = "okay";
    pinctrl-0 = <&uart0_default>;
    pinctrl-1 = <&uart0_sleep>;
    pinctrl-names = "default", "sleep";
};

5554.ZP_Transfer.zip

Parents
  • Hi Lexie,

    but now the Q doesn’t appear on the pins anymore.

    If I am understanding you correctly it worked for a while, but then suddenly didn't? If so, then dts wouldn't be my prime suspect. Some loose connections or other random variables that vary more or are easier to overlook seem more likely.

            zephyr,console = &uarte1;
            zephyr,shell-uart = &uarte1;

    Another thing to note is this. On the DK the default name of these is uart0, did you mean to change this to uarte? If you wanted easy dma you only need this part:

        compatible = "nordic,nrf-uarte";

    Besides this, do you know what baud rate this sensor needs?

    Regards,

    Elfving

Reply
  • Hi Lexie,

    but now the Q doesn’t appear on the pins anymore.

    If I am understanding you correctly it worked for a while, but then suddenly didn't? If so, then dts wouldn't be my prime suspect. Some loose connections or other random variables that vary more or are easier to overlook seem more likely.

            zephyr,console = &uarte1;
            zephyr,shell-uart = &uarte1;

    Another thing to note is this. On the DK the default name of these is uart0, did you mean to change this to uarte? If you wanted easy dma you only need this part:

        compatible = "nordic,nrf-uarte";

    Besides this, do you know what baud rate this sensor needs?

    Regards,

    Elfving

Children
No Data
Related