With nrf5_sdk_1.7.1, the BLE_APP_UART example will get stuck

bool erase_bonds;

// Initialize.
uart_init();
log_init();
timers_init();
//buttons_leds_init(&erase_bonds);
// power_management_init();
ble_stack_init();
gap_params_init();
gatt_init();
services_init();
advertising_init();
conn_params_init();

// Start execution.
// printf("\r\nUART started.\r\n");
// NRF_LOG_INFO("Debug logging for UART over RTT started.");
advertising_start();

log init (); And then it gets stuck

Comment out log init (); The program will get stuck in ble_stack_init(); uart_init(); Be commented out

uart_init() needs to be commented out during this process; And log_init(); Then ble initialization succeeds

Parents
  • Try changing the order of initialization for the uart and log as below and please do not ignore the error codes.

    ret_code_t err_code;
    
    err_code = uart_init();
    APP_ERROR_CHECK(err_code);
    
    err_code = log_init();
    APP_ERROR_CHECK(err_code);
    
    err_code = ble_stack_init();
    APP_ERROR_CHECK(err_code);

    If that does not work, I recommend starting your application in the debugger and letting it run until it is in this stuck state. Pause the debugger and see the instruction and context that is being run. Show us the function call stack and we might get more idea on what might be happening in the background in your application.

Reply
  • Try changing the order of initialization for the uart and log as below and please do not ignore the error codes.

    ret_code_t err_code;
    
    err_code = uart_init();
    APP_ERROR_CHECK(err_code);
    
    err_code = log_init();
    APP_ERROR_CHECK(err_code);
    
    err_code = ble_stack_init();
    APP_ERROR_CHECK(err_code);

    If that does not work, I recommend starting your application in the debugger and letting it run until it is in this stuck state. Pause the debugger and see the instruction and context that is being run. Show us the function call stack and we might get more idea on what might be happening in the background in your application.

Children
No Data
Related