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

How to set UART without CTS/RTS in Zigbee CLI example

I use Zigbee CLI example on nRF52840.
(examples\zigbee\experimental\cli\cli_agent_router)

It use UART as 115200 bps with CTS/RTS (hardware flow control).

I want to change setting UART to without CTS/RTS. 

I looked in the project for the settings but couldn't find them.

Where should I set this up?

Parents
  • Hi

    In order to disable HW flow control you only need to set APP_UART_FLOW_CONTROL_DISABLED in the UART parameters and change the CTS and RTS pins in your application to NULL.

    Best regards,

    Simon

  • Hi Simonr! Thank you for reply.

    I didn't know where to set "APP_UART_FLOW_CONTROL_DISABLED" up.

    Instead, I found the following.

    zigbee_cli.c:

    #if CLI_OVER_UART
    nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
    uart_config.pseltxd = TX_PIN_NUMBER;
    uart_config.pselrxd = RX_PIN_NUMBER;
    #if defined(HWFC) && (HWFC == true)
    uart_config.pselcts = CTS_PIN_NUMBER;
    uart_config.pselrts = RTS_PIN_NUMBER;
    uart_config.hwfc = NRF_UART_HWFC_ENABLED;
    #endif
    ret = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_NONE);
    APP_ERROR_CHECK(ret);
    #endif

    I changed to:

        uart_config.hwfc    =  NRF_UART_HWFC_DISABLED;

    So, I was able to get a CLI without RTS/CTS controls.

    But, The

    #if defined(HWFC) && (HWFC == true)

    line are enabled. I don't know why HWCC is true. Where are you setting this up?

Reply
  • Hi Simonr! Thank you for reply.

    I didn't know where to set "APP_UART_FLOW_CONTROL_DISABLED" up.

    Instead, I found the following.

    zigbee_cli.c:

    #if CLI_OVER_UART
    nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
    uart_config.pseltxd = TX_PIN_NUMBER;
    uart_config.pselrxd = RX_PIN_NUMBER;
    #if defined(HWFC) && (HWFC == true)
    uart_config.pselcts = CTS_PIN_NUMBER;
    uart_config.pselrts = RTS_PIN_NUMBER;
    uart_config.hwfc = NRF_UART_HWFC_ENABLED;
    #endif
    ret = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_NONE);
    APP_ERROR_CHECK(ret);
    #endif

    I changed to:

        uart_config.hwfc    =  NRF_UART_HWFC_DISABLED;

    So, I was able to get a CLI without RTS/CTS controls.

    But, The

    #if defined(HWFC) && (HWFC == true)

    line are enabled. I don't know why HWCC is true. Where are you setting this up?

Children
No Data
Related