<?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>RTC fails to wake chip from SystemON Sleep nrf52840</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64765/rtc-fails-to-wake-chip-from-systemon-sleep-nrf52840</link><description>Hello, 
 
 We have a product that sends out an ESB message approximately ever second, it does this using the RTC timer with the following setting: 
 
 
 
 It sends the message then, goes into SystemOn sleep using the power manage function: 
 
 
 
 We</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Aug 2020 07:23:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64765/rtc-fails-to-wake-chip-from-systemon-sleep-nrf52840" /><item><title>RE: RTC fails to wake chip from SystemON Sleep nrf52840</title><link>https://devzone.nordicsemi.com/thread/264993?ContentTypeID=1</link><pubDate>Tue, 18 Aug 2020 07:23:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d442e36b-a075-4123-9b5f-f784847f6572</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Conner&lt;/p&gt;
[quote user="EMPConner562"]This is this first time i&amp;#39;m posting about the issue?[/quote]
&lt;p&gt;Seems so, yes. My point is that I can&amp;#39;t remember anyone else posting about similar issues either, so it&amp;#39;s not a known issue to us.&amp;nbsp;&lt;/p&gt;
[quote user="EMPConner562"]One other thing that I&amp;#39;ve since found out is that the ones in production were programmed with the nRFgo Studio, with Read back protection enabled. These are the devices that appear to have failed.[/quote]
&lt;p&gt;This might explain it. nRFgo Studio is very old, and is not recommended for use with the nRF5 series. I would strongly suggest using nrfjprog instead, and make sure you have up to date JLink drivers.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="EMPConner562"]I also enabled read back protection in the following way in code:[/quote]
&lt;p&gt;When writing to the flash it is important to check the state of the READY register before and after each operation. For reference I have included a code snippet from the system_nrf52840.c file to illustrate this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#if defined (CONFIG_GPIO_AS_PINRESET)
    if (((NRF_UICR-&amp;gt;PSELRESET[0] &amp;amp; UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos)) ||
        ((NRF_UICR-&amp;gt;PSELRESET[1] &amp;amp; UICR_PSELRESET_CONNECT_Msk) != (UICR_PSELRESET_CONNECT_Connected &amp;lt;&amp;lt; UICR_PSELRESET_CONNECT_Pos))){
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
        NRF_UICR-&amp;gt;PSELRESET[0] = 18;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
        NRF_UICR-&amp;gt;PSELRESET[1] = 18;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
        NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Ren &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
        while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy){}
        NVIC_SystemReset();
    }
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC fails to wake chip from SystemON Sleep nrf52840</title><link>https://devzone.nordicsemi.com/thread/264776?ContentTypeID=1</link><pubDate>Mon, 17 Aug 2020 08:27:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d31d394-161f-4481-9ebf-e6db71e95e20</guid><dc:creator>EMPConner562</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;This is this first time i&amp;#39;m posting about the issue?&lt;/p&gt;
&lt;p&gt;The battery is soldered in, so I&amp;#39;ve removed and then re-soldered the battery and the device didn&amp;#39;t start working again, with the one i tested.&lt;/p&gt;
&lt;p&gt;The voltage on the batteries is close to the nominal 3V.&lt;/p&gt;
&lt;p&gt;This is the RTC handler code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void rtc_handler(nrf_drv_rtc_int_type_t int_type)
{
    if (int_type == NRF_DRV_RTC_INT_COMPARE0)
    {
       nrfx_clock_hfclk_start();
       gpio_check_and_esb_tx();
       nrf_drv_rtc_counter_clear(&amp;amp;rtc);
       nrf_drv_rtc_cc_set(&amp;amp;rtc,0,COMPARE_COUNTERTIME * 8,true);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;One other thing that I&amp;#39;ve since found out is that the ones in production were programmed with the nRFgo Studio, with Read back protection enabled. These are the devices that appear to have failed. I also enabled read back protection in the following way in code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    if (NRF_UICR-&amp;gt;APPROTECT != 0x0)
    {
    NRF_NVMC-&amp;gt;CONFIG = 0x1;
    NRF_UICR-&amp;gt;APPROTECT = 0x0;
    NRF_NVMC-&amp;gt;CONFIG = 0x0;
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I have setup a test to see if enabling the read back protection in nRFgo Studio has any affect on the crash. I have programmed three devices one with segger, one with nRFgo without the read back protection, and one with nRFgo Studio with read back protection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;After letting these run from Wednesday, I have checked them again today and only the one programmed with nRFgo Studio with read back protection has stopped working. This could be a coincidence however I now believe this to be the issue.&lt;/p&gt;
&lt;p&gt;Is there any reason that you can think of that this might cause such an issue?&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Conner&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: RTC fails to wake chip from SystemON Sleep nrf52840</title><link>https://devzone.nordicsemi.com/thread/264554?ContentTypeID=1</link><pubDate>Fri, 14 Aug 2020 07:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2819201-00dd-41ba-b977-315607846ba9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t remember seeing reports of this issue earlier.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does it start working again if you remove and re-insert the battery?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the voltage over the batteries?&lt;/p&gt;
&lt;p&gt;Could you show me how the RTC interrupt is handled?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>