<?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>No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70111/no-scan-response-using-latest-version-of-pc-ble-driver-v6-1-1-on-nrf52832</link><description>We are using the latest pc-ble-driver with SoftDevice v6.1.1 and latest connectivity firmware on an nrf52832 (s132) which is connected via usb-uart. 
 We were previously using v5, but had some issues with setting TX power and so have updated to v6.1.1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Feb 2021 13:08:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70111/no-scan-response-using-latest-version-of-pc-ble-driver-v6-1-1-on-nrf52832" /><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/292233?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 13:08:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e19f5e43-c711-44a8-a955-0df16e375c46</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am sorry, but I am not sure exactly how to fix this. It is not trivial to manipulate the connectivity firmware, and as I mentioned, it is not certain that this would work at all. Perhaps it messes up the internal state machine and message flow.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="fbttv"]We were good to go with pc-ble-driver v5, were we don&amp;#39;t have to restart the scan after each event - but we are now running in to the fact that does not appear to cooperate with the&amp;nbsp;DFU examples given in that version of the SDK.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Perhaps it would be either to either fix this, or put the important data in the advertising packet instead of the scan response?&lt;/p&gt;
&lt;p&gt;Why is the DFU not working? What observations do you see?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br /&gt;Edvin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/291985?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 12:28:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6bbf56c1-a095-4731-bfbe-0946fd700b76</guid><dc:creator>ttveldhuis</dc:creator><description>&lt;p&gt;Sorry for the delayed reply, it took a while to get to this. Unfortunately without good results.&lt;/p&gt;
&lt;p&gt;Depending on where I try to start the scan (tried with different calls) the result was either the scan not being&amp;nbsp;resumed at all or the pc-ble-driver outputting the error:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;Failed to decode event, error code is 14/0xe&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Eventually I even tried to just add the application as an observer and start the scan from that callback by adding:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static uint8_t m_scan_buffer_data[31];
static ble_data_t m_scan_buffer = { m_scan_buffer_data, 31 };

void test_ble_event_handle(ble_evt_t const * p_ble_evt, void * p_context)
{
    sd_ble_gap_scan_start(nullptr, &amp;amp;m_scan_buffer);
}

