<?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>BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/46112/ble-stack-re-initialize-problem-with-freertos</link><description>How to correctly reinitialize the BLE stack when using FreeRTOS? 
 I can not find in the libraries where the task for the work of the stack under FreeRTOS is created. 
 Stopping the stack is successful, but here&amp;#39;s a new initialization leads to a hardfall</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 May 2019 15:38:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/46112/ble-stack-re-initialize-problem-with-freertos" /><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/185792?ContentTypeID=1</link><pubDate>Tue, 07 May 2019 15:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23e3c4f3-0b5b-4741-bea0-3cd49761e40e</guid><dc:creator>Chongchun Moon</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Susheel,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; It works for me also. But, If I tried enable and disable softdevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; It looks Task for softdevice is not created due to memory shortage.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; Is that Okay on your test?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; Chongchun Moon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/185589?ContentTypeID=1</link><pubDate>Tue, 07 May 2019 02:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f5df50f4-e051-4bc2-ac5d-fb13eb788ef6</guid><dc:creator>silivanov</dc:creator><description>&lt;p&gt;Thank. This solves the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/185577?ContentTypeID=1</link><pubDate>Mon, 06 May 2019 21:19:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bea716cd-5d21-4a16-93c6-2702eeb65eec</guid><dc:creator>Chongchun Moon</dc:creator><description>&lt;p&gt;Hello Susheel,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Could you provide all the project file?&lt;/p&gt;
&lt;p&gt;&amp;nbsp; I also try to enable and disable softdevice with&amp;nbsp; freeRTOS running.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; But, It&amp;nbsp;doesn&amp;#39;t work.&amp;nbsp;I want to see what you changed.&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Thanks,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; Chongchun Moon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/184887?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 12:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e23e1fa1-6396-4975-8e71-f5bb479ce828</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It also depends on the context on when you are disabling the softdevice and when you want to enable it back.&lt;/p&gt;
&lt;p&gt;Small test on my side shows that this works fine, but i have tested it crudely in the idle handler like this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void vApplicationIdleHook( void )
{
    ret_code_t err_code;
  static uint32_t count = 0;
#if NRF_LOG_ENABLED
     vTaskResume(m_logger_thread);
#endif
  
  if (count++ == 0)
  {
        application_timers_stop();
    nrf_sdh_disable_request();
    nrf_sdh_freertos_deinit();


    ble_stack_init();
    
    application_timers_start();
    nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);
  }

}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/184837?ContentTypeID=1</link><pubDate>Thu, 02 May 2019 10:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e099ecc0-723f-45a0-8598-07f78d0c72b9</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;try this.&lt;/p&gt;
&lt;p&gt;remove heap_1.c and add heap_2.c file in your project. Since heap_1,c does not support deletion of heap memory needed to delete the task.&lt;/p&gt;
&lt;p&gt;add the below function in nrf_sdh_freertos.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void nrf_sdh_freertos_deinit()
{
     // Use the handle to delete the task.
     if( m_softdevice_task != NULL )
     {
         vTaskDelete( m_softdevice_task );
     }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;when you disable the softdevice delete the task along with disable&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_sdh_disable_request();
nrf_sdh_freertos_deinit();
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When you want to reenable the softdevice, then do the below&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    err_code = nrf_sdh_enable_request();
    APP_ERROR_CHECK(err_code);
    
    nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Should work fine .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE stack re-initialize problem with FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/184114?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2019 14:24:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0858a396-8c37-4924-b791-c0eb2be63c9c</guid><dc:creator>Vladimir Aparin</dc:creator><description>&lt;p&gt;Can anybody help with this question?&lt;br /&gt;I&amp;#39;m very interesting in this question too. But I can&amp;#39;t found the solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>