<?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>System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42973/system-hangs-while-sending-packets-over-ble</link><description>Hello 
 I am using the nRF52832 with SDK 14.2, JLinkRTT Client, and SEGGER IDE. The system simultaneously runs a soft DAC, IMU, digital potentiometer, and provides variable PWM control. The system employs two TWI masters - one dedicated to the IMU and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 28 Jan 2019 13:12:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42973/system-hangs-while-sending-packets-over-ble" /><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/168239?ContentTypeID=1</link><pubDate>Mon, 28 Jan 2019 13:12:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9159f7ab-9305-4725-902d-fc9f25ce24da</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You need to catch the error code that&amp;nbsp;ble_lbs_on_button_change returns.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/168113?ContentTypeID=1</link><pubDate>Sun, 27 Jan 2019 22:23:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:487446a5-dcf5-4176-9fc9-97813ab81a51</guid><dc:creator>GaryD</dc:creator><description>&lt;p&gt;Update - I installed nRF Connect V2.6.1 and ran our target board for 36 hours without an issue.&amp;nbsp; We ran continuous&amp;nbsp;25&amp;nbsp;BLE packets per second carrying accelerometer data at an effective rate of 50 samples per second for x, y, and z measurements.&lt;/p&gt;
&lt;p&gt;Is there a third party BLE dongle that we can buy that has an nRF51 or nRF52 processor and appropriate PC drivers to interface to our PC app?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/167984?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:54:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81a9042b-326b-47ad-9d3d-3b76eab2150f</guid><dc:creator>GaryD</dc:creator><description>&lt;p&gt;One other quick question:&lt;/p&gt;
&lt;p&gt;I came across some references that the nRF52DK runs on a 16M crystal.&amp;nbsp; I believe our target board uses a 32 M crystal - could there be an issue with the crystal setup?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/167982?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:199b82a2-020e-4ffb-b322-bac7f3a0abd6</guid><dc:creator>GaryD</dc:creator><description>&lt;p&gt;Hakon,&lt;/p&gt;
&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;The system is not missing any packets.&amp;nbsp; as in the diagram above, a packet is successfully sent out, the next packet is submitted to send over BLE 40 mS later and the SoftDevice just seems to be hung up.&amp;nbsp; I press stop and get the undefined function.&amp;nbsp; No ASSERT is made.&lt;/p&gt;
&lt;p&gt;Here are my parameters:&amp;nbsp; Most are default from the lbs example I derived my code from except for the min and max connection intervals .&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define APP_BLE_OBSERVER_PRIO           3                                       /**&amp;lt; Application&amp;#39;s BLE observer priority. You shouldn&amp;#39;t need to modify this value. */
#define APP_BLE_CONN_CFG_TAG            1                                       /**&amp;lt; A tag identifying the SoftDevice BLE configuration. */

#define APP_ADV_INTERVAL                64                                      /**&amp;lt; The advertising interval (in units of 0.625 ms; this value corresponds to 40 ms). */
#define APP_ADV_TIMEOUT_IN_SECONDS      BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED   /**&amp;lt; The advertising time-out (in units of seconds). When set to 0, we will never time out. */

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(20, UNIT_1_25_MS)        /**&amp;lt; Minimum acceptable connection interval (0.5 seconds). */
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(40, UNIT_1_25_MS)        /**&amp;lt; Maximum acceptable connection interval (1 second). */
#define SLAVE_LATENCY                   0                                       /**&amp;lt; Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)         /**&amp;lt; Connection supervisory time-out (4 seconds). */

