[nRF Connect SDK] uart tx failure

Target nRF52832(nrf52dk_nrf52832)
SDK NCS v1.9.1

my.dts
&uart0 {
status = "okay";
tx-pin = <14>;
rx-pin = <13>;
rts-pin = <17>;
cts-pin = <16>;
current-speed = <921600>;
hw-flow-control;
};

[URGENT]
Issue: UART Tx failure. (Most of time. In failure case, any data did not transmitted, I checked Tx pin with microscope)
UART works well with PC(usb to serial) Tx, Rx
Issue happened  with my target MCU's uart.(UART Rx is good, Tx failed)
But It was fine with old SDK(nRF5_SDK_17.1.0_ddde560).(Tx, Rx). NCS has issue.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Prj.conf
# Enable the UART driver
CONFIG_UART_CONSOLE=n
CONFIG_UART_ASYNC_API=n
CONFIG_UART_INTERRUPT_DRIVEN=y
[main.c]
static void uart_init_irq(void)
{
lpuart = device_get_binding("UART_0");
uart_irq_callback_set(lpuart, uart_irq_handler);
}
static void uart_irq_handler(const struct device *dev, void *context)
{
uint8_t *data_tx = NULL;
uart_irq_update(dev);
if (uart_irq_tx_ready(dev)) {
int nr_bytes_read =
ring_buf_get_claim(&uart_rb, &data_tx, CONFIG_UART_0_NRF_TX_BUFFER_SIZE);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



For Nordic kind support, we can make it not to late. Thank you. I hope this is to be last question.
Can you please give me guide. I have to prepare new firmware by the end of this week. Pre-mass production is scheduled.

+addition
I found uart_irq_tx_complete() returns '0' for more than 30 sec.(call it every 1 second)

  • Hello, I will take a look at this tomorrow.

    Best regards,

    Simon


  • I found uart_irq_tx_complete() returns '0' in success case. Please take into your consideration.

  • In my test, async uart sample works with my target MCU so far. However I'm using interrupt-driven method due to case #286832 at the beginning of NCS project.

    My project do requires good performance of UART Rx. (current-speed = <921600>; hw-flow-control;) 
    Otherwise We don't have lots of Tx data than Rx. 

    Currently I'm satisfied with INT-driven with uart for Rx. 
    I believe you can give me good solution. Slight smile

  • Sorry for the late answer, I was a little bit busy today. Have you seen the sample https://github.com/nrfconnect/sdk-zephyr/tree/main/samples/drivers/uart/echo_bot? Please let me know if this is not suficcient and I will help you to have the firmware ready before the end of the week.

  • Thanks for updating.
    From your sample, INT used for Rx with polling writing api. It seems that It is nothing different with me.

    Prj.conf
    CONFIG_SERIAL=y
    CONFIG_UART_INTERRUPT_DRIVEN=y
    main.c
    uart_poll_out(uart_dev, buf[i]);

    I'm checking 4 uart line with micro-scope then update it.

1 2