52840 UARTE Support in Zephyr RTOS. Does it exist?

Hey do you know if the UARTE driver is available for Zephyr RTOS? What are your recommendations for getting UART working on NCS 1.4.1 for the NRF52840. Please link any helpful documentation and examples.

Parents
  • Hi, 

    Yes, the UARTE driver is available in NCS. You can refer to the bluetooth-peripheral-uart sample and its prj.conf for the setting. 

    -Amanda H.

  • Thank you for the recommendation! I am stuck on getting uart0 up. here is my main it throws an exception on line 16 device_get_binding. Additionally here is my board's def configs

    # SPDX-License-Identifier: Apache-2.0
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52840_QIAA=y
    CONFIG_BOARD_NRF52840_XXXX=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # enable GPIO
    CONFIG_GPIO=y
    
    # enable uart driver
    CONFIG_SERIAL=y
    CONFIG_UART_NRFX=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    #include <zephyr.h>
    #include <device.h>
    #include <sys/printk.h>
    #include <drivers/uart.h>
    
    const struct uart_config uart_cfg = {
            .baudrate = 9600,
            .parity = UART_CFG_PARITY_NONE,
            .stop_bits = UART_CFG_STOP_BITS_1,
            .data_bits = UART_CFG_DATA_BITS_8,
            .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
        };
    void main(void)
    {
        const struct device *uart_dev; 
        uart_dev = device_get_binding("UART_0");
        while(1){
            printk("Hello");
        }
    }
Reply
  • Thank you for the recommendation! I am stuck on getting uart0 up. here is my main it throws an exception on line 16 device_get_binding. Additionally here is my board's def configs

    # SPDX-License-Identifier: Apache-2.0
    CONFIG_SOC_SERIES_NRF52X=y
    CONFIG_SOC_NRF52840_QIAA=y
    CONFIG_BOARD_NRF52840_XXXX=y
    
    # Enable MPU
    CONFIG_ARM_MPU=y
    
    # enable GPIO
    CONFIG_GPIO=y
    
    # enable uart driver
    CONFIG_SERIAL=y
    CONFIG_UART_NRFX=y
    
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    #include <zephyr.h>
    #include <device.h>
    #include <sys/printk.h>
    #include <drivers/uart.h>
    
    const struct uart_config uart_cfg = {
            .baudrate = 9600,
            .parity = UART_CFG_PARITY_NONE,
            .stop_bits = UART_CFG_STOP_BITS_1,
            .data_bits = UART_CFG_DATA_BITS_8,
            .flow_ctrl = UART_CFG_FLOW_CTRL_NONE
        };
    void main(void)
    {
        const struct device *uart_dev; 
        uart_dev = device_get_binding("UART_0");
        while(1){
            printk("Hello");
        }
    }
Children
Related