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

Removing uart_init() from ble_app_uart example stops BLE Announcements.

Hi,

I've been using the ble_app_uart example as a template for our use case. It is a good starting point. We don't actually need UART functionality, and we've assigned pins 5, 6, 7, 8 to GPIO usage.

I commented out uart_init() from main(), so it looks like:

/**@brief Application main function.
 */
int main(void)
{
    uint32_t err_code;
    bool erase_bonds;
    uint8_t  start_string[] = START_STRING;
    
    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);
    
    // uart_init();
    buttons_leds_init(&erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();
    
    printf("%s",start_string);

    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);
    
    // Enter main loop.
    for (;;)
    {
        power_manage();
    }
}

However, now when I use the Android nRF UART v2.0 app and Scan for devices, the Nordic_UART device does not show up anymore, so I can't talk to the software I've written for the Nordic at all.

I'm not sure I understand why not initting the UART has the side effect of disabling the Bluetooth announcements?

Any help would be greatly appreciated.

Thanks, Max

Parents Reply Children
Related