<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52191/bluetooth-disconnects-when-notification-enabled</link><description>Hi, 
 I&amp;#39;m using SDK 15.2. The bluetooth disconnects when I enable notifications on nrfConnect. This happens only if I increase the number of bytes to be sent. I&amp;#39;m writing a code for custom gatt. The references I used were - 
 https://github.com/maidenone</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Sep 2019 04:57:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52191/bluetooth-disconnects-when-notification-enabled" /><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/211089?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 04:57:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2bdf3051-1282-4b43-8ca7-7bfb669ff61f</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Yes you&amp;#39;re absolutely correct! That was the problem.. :) Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210694?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 11:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b963df4-f30c-4b3f-833e-be808f4d57da</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ah, that is the issue:&lt;/p&gt;
[quote user="bop123"]I used nrf52 for above code &amp;amp; nrf51 DK with nrfConnect[/quote]
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The nRF51 doesn&amp;#39;t support an MTU &amp;gt; 20 bytes, because the S130 softdevice does not support this. Try to use an nRF52DK with nRF connect as well (or try to use a phone that you know supports this. Even though MTU &amp;gt; 20 is part of the BLE spec, it is optional to support this, so not all phones support this either, but if you have a fairly new phone, you can test it with nRF Connect for Mobile.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What Microsoft&amp;#39;s BLE Explorer tool supports, I don&amp;#39;t know. You will have to check with them.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210675?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 10:36:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb5dce36-12fa-4907-b7fd-4818ed2a2a52</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Nope thats strange, it does not. I also checked with my Android code &amp;amp; Microsoft&amp;#39;s BLE Explorer tool. Were you consistently seeing this behavior or just one time? Did you use nrf52 DK? I used nrf52 for above code &amp;amp; nrf51 DK with nrfConnect &amp;amp; couldnt see more than 20 bytes being passed both ways. Could you please try the same or with different host code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210673?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 10:29:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c05a911-d23a-44c5-aa1d-2e0e9b3b8f17</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I tested your project against nRF Connect for Desktop:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-995d0987003646bbb80ebebe306f77ab/pastedimage1568885805741v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;I was able to both receive and send 29 bytes.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-995d0987003646bbb80ebebe306f77ab/pastedimage1568885865715v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Does it not behave the same in your case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210475?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 14:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff994c4e-cd6a-454e-8991-6cfd22b63648</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;I checked it on nrfconnect. Even I was thinking the same that I&amp;#39;m correctly sending 29 bytes, may be nrfconnect does not display them?&lt;/p&gt;
&lt;p&gt;Can you check at your end if its the same?&lt;/p&gt;
&lt;p&gt;I also receive only 20 bytes from host. So both ways its restricted to 20 bytes only.&lt;/p&gt;
&lt;p&gt;For receiving 29 bytes, I changed the code to-&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_write(ble_cus_t * p_cus, ble_evt_t const * p_ble_evt)
{
	ble_gatts_evt_write_t const * p_evt_write = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;
    // Custom Value Characteristic Written to.
    if (p_evt_write-&amp;gt;handle == p_cus-&amp;gt;custom_value_handles.value_handle)
    {
        nrf_gpio_pin_toggle(LED_4);
		for(int i = 0; i &amp;lt; p_evt_write-&amp;gt;len; i++)
		{
			NRF_LOG_INFO(&amp;quot;Data Received: %d&amp;quot;, p_evt_write-&amp;gt;data[i]);
		}
        /*if(*p_evt_write-&amp;gt;data == 0x01)
        {
            nrf_gpio_pin_clear(LED_3);
        }
        else if(*p_evt_write-&amp;gt;data == 0x02)
        {
            nrf_gpio_pin_set(LED_3);
        }
        else
        {
          //Do nothing
        }*/
    }
    // Check if the Custom value CCCD is written to and that the value is the appropriate length, i.e 2 bytes.
    if ((p_evt_write-&amp;gt;handle == p_cus-&amp;gt;custom_value_handles.cccd_handle) &amp;amp;&amp;amp; (p_evt_write-&amp;gt;len == 2))
    {
        // CCCD written, call application event handler
        if (p_cus-&amp;gt;evt_handler != NULL)
        {
            ble_cus_evt_t evt;
            if (ble_srv_is_notification_enabled(p_evt_write-&amp;gt;data))
            {
                evt.evt_type = BLE_CUS_EVT_NOTIFICATION_ENABLED;
            }
            else
            {
                evt.evt_type = BLE_CUS_EVT_NOTIFICATION_DISABLED;
            }
            // Call the application event handler.
            p_cus-&amp;gt;evt_handler(p_cus, &amp;amp;evt);
        }
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I send more than 20 bytes from nrfConnect, I get a message saying&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568838576779v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;When I was debugging, I got&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1568841907029v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could you please check at your end? I cant seem to find any solution to this.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_template_5F00_custom_5F00_packet.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_template_5F00_custom_5F00_packet.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using SDK15.2. My thinking is that the updated MTU size is not being exchanged between peripheral &amp;amp; central.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210385?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 12:02:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7d89135-0aed-4e9c-98b8-432bf8d4b3d1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok. How do you determine that you are just able to send 20 bytes? I do believe you, but I want to know what symptoms you are seeing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210372?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 11:30:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2367107f-0719-4f8e-b498-afdfcc06984e</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Hi Edvin, I have already mentioned above that I made these changes -&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GAP_DATA_LENGTH 36&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 32&lt;/p&gt;
&lt;p&gt;BLE_GATT_ATT_MTU_DEFAULT = 32 define in ble_gatt.h&lt;/p&gt;
&lt;p&gt;may require you to change your ram settings again.&lt;/p&gt;
&lt;p&gt;But still it does not send more than 20 bytes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210307?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 08:22:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a832c6b-cf29-43bf-9537-355aeb5c0be1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I suggest you look into the ble_app_uart example to see how to send more than 20 bytes. Increasing these:&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GAP_DATA_LENGTH 36&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 32&lt;/p&gt;
&lt;p&gt;BLE_GATT_ATT_MTU_DEFAULT = 32 define in ble_gatt.h&lt;/p&gt;
&lt;p&gt;may require you to change your ram settings again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="bop123"]Also how do I receive 20 bytes from host? Right now its just a byte.[/quote]
&lt;p&gt;&amp;nbsp;To see how to &amp;quot;receive more than one byte&amp;quot;, please refer to the ble_app_uart_c example. You probably receive more than one byte, but you need to look at the length field. Please check the function&amp;nbsp;ble_nus_c_evt_handler() and the event BLE_NUS_C_EVT_NUS_TX_EVT. The data is located in&amp;nbsp;p_ble_nus_evt-&amp;gt;p_data,&amp;nbsp; and the length of the data is found in&amp;nbsp;p_ble_nus_evt-&amp;gt;data_len.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210225?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 18:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca2e5459-7779-4548-bbea-bf761907ed3c</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The above error got fixed by referring to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/34650/custom_ble_service_example---uint16_t-custom_value---nrf_error_data_size"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/34650/custom_ble_service_example---uint16_t-custom_value---nrf_error_data_size&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But now I&amp;#39;m able to send only 20 bytes out of 29 bytes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Changes I made -&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In sdk_config.h -----------&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GAP_DATA_LENGTH 36&lt;/p&gt;
&lt;p&gt;#define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 32&lt;/p&gt;
&lt;p&gt;BLE_GATT_ATT_MTU_DEFAULT = 32 define in ble_gatt.h&lt;/p&gt;
&lt;p&gt;changed the RAM settings&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint32_t custom_value_char_add(ble_cus_t * p_cus, const ble_cus_init_t * p_cus_init)
{
    uint32_t            err_code;
    ble_gatts_char_md_t char_md;
    ble_gatts_attr_md_t cccd_md;
    ble_gatts_attr_t    attr_char_value;
    ble_uuid_t          ble_uuid;
    ble_gatts_attr_md_t attr_md;

    // Add Custom Value characteristic
    memset(&amp;amp;cccd_md, 0, sizeof(cccd_md));

    //  Read  operation on cccd should be possible without authentication.
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;cccd_md.write_perm);

    cccd_md.write_perm = p_cus_init-&amp;gt;custom_value_char_attr_md.cccd_write_perm;
    cccd_md.vloc       = BLE_GATTS_VLOC_STACK;

    memset(&amp;amp;char_md, 0, sizeof(char_md));

    char_md.char_props.read   = 1;
    char_md.char_props.write  = 1;
    char_md.char_props.notify = 1;
    char_md.p_char_user_desc  = NULL;
    char_md.p_char_pf         = NULL;
    char_md.p_user_desc_md    = NULL;
    char_md.p_cccd_md         = &amp;amp;cccd_md;
    char_md.p_sccd_md         = NULL;

    ble_uuid.type = p_cus-&amp;gt;uuid_type;
    ble_uuid.uuid = CUSTOM_VALUE_CHAR_UUID;

    memset(&amp;amp;attr_md, 0, sizeof(attr_md));

    attr_md.read_perm  = p_cus_init-&amp;gt;custom_value_char_attr_md.read_perm;
    attr_md.write_perm = p_cus_init-&amp;gt;custom_value_char_attr_md.write_perm;
    attr_md.vloc       = BLE_GATTS_VLOC_STACK;
    attr_md.rd_auth    = 0;
    attr_md.wr_auth    = 0;
    attr_md.vlen       = 0;

    memset(&amp;amp;attr_char_value, 0, sizeof(attr_char_value));

    attr_char_value.p_uuid    = &amp;amp;ble_uuid;
    attr_char_value.p_attr_md = &amp;amp;attr_md;
    attr_char_value.init_len  = 29*sizeof(uint8_t);
    attr_char_value.init_offs = 0;
    attr_char_value.max_len   = 29*sizeof(uint8_t);

    err_code = sd_ble_gatts_characteristic_add(p_cus-&amp;gt;service_handle, &amp;amp;char_md, &amp;amp;attr_char_value, &amp;amp;p_cus-&amp;gt;custom_value_handles);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }

    return NRF_SUCCESS;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t ble_cus_custom_value_update(ble_cus_t * p_cus, uint8_t * custom_value)	/*NEW CHANGE*/
{
    NRF_LOG_INFO(&amp;quot;In ble_cus_custom_value_update. \r\n&amp;quot;);
    if (p_cus == NULL)
    {
        return NRF_ERROR_NULL;
    }
    uint32_t err_code = NRF_SUCCESS;
    ble_gatts_value_t gatts_value;
    // Initialize value struct.
    memset(&amp;amp;gatts_value, 0, sizeof(gatts_value));
    gatts_value.len     = 29*sizeof(uint8_t);	/*NEW CHANGE*/
    gatts_value.offset  = 0;
    gatts_value.p_value = custom_value;
    // Update database.
    err_code = sd_ble_gatts_value_set(p_cus-&amp;gt;conn_handle, p_cus-&amp;gt;custom_value_handles.value_handle, &amp;amp;gatts_value);
    if (err_code != NRF_SUCCESS)
    {
        return err_code;
    }
    // Send value if connected and notifying.
    if ((p_cus-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID))
    {
        ble_gatts_hvx_params_t hvx_params;
        memset(&amp;amp;hvx_params, 0, sizeof(hvx_params));
        hvx_params.handle = p_cus-&amp;gt;custom_value_handles.value_handle;
        hvx_params.type   = BLE_GATT_HVX_NOTIFICATION;
        hvx_params.offset = gatts_value.offset;
        hvx_params.p_len  = &amp;amp;gatts_value.len;
        hvx_params.p_data = gatts_value.p_value;
        err_code = sd_ble_gatts_hvx(p_cus-&amp;gt;conn_handle, &amp;amp;hvx_params);
        NRF_LOG_INFO(&amp;quot;sd_ble_gatts_hvx result: %x. \r\n&amp;quot;, err_code);
		NRF_LOG_INFO(&amp;quot;hvx_params.p_len: %x. \r\n&amp;quot;, &amp;amp;hvx_params.p_len);
    }
    else
    {
        err_code = NRF_ERROR_INVALID_STATE;
        NRF_LOG_INFO(&amp;quot;sd_ble_gatts_hvx result: NRF_ERROR_INVALID_STATE. \r\n&amp;quot;);
    }
    return err_code;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also how do I receive 20 bytes from host? Right now its just a byte.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_write(ble_cus_t * p_cus, ble_evt_t const * p_ble_evt)
{
	ble_gatts_evt_write_t const * p_evt_write = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;
    // Custom Value Characteristic Written to.
    if (p_evt_write-&amp;gt;handle == p_cus-&amp;gt;custom_value_handles.value_handle)
    {
        nrf_gpio_pin_toggle(LED_4);
        NRF_LOG_INFO(&amp;quot;GOT WRITE ON: %d&amp;quot;,*p_evt_write-&amp;gt;data);
        if(*p_evt_write-&amp;gt;data == 0x01)
        {
            nrf_gpio_pin_clear(LED_3);
        }
        else if(*p_evt_write-&amp;gt;data == 0x02)
        {
            nrf_gpio_pin_set(LED_3);
        }
        else
        {
          //Do nothing
        }
    }
    // Check if the Custom value CCCD is written to and that the value is the appropriate length, i.e 2 bytes.
    if ((p_evt_write-&amp;gt;handle == p_cus-&amp;gt;custom_value_handles.cccd_handle) &amp;amp;&amp;amp; (p_evt_write-&amp;gt;len == 2))
    {
        // CCCD written, call application event handler
        if (p_cus-&amp;gt;evt_handler != NULL)
        {
            ble_cus_evt_t evt;
            if (ble_srv_is_notification_enabled(p_evt_write-&amp;gt;data))
            {
                evt.evt_type = BLE_CUS_EVT_NOTIFICATION_ENABLED;
            }
            else
            {
                evt.evt_type = BLE_CUS_EVT_NOTIFICATION_DISABLED;
            }
            // Call the application event handler.
            p_cus-&amp;gt;evt_handler(p_cus, &amp;amp;evt);
        }
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;My files -&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1070.ble_5F00_cus.c"&gt;devzone.nordicsemi.com/.../1070.ble_5F00_cus.c&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2068.ble_5F00_cus.h"&gt;devzone.nordicsemi.com/.../2068.ble_5F00_cus.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/257070.sdk_5F00_config.h"&gt;devzone.nordicsemi.com/.../257070.sdk_5F00_config.h&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/53767.main.c"&gt;devzone.nordicsemi.com/.../53767.main.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210182?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 15:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fa3b048-a5ca-4d13-8378-c2e666994237</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;did you define DEBUG in your preprocessor defines? If you are not sure how to do it, let me know what compiler/IDE you are using, and I can help you. Segger Embedded Studio? Keil? something else?&lt;/p&gt;
&lt;p&gt;When you define DEBUG it should tell you what the call to ble_cus_custom_value_update() returned, which is useful information, and not just that it returned != 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210174?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 14:38:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7953748-be1b-4300-bb24-0b8906b2a5a5</guid><dc:creator>bscdb</dc:creator><description>&lt;p&gt;Its failing in&amp;nbsp;ble_cus_custom_value_update() with fatal error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth disconnects when notification enabled</title><link>https://devzone.nordicsemi.com/thread/210170?ContentTypeID=1</link><pubDate>Tue, 17 Sep 2019 14:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08d482ae-414a-4254-a84b-0e2caebebc7d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Can you try to define DEBUG in your preprocessor defines, and monitor the log on the nRF? What does it say when you try to enable notifications?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>