<?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>How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37870/how-to-create-tasks-using-base-project-ble_app_hrs_freertos</link><description>I am new to Embedded Studio &amp;amp; Nordic; I have tried different way to create two another tasks with this project. But system crashed every time. 
 If I comment out: 
 // nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);, 
 and keep task1_thread, but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Mar 2023 08:24:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37870/how-to-create-tasks-using-base-project-ble_app_hrs_freertos" /><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418509?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 08:24:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42af7d82-c85e-4c86-a04e-3d22d4eda92a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I am asking you to create a new &lt;a href="https://devzone.nordicsemi.com/support/add"&gt;DevZone thread&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418503?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:56:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08d60637-54f9-42d1-825c-7ab13275f514</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;Initially, I called xPortGetFreeHeapSize() and found that there was insufficient space, so I changed the value of configTOTAL_HEAP_SIZE. I found that this value cannot be increased by a lot, and can only be increased by a small amount above 4096.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418501?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:54:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56f4b74d-1b66-4e25-94f4-4cd00cc3f2d6</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;This has nothing to do with threads. I can create and run threads without any issues.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418500?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a5bc743-d53f-4d72-b698-b3ca511e2bc5</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;But，When I increased the value of configTOTAL_HEAP_SIZE, all my log information disappeared.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418498?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83d5ca81-e078-49cd-aaf5-2db84e1ba083</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Please make&lt;em&gt; a new thread&lt;/em&gt; as this is likely not related to the original topic in this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418497?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:44:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21b95948-4bf5-4e8c-8931-15bb982b841a</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;Could this be related to the burning of the Bluetooth protocol stack into the device?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418496?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:42:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18e12765-bfdd-4e6b-a106-071b3176ca8c</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;int main(void)&lt;br /&gt;{&lt;br /&gt; bool erase_bonds;&lt;br /&gt; char buf[256];&lt;br /&gt; uint8_t address[6];&lt;br /&gt; size_t free_size;&lt;br /&gt; ble_gap_addr_t addr;&lt;br /&gt; led_init();&lt;br /&gt; usart_init();&lt;br /&gt; init_storage();&lt;br /&gt; relay_init();&lt;br /&gt; log_init();&lt;br /&gt; timers_init();&lt;br /&gt; my_adc_enable();&lt;br /&gt; SCB-&amp;gt;SCR |= SCB_SCR_SLEEPDEEP_Msk;&lt;br /&gt; ble_stack_init();&lt;br /&gt; gap_params_init();&lt;br /&gt; gatt_init();&lt;br /&gt; advertising_init();&lt;br /&gt; services_init();&lt;br /&gt; conn_params_init();&lt;br /&gt; peer_manager_init();&lt;br /&gt; application_timers_start();&lt;br /&gt; nrf_sdh_freertos_init(advertising_start, &amp;amp;erase_bonds);&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; xTaskCreate(logger_thread, &amp;quot;LOGGER&amp;quot;, 256, NULL, 5, m_logger_thread);&lt;/p&gt;
&lt;p&gt;xTaskCreate(test_thread, &amp;quot;test&amp;quot;, 32, NULL, 3, m_test_thread);&lt;/p&gt;
&lt;p&gt;free_size=xPortGetFreeHeapSize();&lt;br /&gt; NRF_LOG_INFO(&amp;quot;%d&amp;quot;,free_size);&lt;/p&gt;
&lt;p&gt;vTaskStartScheduler();&lt;/p&gt;
&lt;p&gt;for (;;)&lt;br /&gt; {&lt;br /&gt; // 正常情况下程序永远不能走到这里，走到这里说明程序的线程出现异常&lt;br /&gt; APP_ERROR_HANDLER(NRF_ERROR_FORBIDDEN);&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418495?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:41:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:914407c1-eb26-40c9-b73c-9be441da6423</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;When I was debugging just now, I found that the value of configTOTAL_HEAP_SIZE could be increased from 4096 to 4420, but not further. The program would get stuck at this statement during debugging. I am a beginner and do not understand assembly language. 0x0002528C 9906 LDR r1,[sp,#0x18]&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418489?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 07:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9a5d703-a9ae-49b5-b52b-b45ffba50825</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;I don&amp;#39;t know, we need more information. But please &lt;a href="https://devzone.nordicsemi.com/support/add"&gt;make a new&amp;nbsp;thread&lt;/a&gt;&amp;nbsp;for it and explain more what you are using, what you have changed, how you are testing and what you have found from debugging&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/418449?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2023 02:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bbc112e-630b-488f-a8db-55c6e00e7c5c</guid><dc:creator>qingfenghu</dc:creator><description>&lt;p&gt;&lt;span&gt;Why does the program stop running after changing the value of &lt;/span&gt;&lt;code&gt;configTOTAL_HEAP_SIZE&lt;/code&gt;&lt;span&gt; from 4096 to 8192? Before the change, there was not enough space.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/222750?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 10:21:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56584de1-5c18-4217-82ef-00fe60353f7a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There is not enough information here to make any suggestions. Please describe in detail what you do and which error you get where. If it is not &lt;em&gt;directly&lt;/em&gt; related to the original question I suggest you do so in a new question.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/222696?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 06:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44e7469a-6cd2-400b-b86e-75f990b2570c</guid><dc:creator>Namdev</dc:creator><description>&lt;p&gt;hello,&lt;/p&gt;
&lt;p&gt;I tried doing the same but i get oxooooooooof as the error code in int main().&lt;/p&gt;
&lt;p&gt;May i know why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to create tasks using base project ble_app_hrs_freertos</title><link>https://devzone.nordicsemi.com/thread/146067?ContentTypeID=1</link><pubDate>Tue, 28 Aug 2018 09:29:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:810a5e41-4749-405a-9843-876b35159cf3</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;That was strange. Increasing the total heap size in the projects FreeRTOSConfig.h (under &amp;lt;SDK&amp;gt;\examples\ble_peripheral\ble_app_hrs_freertos\config\) fixes this on my side.&lt;/p&gt;
&lt;p&gt;You can compare with this modified HRS example from SDK 15.0.0 which adds an additional dummy task based on your question.&lt;/p&gt;
&lt;p&gt;Diff of main.c:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-e4988bb64fa54ed9973fcb3007251f02/main.c.diff"&gt;devzone.nordicsemi.com/.../main.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Diff of FreeRTOSConfig.h:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-e4988bb64fa54ed9973fcb3007251f02/FreeRTOSConfig.h.diff"&gt;devzone.nordicsemi.com/.../FreeRTOSConfig.h.diff&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>