NRF54L15: Error -88 when setting UART20 for a callback in async mode

Hi,

I am trying to set up a half duplex UART in async mode over pin 1.9 on NRF54DK board for my project:

Overlay file:
&uart20 {
    compatible = "nordic,nrf-uarte";
    status = "okay";
    current-speed = <115200>;
    pinctrl-0 = <&uart20_default>;
    pinctrl-1 = <&uart20_sleep>;
    pinctrl-names = "default", "sleep";
};

prj.conf:

CONFIG_SERIAL=y
CONFIG_UART_NRFX=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_20_ASYNC=y
Code:
   // Get UART20 device
    uart1_dev = DEVICE_DT_GET(DT_NODELABEL(uart20));
    if (!device_is_ready(uart1_dev)) {
        LOG_ERR("UART: UART20 device is not ready");
        return -ENODEV;
    }

    // Configure UART with callback for async operation
    err = uart_callback_set(uart1_dev, uart_callback_set_handler, NULL);
    if (err) {
        LOG_ERR("UART: Failed to set callback (err %d)", err);
        return err;
    }

    // Enable async RX with buffer
    err = uart_rx_enable(uart1_dev, uart_rx_buf, sizeof(uart_rx_buf), 1);
    if (err) {
        LOG_ERR("UART: Failed to enable RX (err %d)", err);
        return err;
    }
However, no matter what, I am always getting an error -88 when trying to register for a callback (uart_callback_set call). 
Please let me know what I am doing wrong and what should be done to make it working.
Thanks
Parents
  • Hi,

    -ENOSYS (-88) from uart_callback_set() indicates that async support has not been enabled for "uart1_dev", but I see you've already added CONFIG_UART_20_ASYNC=y to your project configuration, so I'm not exactly sure why this error occurs. Do you see any Kconfig warnings in the build log indicating that this symbol did not end up being selected?
    Best regards,
    Vidar
Reply
  • Hi,

    -ENOSYS (-88) from uart_callback_set() indicates that async support has not been enabled for "uart1_dev", but I see you've already added CONFIG_UART_20_ASYNC=y to your project configuration, so I'm not exactly sure why this error occurs. Do you see any Kconfig warnings in the build log indicating that this symbol did not end up being selected?
    Best regards,
    Vidar
Children
Related