<?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>I would like to call hvx function in my custom task.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13277/i-would-like-to-call-hvx-function-in-my-custom-task</link><description>i using a ble_app_hrs_freertos example, nrf52 
 I inserted a new custom task. 
 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);
} 
 
 and in my custom task, called a sd_ble_gatts_hvx</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Apr 2016 12:45:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13277/i-would-like-to-call-hvx-function-in-my-custom-task" /><item><title>RE: I would like to call hvx function in my custom task.</title><link>https://devzone.nordicsemi.com/thread/50615?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 12:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:facc7b50-049f-4259-b640-fc33836dd25b</guid><dc:creator>bigzero</dc:creator><description>&lt;p&gt;tnak you for reply.&lt;/p&gt;
&lt;p&gt;i know that the priority 3 is  high priority.&lt;/p&gt;
&lt;p&gt;#define tskIDLE_PRIORITY			( ( UBaseType_t ) 0U )
and
#define configTIMER_TASK_PRIORITY                                                 ( 2 )&lt;/p&gt;
&lt;p&gt;the priority number 1 is low priority.&lt;/p&gt;
&lt;p&gt;a task priority and a interrupt priority is different.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I would like to call hvx function in my custom task.</title><link>https://devzone.nordicsemi.com/thread/50614?ContentTypeID=1</link><pubDate>Mon, 18 Apr 2016 11:06:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:038a3814-d60c-4fba-9e17-286fdd3a0ab6</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You are creating your custom task with a priority &amp;quot;1!. Which is high and cannot call any sd_xx functions. Because sd_ble_gatts_hvx converts into SVC the ARM Cortex does not allow calling SVC (priority 2) from higher priority task (like your custom task).&lt;/p&gt;
&lt;p&gt;Change the priority to 3 incase you want to make sd_xxx calls from your custom task.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;if(pdPASS != xTaskCreate(main_thread, &amp;quot;MAIN&amp;quot;, 32, NULL , 3, &amp;amp;m_main_thread))
{
   APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>