UART Hardware Flow Control

Hello Nordic community,

using nrf5-sdk for nrf52840 SoC, I followed the uart example as below.

ret_code_t uart_init(void)
{
	ret_code_t err_code = NRF_SUCCESS;
	
	app_uart_comm_params_t const comm_params =
	{
		.rx_pin_no    = U_RX,
		.tx_pin_no    = U_TX,
		.rts_pin_no   = U_RTS,
		.cts_pin_no   = U_CTS,
		.flow_control = APP_UART_FLOW_CONTROL_ENABLED,
		.use_parity   = false,
		.baud_rate    = NRF_UART_BAUDRATE_76800
	};

	APP_UART_FIFO_INIT(&comm_params,
                		 RX_BUF,
                		 TX_BUF,
                		 uart_event_handle,
                		 APP_IRQ_PRIORITY_HIGH,
                		 err_code);
	
	return err_code;
}

The uart tx and rx works fine BUT NOT THE HWFC 

eg. When the CTS is set HIGH, the transmitter (nRF52840) doesn't stop sending.

      (I tried setting the CTS to LOW as well, but no change in the transmitter behavior)

So my questions are:

1. Why this simple test for Hardware flow control over UART is not working?

2. Is there any example that you can provide for UART with HWFC, where the nRF as Transmitter reacts to CTS?

Thank you for your support.

Best regards.

Lal

Parents
  • Hi,

    Are testing it on nRF52840 DK or custom board? If this is on nRF52840 DK using the default VCOM0 pins (P0.05 RTS / P0.06 TXD / P0.07 CTS / P0.08 RXD), the interface MCU on the DK actively drives CTS as part of its "Dynamic HWFC" auto-detection, and only releases the pin if it detects HWFC is not in use (or if SW11 is switched off). If you're trying to force CTS externally on those specific pins, you may be fighting the interface MCU rather than actually controlling the nRF52840 CTS input. Worth checking with a scope or logic analyzer what is really on that pin — not just what you are asserting.
    Dynamic hardware flow control • nRF52840 DK Hardware • Technical Documentation

    Also feel free to switch to nRF Connect SDK instead of nRF5 SDK. You can find a lot of guidance for new developments on nRF Connect SDK.


    Best regards,
    Ressa

Reply
  • Hi,

    Are testing it on nRF52840 DK or custom board? If this is on nRF52840 DK using the default VCOM0 pins (P0.05 RTS / P0.06 TXD / P0.07 CTS / P0.08 RXD), the interface MCU on the DK actively drives CTS as part of its "Dynamic HWFC" auto-detection, and only releases the pin if it detects HWFC is not in use (or if SW11 is switched off). If you're trying to force CTS externally on those specific pins, you may be fighting the interface MCU rather than actually controlling the nRF52840 CTS input. Worth checking with a scope or logic analyzer what is really on that pin — not just what you are asserting.
    Dynamic hardware flow control • nRF52840 DK Hardware • Technical Documentation

    Also feel free to switch to nRF Connect SDK instead of nRF5 SDK. You can find a lot of guidance for new developments on nRF Connect SDK.


    Best regards,
    Ressa

Children
No Data
Related