#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(20000)                  /**&amp;lt; Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (15 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(5000)                   /**&amp;lt; Time between each call to sd_ble_gap_conn_param_update after the first call (5 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                       /**&amp;lt; Number of attempts before giving up the connection parameter negotiation. */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As shown in the diagram above, the last packet that contains packet 618 data is just fine.&amp;nbsp; The next packet for samples in 619 and 620 never make it.&amp;nbsp; The firmware starts to pack the samples for the next BLE transmission and the system hangs up.&amp;nbsp; Note that if I use the Nordic Master Control Panel with the nRF51 dongle, the transmissions seem to go forever - I have run tests for more than 24 hours without an issue.&lt;/p&gt;
&lt;p&gt;Do you have any info on PC driver issues for native BLE hardware?&lt;/p&gt;
&lt;p&gt;I use a while loop to avoid ERROR 19 (as derived from some other blog answers) to send the data.&amp;nbsp; Here is my code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;        //Send data packet over BLE
        while (ble_lbs_on_button_change(m_conn_handle, &amp;amp;m_lbs, m_stim_packet_data) == NRF_ERROR_RESOURCES);
        //err_code = ble_lbs_on_button_change(m_conn_handle, &amp;amp;m_lbs, m_stim_packet_data);
        //if (err_code != NRF_SUCCESS &amp;amp;&amp;amp;
        //        err_code != BLE_ERROR_INVALID_CONN_HANDLE &amp;amp;&amp;amp;
        //        err_code != NRF_ERROR_INVALID_STATE &amp;amp;&amp;amp;
        //        err_code != BLE_ERROR_GATTS_SYS_ATTR_MISSING) //&amp;amp;&amp;amp;
                //err_code != NRF_ERROR_RESOURCES;  //resource error 
        //      {
                //APP_ERROR_CHECK(err_code);
        //        printf(&amp;quot;\r\n + + + + Error  %i  + + + + +&amp;quot;,err_code);
        //      }
 &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/167963?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 14:16:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fc2a107-eed1-449c-ae43-d51672ec6b12</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hey Gary,&lt;/p&gt;
&lt;p&gt;I think the &amp;quot;undefined function&amp;quot; is just a arbritrary SoftDevice process that is common to hit if you manually stop the program execution at a random point in time.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Do you have some more information on the nature of your symptom itself? &amp;quot;&lt;span&gt;After a random time in seconds to hours, the system just hangs...&amp;quot; is not enough information.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Are you missing packets, sensor samples corrupted, or something like that?&lt;br /&gt;&lt;br /&gt;What are your BLE connection parmeters?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/167939?ContentTypeID=1</link><pubDate>Fri, 25 Jan 2019 13:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3d4cc80-10ab-42aa-938d-6c9808db00ef</guid><dc:creator>GaryD</dc:creator><description>&lt;p&gt;Here is a further update on the issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I have run the Nordic Master Control Panel PC tool with our target MCU continuously since yesterday at about 6 pm (almost 13 hours).&amp;nbsp; This is the configuration that I have indicated running overnight on previous occasions.&amp;nbsp; The test is still running.&amp;nbsp; There must be some unique handling that the Nordic Master Control Panel uses to work well on the PC.&amp;nbsp; We need further&amp;nbsp;help on this.&amp;nbsp; It may be due to the PC BLE drivers for the standard PC installation.&amp;nbsp; The Nordic Master Control Panel uses its own USB dongle for the BLE connection instead of the native PC BLE hardware.&amp;nbsp; See below the 2 traces being run showing SmartSTIM Burst 12691 and the data from sample 1254 in the MCU trace (JLinkRTTClient) correlating to the highlighted line in the Master Control Panel trace.&lt;/p&gt;
&lt;p&gt;&lt;img height="359" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1548423008313v1.png" width="335" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: System Hangs While Sending Packets over BLE</title><link>https://devzone.nordicsemi.com/thread/167680?ContentTypeID=1</link><pubDate>Thu, 24 Jan 2019 14:42:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3d1ba4f-754d-4805-922b-785573ee8ca5</guid><dc:creator>GaryD</dc:creator><description>&lt;p&gt;I accidentally hit POST - here is the continuation -&lt;/p&gt;
&lt;p&gt;In case you cannot read the image above, the message on the SEGGER IDE is: Unknown function at 0x00006E7A.&amp;nbsp; When the system hangs it is still &amp;quot;running&amp;quot; and I hit the stop button to get this output.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1548340683918v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is a snapshot of the JLINKRTT Client with the output of the PC tool Bluetooth LE explorer.&amp;nbsp; Note how the packets are formed from the data collected from the IMU.&lt;/p&gt;
&lt;p&gt;&lt;img height="212" src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1548340445302v1.png" width="443" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What seems odd is the the system is most reliable using the nRF Master Control Panel..&amp;nbsp; However, the error occurs on both our custom MCU board and the nRF52 DK board.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>