<?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>Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105877/proper-way-to-handle-long-computations-while-preserving-ble-timing</link><description>Hi! 
 I am working on a biosensing device that does some onboard processing. The firmware application is quite complex, but working quite stable and power-efficient until now, where we are adding some more onboard processing functions. 
 The task at hand</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Nov 2023 15:30:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105877/proper-way-to-handle-long-computations-while-preserving-ble-timing" /><item><title>RE: Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/thread/456739?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 15:30:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1d4fa32-8014-410f-b26e-5a253155728f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Not sure if I am not of much help in that kind of implementation, but do checkout the interrupt priorities that you have available when using a softdevice (if you haven&amp;#39;t already):&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html"&gt;https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/processor_avail_interrupt_latency/exception_mgmt_sd.html&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/thread/456620?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 09:09:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad3c6a8f-7eaa-4e63-9679-c299b81646d1</guid><dc:creator>PowerConsumer</dc:creator><description>&lt;p&gt;Hi Kenneth, thank you for your answer. Yes this is correct, we are indeed already porting to the nRF Connect SDK but currently still use nRF5. As the application is already quite complicated however, I was hoping there to be a solution to continue improving on the old app while the new one is still unusable. Would you be willing to look at two code files that illustrate my idea to relatively quickly implement a proper schedule for this case for some feedback? We already have a state machine which I think we can use to solve the interrupt issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/thread/456619?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 09:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:712e7a25-0881-4b70-904a-d655264f7589</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I get the impression you are working on the nRF5 SDK, if you swap to the nRF Connect SDK this could be a bit easier, since you can put non-timing critical timings tasks (that take for instance take long time) into a workque that is handle at a low priority. You can also set threads with different priorities. You can learn more about nRF Connect SDK:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/"&gt;https://academy.nordicsemi.com/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/thread/456613?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2023 08:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ff133e1-cffb-4da5-846d-c6a261f4d52a</guid><dc:creator>PowerConsumer</dc:creator><description>&lt;p&gt;Hey, thanks for your answer! Makes sense. I&amp;#39;ll try to make it work with the existing state machine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Proper way to handle long computations while preserving BLE timing?</title><link>https://devzone.nordicsemi.com/thread/456544?ContentTypeID=1</link><pubDate>Mon, 20 Nov 2023 19:21:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97640fda-447d-469e-aea1-ec98317f2d00</guid><dc:creator>d2sc</dc:creator><description>&lt;p&gt;I usually split up long running tasks into shorter (5-20ms) chunks and put them in the scheduler queue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In general it sounds like you are running into an issue where your application is not managing the priorities of different tasks. I recommend looking into the interrupt levels you have set for different operations -&amp;gt; and further more make sure the soft device is safely able to interrupt your application flow without causing issues.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>