<?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>Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53743/zigbee-sdk-on-top-of-freertos</link><description>Hi 
 I&amp;#39;m trying to use nRF5 SDK for thread and Zigbee 3.2.0 on top of FreeRTOS 9.0 for a Zigbee coordinator. Since I could not find any coordinator example on FreeRTOS, I started with adding the files etc as of &amp;quot;Adding dynamic multiprotocol Zigbee support</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Apr 2023 09:48:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53743/zigbee-sdk-on-top-of-freertos" /><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/421435?ContentTypeID=1</link><pubDate>Thu, 20 Apr 2023 09:48:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6151bef4-2ac7-43a2-9eda-22ad0d65a54b</guid><dc:creator>Fayne</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;I would like to know if you have a solution at this problem.&lt;br /&gt;We have exactly the same deadlock at the same position.&lt;br /&gt;We can&amp;#39;t change the priority of BLE or ZIGBEE because we haven&amp;#39;t any FREERTOS or OS in the product.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;And this bug is really important to correct for us.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/229480?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2020 18:11:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87b0f6de-7677-489d-bac2-676942243fc9</guid><dc:creator>WestCoastDaz</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/vilpih"&gt;vilpih&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Did you manage to get this working?&amp;nbsp; I managed to get it working by creating a separate higher priority BLE task.&amp;nbsp; This seems to allow the flash events emitted from the SD to be processed without the ZigBee thread getting stuck.&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/224797?ContentTypeID=1</link><pubDate>Tue, 10 Dec 2019 17:12:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e038aa39-9b34-4842-a63a-5972482bfdf5</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi Vilhelm,&lt;/p&gt;
