NCS UART uart_poll_out with nordic,nrf-uart faulty TX, but works nordic,nrf-uarte

Hi folks,

The blocking transmit function uart_poll_out() works as expected with UARTE, but not with UART.

For our project low power is critical. Thats why I need to use UART (~300 uA) instead of UARTE (~1300 uA). Baud is very low, so DMA does not benefit us.

brd_test.overlay file -> uart0 ->  compatible = "nordic,nrf-uart";

Figure. UART - faulty transmission

brd_test.overlay file -> uart0 ->  compatible = "nordic,nrf-uarte";

Figure. UARTE - transmission OK.

I also tried calling uart_irq_tx_ready() inside ISR -without effect.



I took the echo_bot example and modified it. Here are the files that i modified (i removed RX code for cleanness sake):

5852.main.cpp7028.prj.confbrd_test.overlaybrd_test.dtsi

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(echo_bot_2)

target_sources(app PRIVATE src/main.cpp)

Second issue is that calling uart_irq_tx_enable(uart_dev) ends in signal handler. Please test it by adding uart_irq_tx_enable() inside uart_tx(). I hoped to work around the faulty transmission by using interrupt driven api, but I cant even enable the tx interrupt in the first place.

Third issue is being able to disable receiver (only async api has RX enable/disable). Unfortunately I couldn't get the async api it to receive in a stable manner. Thats another rant.
For interrupt driven driver I managed to get the sleep power consumption down 2.7 uA by calling pm_device_action_run() manually (as seen in the code). Are there any caveats doing it?

Parents
  • Hi

    I don't have any specific suggestions as to why this must be, so I'm mostly starting out by asking a few clarifying questions:

    1. What version of the nRF Connect SDK are you using?
    2. Does the data you write seem to just be random, or are the data skewed/offset by something specific when using the regular UART?
    3. Are you seeing any sort of error messages when debugging this on your end or does the application seemingly work as expected except the UART data being jumbled?
    4. Is this reproducible on an nRF52832 DK or just on a custom board?
    5. Have you tried enabling HWFC in the UART overlay to see if that makes any change?

    Best regards,

    Simon

Reply
  • Hi

    I don't have any specific suggestions as to why this must be, so I'm mostly starting out by asking a few clarifying questions:

    1. What version of the nRF Connect SDK are you using?
    2. Does the data you write seem to just be random, or are the data skewed/offset by something specific when using the regular UART?
    3. Are you seeing any sort of error messages when debugging this on your end or does the application seemingly work as expected except the UART data being jumbled?
    4. Is this reproducible on an nRF52832 DK or just on a custom board?
    5. Have you tried enabling HWFC in the UART overlay to see if that makes any change?

    Best regards,

    Simon

Children
Related