nrf_ble_scan_start() fall progect

If I have started scan, and want to restart scan again with a new  scan_init(); I got an exeption.

With my same ticket I understood, I can't change  "update the identities" during the scan or advertising.

Ok, I don't advertise, I just scanning.
And I made 

nrf_ble_scan_stop();
scan_init();
nrf_ble_scan_start();

during the scanning. I need to run scanning with another settings of whitelist.

And I got an exception.

What I did wrong? I have stopped scanning, reinit whielist and run it again.

 

Parents
  • Hi Tomas, 
    We need to see what cause the assert. 
    Please compile the project in debug mode and try again and check the log. It should be able to printout what's the error code and what's the line of code that throw the error. 
    You can also add a breakpoint inside app_error_fault_handler() to see the info. 
    If you don't update whitelist do you see the error ? I suspect that it has something to do with the new whitelist you provided. 

Reply
  • Hi Tomas, 
    We need to see what cause the assert. 
    Please compile the project in debug mode and try again and check the log. It should be able to printout what's the error code and what's the line of code that throw the error. 
    You can also add a breakpoint inside app_error_fault_handler() to see the info. 
    If you don't update whitelist do you see the error ? I suspect that it has something to do with the new whitelist you provided. 

Children
  • Hi!

    Thanks for your help.

    error here.

    printout

    I bonded 2nd tag to central and after 

    case BLE_GAP_EVT_AUTH_STATUS:
    NRF_LOG_INFO("BLE_GAP_EVT_AUTH_STATUS: status=0x%x bond=0x%x lv4: %d kdist_own:0x%x kdist_peer:0x%x",
    p_ble_evt->evt.gap_evt.params.auth_status.auth_status,
    p_ble_evt->evt.gap_evt.params.auth_status.bonded,
    p_ble_evt->evt.gap_evt.params.auth_status.sm1_levels.lv4,
    *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_own),
    *((uint8_t *)&p_ble_evt->evt.gap_evt.params.auth_status.kdist_peer));
    
    if (m_mode == ADD_TAG_BONDING && p_ble_evt->evt.gap_evt.params.auth_status.bonded == 0x01) // bonded tags
    {
    if (get_bonded_tags() == 2)
    {
    enter_mode_logic(); // m_mode = NORMAL; here
    }
    }
    break;

    call enter_mode_logic(); got this error. 
    Where I do

    m_mode = NORMAL;
    nrf_ble_scan_stop();
    scan_init();
    scan_start();

    I was in the scan mode and after this operation, I tryed to make 

    scan_init();
    scan_start();


    Yes, I used whitelist for scanning. But in the code I don't call whitelist directly .

     

    If you don't update whitelist do you see the error ?

    I don't know exaclty, but if I run scan start, then start advertising, it works fine. 
    If I first start advertise, then make

    scan_init();
    scan_start();

    I got this error.
    I suppose due to update whitelist.

Related