This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

During uart communication, a delay of about 10us occurs between characters.

Hello.
I am writing a program using an example called ble_app_uart.
While using the printf function, the output is output with a delay of 10us between characters and characters.

Can't you get rid of this delay?

Additionally, I gave a baud rate of 1000000.

static void uart_init(void)
{
    uint32_t                     err_code;
    app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = RX_PIN_NUMBER,
        .tx_pin_no    = TX_PIN_NUMBER,
        .rts_pin_no   = RTS_PIN_NUMBER,
        .cts_pin_no   = CTS_PIN_NUMBER,
        .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
        .use_parity   = false,
#if defined (UART_PRESENT)
        .baud_rate    = NRF_UART_BAUDRATE_1000000
#else
        .baud_rate    = NRF_UARTE_BAUDRATE_115200
#endif
    };

    APP_UART_FIFO_INIT(&comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOWEST,
                       err_code);
    APP_ERROR_CHECK(err_code);
}

--------------------------------------------------------------

No results for about 4 days.
Do you also have this problem?
Is it only me having problems?

  • Hello,

    No results for about 4 days.

    Thank you for your patience with this. The national Easter holiday has just concluded here in Norway, and we are now back in office.

    While using the printf function, the output is output with a delay of 10us between characters and characters.

    The retargeted printf is just calling app_uart_put which uses a FIFO buffer to do bytewise transfers, this might be why you are seeing one-and-one byte being transferred.
    Could you try to use the nrfx_uart_tx function directly, with an array larger than 1, and see if you then get rid of the 10us delay.

    Best regards,
    Karl

Related