Adding UART in ble_app_template

Hi,

1-I have successfully developed an app ...\nRF5SDK17009d13099\nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_template.

2-I have set a UART example to send data from Arduino and successfully send data from Arduino and receiving on nRF52840. I have used this example code:  ..\SDK\nRF5SDK17009d13099\nRF5_SDK_17.0.0_9d13099\examples\peripheral\libuarte 

3- Now I want to add the UART part in my ble_app_template. But getting the following error. kindly suggest a solution? or how should I add in ble_app_template?


Thanks!

Parents Reply
  • Thanks, 

    Now code is successfully run.
    But When I add the following part in the main BLE stop adverting and am unable to receive data from UART.

        err_code = NRF_LOG_INIT(app_timer_cnt_get);
        APP_ERROR_CHECK(err_code);
    
    
        NRF_LOG_DEFAULT_BACKENDS_INIT();
    
    
        nrf_libuarte_async_config_t nrf_libuarte_async_config = {
                .tx_pin     = TX_PIN_NUMBER,
                .rx_pin     = RX_PIN_NUMBER,
                .baudrate   = NRF_UARTE_BAUDRATE_9600,
                .parity     = NRF_UARTE_PARITY_EXCLUDED,
                .hwfc       = NRF_UARTE_HWFC_DISABLED,
                .timeout_us = 100,
                .int_prio   = APP_IRQ_PRIORITY_LOW
        };
    
        err_code = nrf_libuarte_async_init(&libuarte, &nrf_libuarte_async_config, uart_event_handler, (void *)&libuarte);
    
        APP_ERROR_CHECK(err_code);
    
        nrf_libuarte_async_enable(&libuarte);
    


    Here is my main file. Can you please mention where I am making mistakes while adding both projects as both are working fine separately?

     

    251167.main.c

Children
Related