RAKWireless / RAK4630-Amazon-Sidewalk-Example

Example code for Sidewalk application on the RAK4630/RAK4631
MIT License
2 stars 1 forks source link

Trouble enabling UART1 #3

Open ryanfeist2 opened 5 months ago

ryanfeist2 commented 5 months ago

Hi,
I'm having some trouble enabling UART1 within the rak4631_rak1901_demo application.
I've added what I think are the appropriate lines to _rak4631nrf52840.overlay and proj.conf.
I then added lines in the application to initialize and set a callback for the peripheral, but unfortunately, it fails on compile with the following error:

rak-repo/rak-sid-workspace/rak-sid/app/rak4631_rak1901_demo/src/my_tasks.c:183: undefined reference to `__device_dts_ord_88'

The error is in reference to this line I've added in my_tasks.c to initialize the UART1 peripheral:

static const struct device *uart1_dev = DEVICE_DT_GET(DT_NODELABEL(uart1));
if (device_is_ready(uart1_dev)) {
    printk("UART1 device is found!");
} else {
    printk("UART1 device is NOT found!");
}

It seems to be unable to resolve the name "uart1" even though I have added lines in the overlay and .conf file to support it, as shown below:

Additions in rak4631_nrf52840.overlay:

&pinctrl {
   uart1_default: uart1_default {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 16)>,
                    <NRF_PSEL(UART_RX, 0, 15)>;
        };
    };
   uart1_sleep: uart1_sleep {
        group1 {
            psels = <NRF_PSEL(UART_TX, 0, 16)>,
                    <NRF_PSEL(UART_RX, 0, 15)>;
        low-power-enable;
        };
    };
};
&uart1 {
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart1_default>;
        pinctrl-1 = <&uart1_sleep>;
        pinctrl-names = "default", "sleep";
};

Additions in proj.conf:

CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_1_ASYNC=y

Any assistance you could provide would be great, I've been stuck on this for a while. Thanks.

ryanfeist2 commented 5 months ago

Issue resolved by enabling config UART_1_NRF_UARTE default y in sidewalk/Kconfig.dependencies