This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52-DK : UART Rx over USB loses first byte after hard reset but not after power cycle

we have an app where we use a nRF52-DK board (with the 52832 chip) as a serial to BLE interface. We connect to the board using the USB UART channel. The interface IC on the board is flashed with binary j-link-ob-sam3u128-v2-nordicsemi-170724.bin

We have flow control on the interface enabled, parity off, baud rate 115200

The issue we see is that if we power cycle the DK and send a short binary packet, the complete packet is received. However if we use the RESET button on the DK, the first byte is NOT received by the nRF52832. This happens consistently and even when several seconds pass between the reset and sending the serial data.

Is this a known issue, is there some step that we need to do after a reset?

Thanks. UART INIT code follows.

void uart_init(void)
{
    ret_code_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_ENABLED,
        .use_parity   = false,
        .baud_rate    = UART_BAUDRATE_BAUDRATE_Baud115200
    };

    APP_UART_FIFO_INIT(&comm_params,
                       UART_RX_BUF_SIZE,
                       UART_TX_BUF_SIZE,
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOW,
                       err_code);

    APP_ERROR_CHECK(err_code);
}

Parents
  • Hi Daniel

    I was indeed able to reproduce the same behavior on my end with J-Link v7.60e, but only on the very first UART message I write to the central device. After that it works as expected until I reset the DK. So this is not only you. I'll report the reproduced behavior internally and we'll see what we can do to remedy this.

    Best regards,

    Simon

  • thanks Simon.

    A very curious and confusing behaviour we noticed early on in this investigation was that I could take a DK board programmed by a colleague and it ran fine on my setup. However, after I re-programmed the board with the same binary, everything would break! (This was before we knew the serial stuff was not good.) Also we have seen some inconsistent but still wrong behaviour (like the "missing first byte" stuff on my initial post here). So it is not just about the serial handling I think. This was not a one off, it happened quite consistently. There is something really odd and broken about this version of JLink I think.

  • Indeed. I don't have more information to share at the moment other than that we're looking into it, and that we've reported it to SEGGER. Glad you have a workaround for now. If you'd like, I can keep you updated, but I can't guarantee when I have more information for you.

    Best regards,

    Simon

Reply
  • Indeed. I don't have more information to share at the moment other than that we're looking into it, and that we've reported it to SEGGER. Glad you have a workaround for now. If you'd like, I can keep you updated, but I can't guarantee when I have more information for you.

    Best regards,

    Simon

Children
No Data
Related