<?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>pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60472/pc-ble-driver-reports-failed-to-decode-event-error-code-is-14-0xe</link><description>I&amp;#39;m using the nrf52840 with connectivity firmware and S140 SoftDevice, accessed through pc-ble-driver version 4.1.1, with NRF_SD_BLE_API=6 
 Occasionally pc-ble-driver fails to decode an advertisement event, and notifies my application with a status callback</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 May 2020 07:24:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60472/pc-ble-driver-reports-failed-to-decode-event-error-code-is-14-0xe" /><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/251174?ContentTypeID=1</link><pubDate>Fri, 22 May 2020 07:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a6ff29b4-bd31-4e62-bdff-a7d904f5a170</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;is it possible that you are creating multiple advertising sets. I see that there are fixed 8 slots/shadow buffers used for scanning and advertising. In theory, it can be drained. I&amp;#39;m still not sure why i cannot reproduce it. Will try again next week.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/251064?ContentTypeID=1</link><pubDate>Wed, 20 May 2020 16:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db9ce38c-b178-4530-9b4b-6747fca0e70b</guid><dc:creator>Paul Bradford</dc:creator><description>&lt;p&gt;I have confirmed that when I get&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;ldquo;Failed to decode event, error code is 14/0xe&amp;rdquo;&lt;/span&gt; i have not called sd_ble_gap_scan_stop any time recently. &amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/250779?ContentTypeID=1</link><pubDate>Tue, 19 May 2020 14:35:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7686d652-2fbe-4b78-a774-d7fe219924db</guid><dc:creator>Paul Bradford</dc:creator><description>&lt;p&gt;The place where the problem first manifests is in the firmware that creates the&amp;nbsp;BLE_GAP_EVT_ADV_REPORT event with a buffer ID of 0, which is not a valid buffer ID. The buffer that should be used for the BLE_GAP_EVT_ADV_REPORT event is the third argument to&amp;nbsp;sd_ble_gap_scan_start. That buffer remains valid until&amp;nbsp;sd_ble_gap_scan_stop is called. I am trying to determine, using the test program, if I call sd_ble_gap_scan_stop immediately before seeing the &amp;#39;Failed to decode&amp;#39; error. &amp;nbsp; If this happens right after I call&amp;nbsp;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_ble_gap_scan_stop&lt;/span&gt;, that would imply there is some race condition in the firmware when it is processing an incoming advertisement packet at the same time that&amp;nbsp;sd_ble_gap_scan_stop is called. &amp;nbsp;&amp;nbsp; If I do not call&amp;nbsp;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_ble_gap_scan_stop&lt;/span&gt; immediately before the error, what else could cause that buffer to be freed?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/249093?ContentTypeID=1</link><pubDate>Mon, 11 May 2020 07:38:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fbc562c-01fd-45b6-b30f-fcd02e32eb86</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;It is all about buffers coming from the application to the softdevice API. When scanning or advertising is started buffer content and buffers for incoming packets are provided to the softdevice API and softdevice event shall return same pointer in the event. Also if timeout occurs or scaning/advertising is terminated then buffer shall be returned to the application. In case of serialization application and softdevice are on different chips (application on PC in case of pc-ble-driver) so dedicated managing mechinism must be addded.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When the is a call to softdevice which provides the buffer then on application side (PC) pointer is stored in small database and ID is assigned. This ID is passed to connectivity. Connectivity allocated buffer from the pool and assigns the same ID. When buffer is sent back to the application then data comes together with that ID, buffer returned to the pool on connectivity side. On application side when event is received, database is checked for that ID to get pointer to the user buffer and data received from the connectivity is stored in that buffer.&lt;/p&gt;
