<?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>Serialized ble_app_hrs example app Hard Faults when de-serializing SD_BLE_GAP_ADV_SET_CONFIGURE response</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48470/serialized-ble_app_hrs-example-app-hard-faults-when-de-serializing-sd_ble_gap_adv_set_configure-response</link><description>Hello! 
 I have been trying to implement the serialization for STM32L476. During my development I discovered that the deserialization of the SD_BLE_GAP_ADV_SET_CONFIGURE response in ble_gap_adv_set_configure_rsp_dec caused a Hard Fault. To trouble shoot</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Oct 2019 06:48:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48470/serialized-ble_app_hrs-example-app-hard-faults-when-de-serializing-sd_ble_gap_adv_set_configure-response" /><item><title>RE: Serialized ble_app_hrs example app Hard Faults when de-serializing SD_BLE_GAP_ADV_SET_CONFIGURE response</title><link>https://devzone.nordicsemi.com/thread/214040?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 06:48:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4668019d-4fed-46b3-9e7b-4f9d0901ff3b</guid><dc:creator>BenEdna</dc:creator><description>&lt;p&gt;Thank you! The example is working now for me &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serialized ble_app_hrs example app Hard Faults when de-serializing SD_BLE_GAP_ADV_SET_CONFIGURE response</title><link>https://devzone.nordicsemi.com/thread/213990?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 16:36:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0bb92c9-24ae-4d8d-b407-323e4e27dda0</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Good news! It looks like this has been fixed for the next nRF5 SDK release.&lt;/p&gt;
&lt;p&gt;The issue was with using adv_data instead of p_adv_handle in input/output parameters in &amp;lt;sdk folder&amp;gt;/components/serialization/application/codecs/ble/middleware/app_mw_ble_gap.c.&lt;/p&gt;
&lt;p&gt;In gap_adv_set_configure_rsp_dec() (line 1899 in SDK 15.3), change the calls to app_ble_gap_adv_buf_addr_unregister() inside the if statement to:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    app_ble_gap_adv_buf_addr_unregister(mp_out_params[1], false);
    app_ble_gap_adv_buf_addr_unregister(mp_out_params[2], false);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(I.e. indexes 0 and 1 changed to 1 and 2 respectively.)&lt;/p&gt;
&lt;p&gt;Similarly, in _sd_ble_gap_adv_set_configure() (line 1925 in SDK 15.3), change the indexes from 0 and 1 to 1 and to respectively. Also add the &amp;quot;mp_out_params[0] = p_adv_handle;&amp;quot; before the if statement. Excerpt should look like this after the change:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;
    mp_out_params[0] = p_adv_handle;
    if (p_adv_handle)
    {
        mp_out_params[1] = p_adv_data-&amp;gt;adv_data.p_data;
        mp_out_params[2] = p_adv_data-&amp;gt;scan_rsp_data.p_data;
    }
    else
    {
        mp_out_params[1] =  NULL;
        mp_out_params[2] =  NULL;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The main reason for the hardfault seems to be when mp_out_params[0] was set to NULL, then at some location in code there is an attempt to use that NULL pointer. The above changes fixes the root cause which was wrong use of parameters.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serialized ble_app_hrs example app Hard Faults when de-serializing SD_BLE_GAP_ADV_SET_CONFIGURE response</title><link>https://devzone.nordicsemi.com/thread/213969?ContentTypeID=1</link><pubDate>Tue, 08 Oct 2019 14:38:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b4a5a96-bd0d-4c71-9ad2-83177bae68c2</guid><dc:creator>BenEdna</dc:creator><description>&lt;p&gt;We have the same issue (using IAR 8.32.3), is there any update on the issue report?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serialized ble_app_hrs example app Hard Faults when de-serializing SD_BLE_GAP_ADV_SET_CONFIGURE response</title><link>https://devzone.nordicsemi.com/thread/192665?ContentTypeID=1</link><pubDate>Thu, 13 Jun 2019 11:48:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:847e205a-97e2-4191-8787-f6eb9ced07c8</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have tested the example on my desk, and was able to reproduce. I used SES on Windows 7 and I got a hardfault shortly after starting the example. At first glance it looks like a buffer size error when decoding the result of the sd_ble_gap_adv_set_configure() call.&lt;/p&gt;
&lt;p&gt;There were some changes to the advertising part of the SoftDevice API between SoftDevice versions 5 and 6. A further change behind the hood happened between versions 6.0.0 and 6.1.0, at which point the SoftDevice started to use the advertising data buffer of the application rather than copying the data into its own buffer. Those changes may be related in some way to the issue, e.g. the API is newly changed and the usage pattern of transferring buffer data has changed.&lt;/p&gt;
&lt;p&gt;I have reported the issues internally. For now, potential workarounds might be:&lt;/p&gt;
&lt;p&gt;1) Try with a different physical transport layer for the serialization. For instance HCI has proven to be more reliable (and also uses UART). HCI is also what is used for pc-ble-driver and nRF Connect for Desktop.&lt;/p&gt;
&lt;p&gt;2) Revert to an earlier version of the SoftDevice (see for instance nRF5 SDK v14.2).&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>