<?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>Example ble_app_hrs_freertos of SDK15.2.0 failing FreeRTOS assertion.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40942/example-ble_app_hrs_freertos-of-sdk15-2-0-failing-freertos-assertion</link><description>Hello Nordic experts, 
 I am working with nRF5_SDK_15.2.0_9412b96 SDK. 
 In example nRF5_SDK_15.2.0_9412b96/examples/ble_peripheral/ble_app_hrs_freertos/main.c I have at line № 969 a call to nrf_sdh_freertos_init . This function is that which instantiates</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 29 Nov 2018 18:17:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40942/example-ble_app_hrs_freertos-of-sdk15-2-0-failing-freertos-assertion" /><item><title>RE: Example ble_app_hrs_freertos of SDK15.2.0 failing FreeRTOS assertion.</title><link>https://devzone.nordicsemi.com/thread/159621?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 18:17:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edc61d54-4baf-4b78-968e-18adf523f87a</guid><dc:creator>Vincent Bela&amp;#239;che</dc:creator><description>&lt;p&gt;OK, thank you for reply, that will definitely help me to make it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example ble_app_hrs_freertos of SDK15.2.0 failing FreeRTOS assertion.</title><link>https://devzone.nordicsemi.com/thread/159505?ContentTypeID=1</link><pubDate>Thu, 29 Nov 2018 09:13:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61ef4caf-a9b8-49ed-8c57-d449933313dd</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That is a good question.&lt;/p&gt;
