Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrfx_uarte_rx doesn't receive/return last byte

I need to implement a simple uart protocol. most messages are fixed length (8bytes) with some exceptions.

here what I do in pseudo code, I send 8bytes and expect 8bytes back.

  1. nrfx_uarte_tx() [8bytes]
  2. in evt handler, TX_DONE event, nrfx_uarte_rx() [8bytes]
  3. RX_DONE event never happens

if I change nrfx_uarte_rx() to receive 7bytes, the first 7bytes of the message is received correctly.

to receive variable size messages, my idea is to receive as many bytes as I need to get the length information, then issue another nrfx_uarte_rx() call to get the rest.

the problem now is, why do I not receive the last byte of my message?

Chip: nrf52840 (ublox NINA-B3)
SDK: 15.2.0
OS: Linux
Toolchain: GNU Tools for Arm Embedded Processors 7-2018-q3-update

Related