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

CLI UART + NUS

Hello,

I'm trying to make CLI working with UART and BLE (NUS) backend simultaneously. Starting point is CLI example from SDK 14. What should I enable in sdk_config.h and how shuould I intialize CLI with UART and NUS in my app? In ble_app_cli CLI NUS is working alongside with RTT backend. How can I use UART instead of RTT?

Parents
  • I think you can modify this example:

    examples\ble_peripheral\experimental\ble_app_cli

    Baically you need to change RTT to UART (you can base on this example: \examples\peripheral\cli as it uses both RTT and UART)

  • CLI UART init:

    nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
    uart_config.pseltxd = TX_PIN_NUMBER;
    uart_config.pselrxd = RX_PIN_NUMBER;
    uart_config.hwfc    = NRF_UART_HWFC_DISABLED;
    ret                 = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_INFO);
    APP_ERROR_CHECK(ret);
    

    Where should I put this:

    APP_ERROR_CHECK(nrf_cli_ble_uart_service_init());
    

    And this:

    ret_code_t ret;
    
    ret = nrf_cli_start(&m_cli_uart);
    APP_ERROR_CHECK(ret);
    

    I always getting fatal error on nrf_cli_ble_uart_service_init().

Reply
  • CLI UART init:

    nrf_drv_uart_config_t uart_config = NRF_DRV_UART_DEFAULT_CONFIG;
    uart_config.pseltxd = TX_PIN_NUMBER;
    uart_config.pselrxd = RX_PIN_NUMBER;
    uart_config.hwfc    = NRF_UART_HWFC_DISABLED;
    ret                 = nrf_cli_init(&m_cli_uart, &uart_config, true, true, NRF_LOG_SEVERITY_INFO);
    APP_ERROR_CHECK(ret);
    

    Where should I put this:

    APP_ERROR_CHECK(nrf_cli_ble_uart_service_init());
    

    And this:

    ret_code_t ret;
    
    ret = nrf_cli_start(&m_cli_uart);
    APP_ERROR_CHECK(ret);
    

    I always getting fatal error on nrf_cli_ble_uart_service_init().

Children
No Data
Related