<?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>Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/94083/hardfault-with-zigbee-initialisation-when-ble-softdevice-is-included</link><description>Hello Nordic support, 
 I am working on an application that works either with BLE or Zigbee and the protocol to be used is determined at application startup. Initially, my application was only Zigbee based and was using RTOS for performing various operations</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Nov 2022 12:11:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/94083/hardfault-with-zigbee-initialisation-when-ble-softdevice-is-included" /><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/398319?ContentTypeID=1</link><pubDate>Wed, 30 Nov 2022 12:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dc3fa5d-6547-475b-bccf-7f76f54abf33</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Please create a new ticket for it as the issue with the original title seems solved.&amp;nbsp;&lt;/p&gt;
&lt;div style="left:-119px;top:5.62216px;"&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/398150?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 14:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c105146c-e91c-4132-8835-77cf5447d944</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Thanks for checking this. The problem with Systick interrupt got solved. The issue was with function&amp;nbsp;&lt;strong&gt;sd_softdevice_enable()&amp;nbsp;&lt;/strong&gt;not returning. My application had bootloader and application firmware with bootloader placed after soft device and then followed by application code. The issue was resolved by moving the application code after the soft device. However, now i am facing another issue with zigbee initialization not working. I see that when&amp;nbsp;&lt;strong&gt;zigbee_init()&amp;nbsp;&lt;/strong&gt;is called, the program gets stuck on calling&amp;nbsp;&lt;strong&gt;zb_mac_transport_init()&lt;/strong&gt;.This seems like not an issue with this thread. Let me know if i should raise a new case.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/398013?ContentTypeID=1</link><pubDate>Tue, 29 Nov 2022 07:47:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6175694-75b4-4e18-ae22-1201c2b6a0b1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Anusha,&lt;/p&gt;
&lt;p&gt;I verified enabling SYSTICK in ble_app_hrs_freertos project, disabling tickless idle mode.&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5773.pastedimage1669707901372v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;But I do not see any issues enabling the softdevice. I have disable app_timer_freertos in my project since it calls RTC.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:691px;max-width:685px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1370x1382/__key/communityserver-discussions-components-files/4/6354.pastedimage1669707845541v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;I have verified that the systick interrupt is being called now instead of rtc interrupt. It has to be something with your project that causes the issue you are seeing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397808?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 09:27:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:49a94698-5496-489c-9767-c053f3ef9d92</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;While I was debugging my application when I enable SoftDevice, I noticed the following:&lt;/p&gt;
&lt;p&gt;When&amp;nbsp;&lt;strong&gt;nrf_sdh_enable_request&lt;/strong&gt;() is called,&amp;nbsp;in this function, there is a call to&amp;nbsp;&lt;strong&gt;sd_softdevice_enable&lt;/strong&gt;() which is an SVC call. I noticed that this call transfers the program control to&amp;nbsp;&lt;strong&gt;vPortSVCHandler&lt;/strong&gt;() in port.c causing one of the RTOS task related to my application to start running and it looks like the &lt;strong&gt;softdevice_enable&lt;/strong&gt;() never completed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tried to see where the program control goes when &lt;span&gt;&lt;strong&gt;sd_softdevice_enable&lt;/strong&gt;() is called in one of the examples &lt;strong&gt;ble_app_hrs_freertos&lt;/strong&gt; and in this I see that the program control goes to memory location 0xAA4 and starts executing some instructions and control comes back &lt;strong&gt;nrf_sdh_enable_request&lt;/strong&gt;() after the instructions are executed. However, this does not happen in my case. So, I would like to understand the possible reason for the program control to go to&amp;nbsp;vPortSVCHandler() when SVCALL is called for enabling the SoftDevice.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Anusha&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397783?ContentTypeID=1</link><pubDate>Mon, 28 Nov 2022 07:20:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64ca4566-6421-4d13-9a2b-4d4ccc573994</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Ok,&amp;nbsp; this would be helpful so that I can understand if the issue is coming from my project or not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397747?ContentTypeID=1</link><pubDate>Sat, 26 Nov 2022 14:32:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95e26282-0107-4a70-8f26-2c54842f7124</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Anusha,&lt;/p&gt;
&lt;p&gt;Like I said I have never used systick as it needs HFCLK and all of my experiments were for lower power use case which needed me to use RTC and tickless idle. I can do a quick test on Monday to see if I see the same behavior as you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397334?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 09:00:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:900ec164-458c-4768-be2d-c42f50336d59</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Yes, from what I observed, calling&amp;nbsp;&lt;span&gt;nrf_sdh_enable_request() was causing sytick to not work anymore.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is it possible for you to share the modified BLE example with FreeRTOS using Systick so that I can check against my project and see what is missing or incorrect in my project?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding sharing the project, I am not sure if it is possible and will need to discuss this internally. Probably, will try to share a sample project where the issue is reproducible.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Anusha&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397309?ContentTypeID=1</link><pubDate>Thu, 24 Nov 2022 07:22:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c14f553d-aa94-483d-a224-929040fb4d32</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not able to reproduce this on a BLE example using FreeRTOS and systick instead of RTC with tickless disabled. Are you sure there it is this call that makes the Systick suspended? Are you sure there is no other call to any sleep function in your code. Can you please share your project so that I can test this at my end.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397151?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 11:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:682d021d-27ff-487b-a2e8-4e511cbad36c</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Thanks for your response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am not using tickless Idle in FreeRTOS as it&amp;#39;s not supported when using systick as seen in port_cmsis_systick.c:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669203821921v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Anusha&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/397139?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 11:20:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f38e128-95bb-4e96-971b-cd53a2fa9aaf</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;OK, if systick is clocked only when CPU is clocked then probably you are using tickless idle in freeRTOS that calls WFI to make the chip go to sleep mode? But that does not explain why the systick stops working on when BLE is enabled. Can you disable tickless idle mode in FreeRTOS if you have enabled it and check again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/396969?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 14:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7814aac8-05b1-4ae3-90ad-c54b4d3230b9</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Thanks for your response. However, it looks like I cannot use&amp;nbsp;&lt;span&gt;NVIC_GetEnableIRQ&amp;nbsp; to check systick interrrupt is enabled or disabled as it cannot be used with negative interrupt numbers. Systick interrupt has a value of -1.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669126847739v1.png" alt=" " /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This seems to be also mentioned here:&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/24057/nvic-check-if-irq-is-enabled"&gt;NVIC check if IRQ is enabled&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have also read that instructions WFE/WFI will also cause systick timer to stop. Ref:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/76759/wfi-instruction-stops-systick-timer"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/76759/wfi-instruction-stops-systick-timer&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However, I am not using these instructions in my multiprotocol application but are these instructions called by any of the SDK file related to BLE or Zigbee when I call&amp;nbsp;nrf_sdh_enable_request()?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/396954?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 13:56:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7dc823d8-e8ab-4675-b949-2a039b3b258f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Check if the&amp;nbsp;SysTick_IRQn is still enabled after the softdevice is enabled? I have a feeling that maybe the systick interrupt is being disabled after the softdevice.. You can use NVIC_GetEnableIRQ API to querry if a particular irq is enabled or not. Check if the interrupt is still enabled after the softdevice is enabled. If you find it disabled, then enable it after the softdevice is enabled. I have a feeling that softdevice might be disabling systick irq when it is initializing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/396873?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 11:41:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d78f964e-a554-415a-a929-8da401e724db</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;I checked if the function&amp;nbsp;&lt;strong&gt;xPortSysTickHandler&lt;/strong&gt;&amp;nbsp; in&amp;nbsp; port_cmsis_systick.c&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;which increments the tick count is called when softdevice is enabled. I noticed that this function is executed only if softdevice is not enabled.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1669111034453v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/396844?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 09:46:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b5c033a-0d46-4a9a-a130-23212f736b52</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am not sure, never tested systick along with BLE myself. Maybe when you enable softdevice it disables systick and clocks RTC instead? Can you check if the internal Systick counters are ticking just to check if it is still being enabled and clocked after softdevice is enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Hardfault with Zigbee initialisation when BLE SoftDevice is included.</title><link>https://devzone.nordicsemi.com/thread/396791?ContentTypeID=1</link><pubDate>Tue, 22 Nov 2022 05:59:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1015dcea-65d1-4837-bcfb-d27b9db5b844</guid><dc:creator>anusha_14</dc:creator><description>&lt;p&gt;I found that the cause for the hardfault was the execution of xQueueReceive function provided with a timeout value. If I make this timeout as 0, there is no hardfault. However, the RTOS tick does not increment. Note that RTOS tick source is coming from Systick. If I do not call &lt;span&gt;nrf_sdh_enable_request(), then the RTOC tick increments.&amp;nbsp;&lt;/span&gt;Could you please provide possible reason as to why the RTOS tick count doesn&amp;#39;t increase when I call&amp;nbsp;&lt;span&gt;nrf_sdh_enable_request()?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>