<?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 problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50191/pc-ble-driver-problem-target-reset-after-starting-scanning</link><description>Hi, 
 We have a Gateway based on mediatek MT7688 MIPS 32bits architecture CPU, and we integrate an nRF523832 chip to acquire BLE packets. 
 The gateway uses OpenWrt OS, and communicates with the nRF52832 chip over UART using pc-ble-driver in my application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Aug 2019 08:03:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50191/pc-ble-driver-problem-target-reset-after-starting-scanning" /><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/201766?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2019 08:03:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:603cd322-3b64-4026-9345-5079485f9967</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I need to have someone who has worked a bit closer with serialization to have a look at this. But just to check: When you run on the DK, does it still say &amp;quot;Target Reset performed&amp;quot;, but without the errors afterward?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/201051?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 16:24:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:737f344b-64eb-4768-9229-5eb7a16d8630</guid><dc:creator>KEOPS</dc:creator><description>&lt;p&gt;I have tested the heart_rate_collector as that without any modification, and still have the same problem.&lt;/p&gt;
&lt;p&gt;Yes, i used the same baudrate (1m) for both DK and gateway, and it doen&amp;#39;t fail in the DK but fails in the gateway&lt;/p&gt;
&lt;p&gt;i have stopped the debugger inside the sd_ble_gap_scan_start() but i dont see anything that can help me !!.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1564417145226v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1564417294761v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;FYI: i have tested the heart_rate_collector in connectivity V3 with connectivity_2.0.1_1m_with_s132_5.0.hex and it works fine, no crashes since boot (7 hours)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200883?ContentTypeID=1</link><pubDate>Mon, 29 Jul 2019 07:01:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:496a73b4-d5d0-40c9-8f3f-b8df9b7f6d77</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I see that you did some changes to the on_adv_report() function, is that correct? Does it happen if you revert to the standard:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_adv_report(const ble_gap_evt_t * const p_ble_gap_evt)
{
    uint32_t err_code;
    uint8_t  str[STRING_BUFFER_SIZE] = {0};

    // Log the Bluetooth device address of advertisement packet received.
    ble_address_to_string_convert(p_ble_gap_evt-&amp;gt;params.adv_report.peer_addr, str);
    printf(&amp;quot;Received advertisement report with device address: 0x%s\n&amp;quot;, str);
    fflush(stdout);

    if (find_adv_name(&amp;amp;p_ble_gap_evt-&amp;gt;params.adv_report, TARGET_DEV_NAME))
    {
        if (m_connected_devices &amp;gt;= MAX_PEER_COUNT || m_connection_is_in_progress)
        {
            return;
        }

        err_code = sd_ble_gap_connect(m_adapter,
                                      &amp;amp;(p_ble_gap_evt-&amp;gt;params.adv_report.peer_addr),
                                      &amp;amp;m_scan_param,
                                      &amp;amp;m_connection_param
#if NRF_SD_BLE_API &amp;gt;= 5
                                     , m_config_id
#endif
                                     );
        if (err_code != NRF_SUCCESS)
        {
            printf(&amp;quot;Connection Request Failed, reason %d\n&amp;quot;, err_code);
            fflush(stdout);
            return;
        }

        m_connection_is_in_progress = true;
    }
#if NRF_SD_BLE_API &amp;gt;= 6
    else {
        err_code = sd_ble_gap_scan_start(m_adapter, NULL, &amp;amp;m_adv_report_buffer);

        if (err_code != NRF_SUCCESS)
        {
            printf(&amp;quot;Scan start failed with error code: %d\n&amp;quot;, err_code);
            fflush(stdout);
        }
        else
        {
            printf(&amp;quot;Scan started\n&amp;quot;);
            fflush(stdout);
        }
    }
#endif

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Not saying that you can&amp;#39;t do any changes, but just to pinpoint whether it is the changes or if it is something with the setup. Do you use the same baudrate/frequency as when you use the DK (and it doesn&amp;#39;t fail)?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Can you try to stop the debugger inside the sd_ble_gap_scan_start() and see what check or what function that returns the err_code != 0?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200781?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 13:19:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc946d7e-6525-4fda-89ed-3144331b3525</guid><dc:creator>KEOPS</dc:creator><description>&lt;p&gt;finally, i can debug on the gateway now&amp;nbsp;&lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;attached the callstack.&lt;/p&gt;
&lt;p&gt;Do you see something interesting ?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3568.reset.png" /&gt;&lt;/p&gt;
&lt;p&gt;Edit : i have a remark :&lt;/p&gt;
&lt;p&gt;when i add a usleep(50000) just before sd_ble_gap_scan_start() on on_adv_report() it seems like the reset time before reset is bigger &amp;gt; 4 min&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void on_adv_report(const ble_gap_evt_t * const p_ble_gap_evt)
{
    uint32_t err_code;
    uint8_t  str[STRING_BUFFER_SIZE] = {0};

    // Log the Bluetooth device address of advertisement packet received.
    ble_address_to_string_convert(p_ble_gap_evt-&amp;gt;params.adv_report.peer_addr, str);
    
    printf(&amp;quot;address: 0x%s&amp;quot;, str);
    fflush(stdout);
    printf(&amp;quot; - ch_idx : %d &amp;quot;, p_ble_gap_evt-&amp;gt;params.adv_report.ch_index);
    fflush(stdout);
    printf(&amp;quot; - rssi : %d \n&amp;quot;, p_ble_gap_evt-&amp;gt;params.adv_report.rssi);
    fflush(stdout);

    //wait
    usleep(50000);

    err_code = sd_ble_gap_scan_start(m_adapter, NULL, NULL);
    if (err_code != NRF_SUCCESS)
    {
       printf(&amp;quot;Scan start failed with error code: 0x%02X\n&amp;quot;, err_code);
        fflush(stdout);
    }

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;my supposition : it seems like the problem is sd_ble_gap_scan_start(), the call of this method is very fast and the transport fails !!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200664?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 07:28:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02017132-190e-45ad-b9e6-85276e0b55d6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Me neither.&lt;/p&gt;
&lt;p&gt;What are the differences between the DK and your PCB? Do you use the same crystals? Do you have a Low frequency Xtal? The 32KHz? Although if you are able to scan that doesn&amp;#39;t seem like the issue, but I am just trying to think of possible reasons.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And again, can you try to set a breakpoint on the line where it says: &amp;quot;Status 6, message: Target reset performed&amp;quot;, and see if you can determine from the callstack why this happens? What caused the device to try to reset the nRF?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200595?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 15:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:571bbae9-815b-4787-9772-216081237f77</guid><dc:creator>KEOPS</dc:creator><description>&lt;p&gt;With exactly the same application (same code heart_rate_collector and same pc-ble-driver) on my pc (ubuntu 18.04 LTS) and nRF52, i don&amp;#39;t have the problem, now it&amp;#39;s been 3 hours since the application runs and no problem !!&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand why it crashes in the gateway after few sencods!!&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200509?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 12:05:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecabf514-376d-48fd-99e6-e66e5953a6a9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Can you see whether you are able to reproduce it using a DK so that you have debugging capabilities? I believe development would be a bit easier if you are able to debug.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200458?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 09:55:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55101142-6daa-4747-922e-32a9abdcd202</guid><dc:creator>KEOPS</dc:creator><description>&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;Thanks for reply,&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The application turns in the gateway (MT7688 MIPS 32bits architecture CPU) with OpenWrt OS.&lt;/li&gt;
&lt;li&gt;I have programmed the nrf52832 chip with connectivity_4.0.0_1m_with_s132_6.1.0.hex which is present in the git repository.&lt;/li&gt;
&lt;li&gt;the nrf52832 is not a DK but it is in the gateway on the same PCB as the MT7688 MIPS 32bits architecture CPU (see attached images).&lt;/li&gt;
&lt;li&gt;I used the heart_rate_collector example in the pc-ble-driver repository.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;unfortunately, i cannot debug on the gateway for the moment, it is very difficult (if no choice, i will try with gdb server on remote !!)&lt;/p&gt;
&lt;p&gt;Do you think that my problem is that the pc-ble-driver is not compatible with embedded architectures ? or...&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20190725_5F00_114625.jpg" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_20190725_5F00_114647.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: pc-ble-driver problem : target reset after starting scanning</title><link>https://devzone.nordicsemi.com/thread/200291?ContentTypeID=1</link><pubDate>Wed, 24 Jul 2019 12:52:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a71ed15-b0fe-4643-89d1-a264d8355666</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;The line: &amp;quot;Failed to receive response for command&amp;quot;&lt;/p&gt;
&lt;p&gt;comes from&amp;nbsp;serialization_transport.cpp, from the&amp;nbsp;SerializationTransport::send() function. It is the&amp;nbsp;NRF_ERROR_SD_RPC_SERIALIZATION_TRANSPORT_NO_RESPONSE return value (0x8016) that is returned.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Error sending packet to target. Code:&amp;quot; is printed from&amp;nbsp;encode_decode() in ble_common.cpp.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The reason why this happens is not easy to say. It means that the nRF has stopped responding. How did you program the device, and with what?&lt;/p&gt;
&lt;p&gt;It looks like the application is trying to reset the nRF, but that it isn&amp;#39;t able to do so. Did you connect the reset pin to your controller? And did you shorten SB 17 on the DK? The log doesn&amp;#39;t say why it attempts to reset the device, though. Can you try to set a breakpoint on the line saying &amp;quot;Target Reset performed&amp;quot;, and see if you can see from the callstack why this is called?&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>