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

UART inserting extra data into stream

I am implementing a serial transmitter using the nrf_serial library from the nRF5 SDK 15.3.0. The application is very similar to a serially addressable LED string.

My serial instance is initialized as follows:

#define SERIAL_FIFO_TX_SIZE 32
#define SERIAL_FIFO_RX_SIZE 32

#define SERIAL_BUFF_TX_SIZE 4
#define SERIAL_BUFF_RX_SIZE 4

#define RX_PIN     0xFFFFFFFF  // Pin definition of 0xFFFFFFFF  leaves pin disconnected
#define TX_PIN     23
#define RTS_PIN    0xFFFFFFFF  // Pin definition of 0xFFFFFFFF  leaves pin disconnected
#define CTS_PIN    0xFFFFFFFF  // Pin definition of 0xFFFFFFFF  leaves pin disconnected
#define BAUDRATE   0xA3D71     // Baudrate of 2500, calculated using eqation Baudrate = desired baudrate * 2^32 / 16000000

NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uart0_drv_config,
                    RX_PIN, TX_PIN,
                    RTS_PIN, CTS_PIN,
                    NRF_UART_HWFC_DISABLED, NRF_UART_PARITY_EXCLUDED,
                    BAUDRATE,
                    UART_DEFAULT_CONFIG_IRQ_PRIORITY);



NRF_SERIAL_QUEUES_DEF(m_queues, SERIAL_FIFO_TX_SIZE, SERIAL_FIFO_RX_SIZE);


NRF_SERIAL_BUFFERS_DEF(m_serialBuffers, SERIAL_BUFF_TX_SIZE, SERIAL_BUFF_RX_SIZE);

NRF_SERIAL_CONFIG_DEF(m_serial, NRF_SERIAL_MODE_IRQ,
                      &m_queues, &m_serialBuffers, serialEventHandler, NULL);

NRF_SERIAL_UART_DEF(m_serialUart, 0);

I'm running into issues with the UART inserting extra data into my serial data stream. I am trying to send the data 0x00, 0x44, 0x77, 0x01. When I turn on debugging for the UART module, I see the following in the debug terminal:

<info> UART: Transfer tx_len: 4.
<debug> UART: Tx data:
<debug> UART:  00 44 77 01            |.Dw.   
<info> UART: Function: nrfx_uart_tx, error code: NRF_SUCCESS.


This indicates to me that the UART driver is getting the correct data passed to it. However, when I view the output on my oscilloscope, I see extra data being inserted, such that the waveform that ultimately comes out reads 00 44 67 76 01 (see image)

Has anyone seen something similar to this in the past? Any idea what might be going on? All help is appreciated.

Thanks,

Kevin

Parents Reply Children
No Data
Related