<?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>Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21638/open-mesh-radio_signal_callback-busy-loop</link><description>I was having some troubles using the app_timer (RTC1) shortly after mesh startup, so I enabled the PIN_IN_CB and PIN_IN_TS debug pins, and saw some interesting behavior. 
 
 My app periodically calls rbc_mesh_enable(). On the first enable, it looks</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 May 2017 15:13:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21638/open-mesh-radio_signal_callback-busy-loop" /><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84941?ContentTypeID=1</link><pubDate>Tue, 02 May 2017 15:13:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e0455da-a87f-4a71-a3c4-df86e3e683b6</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Pete,
How often do you have BLE activity in your application ?
I did a test here and count the number of NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED  multiply by TIMESLOT_SLOT_EXTEND_LENGTH_US I get exactly the size of the time slot I have (usually it&amp;#39;s the advertising interval minus a few milliseconds).&lt;/p&gt;
&lt;p&gt;So what happens is that we try to request as quick as possible maximum size for the timeslot but requesting each time TIMESLOT_SLOT_EXTEND_LENGTH_US  and request again when we get approved  (NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED event).
After that the CPU won&amp;#39;t be waken up again to do extending.&lt;/p&gt;
&lt;p&gt;If you comment out the line you mentioned, we only request extension when we start a timeslot.  This result in 19ms timeslot as you have seen (not sure why it&amp;#39;s not 20ms).&lt;/p&gt;
&lt;p&gt;We would suggest you to increase TIMESLOT_SLOT_EXTEND_LENGTH_US to 50 or 100ms, then the number of NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED  will be reduced and you should see shorter period where the PIN_IN_CB is toggled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84940?ContentTypeID=1</link><pubDate>Fri, 28 Apr 2017 13:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ac45271-98d4-4389-be75-8f8fba066dec</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;I don&amp;#39;t think changing TIMESLOT_SLOT_EXTEND_LENGTH_US would have an effect, since the busy loop is already a much faster cycle than that.  It looks to me like the callback is trying to extend the timeslot immediately after every callback that indicates the timeslot was successfully extended.  So I would expect a busy loop.  Shouldn&amp;#39;t the timeslot only be extended after some delay?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84939?ContentTypeID=1</link><pubDate>Fri, 28 Apr 2017 11:12:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f67aeda4-4226-4950-af24-4cd0994a0275</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Pete,&lt;/p&gt;
&lt;p&gt;I can see the same issue here. We will investigate further. One thing you can change is to increase TIMESLOT_SLOT_EXTEND_LENGTH_US and see if it would occurs less often. Commenting out the extending code is not recommended. We will check why there is such a long busy loop.&lt;/p&gt;
&lt;p&gt;19ms maybe is the result of 10ms initial timeslot and 01 extension, just my guess.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84938?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 14:59:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5dde037-25a4-42cf-85bb-aa03506c618b</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;Commenting out this: &lt;a href="https://github.com/NordicSemiconductor/nRF51-ble-bcast-mesh/blob/master/nRF51/rbc_mesh/src/timeslot.c#L331-L337"&gt;github.com/.../timeslot.c&lt;/a&gt; seems to fix the busy loop, and the mesh still renews the timeslot.  I&amp;#39;ll continue to see if I have other side effects from commenting that out.  The only other thing that is weird is that it seems like the timeslots are 19ms in length, when I would expect 10ms since m_ret_param.params.extend.length_us is set to 10000.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84937?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 14:43:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8811f19f-2bcf-4e2d-9561-3d01d5fe4cd1</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;I have made changes to the library, but they&amp;#39;re restricted to handling additional serial commands, that I wouldn&amp;#39;t expect to change timeslot behavior.  I think the only unusual thing I&amp;#39;m doing is starting and stopping the mesh periodically.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84936?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 14:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ef757b6-1a81-45f5-96bd-6f9a2fef5f77</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;The callback is made at a rate of 15khz, or around 66us between each call.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84935?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 14:38:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cf5879e-97a0-4b41-8493-555e90fdf6d7</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;So it appears that we&amp;#39;re in a loop of responding to a message that the extend succeeded, and we turn around and ask for another extension immediately. How is this code supposed to work?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicSemiconductor/nRF51-ble-bcast-mesh/blob/master/nRF51/rbc_mesh/src/timeslot.c#L335"&gt;github.com/.../timeslot.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84934?ContentTypeID=1</link><pubDate>Wed, 26 Apr 2017 11:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:617af591-0129-4bc7-ba42-bd00cded7848</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Pete: Could you send the trace ? I want to see the period between the pulses. As far as I understand the timeslot manager only send extend request at the end of the current timeslot with 10ms extension (TIMESLOT_SLOT_EXTEND_LENGTH_US) . It should not be a continuous requests as in your trace. Have you modified anything else in the rbc library ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Open Mesh radio_signal_callback busy loop</title><link>https://devzone.nordicsemi.com/thread/84933?ContentTypeID=1</link><pubDate>Tue, 25 Apr 2017 22:15:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2280f49-c0b5-4c9a-a8c6-dc17f6288c84</guid><dc:creator>Pete</dc:creator><description>&lt;p&gt;Looks like NRF_RADIO_CALLBACK_SIGNAL_TYPE_EXTEND_SUCCEEDED is the signal being sent to radio_signal_callback().  When I toggle a pin in that case statement, I see frequent toggling during that period.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>