&lt;p&gt;If you look into components\softdevice\s140\headers\nrf_soc.h file, you will see&amp;nbsp;NRF_SOC_SVCS&lt;/p&gt;
&lt;p&gt;enum NRF_SOC_SVCS&lt;br /&gt;{&lt;br /&gt; &lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt;SD_PPI_CHANNEL_ENABLE_GET = SOC_SVC_BASE,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_CHANNEL_ENABLE_SET,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_CHANNEL_ENABLE_CLR,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_CHANNEL_ASSIGN,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_GROUP_TASK_ENABLE,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_GROUP_TASK_DISABLE,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_GROUP_ASSIGN,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_PPI_GROUP_GET,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_FLASH_PAGE_ERASE,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_FLASH_WRITE,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;&lt;strong&gt; SD_FLASH_PROTECT,&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt; SD_MUTEX_NEW = SOC_SVC_BASE_NOT_AVAILABLE,&lt;br /&gt; SD_MUTEX_ACQUIRE,&lt;br /&gt; SD_MUTEX_RELEASE,&lt;br /&gt; SD_NVIC_ENABLEIRQ,&lt;br /&gt; SD_NVIC_DISABLEIRQ,&lt;br /&gt; SD_NVIC_GETPENDINGIRQ,&lt;br /&gt; SD_NVIC_SETPENDINGIRQ,&lt;br /&gt; SD_NVIC_CLEARPENDINGIRQ,&lt;br /&gt; SD_NVIC_SETPRIORITY,&lt;br /&gt; SD_NVIC_GETPRIORITY,&lt;br /&gt; SD_NVIC_SYSTEMRESET,&lt;br /&gt; SD_NVIC_CRITICAL_REGION_ENTER,&lt;br /&gt; SD_NVIC_CRITICAL_REGION_EXIT,&lt;br /&gt; SD_RAND_APPLICATION_POOL_CAPACITY,&lt;br /&gt; SD_RAND_APPLICATION_BYTES_AVAILABLE,&lt;br /&gt; SD_RAND_APPLICATION_GET_VECTOR,&lt;br /&gt; SD_POWER_MODE_SET,&lt;br /&gt; SD_POWER_SYSTEM_OFF,&lt;br /&gt; SD_POWER_RESET_REASON_GET,&lt;br /&gt; SD_POWER_RESET_REASON_CLR,&lt;br /&gt; SD_POWER_POF_ENABLE,&lt;br /&gt; SD_POWER_POF_THRESHOLD_SET,&lt;br /&gt; SD_POWER_RAMON_SET,&lt;br /&gt; SD_POWER_RAMON_CLR,&lt;br /&gt; SD_POWER_RAMON_GET,&lt;br /&gt; SD_POWER_GPREGRET_SET,&lt;br /&gt; SD_POWER_GPREGRET_CLR,&lt;br /&gt; SD_POWER_GPREGRET_GET,&lt;br /&gt; SD_POWER_DCDC_MODE_SET,&lt;br /&gt; SD_APP_EVT_WAIT,&lt;br /&gt; SD_CLOCK_HFCLK_REQUEST,&lt;br /&gt; SD_CLOCK_HFCLK_RELEASE,&lt;br /&gt; SD_CLOCK_HFCLK_IS_RUNNING,&lt;br /&gt; SD_RADIO_NOTIFICATION_CFG_SET,&lt;br /&gt; SD_ECB_BLOCK_ENCRYPT,&lt;br /&gt; SD_RADIO_SESSION_OPEN,&lt;br /&gt; SD_RADIO_SESSION_CLOSE,&lt;br /&gt; SD_RADIO_REQUEST,&lt;br /&gt; SD_EVT_GET,&lt;br /&gt; SD_TEMP_GET,&lt;br /&gt; SVC_SOC_LAST&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;All the &lt;strong&gt;bold&amp;nbsp;&lt;/strong&gt;svcs are available even if the softdevice is not enabled. Just flashing them to the flash memory is enough for them to work. But the rest (including &lt;span&gt;SOC_SVC_BASE_NOT_AVAILABLE&lt;/span&gt;) are only available when the softdevice is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example ble_app_hrs_freertos of SDK15.2.0 failing FreeRTOS assertion.</title><link>https://devzone.nordicsemi.com/thread/159290?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 15:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab9bec6c-1f86-4a3e-8f8c-59dbd557ed46</guid><dc:creator>Vincent Bela&amp;#239;che</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for the answer. Your first recommendation &amp;mdash; ie hacking the SDK in order to replace xTaskResumeFromISR by vTaskNotifyGiveFromISR was OK for me.&lt;/p&gt;
&lt;p&gt;However for the second recommendation, I got into trouble, which indeed I am the only one to blame. This re-opened some leftover dirty code which I had not done properly by lack of time, and now I cannot postpone this&amp;hellip;&lt;br /&gt;In some other FreeRTOS task I am calling nrf_drv_clock_hfclk_request. I should have used sd_clock_hfclk_request instead as you recommended &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30355/problem-between-soft-device-handler-and-clock-driver"&gt;here&lt;/a&gt;. However, for some reason which I must admit I have not investigated, it was somehow working properly in this dirty way &amp;mdash; well I should have checked this thouroughly too.&lt;/p&gt;
&lt;p&gt;Anyway, my trouble is now that I need to know whether I need to use nrf_drv_clock_hfclk_request or sd_clock_hfclk_request depending on whether the SoftDevice is initialised or not, which now depends on the order in which the two FreeRTOS tasks are initialized. OK, this is probably something that I can overcome by using some by some atomic flag, or some such stuff.&lt;/p&gt;
&lt;p&gt;I would like to raise however the following question&amp;nbsp;: is that possible to initialise the SoftDevice in a way that the sd_clock_hfclk_request primitive is available &amp;mdash; does this primitive need at all that the SoftDevice be initialised in any way, or does it suffice that the SoftDevice .hex be flashed on chip &amp;mdash; while the event causing SD_EVT_IRQHandler to be called be not activated&amp;nbsp;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Example ble_app_hrs_freertos of SDK15.2.0 failing FreeRTOS assertion.</title><link>https://devzone.nordicsemi.com/thread/159210?ContentTypeID=1</link><pubDate>Tue, 27 Nov 2018 11:56:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aff23054-8aa2-4718-8503-2cf2d737b712</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Very good question.&lt;/p&gt;
&lt;p&gt;First of all, there is a race condition in using xTaskResumeFromISR which should be replaced by notify API as mentioned in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/39459/observer-under-freertos-events-stop-coming-after-a-few-minutes/154246#154246"&gt;this &lt;/a&gt;answer.&lt;/p&gt;
&lt;p&gt;You question is still valid after you use the fixed mentioned in the above link.&lt;/p&gt;
&lt;p&gt;That is the reason we use hook_fn in&amp;nbsp;nrf_sdh_freertos_init where we start the radio activity (Advertise or scan) that will be able to generate the first interrupt in&amp;nbsp;SD_EVT_IRQHandler .&lt;/p&gt;
&lt;p&gt;So the m_task_hook function will only be called of softdevice_task has been started. If softdevice_task is not started then no radio activity will occur and hence there is no possibility in triggering&amp;nbsp;SD_EVT_IRQHandler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>