int main(void)
{
    ....
    NRF_SDH_BLE_OBSERVER(m_ble_observer, 0, test_ble_event_handle, NULL);
    
    ....
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;But unfortunately that yielded the same &amp;quot;Failed to decode event&amp;quot; error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any (other) tips or suggestions?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sidenote;&lt;/p&gt;
&lt;p&gt;We were good to go with pc-ble-driver v5, were we don&amp;#39;t have to restart the scan after each event - but we are now running in to the fact that does not appear to cooperate with the&amp;nbsp;DFU examples given in that version of the SDK.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/288169?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2021 12:41:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb56807c-9f75-496c-b730-03b7177536a0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thys,&lt;/p&gt;
&lt;p&gt;To be fair, I don&amp;#39;t know whether this will work or not at all. Officially, this is not supported, so I am not sure what scan buffer you can use. I am trying to see how the scan buffer is set up when the scanning is normally started.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It is usually started using&amp;nbsp;conn_mw_ble_gap_scan_start() in conn_mw_ble_gap.c, so perhaps it would be possible to call that from the advertising report.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;&lt;strong&gt;believe&lt;/strong&gt; that this is usually triggered from conn_mw_handler() in conn_mw.c -&amp;gt; conn_mw_handler_get(), which again is called from&amp;nbsp;ser_conn_command_process() in ser_conn_cmd_decoder.c.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How about trying to call ser_conn_command_process(SD_BLE_GAP_SCAN_START, packet_len); from the adv report?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t tell what the packet_len is used for, other than being the length of the serial command itself. Try setting it to a random number and see what happens. It looks like the len needs to be &amp;gt; 0, so try with 1.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/288142?ContentTypeID=1</link><pubDate>Fri, 08 Jan 2021 11:12:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32f68012-c9c9-4428-8361-c7d25e330f37</guid><dc:creator>ttveldhuis</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;We&amp;#39;ll give that a try.&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;sd_ble_gap_scan_start&lt;/strong&gt; call requires a buffer for the second argument, is there any easy place we can access the current scan buffer from for when calling it from&amp;nbsp;&lt;span&gt;the&amp;nbsp;ser_conn_ble_event_encoder&lt;/span&gt;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Thys&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/287774?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 15:27:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e59a9dc-5e71-43bf-8815-c07bd8cf9bb0</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Thys,&lt;/p&gt;
&lt;p&gt;I have not tested this, but the events occur in&amp;nbsp;ser_conn_ble_event_handle() in ser_conn_handlers.c.&lt;/p&gt;
&lt;p&gt;The advertising reports will trigger the following chain:&lt;/p&gt;
&lt;p&gt;ser_conn_ble_event_handle() -&amp;gt;&amp;nbsp;app_sched_event_put() -&amp;gt; which will trigger:&lt;/p&gt;
&lt;p&gt;ser_conn_ble_event_encoder() -&amp;gt; ble_event_enc() -&amp;gt; case BLE_GAP_EVT_ADV_REPORT: -&amp;gt; ble_gap_evt_adv_report_enc()&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the first thing I would check is whether adding the scan start call before ble_gap_evt_adv_report_enc() would be sufficient. You can check the return value of this softdevice call and see whether it ever returns anything other than NRF_SUCCESS;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Does it work without connecting to anything? Does any errors occur when you try to connect to anything? You can expect the scan_start() call in your application to return != NRF_SUCCESS, so try to ignore that for the time being. You can take note of what it returns.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have not set up pc-ble-driver on my computer, so if you can give this a go, that would be great. If you are stuck somewhere, I can try to install it.&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: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/287734?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 13:37:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:945581a0-4eb0-47ae-9749-5eebdf26a434</guid><dc:creator>ttveldhuis</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply, the delay in the communication then is what I expected.&lt;/p&gt;
&lt;p&gt;We are using the connectivity application that is compiled by the compile_connectivity target in the pc-ble-driver repository. Which from what I understand&amp;nbsp;is&amp;nbsp;the application from&amp;nbsp;&lt;em&gt;examples\connectivity\ble_connectivity.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;There is no objection to modifying the connectivity application, I have tried to play around with it but couldn&amp;#39;t find the proper things to change and where to add/change them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We do also connect to devices (currently only one at a time), so we have to take that in to account.&lt;/p&gt;
&lt;p&gt;If you could guide&amp;nbsp;us&amp;nbsp;to what to add/change and where that would be great.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Thys&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: No scan response using latest version of pc-ble-driver v6.1.1 on nrf52832</title><link>https://devzone.nordicsemi.com/thread/287729?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 13:25:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c0a7f35-4184-4d47-ba31-8ba6c18f7456</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I had to ask around, as I see there have been some discussions on this topic, both here on DevZone, and internally.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What I see is that due to an API change in SD API v6 you need to restart the scanning after every advertising report. In serialization, this means that the advertising report needs to be sent (over serial), and then the application core/computer needs to decide whether or not to resume scanning, send the command back over serial, before it can be resumed. Since this takes time, the scan response has already been sent, and will not be picked up by the softdevice.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the internal ticket:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;The scanning APIs were changed in SD API v6 so that the scanning needs to be restarted for every received advertising packet. Since ble-driver uses serialization, the event needs to travel from the connectivity firmware, over USB-UART, and up to the application on the pc-side. Then the application needs to send a command back to the connectivity to continue the scanning. This roundtrip time makes it a lot slower to receive advertising packets. &amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I don&amp;#39;t know where you found your serialization application (the one running on the nRF device that is plugged in the computer), but if you have compiled it yourself, you can look into restarting the scan directly in the nRF application in the BLE_GAP_EVT_ADV_REPORT event, so that this decision doesn&amp;#39;t have to take the round trip.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you ever connect to anything? If so, you may need to take this into concideration. If you only support one connection, and start scanning, the softdevice will return an error to the&amp;nbsp;start_scan&amp;nbsp;call.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Let me know what you think about this, and whether you can try to change the connectivity firmware, found in SDK\examples\connectivity\ble_connectivity.&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>