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

UART HW flow control bugs

I have an nrf52832 connected to a UART-USB driver with RTS/CTS. CLI manages the UART connection. Using SDK 14.0.

When HWFC is enabled, if a serial connection is NOT established immediately, the scheduler library overflows with tasks causing the device to reset.

No such overflow is observed when the serial connection is established immediately. Or when HWFC is disabled.

Is there any configuration that needs to take place for RTS/CTS pins? It seems as if the UART module is going into blocking mode perhaps when HWFC is enabled and USB serial connection disabled?

  • I posted this elsewhere, but offhand forget where. I think that the flow control is incorrectly inverted in the hardware for use with a UART-USB (typically an FTDI part) connected to a PC. The complication starts with the meaning of "flow control", as there are at least two versions, the traditional modem CTS/RTS usage and the more modern CTS/RTS handshake. I added these comments to clarify this:

    /**@brief  Function for initializing the UART module.
     * Traditional Modem Flow Control
     * If flow control is enabled, a transmission will be automatically suspended when CTS is deactivated and
     * resumed when CTS is activated again.
     * A byte that is in transmission when CTS is deactivated will be fully transmitted before the transmission is
     * suspended.
     * nRF52 DTE Output pin to DCE - asserts to request transmit
     * nRF52 DTE Input pin from DCE - asserts to allow transmit
     *
     * Hardware Flow Control
     * "RTS/CTS handshaking" the DTE asserts RTS whenever it is ready to receive data from the DCE, and the DCE
     * asserts CTS whenever it is ready to receive data from the DTE. Unlike the original use of RTS and CTS with
     * half-duplex modems, these two signals operate independently from one another.
     * nRF52 DTE Output pin to DCE - asserts to allow DCE to transmit
     * nRF52 DTE Input pin from DCE - asserts to allow nRF52 DTE transmit
     */
    

    The nRF52 hardware supports the traditional modem usage, but the software is written for the more recent CTS/RTS handshake which requires an inverter for proper operation as the nRF52832 does not allow configuring active-high/low operation unless the lines are driven manually (the logic is inverted so does not work correctly). Hope this helps.

  • Oh wow, thanks for that. Any ideas on possible solutions?

Related