Bytes are lost when sending with nrfx_uarte_tx in uarte_handler

Hello,

I´m trying to send a paket of databytes. For some reasons I need to send it byte by byte (that´s not changeable).

I have inited the uarte with a handler:

nrfx_uarte_init(&m_uarte1_inst, &m_uarte1_config, uarte1_handler);

The first byte is sent in the main-thread. After that I´m using the handler for the following bytes.

In the handler I´m checking the event-Type and on EVT_TX_DONE I´m trying to send the next byte.

switch (p_event->type)
  {
  case NRFX_UARTE_EVT_ERROR:
...
    break;

  case NRFX_UARTE_EVT_RX_DONE:
    ...
    break;

  case NRFX_UARTE_EVT_TX_DONE:
    LOG_DBG("HW %02x", txData);
    ret = nrfx_uarte_tx(p_current_uarte, &txData, 1, 0);
    if (ret != NRFX_SUCCESS)
    LOG_DBG("TX-Error");
    break;

Sometimes there are Bytes missing in the transmission (checked with a logic-analyser at the output-pin). In the LOG I can see the bytes correctly. And there are no "TX-Error"-Messages. So the bytes seems to be transmitted to the uarte-peripheral correctly, but it are not always sent out.

Are there any hints that I could follow?

Parents Reply Children
No Data
Related