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.
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.
I cannot find CONFIG_BOARD_NRF52840_XXXX in http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html I think that config is not supported and I cannot run with it. Remove that config…
I see here in the git of the sdk that there are k config flags. sdk-zephyr/Kconfig.nrfx at master · nrfconnect/sdk-zephyr (github.com)
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"); } }
I cannot find CONFIG_BOARD_NRF52840_XXXX in http://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html I think that config is not supported and I cannot run with it. Remove that config in prj.conf, I can run your main.c without issue and see the "Hello" in the terminal.
prj.conf:
CONFIG_NRFX_UARTE0=y ######################## # 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
I fixed it by adding my own board to CMake and correcting the DTS file with it.