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

nrf52 dk, sdk 17, ble_app_uart_pca10040_s132 error 0x3401

I get error 0x3401 in ble_app_uart_pca10040_s132 (nrf52 dk, sdk17) in  ble_nus.c line 95:


err_code = sd_ble_gatts_value_get(p_ble_evt->evt.gap_evt.conn_handle,
p_nus->tx_handles.cccd_handle,
&gatts_val);

I am running an unmodified version of the ble_app_uart.

The error appears when connecting using the nrfConnect app (iOS, iPhone X).

nrfConnects, but no Tx or Rx characteristics shows up in nrfConnect. 

Is there a bug in sdk17? Maybe related to the handling of cccd? 

Running the ble_app_uart as in sdk15.3.0, gives no issues...

sdk17 details: SDK_17.0.0_9d13099

Parents Reply Children
  • I find it strange that it happens in the original unmodified sdk17 ble_app_uart example.

    I have already tried various varaints with  the  sd_ble_gatts_sys_attr_set(), but with no luck.

    Also debugging through the ble_app_uart_example, it seems to me like the gatt, services etc. are defined correctly for the NUS profile. The nrfConnect app (iOS, iPhone X) reports that it find the NUS profile, but with the services that one expect to find in the Blinky example (and not the NUS TX and RX services) ...

  • Just to make everything clear, are you using this sample (as in this ticket), or this sample (located in nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_uart)?

    Best regards,

    Simon

  • nrf52 dk, sdk 17, ble_app_uart_pca10040_s132

    sdk17 details: SDK_17.0.0_9d13099

    I.e. nRF5_SDK_17.0.0_9d13099\examples\ble_peripheral\ble_app_uart

    FYI: The same issues is also present using SDK16:

    nrf52 dk, sdk16, ble_app_uart_pca10040_s132, compiled debug, SES 4.52c

    I can se there was a change in ble_nus.c in the function  on_connect(), going from sdk15.3 to sdk16 (and sdk17):

    sdk16 and 17:
    err_code = sd_ble_gatts_value_get(p_ble_evt->evt.gap_evt.conn_handle,
    p_nus->tx_handles.cccd_handle,
    &gatts_val);

    sdk 15:
    err_code = sd_ble_gatts_value_get(p_ble_evt->evt.gap_evt.conn_handle,
    p_nus->rx_handles.cccd_handle,
    &gatts_val);


  • I downloaded a fresh SDK 17 and programmed the ble_app_uart peripheral example onto an nRF52832 DK. Then I opened nRF Connect for Mobile and connected, and I experienced the same as you, no UART services nor TX/RX characteristics showed up.

    However, deleting the bonding information solved the issue for me:

    I guess this is due to caching from some earlier bonding sessions.

    Hopefully, this is the case for you as well. If not, please tell me, and I'll look into it.

    Best regards,

    Simon

  • Ahhh. Thanks.

    As far as I can understand, there is no "Delete bond" in the latest iOS nRF Connect app. Had to turn BT Off and On on the iPhone. Now it is working... 

    Edit: Ran into the same error issues using JS Web Bluetooth on Win10. Had to reboot the PC in order to clear bonding before it worked. It was not enough to turn BT off/on on the PC.

Related