<?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>nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65723/nrf52840-hard-fault-issue</link><description>Hi All, 
 I am working on the nRF52840 Zigbee protocol and I am using nRF5_SDK_for_Thread_and_Zigbee_v3.0.0_d310e71 SDK. 
 With the help of engineers and other stuff, I am able to design my end product using Zigbee and Alexa communication. 
 My product</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Oct 2020 04:19:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65723/nrf52840-hard-fault-issue" /><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/275240?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 04:19:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89026ea8-2462-454e-93bb-80e7488a1c5b</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thank you for the response.&lt;/p&gt;
&lt;p&gt;I will do the necessary changes and test the same using only 2 timers (timer 2 and timer4). Hope this time it works without any problems.&lt;/p&gt;
&lt;p&gt;Let you know my result once testing is done.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much for your constant help :)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/275114?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 13:19:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e5a58f4-d059-4013-87f7-bf501f580448</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;That is correct Rohit!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274986?ContentTypeID=1</link><pubDate>Thu, 15 Oct 2020 07:18:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71f3c1a2-f00d-4aa4-a2e4-82ba74b7a7cb</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Okay, thank you so much for the feedback.&lt;/p&gt;
&lt;p&gt;This means, in Zigbee-related development, we can not use timer 0, timer 1, and timer 3. Am I correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274876?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 12:05:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ddf92c1-de32-43e7-a3e1-0096d7c084fd</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Rohit&lt;/p&gt;
&lt;p&gt;Seems like you&amp;#39;re onto something here. The 802.15.4 Radio driver seems to be using TIMER0 and TIMER1, which would explain a lot of the issues you&amp;#39;ve been having it seems. I was sure I asked some Zigbee experts about this internally, but it seems to have flown over our heads. If you check out &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fthread_zigbee__intro.html&amp;amp;anchor=thread_zigbee_hardware_requirements_zigbee"&gt;the Zigbee peripheral requirements&lt;/a&gt; you can see a table of all the resources used by the Zigbee and 802.15.4 radio driver.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274800?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 07:55:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:675849c6-0b3f-4f01-b616-629c45aaff57</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Okay, Thank you so much for clearing the points.&lt;/p&gt;
&lt;p&gt;Also, I have observed one more thing, I might be wrong in this case but just observation.&lt;/p&gt;
&lt;p&gt;As I explained I am doing 2 projects which is similar and in both project, I am using same ZCD and Trimer method to control the brightness of LED/bulb.&lt;/p&gt;
&lt;p&gt;As I told my current version code also got into hard fault handler after 4 hours on Dev-kit as well as on Custom hardware. And my previous hardware also uses to stuck in a hard fault handler. And in both projects, I am using timer 0 for some controlling functionality. What I suspect is Timer 0 is the one causing the issue. I&amp;nbsp; am not sure, my assumption might be wrong. &lt;/p&gt;
&lt;p&gt;I am saying timer 0 might the issue because in current version of project I have conducted one test case. Here, what I did is I have just removed the timer 0 from my project and used timer 2 and timer 4 only for my controlling part and the code worked on Dev-kit for 6hours though I have not tested it completely by running 24hours but my observation after commenting timer0 part for code, the code run for 2hours extra time. So this might be the issue. But again I have not tested it for long time. It is jsut observation.&lt;/p&gt;
&lt;p&gt;Let me know your views on this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274770?ContentTypeID=1</link><pubDate>Wed, 14 Oct 2020 06:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82855ba4-c5f3-4977-a952-09e7b58e276a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Correct, Rohit!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274547?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 09:28:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:044fc099-0e03-4167-ad3c-004e02a80bd2</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Okay, thank you for the response,&lt;/p&gt;
&lt;p&gt;And timer 3 also used by Zigbee stack If I am not wrong because In my earlier phase when I started using nRF for my project. The below statement was stated by one of your engineers when I was configuring timer in Zigbee.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;&amp;quot;It seems your timer3 is using one of the timers ZB_INIT() is trying to initialize, which causes a halt. This is because the&amp;nbsp;nrf_drv_timer_t TIMER_LED = NRF_DRV_TIMER_INSTANCE(3);&amp;nbsp;tries to use the same timer instance as the ZIGBEE_TIMER_INSTANCE_NO uses in sdk_config.h.&amp;quot;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;- So timer 1 and timer 3 are reserved in Zigbee. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274541?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 09:19:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:220ea079-8f7d-423f-a103-40894915c79c</guid><dc:creator>Simonr</dc:creator><description>[quote user="Rohit Rajapure"]It is already there I guess[/quote]
&lt;p&gt;&amp;nbsp;Indeed, you&amp;#39;re right, this is part of the Zigbee stack it seems, sorry about that! The Zigbee stack uses Timer1 already in nRF examples for timing beacon intervals, which explains why you&amp;#39;re not able to use it like the other timers.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274449?ContentTypeID=1</link><pubDate>Tue, 13 Oct 2020 04:55:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d24e77af-3183-4ee9-9f5b-4eaddef26016</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon, &lt;/p&gt;
&lt;p&gt;Thank you for the feedback,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/274262#274262"]1. You can do this by setting the NRF_LOG_BACKEND_UART_TX_PIN to a GPIO that is free in your project (I see that you have already set P0.10 as the TX pin in your project. This pin is reserved for the NFC antenna, so I suggest using another one, or set&amp;nbsp;&lt;strong&gt;&lt;code&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/code&gt;&amp;nbsp; &lt;/strong&gt;in your preprocessor definitions to use this pin as a regular GPIO. You also have to set&amp;nbsp;NRF_LOG_BACKEND_UART_ENABLED to 1 in the sdk_config.h.[/quote]
&lt;p&gt;- Okay, I will follow this step and get back to you&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/274262#274262"]What is TIMER1 used for in line 100 in the &lt;strong&gt;zb_nrf52840_timer.c&lt;/strong&gt; file in your project?[/quote]
&lt;p&gt;- Sorry, but I do not know, It is already there I guess and I have not checked these files previously or not even edited. Maybe it by default in&amp;nbsp; SDK&amp;#39;s light_bulb example and editing in main.c file other than that no other files where edited. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274262?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 10:52:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d669c5a6-4fb7-470a-8601-98aae92e4f9d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Rohit&lt;/p&gt;
&lt;p&gt;1. You can do this by setting the NRF_LOG_BACKEND_UART_TX_PIN to a GPIO that is free in your project (I see that you have already set P0.10 as the TX pin in your project. This pin is reserved for the NFC antenna, so I suggest using another one, or set&amp;nbsp;&lt;strong&gt;&lt;code&gt;CONFIG_NFCT_PINS_AS_GPIOS&lt;/code&gt;&amp;nbsp; &lt;/strong&gt;in your preprocessor definitions to use this pin as a regular GPIO. You also have to set&amp;nbsp;NRF_LOG_BACKEND_UART_ENABLED to 1 in the sdk_config.h.&lt;/p&gt;
&lt;p&gt;2. What is TIMER1 used for in line 100 in the &lt;strong&gt;zb_nrf52840_timer.c&lt;/strong&gt; file in your project?&lt;/p&gt;
&lt;p&gt;3. Thank you for clarifying.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/274192?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 07:22:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91378bc5-c3d6-4197-9ede-b665da10e07c</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/273690#273690"]Can you try editing the HardFault_process() function to process logs instead of rebooting. Replacing line 56-60 in &lt;strong&gt;hardfault_implementation.c&amp;nbsp;&lt;/strong&gt;to the following should do the trick, assuming that you have enabled logging in your application. Can you upload the log information processed here so we can take a look?[/quote]
&lt;p&gt;- I have disabled the log because I am using P0_6 and P0_8 in my project, one as input and another one as output. I need to enable another UART pins and check the logs. Can you please share how to enable other pins as UART pin and test it. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/273690#273690"]As for&amp;nbsp;the TIMER1 issue, I don&amp;#39;t see any reason that this should behave different to the other timers. The only place it is mentioned in your project (0.9.6.1) where the others aren&amp;#39;t is at line 100 in zb_nrf52840_timer.c, what are you using it for there?[/quote]
&lt;p&gt;- I did not understand it clearly. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/273690#273690"]Are you able to see this behavior on more than one board? I tested Timer1 on a DK on my side, and I can&amp;#39;t see any deviation when setting it to trig every 10 ms.[/quote]
&lt;p&gt;- I have 3 boards and all are new but I am getting the same result. If I enable it for 10msec or either in 1sec also timer 1 not giving me the expected result. &lt;/p&gt;
&lt;p&gt;- If you have that code where timer 1 is enabled as 10msec in Zigbee light _bulb code then please share it I will compare it in my code.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/273690?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 10:48:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad3e5753-07f6-47c9-a69d-2845479d27f1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi again Rohit&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry, but it&amp;#39;s taking more time than expected finding these stack pointer values than anticipated. Can you try editing the HardFault_process() function to process logs instead of rebooting. Replacing line 56-60 in &lt;strong&gt;hardfault_implementation.c&amp;nbsp;&lt;/strong&gt;to the following should do the trick, assuming that you have enabled logging in your application. Can you upload the log information processed here so we can take a look?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;__WEAK void HardFault_process(HardFault_stack_t * p_stack)
{
    // Restart the system by default
    //NVIC_SystemReset();
    while (true)
    {
      NRF_LOG_PROCESS();
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;As for&amp;nbsp;the TIMER1 issue, I don&amp;#39;t see any reason that this should behave different to the other timers. The only place it is mentioned in your project (0.9.6.1) where the others aren&amp;#39;t is at line 100 in zb_nrf52840_timer.c, what are you using it for there? Are you able to see this behavior on more than one board? I tested Timer1 on a DK on my side, and I can&amp;#39;t see any deviation when setting it to trig every 10 ms.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/273608?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 04:03:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:418ea458-398b-4f19-8077-08ccbfb97fd8</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Simon,&lt;/p&gt;
&lt;p&gt;Thanks for the response,&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/273506#273506"]I&amp;#39;m sorry about the late reply, but Susheel is out of office for the time being, so I&amp;#39;ve been tasked to look into this while he is away. I will get back to you regarding these stack pointer values as I&amp;#39;ll have to ask internally for what exactly these&amp;nbsp;points to, hopefully I&amp;#39;ll get back to you tomorrow.[/quote]
&lt;p&gt;- Okay, please let me know &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/273506#273506"]2. Timer 1 is not enabled by default in the light_bulb example, so it shouldn&amp;#39;t be used for anything else as far as I know. What happens when you try to configure Timer1 as a 10ms timer, do you see some kind of error? Have you enabled TIMER1_ENABLED in sdk_config.h? Also, please make sure that Timer1 is not used anywhere else in your project.[/quote]
&lt;p&gt;- Ya, I have enabled in sdk_config.h file as done for timer 2 and timer 4. I have followed the same way as done for timer 2 and timer 4 to configure timer 1 but if I run the code, I should get interrupted for every 10msec but I am getting some random amount of time to interrupt example 5sec/10sec. &lt;/p&gt;
&lt;p&gt;- Then I thought let&amp;#39;s configure the same timer (timer 1) for 5sec and check but there also the same it not running as expected.&lt;/p&gt;
&lt;p&gt;- I tried to search in code whether it is already used somewhere or not, but I could not found any relevant data regarding this. If you know then please let me know is it already used or not?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/273506?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 13:05:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea555ca8-e1d8-4877-bb81-96052afe5cb1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Rohit&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sorry about the late reply, but Susheel is out of office for the time being, so I&amp;#39;ve been tasked to look into this while he is away. I will get back to you regarding these stack pointer values as I&amp;#39;ll have to ask internally for what exactly these&amp;nbsp;points to, hopefully I&amp;#39;ll get back to you tomorrow.&lt;/p&gt;
&lt;p&gt;As for the questions in your latest reply:&lt;/p&gt;
&lt;p&gt;1. You do not have to define both TIMER0_ENABLED and NRFX_TIMER0_ENABLED, as these defines are taken care of in &lt;strong&gt;apply_old_config.h&lt;/strong&gt; and NRFX_TIMER0_ENABLED will be set equal to TIMER0_ENABLED in this case. The same goes for timers 2 and 4 as well.&lt;/p&gt;
&lt;p&gt;2. Timer 1 is not enabled by default in the light_bulb example, so it shouldn&amp;#39;t be used for anything else as far as I know. What happens when you try to configure Timer1 as a 10ms timer, do you see some kind of error? Have you enabled TIMER1_ENABLED in sdk_config.h? Also, please make sure that Timer1 is not used anywhere else in your project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/271514?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2020 12:37:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c831009-bcb4-478f-a6e8-865557a1a840</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;There is one more bad news or facing the same problem.&lt;/p&gt;
&lt;p&gt;As I told in a previous post or my last ticket, I am developing another project and which also similar to the current device based on ZCD (Zero cross detection) and Timer using Zigbee to control bulb brightness.&lt;/p&gt;
&lt;p&gt;My first phase is developed using ZCD and Timer for controlling brightness it has been observed that in the new version of the device also I am facing a hard fault issue after 4/5 hours. After 4/5 hours fixed device stops responding.&lt;/p&gt;
&lt;p&gt;Attached in the hard fault screenshot.&lt;/p&gt;
&lt;p&gt;And I think for both my project ( both versions of devices) causing the same issue which results in hard fault after a few hours. But I am unable to trace back and slove it.&lt;/p&gt;
&lt;p&gt;It will be very helpful for me if you guide me to trace my issue. please let me know the steps or guide to trace the same.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/hard-fault-0.9.9.21.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;And, I have some question please help me with it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1) in sdk_config.h file,&amp;nbsp; #define TIMER0_ENABLED 1 like this I have done for timer 2 and timer 4 which I am using in my project.&amp;nbsp; And in same file I can see that #define NRFX_TIMER0_ENABLED 0 also present for all timers so do I need to enable this also?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2)&lt;/strong&gt; &lt;strong&gt;Instead of timer 0, I tried to configure timer 1 for 10msec but I am not able to configure it for 10msec. &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;below is snippet which I followed to configure timer0, timer2 and timer4 as 10msec timer,&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
    timer_cfg.frequency = 4; //set frequency 1MHz  
    err_code = nrf_drv_timer_init(&amp;amp;TIMER_1, &amp;amp;timer_cfg, timer1_event_handler);
    if (err_code != NRF_SUCCESS)
    {
        // handle error condition
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;If I follow same configuration for timer 1 then I am unable to configure it for 10msec. Can you please let me know what is the problem for timer 1 configuration or how to configure it for 10msec?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Let me know your feedback.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/270833?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 12:06:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ca50c43-6a6f-4ae3-ae5c-5693f2bae188</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply,&lt;/p&gt;
&lt;p&gt;As per your suggestion, what i did is in 0.9.6.1 version firmware I have used nrf_drv_timer_disable(&amp;amp;Timer0) and kept timer 0 as one shot timer using nrf_drv_timer_compare().&lt;/p&gt;
&lt;p&gt;And I am able to execute the timer0&amp;#39;s event handler, means statements inside handler function as explained in previous post.&lt;/p&gt;
&lt;p&gt;So I kept the dev-kit running with above configuration but after 4 hour it enters into hard fault handler. Below are the attached screen shot of the same.&lt;/p&gt;
&lt;p&gt;1st is when code enters into hard fault handler and 2nd is when I again run the code using step over command.&lt;/p&gt;
&lt;p&gt;Please check the CPU window and it&amp;#39;s SP, LR, and register values and let me know based on this what could be the issue. Or how to figure out the problem.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hard-fault-2.zip"&gt;devzone.nordicsemi.com/.../hard-fault-2.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/269273?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 04:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2fbb3a7f-5710-4d55-841d-118227d108c3</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/268995"]The timer is still running keeping the HFCLK active. If you do not need the timer it is best practice to disable it. the callback is still only called once even if you DO NOT disable it, but i recommend you to disable the timer if you do not need to use it again for considerable amount of time.[/quote]
&lt;p&gt;- Okay, I will disable it and check the result. &lt;/p&gt;
&lt;p&gt;- I will get back to you once I test all the suggested points.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the update&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/268995?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 13:10:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69ed5952-5627-40a4-9a9c-87ce5bfafa99</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="Rohit Rajapure"]1) If I configure timer using&amp;nbsp; &lt;em&gt;&lt;strong&gt;nrf_drv_timer_compare&lt;/strong&gt;&lt;/em&gt; instead of &lt;em&gt;&lt;strong&gt;nrf_drv_timer_extended_compare &lt;/strong&gt;&lt;/em&gt;this then I need not call &lt;em&gt;&lt;strong&gt;nrf_drv_timer_disable&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt; &lt;/strong&gt;in the timer handler.&lt;em&gt; &lt;/em&gt;As per my understanding if we configured one shot then there is no need to call disable the function. Am I correct?[/quote]
&lt;p&gt;&amp;nbsp;The timer is still running keeping the HFCLK active. If you do not need the timer it is best practice to disable it. the callback is still only called once even if you DO NOT disable it, but i recommend you to disable the timer if you do not need to use it again for considerable amount of time.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Rohit Rajapure"]- If my above statement is correct, then I am working on another project where I have used a timer 2 as a one-shot timer there I observed that my bulb is flickering after configuring one shot. (Basically, my other project is the next version of Zigbee base Dimming control which also has similar logic as the current one)[/quote]
&lt;p&gt;&amp;nbsp;The normal practice is that you disable it and when you need to activate it again you call&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;nrfx_timer_compare&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;nrfx_timer_clear&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;m_timer);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;nrfx_timer_enable&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;&lt;/span&gt;&lt;span&gt;m_timer)&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/268912?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 10:08:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfd69a46-59c7-4247-afb1-2f5531e8ae24</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
&lt;p&gt;Thanks for the feedback.&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/268878"]I would suggest that you take the version 0.9.4 and change the&amp;nbsp;&lt;em&gt;&lt;strong&gt;nrf_drv_timer_extended_compare&amp;nbsp;&lt;/strong&gt;to&amp;nbsp;&lt;strong&gt;nrf_drv_timer_compare&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;keeping everything else same.[/quote]
&lt;p&gt;- Okay, I will compare and make the suggested changes keeping the rest things the same. &lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One more doubt clears me If doing something wrong.&lt;/p&gt;
&lt;p&gt;1) If I configure timer using&amp;nbsp; &lt;em&gt;&lt;strong&gt;nrf_drv_timer_compare&lt;/strong&gt;&lt;/em&gt; instead of &lt;em&gt;&lt;strong&gt;nrf_drv_timer_extended_compare &lt;/strong&gt;&lt;/em&gt;this then I need not call &lt;em&gt;&lt;strong&gt;nrf_drv_timer_disable&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt; &lt;/strong&gt;in the timer handler.&lt;em&gt; &lt;/em&gt;As per my understanding if we configured one shot then there is no need to call disable the function. Am I correct?&lt;/p&gt;
&lt;p&gt;- If my above statement is correct, then I am working on another project where I have used a timer 2 as a one-shot timer there I observed that my bulb is flickering after configuring one shot. (Basically, my other project is the next version of Zigbee base Dimming control which also has similar logic as the current one)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please correct me If I am wrong.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/268878?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 08:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aa24e72-5ca0-4663-82ac-43c8762df30e</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Rohit,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have run some tests and it seems that the timer runs well in the one shot mode. I tested this in Zigbee/BLE and stand alone mode.&lt;/p&gt;
&lt;p&gt;There are many changes in your code from 0.9.4 compared to 0.9.6.1&amp;nbsp; and are not just the change related to to timer.&lt;/p&gt;
&lt;p&gt;I would suggest that you take the version 0.9.4 and change the&amp;nbsp;&lt;em&gt;&lt;strong&gt;nrf_drv_timer_extended_compare&amp;nbsp;&lt;/strong&gt;to&amp;nbsp;&lt;strong&gt;nrf_drv_timer_compare&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;keeping everything else same.&lt;/p&gt;
&lt;p&gt;I am sure that if the extended work in 0.9.4, then the one shot will also work just fine. We cannot compare two difference code versions and narrow down the problem to just the timer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/268837?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 05:57:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2691e5c5-ebae-423e-870c-e2eff767fc3b</guid><dc:creator>Rohit Rajapure</dc:creator><description>&lt;p&gt;Hi Susheel,&lt;/p&gt;
[quote userid="6207" url="~/f/nordic-q-a/65723/nrf52840-hard-fault-issue/268763"]The above sentence is not clear what it means. What do you mean the interrupt routine is not executing? how are you verifying this?[/quote]
&lt;p&gt;- I think you only had suggested &amp;quot;&lt;em&gt;&lt;strong&gt;configure timer 0 as one-shot timer using nrf_drv_timer_compare() instead of nrf_drv_timer_extended_compare() as your disabling it in interrupt handler&lt;/strong&gt;&lt;/em&gt;&amp;quot; . So per your suggestion only I made respective changes but unfortunately when I kept &amp;quot;Breakpoint&amp;quot; inside &lt;em&gt;&lt;/em&gt;this function &lt;em&gt;&lt;strong&gt;&amp;quot;void timer0_event_handler(nrf_timer_event_t event_type, void* p_context)&amp;quot;, &lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;the statement inside this functions not executing in fact code never stopped at a breakpoint.&lt;/p&gt;
&lt;p&gt;I hope this clears my points. In my last post also I was explaining Simon the thing.&lt;/p&gt;
&lt;p&gt;looking for a positive response from your side.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards&lt;/p&gt;
&lt;p&gt;Rohit R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 Hard fault issue</title><link>https://devzone.nordicsemi.com/thread/268763?ContentTypeID=1</link><pubDate>Wed, 09 Sep 2020 13:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:836c6360-0bf6-4a04-a429-b66258368ff0</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Rohit,&lt;/p&gt;
[quote user=""]The result - While testing this device after 6 to 8 hours it enters into the hard fault handler we tried to figure out the issue but still no success.[/quote]
&lt;p&gt;I remember your old case which my colleague Simon was looking into. We were not allowed to plug in your device into our sockets for security reasons.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First thing is that &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/27014/how-can-i-distinguish-the-reason-for-hardfault"&gt;hardfaults &lt;/a&gt;are traceable (if the stack is not corrupt). Since we cannot reproduce or run your hardware in our premises, we cannot debug that for you. Can you please refresh me what was your hardfault debugging results? Timers from SDK are well tested and mature libraries.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]After his suggestion, configured Timer 0 (which I am using in my project as a one-shot) but its interrupt routine means timer 0&amp;#39;s interrupt routine not executing[/quote]
&lt;p&gt;The above sentence is not clear what it means. What do you mean the interrupt routine is not executing? how are you verifying this?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>