<?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>What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/785/what-is-the-best-place-to-update-characteristics-from</link><description>I am developing a real-time system which triggers an interrupt every few milliseconds. That data is collected in the interrupt. When a memory buffer is full, the data is then processed. 
 Currently they are 512 byte buffers. I eliminated the heap to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 17 Apr 2016 03:10:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/785/what-is-the-best-place-to-update-characteristics-from" /><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3947?ContentTypeID=1</link><pubDate>Sun, 17 Apr 2016 03:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:965f5014-8ac6-4f28-8b74-dcb7e989b508</guid><dc:creator>bigzero</dc:creator><description>&lt;p&gt;I would like to call a sd_ble_gatts_hvx in my custom thread. but i have hardfault.&lt;/p&gt;
&lt;p&gt;my code base is ble_app_hrs_freertos_s132.&lt;/p&gt;
&lt;p&gt;i inserted my custom task.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(pdPASS != xTaskCreate(main_thread, &amp;quot;MAIN&amp;quot;, 32, NULL , 1, &amp;amp;m_main_thread))
{
   APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and called a sd_ble_gatts_hvxn hardfault!!!&lt;/p&gt;
&lt;p&gt;i only have to call   a sd_ble_gatts_hvx in app_timer or interrupt service routine.&lt;/p&gt;
&lt;p&gt;why? , i can&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;can i call in my custom thread?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3946?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2013 16:21:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:401abeec-555e-4bd0-a2e2-bb6c94b0b10f</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I meant using the app_scheduler module that is provided in the SDK. There isn&amp;#39;t really any overview-kind of documentation on it, but by looking at the examples, I hope that you&amp;#39;re able to get things working. You can also refer to this discussion:
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/app_scheduler-app_timer" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/app_scheduler-app_timer&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3945?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2013 16:14:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b71ded2-a475-461b-b7dd-494e7db185d8</guid><dc:creator>syntroniks</dc:creator><description>&lt;p&gt;When you say scheduler, do you mean a software or hardware function? I was not aware the samples came with any services like that. I am able to write/borrow one if needed. Is that what you are suggesting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3944?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2013 10:00:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e727f127-9654-4828-ab29-ba1e3cec8029</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;I do like the suggestion from Jarek on this, but just to chip in with another option: Have you considered using the scheduler? Doing so would allow you to put an event in the queue from your interrupt handler, which will then be handled in the main queue, i.e. from the main context.&lt;/p&gt;
&lt;p&gt;Just for future reference: It&amp;#39;s correct that you&amp;#39;re not allowed to call softdevice API functions from interrupts with HIGH priority. The reason is that all softdevice API function calls are implemented as SVCs, which runs on interrupt level 2, and triggering a lower-level interrupt from a higher-level interrupt obviously doesn&amp;#39;t work nicely. This is described in the appendix to the &lt;a href="https://www.nordicsemi.com/eng/content/download/13233/212988/file/nRF51%20Series%20Reference%20manual%20v2.0.pdf"&gt;Reference Manual&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3943?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2013 19:40:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02bf49eb-3f34-4213-8b62-d99a056c0d62</guid><dc:creator>Janek Mann</dc:creator><description>&lt;p&gt;I tend to handle processing / transmitting data in the ble_on_radio_active_evt handler, testing for if(!radioactive). This is convenient as I know that I have time until the next radioactive period without expecting interruption from the softdevice.
It&amp;#39;s not ideal if you need minimum latency though as the packets can only be transmitted after the next connection interval.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: What is the best place to update characteristics from?</title><link>https://devzone.nordicsemi.com/thread/3942?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2013 19:31:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dc58c17-4a86-4765-8ca9-54af63ba6dfc</guid><dc:creator>syntroniks</dc:creator><description>&lt;p&gt;I seem to have solved my own problem in a hacky manner. I was originally using a priority 1 interrupt. Changing that to priority 3 no longer resulted in the hard fault upon softdevice call. Still interested in other ways of improving my code though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>