Connection error in nrf52-ble-app-uart-c-multilink

am using a code based on nrf52-ble-app-uart-c-multilink (https://github.com/NordicPlayground/nrf52-ble-app-uart-c-multilink)

If the central is working and the peripherals are incrementally connected, then it can connect to many devices (I have limited it to 16).

But if the peripherals stay connected (more than 4), and the central is powered on (or reset), then it will reset in every new attempt to connect with any peripheral.

i.e. endless resets.

The cause of the resey is in:

case NRF_BLE_SCAN_EVT_CONNECTING_ERROR:
{
err_code = p_scan_evt->params.connecting_err.err_code;
APP_ERROR_CHECK(err_code);
} break;

If I remove the APP_ERROR_CHECK, it doesn't reset, but it cannot connect to the reset of the peripherals. 

The only way to fix it, is to shut down all the peripherals and start connecting again incrementally. 

I recall that the advice was to increase the connection interval -

Can you explain how it affects? What should be the values if I want to connect up to 16 devices?

Thanks

Avi

Parents
  • Hi Avi,

    Which error code do you get here (what is the value of err_code)?

    Einar

  • Hi,

    I get 

    app_error_handler_bare(). err_code returns 0x11

    and there is a reset right after

    Avi

  • Hi Avi,

    Which previous version are you referring to? The project on GitHub always used only a single instance (using BLE_DB_DISCOVERY_DEF) as far as I can see from the git history. SDK 16 and SDK 17 has quite few API differences so I would suggest you port your working code from SDK 16 in this case, instead of going back to the example (now bumped to SDK 17).

  • Hi,

    I did th following:

    1) Checked the latest Git solution which is using SDK17. 

    2) Copied the main.c (that I posted above) into SDK17 (i.e. replaced the latest version with the previous version. 

    In both cases, there were Errors which triggered resets.

    The only code that works is the previous one (attached above) with SDK16. It works without errors.

    Regards,

    Avi

  • Hi Avi,

    Quick question. I went back to the old posts and see now that you had several APP_ERROR checks you commented and it seems I jumped to a conclusion too quickly. You commented out three APP_ERROR checks:

    case BLE_GAP_EVT_CONNECTED:
    err_code = ble_nus_c_handles_assign(&m_ble_nus_c[p_ble_evt->evt.gap_evt.conn_handle], p_ble_evt->evt.gap_evt.conn_handle, NULL);
    //APP_ERROR_CHECK(err_code);
    
    err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
    //APP_ERROR_CHECK(err_code);
    
    // start discovery of services. The NUS Client waits for a discovery result
    err_code = ble_db_discovery_start(&m_db_disc, p_ble_evt->evt.gap_evt.conn_handle);
    //APP_ERROR_CHECK(err_code);

    Which of these three actually saw an error code? And what was that error code?

  • Before commenting, the error was 11.

    I didn't try to check which of the 3 wasresponsible - just made a comment on all the 3.

    I believe there are 2 issues here:

    1) The latest version of the code (main.c) which is in the Github of SDK17 seems to have several differences with the previous versions. like I mentioned above: 

    In the latest version: BLE_DB_DISCOVERY_DEF(m_db_disc);

    While in the previous version: BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT);

    The other issue is that even the previous code that works under SDK 16, doesn't work under SDK17.

  • Avi said:
    I didn't try to check which of the 3 wasresponsible - just made a comment on all the 3.

    We really need to know which exact function returned the error And is the return value 11 or 0x11 (17)? That makes a big difference. If you want to get to the bottom of the problem, this is the path you really should follow.

    Avi said:

    1) The latest version of the code (main.c) which is in the Github of SDK17 seems to have several differences with the previous versions. like I mentioned above: 

    In the latest version: BLE_DB_DISCOVERY_DEF(m_db_disc);

    While in the previous version: BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT);

    Yes, the examples are not identical.

    Avi said:
    The other issue is that even the previous code that works under SDK 16, doesn't work under SDK17.

    Some minor porting effort is needed. As mentioned SDK 16 and SDK 17 are very similar when it comes to API, so that is not a huge task.

Reply
  • Avi said:
    I didn't try to check which of the 3 wasresponsible - just made a comment on all the 3.

    We really need to know which exact function returned the error And is the return value 11 or 0x11 (17)? That makes a big difference. If you want to get to the bottom of the problem, this is the path you really should follow.

    Avi said:

    1) The latest version of the code (main.c) which is in the Github of SDK17 seems to have several differences with the previous versions. like I mentioned above: 

    In the latest version: BLE_DB_DISCOVERY_DEF(m_db_disc);

    While in the previous version: BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, NRF_SDH_BLE_CENTRAL_LINK_COUNT);

    Yes, the examples are not identical.

    Avi said:
    The other issue is that even the previous code that works under SDK 16, doesn't work under SDK17.

    Some minor porting effort is needed. As mentioned SDK 16 and SDK 17 are very similar when it comes to API, so that is not a huge task.

Children
No Data
Related