<?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>BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/811/ble-application-with-soft-device-has-nondeterministic-operation</link><description>Hi, 
 I&amp;#39;ve developed an application which sends sensor data through the BLE interface at maximum available bandwidth by checking the BLE_ERROR_NO_TX_BUFFERS return value. 
 During development, I&amp;#39;ve run into (and currently still see) some very strange</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Nov 2013 13:32:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/811/ble-application-with-soft-device-has-nondeterministic-operation" /><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4042?ContentTypeID=1</link><pubDate>Mon, 04 Nov 2013 13:32:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da7f9f80-3cad-46d1-ae3b-858cd780e599</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Even though it relies on custom hardware, it might be useful to get a look on the code. Again, if you need confidentiality feel free to create a support case.&lt;/p&gt;
&lt;p&gt;Also, did you check app_error_handler?&lt;/p&gt;
&lt;p&gt;Actually, if you just make sure you don&amp;#39;t violate any rules, there isn&amp;#39;t any problems with not using sd_nvic_*, it&amp;#39;s just about making sure that doing illegal things will be impossible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4038?ContentTypeID=1</link><pubDate>Sat, 02 Nov 2013 02:50:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95f05455-9df2-4fbe-8194-461fe0dfad57</guid><dc:creator>KPE</dc:creator><description>&lt;p&gt;Well everything seems fine, so it&amp;#39;s quite strange. Anyway, I guess that you have already tried a lot of different things, but in a case like this I would probably try the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Start by figuring out where the &amp;quot;lockups&amp;quot; happen - are we inside the BLE stack, or outside?&lt;/li&gt;
&lt;li&gt;Remove dependencies to the external HW - stub out the data collecting code, and disable interrupts etc.&lt;/li&gt;
&lt;li&gt;Make the code as simple as possible (down to just incrementing and send a static counter)&lt;/li&gt;
&lt;li&gt;Make random delays in various &amp;quot;strategic places&amp;quot; to see if it can lead to a timing issue somewhere&lt;/li&gt;
&lt;li&gt;Hmmm... check the office against earth radiation, and wear my tin foil hat ;-)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you can remove the HW dependencies, I&amp;#39;m also ready give your project a spin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4037?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 17:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcdaeb0d-7659-47f1-9992-a5af4339eac6</guid><dc:creator>Jamie</dc:creator><description>&lt;p&gt;Hi KPE,&lt;/p&gt;
&lt;p&gt;Thanks for the reply! Once I am correctly sending data, I can maintain that seemingly indefinitely (I ran a test yesterday for 2.5 hours of successful continuous transmission). The problem is many times it won&amp;#39;t reach that state. To answer some of your questions:&lt;/p&gt;
&lt;p&gt;*** I cannot always connect/disconnect--see original post.
*** I am not starting timers driving BLE sends until I receive a connection event in the BLE handler.
*** I see this same operation on both eval kit boards as well as my own custom HW.
*** I&amp;#39;m using Keil uVision 4 IDE. The only issue with sharing an example code is that it relies on an interrupt generated by external HW. I can try removing that part so that anyone can try it.&lt;/p&gt;
&lt;p&gt;Thanks,
Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4041?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 17:48:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab13a043-f818-432b-946d-3e869345081d</guid><dc:creator>Jamie</dc:creator><description>&lt;p&gt;BTW, I have been using v5.2.1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4040?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 17:47:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6219b4fe-5896-405b-8f03-c06d241b230c</guid><dc:creator>Jamie</dc:creator><description>&lt;p&gt;Hi Ole,&lt;/p&gt;
&lt;p&gt;I&amp;#39;d be happy to forward you the project through email or otherwise, but I&amp;#39;m afraid it relies on interrupts generated by hardware that you won&amp;#39;t have on your side (data is being generated there, which I sample and send at high rates through BLE).  I should also mention that if I turn down the BLE connection interval to 1000 ms, for example, the problem almost completely disappears, so it is highly tied to the BLE bandwidth.&lt;/p&gt;
&lt;p&gt;I was thinking about inserting some delays to start application (BLE handler) timers until some time after the connection completes, as I am currently activating them when the connection is made in the BLE handler.&lt;/p&gt;
&lt;p&gt;Also, I noticed that some code called by application_timers_start() in the SDK might have an issue as this is called in the SDK example &lt;em&gt;after&lt;/em&gt; the Soft Device is enabled. The code in question does not use the sd_nvic_* functions, but instead uses the NVIC_* functions supplied by CMSIS. I tried updating this code to use the sd_nvic_* api, but noticed no change in behavior.&lt;/p&gt;
&lt;p&gt;Best,
Jamie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4039?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 10:54:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5de6c343-2519-4756-8a82-69c1c60204ff</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;This is not common behavior. There was a bug with softdevices between 5.0.0 and 5.2.0 causing advertising to potentially stop for periods under certain environmental conditions, but this was fixed in 5.2.1, so I&amp;#39;d recommend you to verify that&amp;#39;s the one you&amp;#39;re using with regard to the advertising issues you see.&lt;/p&gt;
&lt;p&gt;As for the latter, I don&amp;#39;t have any good direct suggestions on what might be wrong, but you should make sure that you check error codes on all softdevice function calls. For development I&amp;#39;d also recommend you to make sure that your app_error_handler does not contain a reset, but instead an infinite loop, so that you can easily catch errors if you have any.&lt;/p&gt;
&lt;p&gt;If you can supply a complete project showing any of these problems, I&amp;#39;d be happy to take a closer look.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Application with Soft device has nondeterministic operation</title><link>https://devzone.nordicsemi.com/thread/4036?ContentTypeID=1</link><pubDate>Fri, 01 Nov 2013 08:55:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ac7720a-7095-4e74-895e-67b696089eed</guid><dc:creator>KPE</dc:creator><description>&lt;p&gt;I have not tested the current firmware thoroughly, but I had a test running for 6-8 hours that was doing nothing but sending packets at high rate (6580 bytes/sec), in a scenario and setup similar to yours. I think I&amp;#39;ve killed the source code now, as I&amp;#39;ve been using the same little project for all my experiments, but it was based on the heart rate sensor (hrs) example.&lt;/p&gt;
&lt;p&gt;Are you sure that you can disconnect and connect at any time, and also sure that you are not destroying your packet sequencing when this happens. I remember that I listened for connection events and checked the connection state before even trying to enter the send loop.&lt;/p&gt;
&lt;p&gt;It sound a little strange that you are seeing these problems, and I don&amp;#39;t think it&amp;#39;s common. Did you also check this on another board to make sure it&amp;#39;s not a HW problem?&lt;/p&gt;
&lt;p&gt;What compiler are you using etc. Can you make an example project that demonstrates the problems you describe and upload it here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>