UARTE

In UART async mode (CONFIG_UART_ASYNC_API=y) the UART transmit data and receive callback works fine. I've been able to set up the callback and enable the rx.

After switching to UARTE (CONFIG_NRFX_UARTE0=y), the UART transmit once, but the event handler is never called.

UARTE is set up like example from: "C:\ncs\v2.0.0\zephyr\samples\boards\nrf\nrfx_prs\src\main.c", the baudrate is set to 9600. nrfx_uarte_init() and nrfx_uarte_tx() show NRFX_SUCCESS. When nrfx_uarte_tx_in_progress() call is added, just after nrfx_uarte_tx(),  nrfx_uarte_tx_in_progress() hangs without any further (log) message.

Is it possible to implement UARTE like this on nRF9160 development board?

Do you need to enable rx on UARTE?

Is there any working sample for nRF9160?

Parents Reply
  • Hi,

    This setting was already present. From compiled devicetree output:

    uart0: uart@8000 {
                                    compatible = "nordic,nrf-uarte";
                                    reg = <0x8000 0x1000>;
                                    interrupts = <8 NRF_DEFAULT_IRQ_PRIORITY>;
                                    status = "okay";
                                    current-speed = <9600>;
                                    pinctrl-0 = <&uart0_default>;
                                    pinctrl-1 = <&uart0_sleep>;
                                    pinctrl-names = "default", "sleep";
                            };

    prj.conf contains CONFIG_UART_ASYNC_API=y and output file .config show:
    CONFIG_UART_ASYNC_API=y
    CONFIG_UART_0_NRF_UARTE=y
    CONFIG_NRF_UARTE_PERIPHERAL=y
    • Does this mean uart0 is running in UARTE mode?
    • Can I use standard uart functions (like uart_callback_set, uart_rx_enable, etc.) and run in UARTE mode or do I have to use the uarte functions (like nrfx_uarte_init, nrfx_uarte_tx, etc.) to run in UARTE mode?

    Best regard, Elbert

Children
Related