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

nRF52840 UART TX pin pulled high (and kept high) by receiving device

Hello,

When troubleshooting a lack of UART communication between my nRF52840 and the device on the receiving end (an STM32L4), an oscilloscope revealed that the TX pin state (from the nRF to the STM) is being held high, presumably by the STM, despite data transmission being attempted. Some quick details:

  • The UART is being initialized as in the example application in SDK 15.2.0 using APP_UART_FIFO_INIT() (see code below)
  • The data can be observed on the TX pin as expected prior to the STM initializing its UART module
  • The STM does not appear to be able to configure the electrical characteristics of its UART RX pin
  • PIN_CNF[] for the TX pin reads a configuration of 0x0000_0003

It seems to me that the next course of action is to modify the PIN_CNF[].DRIVE value (or maybe the PIN_CNF[].PULL?), but any guidance on this process would be appreciated.

Thanks.

UART init function:

static void uart_init(void)
{
    uint32_t err_code;
    app_uart_comm_params_t const comm_params =
    {
        .rx_pin_no    = NRF_RX_PIN,
        .tx_pin_no    = NRF_TX_PIN,
        .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
        .use_parity   = false,
        .baud_rate    = NRF_UART_BAUDRATE_115200
    };

    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);
}

Parents
  • Are you sure you have Tx & Rx the correct way around?

    The output from the nRF must go to the input of the STM, and vice versa.

    Concentrate on the the input and output functions - not the "Tx" and "Rx" names ...

    Is the STM on a Dev Kit? If so, check that there is nothing else on the Dev Kit using  those pins ...

  • I'm very confident in the connections being correct; we can see the data on the scope before the ST boots, then stepping through the ST code line by line will eventually pull the line high when the ST UART is enabled. The obvious solution to me is to modify the ST UART but there appears to be little to no configuration available on the ST UART RX side of things.

    Although we are now thinking the dev kit may be part or all of the problem as the ST engineer has reported success when removing it from the equation. I will update when I know more.

  • we can see the data on the scope before the ST boots, then stepping through the ST code line by line will eventually pull the line high when the ST UART is enabled

    That would still be consistent with you having TX & Rx transposed at the STM32:

    1. Before the UART is configured, the pin will be an input (Hi-Z);
    2. After the UART is configured, its Tx pin will become an output - which would force the line state.
Reply Children
No Data
Related