&lt;p&gt;So reported eror would suggest that something went wrong in that chain, e.g. buffer was already freed. Advertising and scanning uses same pool of data buffers.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Hope, I will be able to reproduce. No luck so far.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/249017?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 16:59:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6836f18a-22b0-4ef8-87f7-08cbc0860c2b</guid><dc:creator>Paul Bradford</dc:creator><description>&lt;p&gt;HI Krzysztof,&lt;/p&gt;
&lt;p&gt;The test program I attached to my other support case reproduces this problem intermittently:&amp;nbsp;&lt;span style="background-color:#ffffff;"&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/57091/disconnecting-while-operations-are-in-progress-never-gives-ble_gap_evt_disconnected-event"&gt;devzone.nordicsemi.com/.../disconnecting-while-operations-are-in-progress-never-gives-ble_gap_evt_disconnected-event&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Can you answer my questions from April 23. I&amp;#39;ll restate my questions and add another&lt;/p&gt;
&lt;p&gt;1.&amp;nbsp;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Your reply on April 23 said &amp;quot;&lt;/span&gt;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;that buffer was already freed&lt;/span&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&amp;quot;. What buffer?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;2. Is there some race condition with the SoftDevice receiving advertisements around the time &lt;span style="background-color:#ffffff;"&gt;sd_ble_gap_scan_stop&lt;/span&gt; is called, which could cause this?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ffffff;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;3. The event whose decoding leads to the &amp;#39;Failed to decode event&amp;#39; error is BLE_GAP_EVT_ADV_REPORT, which I receive because I&amp;#39;m scanning.&amp;nbsp; That event has a zero &amp;#39;buffer id&amp;#39;. What &amp;#39;buffer id&amp;#39; is this, and what would cause it to be freed?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;4. Your April 23 reply talked about a race condition involving&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:400;letter-spacing:normal;line-height:1.5em;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;ADV_SET_TERMINATED, which is an event related to sending out advertisements, but which won&amp;#39;t be received with my configuration&lt;/span&gt;. &lt;span style="background-color:#ffffff;"&gt;How is sending undirected advertisements related to the event&amp;nbsp;&lt;span style="background-color:#ffffff;color:#11171a;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BLE_GAP_EVT_ADV_REPORT&lt;/span&gt; I receive because I&amp;#39;m scanning? &lt;/span&gt;&lt;span style="background-color:#ffffff;"&gt;Are undirected advertising and scanning tied together in some way I don&amp;#39;t understand?&lt;/span&gt;&lt;/p&gt;
&lt;div style="color:#11171a;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;-Paul&lt;/div&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/248955?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 12:53:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2aa4cdbc-af01-4a84-9ee4-d28c842b85b0</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;I&amp;#39;m having trouble reproducing it. Will continue to hunt it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/248757?ContentTypeID=1</link><pubDate>Thu, 07 May 2020 14:12:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60ebe360-3439-4413-8392-954ed045eabb</guid><dc:creator>Paul Bradford</dc:creator><description>&lt;p&gt;Do you have any update with answers to my questions from April 23?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/246285?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 13:40:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48aa5a52-5329-4e29-b605-87186e783100</guid><dc:creator>Paul Bradford</dc:creator><description>&lt;div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;Here&amp;#39;s a fragment of my code that&amp;#39;s preparing to call &amp;quot;sd_ble_gap_adv_set_configure&amp;quot;, indicating that we should never get event BLE_GAP_EVT_ADV_SET_TERMINATED:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;// Because we set both &amp;#39;duration&amp;#39; and &amp;#39;max_adv_evts&amp;#39; to zero, advertising won&amp;#39;t auto-stop, &lt;br /&gt;// so we&amp;#39;ll never get event BLE_GAP_EVT_ADV_SET_TERMINATED according to &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33106/bug-ble_gap_evt_adv_set_terminated-is-never-raised"&gt;devzone.nordicsemi.com/.../bug-ble_gap_evt_adv_set_terminated-is-never-raised&lt;/a&gt;&lt;br /&gt;ble_gap_adv_params_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_adv_params;&lt;br /&gt;m_adv_params.duration = BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED;&lt;br /&gt;m_adv_params.max_adv_evts = 0;// 0 means no limit. &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;This code is setting up undirected advertising (BLE_GAP_ADV_TYPE_NONCONNECTABLE_NONSCANNABLE_UNDIRECTED). How is undirected advertising related to the events I receive because I&amp;#39;m scanning? Are undirected advertising and scanning tied together in some way I don&amp;#39;t understand?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="background-color:#ffffff;"&gt;The event whose decoding leads to the &amp;#39;Failed to decode event&amp;#39; error is BLE_GAP_EVT_ADV_REPORT.&amp;nbsp; That event has a zero &amp;#39;buffer id&amp;#39;. What &amp;#39;buffer id&amp;#39; is this, and what would cause it to be freed?&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver reports “Failed to decode event, error code is 14/0xe”.</title><link>https://devzone.nordicsemi.com/thread/246221?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 11:04:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faf6ec8b-2909-4d0a-864e-5508f5de12c2</guid><dc:creator>Krzysztof Chruscinski</dc:creator><description>&lt;p&gt;buf_id = 0 would indicate that buffer was already freed on connectivity side. One case that comes to my mind is a race between ADV_SET_TERMINATED event and ADV_REPORT event. Do you have logs which would show traffic before that error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>