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

SDK14 NUS Multilink issue

Dear lovely people!

Setup: sdk14 / s132 v5 / nrf52832

Just like with the previous SDKs, I tried to make a multilink nus central fw. The periph device runs my code based on the ble_app_uart example, the central device runs my code based on the ble_app_uart_c example modified according to the multilink example.

What I'm experiencing is that "ble_nus_c_tx_notif_enable" is called more than once from the evt handler and returns NRF_ERROR_BUSY after the 2nd time. Code snippet:

image description

Log:

image description

I found that BLE_NUS_C_EVT_DISCOVERY_COMPLETE event occurrences has some correlation with the number of db_disc instances: BLE_DB_DISCOVERY_ARRAY_DEF(m_db_disc, 3);

What I did:

  • Added BLE_NUS_C_ARRAY_DEF just like it is done in the LBS header.
  • nus init is done in a loop: err_code = ble_nus_c_init(&m_ble_nus_c[i], &nus_c_init_t);
  • nus event handling: ble_nus_c_on_db_disc_evt(&m_ble_nus_c[p_evt->conn_handle], p_evt);

So the question is, is it an issue that ble_nus_c_tx_notifc is called many times or can I just comment out the APP_ERROR_CHECK macro since the first call succeeded? As I remember in previous SDKs this nus handler has been called only once.

Any help and comment is much appreciated! (An example code for multilink nus central would be absolutely fantastic (just like the ones you can find for previous SDKs here on the forum)).

I think this forum post refers to the same problem as I'm having: link

Adam

Parents
  • Dear Petter,

    I'm still clueless about this topic so I uploaded my project and I ask for more help. I wanted to make it as straightforward for you as possible. Since I want to make a combination of the multilink and the nus examples, I used the multilink example as my starting point and added the other required functions from the nus example project. The main.c file is very easy to diff to see what I changed.

    Obviously, to make it work, you need to place it to the same place as the original project (nRF5_SDK_14.2.0_17b948a/examples/ble_central/).

    Link: modified multilink example

    Thank you so much if you can allocate some time for my issue. Thanks!

Reply
  • Dear Petter,

    I'm still clueless about this topic so I uploaded my project and I ask for more help. I wanted to make it as straightforward for you as possible. Since I want to make a combination of the multilink and the nus examples, I used the multilink example as my starting point and added the other required functions from the nus example project. The main.c file is very easy to diff to see what I changed.

    Obviously, to make it work, you need to place it to the same place as the original project (nRF5_SDK_14.2.0_17b948a/examples/ble_central/).

    Link: modified multilink example

    Thank you so much if you can allocate some time for my issue. Thanks!

Children
No Data
Related