&lt;p&gt;If you are not planning to use BLE, then starting with the Zigbee multisensor with Freertos example instead and then add the coordinator functionality to the example will be a better approach.&lt;/p&gt;
&lt;p&gt;You will have to remove the ZB_ED_ROLE define, change the startup function (use zb_set_network_coordinator_role(channel)) and the zboss signal handler (see CLI example for that) to add the coordinator functionality.&lt;/p&gt;
&lt;p&gt;I am not sure why you are getting stucked but I think it has to do with the multiprotocol implementation, as zb_osif_nvram_erase_async is waiting for a nRF SoC event (from nrf_soc.h).&lt;/p&gt;
&lt;p&gt;NB! If your goal is to have multiprotocol BLE+Zigbee+FreeRTOS then starting from a FreeRTOS+BLE example will be better, as adding multiprotocol with Zigbee is much easier than choosing appropiate variants of Softdevice handlers, defining sections etc.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Marjeris&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/224075?ContentTypeID=1</link><pubDate>Fri, 06 Dec 2019 08:15:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb60cbbc-a136-46eb-9c40-1674572361a6</guid><dc:creator>vilpih</dc:creator><description>&lt;p&gt;Thanks!&lt;br /&gt;I don&amp;#39;t like it either, but the code is from the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/223850?ContentTypeID=1</link><pubDate>Thu, 05 Dec 2019 10:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9660948e-6117-48e5-98c7-c298da2e7e7a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Did any of the fstorage items got written or read successfully? or is this this the first flash event that gets stuck. Seems like there seems to be a deadlock condition created by the app you are working that manages to add flash request to the ATFIFO but somehow the thread that makes this request never sleeps/yields. This could cause the thread that needs to pull the events never execute. I am not a Zigbee expert, but these while loop looks dangerous in my opinion which has no time expiry plugged into it&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/222864?ContentTypeID=1</link><pubDate>Fri, 29 Nov 2019 15:52:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb96a310-66cd-4fdf-b522-78819792de16</guid><dc:creator>vilpih</dc:creator><description>&lt;p&gt;I proceeded a bit when changing priorities, but got stuck again.&lt;/p&gt;
&lt;p&gt;My stack trace:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;zb_osif_nvram_erase_async() at zb_nrf52840_nvram.c:405 0x28be4	
zb_nvram_load() at 0x36186	
zb_zdo_dev_init() at 0x3b910	
zdo_dev_start() at 0x3baf4	
zigbee_main_task() at main.c:511 0x2bc2c	
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Where I got stuck:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;zb_ret_t zb_osif_nvram_erase_async(zb_uint8_t page)
{
  zb_uint32_t flash_addr = 0, i;
  zb_int_t ret = 0;

  ZVUNUSED(ret);

  if (page &amp;gt;= ZB_NVRAM_PAGE_COUNT)
  {
    return RET_PAGE_NOT_FOUND;
  }
  TRACE_MSG(TRACE_COMMON3, &amp;quot;zb_osif_nvram_erase_async page %hd&amp;quot;, (FMT__H, page));

  flash_addr = ZB_NVRAM_PAGE_BASE_ADDRESS(page);

  for (i = 0; i &amp;lt; ZB_NVRAM_PAGE_SIZE / ZB_NVRAM_FLASH_PAGE_SIZE; ++i)
  {
    while (zb_osif_flash_op_progress())
    {
    }

    zb_osif_set_flash_op_progress();
    ret = nrf_fstorage_erase(
                &amp;amp;nvram_fstorage,   /* The instance to use. */
                flash_addr,        /* The address of the flash pages to erase. */
                1,                 /* The number of pages to erase. */
                NULL               /* Optional parameter, backend-dependent. */
      );
    ZB_ASSERT(ret == NRF_SUCCESS);
    if (ret != NRF_SUCCESS)
    {
      return RET_ERROR;
    }
    /* This call is designed to be asynchronous, but currently it is synchronous. */

    /* Wait SOC event handler with NRF_EVT_FLASH_OPERATION_SUCCESS or NRF_FSTORAGE_ERASE_RESULT */
    while (zb_osif_flash_op_progress())   &amp;lt;---- Here is where I got stuck forever
    {
    }

    flash_addr += ZB_NVRAM_FLASH_PAGE_SIZE;
  }
  zb_osif_flash_erase_finished(page);
  return RET_OK;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Any clues?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/221429?ContentTypeID=1</link><pubDate>Thu, 21 Nov 2019 20:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b35f8fb-f2d7-48f9-a632-3ad3dc7d0e9a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Sorry for the late response&amp;nbsp;&lt;span&gt;Vilhelm&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The assert does not seem to show anything that tells me that this could cause because of the FreeRTOS port. So this must be Zigbee related assert. With given details, if there is an assert in RAAL, then it most likely could be conflict in interrupt priority ini which zb_init is called.&amp;nbsp;Nothing else strikes me with the given info.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/219809?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2019 07:32:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6cb44113-df71-459f-ad9e-6544bc66d957</guid><dc:creator>vilpih</dc:creator><description>&lt;p&gt;I added ZB_ENABLE_SOFTDEVICE_FROM_ZBOSS=1 since I don&amp;#39;t use the softdevice for BLE yet, but i t will be used in the future.&lt;/p&gt;
&lt;p&gt;Now I get at stack trace like this:&lt;/p&gt;
&lt;p&gt;_exit() at newlibStubs.c:281 0x2dfaa &lt;br /&gt;abort() at 0x60ffa &lt;br /&gt;__assert_func() at 0x60540 &lt;br /&gt;nrf_raal_init() at 0x5fc1e &lt;br /&gt;nrf_802154_rsch_init() at 0x5dbee &lt;br /&gt;nrf_802154_init() at 0x5b984 &lt;br /&gt;mac_nrf52840_hw_init() at 0x3a08a &lt;br /&gt;zb_mac_transport_init() at 0x3a0b6 &lt;br /&gt;zb_init() at 0x41d6a&lt;/p&gt;
&lt;p&gt;Any suggestions&lt;/p&gt;
&lt;p&gt;BR&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zigbee SDK on top of FreeRTOS</title><link>https://devzone.nordicsemi.com/thread/217699?ContentTypeID=1</link><pubDate>Thu, 31 Oct 2019 08:50:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b609e43-d552-4439-bad8-2efb29eb121d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;It depends on what kind of hardfault is it? it is quite hard to say without knowing your implementation. I have not tried Zigbee with FreeRTOS before but you can debug the hardfault as explained &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/27014/how-can-i-distinguish-the-reason-for-hardfault"&gt;here&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>