<?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>Debuging a problem with S310 - program hangs after BT connects</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/72452/debuging-a-problem-with-s310---program-hangs-after-bt-connects</link><description>Hi, 
 I&amp;#39;ve recently added BT to my application and switched from S210 to S310 Softdevice. My Ant+ part is based on the HR RX example in SDK10. My BT part is basically copied from the BT blinky example. 
 It &amp;quot;almost&amp;quot; works 
 The problem happend some time</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 08 Mar 2021 22:49:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/72452/debuging-a-problem-with-s310---program-hangs-after-bt-connects" /><item><title>RE: Debuging a problem with S310 - program hangs after BT connects</title><link>https://devzone.nordicsemi.com/thread/298528?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 22:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6249edaf-2336-40da-b353-fea789ef5596</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Ok. My assumption was correct. I made it all work with nrf_drv_timer wit High Priority matched with GPIOTE High Priority.&lt;/p&gt;
&lt;p&gt;Thank you very much for your advice in the first post.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debuging a problem with S310 - program hangs after BT connects</title><link>https://devzone.nordicsemi.com/thread/298510?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 20:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2186c881-c441-4f0d-9343-f4dc115f2080</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;To be clear. I&amp;#39;m not calling anything from the API myself. I just use the softdevice to receive data. My whole program logic happns based on the incoming data and I use the interrupt on GPIOTE to initiate a timer (app_timer currently) that sets a pin to low or high. I calculate the delay of that timer depending on the data coming form ANT+. So in theory I could still set my timmer priority to HIGH, right?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debuging a problem with S310 - program hangs after BT connects</title><link>https://devzone.nordicsemi.com/thread/298505?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 19:17:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f09512f4-83fd-4e73-8365-f620998739dc</guid><dc:creator>dragilla</dc:creator><description>&lt;p&gt;Well yes, this kinda works, but then I have to set the GPIOTE priority to LOW as well and that causes my program to work &amp;quot;jerky&amp;quot;. I use it to dim the ligjht and the light blinks while being dimmed, telling me the tmers don&amp;#39;t work as they should.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But at least it doesn&amp;#39;f freeze ;)&lt;/p&gt;
&lt;p&gt;Any other way around it? I guess I could go back to experimenting with the Timers (not app-timers) but I had other problems there :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debuging a problem with S310 - program hangs after BT connects</title><link>https://devzone.nordicsemi.com/thread/298435?ContentTypeID=1</link><pubDate>Mon, 08 Mar 2021 14:51:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab26a4de-4083-4696-8df4-578eb343f5d1</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is very likely that you are trying to call the softdevice api from an application interrupt level 0, 1 or 2. You need to call it from priority 3 or main. See &lt;a href="https://infocenter.nordicsemi.com/pdf/S310_SDS_v3.0.pdf"&gt;Figure 4 and 5 in the S310 softdevice specification&lt;/a&gt;:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4786.pastedimage1615215023265v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So this means you should&amp;nbsp;set the priority level for your app_timer to 3 (not 0, 1, 2).&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>