Simple UART using DK nrf52832

I am new to Zephyr and I have been trying to get hold of a tutorial or a sample app that would indicate how I can use the UART on the nRF52832 for communications with another device.

I am using v1.9.99 nRF Connect SDK. 

I have been looking at the KConfig file in VSCode and have manged to tick the right boxes (Hello World app), but getting the APIs to work is where I am stuck,

Any help will be appreciated.

Cheers

Parents Reply
  • Hi,

    When using UART, one of the APIs needs to be chosen. For example, choosing async API requires CONFIG_UART_ASYNC_API=y configuration option (in addition to CONFIG_SERIAL=y). An UART peripheral is defined using struct device
    const struct device *uart= device_get_binding(DT_LABEL(DT_NODELABEL(uart0)));

    In this example uart is the pointer which interacts with UART API. In the devicetree, uart0 would be the name of the devicetree node used which represents UART hardware controller on the chip. You can read more about the devicetree here.

    Best regards,
    Dejan

Children
No Data
Related