Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf52 unable to enable notifications on the client side ( CCCD not discovered )

We have a custom board based on the nrf52, We trying to integrate BLE functionality into our already existing firmware. I am able to create a custom service and characteristic but I have not been able to enable notificatons using nrfConnect. The button for doing that is disabled and I get "cccd not discovered when I mouse over it". I have also tried the lightBlueOs app so it is safe to say that the problem is not with the app. I am using the same exact program from this tutorial: 

https://github.com/bjornspockeli/nRF52-Bluetooth-Course

I am using the same SDK and everything is the same as the tutorial instructed. But I still get this error. I have also tried creating other tutorials like this: https://devzone.nordicsemi.com/tutorials/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial

But they all give me the same problem. The only change I am making to the tutorial sample code is that I am disabling the peer manager initialization. Because initializing it returns an error which I traced back to fds_init(), NRF_ERROR_STORAGE_FULL. I read that the peer manager handles security and bonding, so my assumption is that disabling it shouldn't affect the firmware. Please, I would like to know if anyone has encountered similar problems or if anyone has any suggestions. They will be deeply appreciated. Thanks.

Parents
  • This problem is solved in Hung Bui's answer to this question.  When not using the peer manager, you must handle the BLE_GATTS_EVT_SYS_ATTR_MISSING event in your BLE event handler function.  The blinky example includes this case in the function ble_evt_handler() in main.c:

           case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // No system attributes have been stored.
                err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;

    I burned many hours trying to work this out.  Some comments in the code relating this event to the CCCD, or better that this enables the client's discovery of the CCCD, would have been a big help!

Reply
  • This problem is solved in Hung Bui's answer to this question.  When not using the peer manager, you must handle the BLE_GATTS_EVT_SYS_ATTR_MISSING event in your BLE event handler function.  The blinky example includes this case in the function ble_evt_handler() in main.c:

           case BLE_GATTS_EVT_SYS_ATTR_MISSING:
                // No system attributes have been stored.
                err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
                APP_ERROR_CHECK(err_code);
                break;

    I burned many hours trying to work this out.  Some comments in the code relating this event to the CCCD, or better that this enables the client's discovery of the CCCD, would have been a big help!

Children
No Data
Related