<?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 sometimes won&amp;#39;t wake up.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102889/nrf52840-sometimes-won-t-wake-up</link><description>Hi, 
 
 I&amp;#39;m using nRF52840 with nRF Connect SDK v2.2.0. 
 I need my device to go to sleep and wake up after a button press. 
 I followed &amp;quot;system_off&amp;quot; example. 
 In my main function I have this snippet: 
 
 
 Then I initialize GPIO and P0.25 (button line</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 27 Sep 2023 05:33:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102889/nrf52840-sometimes-won-t-wake-up" /><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/447849?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2023 05:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b12707e-1123-49f1-832b-3287fc073a75</guid><dc:creator>david4255334</dc:creator><description>&lt;p&gt;Seems like this concludes the discussion.&lt;/p&gt;
&lt;p&gt;Thank you guys for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/447079?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2023 12:48:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1f62935-ab81-4ba2-acb5-5f6082828773</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for trying, then I guess it&amp;nbsp;likely is related to requirement that Runar suggested earlier: &amp;quot;Before entering System OFF mode, all on-going EasyDMA transactions need to have completed. See peripheral specific chapters for more information about how to acquire the status of EasyDMA transactions.&amp;quot;&amp;nbsp;This requirement can for instance be ensured by disabling bt stack before going to system OFF, alternatively just stop advertisment and disconnect any potential link before entering system OFF.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/447005?ContentTypeID=1</link><pubDate>Thu, 21 Sep 2023 09:01:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5aad382-a63b-4ab0-a505-c9ea46f62329</guid><dc:creator>david4255334</dc:creator><description>&lt;p&gt;Hi Kenneth,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;After programming the&amp;nbsp;&lt;span&gt;nRF52840DK, and before running the test, I always switch the DK off, unplug and plug the USB cable back in.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding proposed modifications, here&amp;#39;s the results:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mod 1:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    for (int i = 5; i &amp;gt;= 0; --i) {
        k_sleep(K_MSEC(1000));
        printk(&amp;quot;Shutting down the system in %d seconds (w/ __disable_irq();)...\n&amp;quot;, i);
    }

    // When bt_disable() is called, there is no wakeup issue.
    // bt_disable();
    
    gpio_pin_set(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, 1);
    __disable_irq();
    pm_state_force(0u, &amp;amp;(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0, 0});

err:
    while (1) {
        k_sleep(K_MSEC(2000));
        printk(&amp;quot;Error. Infinite loop reached\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This resulted in failure to enter OFF state. I observed &amp;quot;Error. Infinite loop reached&amp;quot; logs running very fast, without 2000 ms delay, as most likely disabled interrupts make the scheduler nonfunctional.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mod 2:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    for (int i = 5; i &amp;gt;= 0; --i) {
        k_sleep(K_MSEC(1000));
        printk(&amp;quot;Shutting down the system in %d seconds (w/NRF_POWER-&amp;gt;SYSTEMOFF = 1;)...\n&amp;quot;, i);
    }

    // When bt_disable() is called, there is no wakeup issue.
    // bt_disable();
    
    gpio_pin_set(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, 1);
    NRF_POWER-&amp;gt;SYSTEMOFF = 1;

err:
    while (1) {
        k_sleep(K_MSEC(2000));
        printk(&amp;quot;Error. Infinite loop reached\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The board got stuck after several minutes&amp;nbsp;from starting the test. It won&amp;#39;t wake up.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mod 3:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    for (int i = 5; i &amp;gt;= 0; --i) {
        k_sleep(K_MSEC(1000));
        printk(&amp;quot;Shutting down the system in %d seconds (w/ __disable_irq(); and NRF_POWER-&amp;gt;SYSTEMOFF = 1;)...\n&amp;quot;, i);
    }

    // When bt_disable() is called, there is no wakeup issue.
    // bt_disable();
    
    gpio_pin_set(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, 1);
    __disable_irq();
    NRF_POWER-&amp;gt;SYSTEMOFF = 1;

err:
    while (1) {
        k_sleep(K_MSEC(2000));
        printk(&amp;quot;Error. Infinite loop reached\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Same here,&amp;nbsp;stuck after&amp;nbsp;several minutes&amp;nbsp;from starting the test.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/446839?ContentTypeID=1</link><pubDate>Wed, 20 Sep 2023 11:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c07a8cf3-d990-465f-831c-4925d26af61f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Two questions from me:&lt;/p&gt;
&lt;p&gt;- Do you power cycle the nRF52840DK after programming the board and before executing testing? This to ensure the chip is not in debug interface mode (which is not proper system OFF, but emulated system OFF). That is kind of the only thing I can think of that may cause this to fail.&lt;/p&gt;
&lt;p&gt;- Is there any difference if&amp;nbsp;you add a&amp;nbsp;&lt;span&gt;__disable_irq&lt;/span&gt;&lt;span&gt;(); before&amp;nbsp;pm_state_force()? What if you use NRF_POWER-&amp;gt;SYSTEMOFF=1; directly instead of&amp;nbsp;pm_state_force().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/445543?ContentTypeID=1</link><pubDate>Tue, 12 Sep 2023 08:13:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a2cf55b-9f1b-4215-9fd2-9d0076fe140c</guid><dc:creator>david4255334</dc:creator><description>&lt;p&gt;Hi Runar,&lt;/p&gt;
&lt;p&gt;I finally found some time to prepare a simple project running on nRF52840dk.&lt;/p&gt;
&lt;p&gt;I was able to reproduce the wake-up issue in the setup running on the DK. Same situation here - disabling BLE before going to sleep fixes the problem.&lt;/p&gt;
&lt;p&gt;Please find below the source code. There are only 3 files, but if you need a zip file, let me know then I can attach it as well.&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;there are any new findings or better (proper?) ways to overcome this wake-up&amp;nbsp;issue, then please let me know.&lt;/p&gt;
&lt;p&gt;nrf52_wakeup_issue/src/main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// nrf52_wakeup_issue/src/main.c
/* How to reproduce:
Power the DK via J3 micro USB.
After DK goes to sleep for the first time, start Arduino code and immediatelly connect THE_PIN to the Button 4 of DK.
Keep running for a while until DK won&amp;#39;t wake up.

I did this test 4 times:
1. won&amp;#39;t wake up after 12 min
2. won&amp;#39;t wake up after 16 min
3. won&amp;#39;t wake up after 3 min
4. won&amp;#39;t wake up after 35 min

Arudino Mega board
Code simulating pressing the button after DK goes to sleep

#define THE_PIN 53

void setup() {
    pinMode(THE_PIN, INPUT);
    Serial.begin(9600);
    Serial.println(&amp;quot;Start&amp;quot;);
    delay(10000);
}
int counter = 0;
void loop() {
    digitalWrite(THE_PIN, LOW);
    pinMode(THE_PIN, OUTPUT);
    Serial.println(&amp;quot;Low for 100 ms&amp;quot;);
    delay(100);

    // Wait until the board wakes up and goes to sleep again
    pinMode(THE_PIN, INPUT);
    Serial.println(&amp;quot;Float for 10 seconds&amp;quot;);
    delay(10000);
}

 */
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/drivers/gpio.h&amp;gt;
#include &amp;lt;zephyr/devicetree.h&amp;gt;
#include &amp;lt;hal/nrf_gpio.h&amp;gt;
#include &amp;lt;zephyr/pm/pm.h&amp;gt;
#include &amp;lt;zephyr/bluetooth/bluetooth.h&amp;gt;
#include &amp;lt;zephyr/settings/settings.h&amp;gt;

static const struct bt_data ad_[] = {
    BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
    BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

static const struct bt_data sd_[] = {
    BT_DATA(BT_DATA_NAME_COMPLETE, CONFIG_BT_DEVICE_NAME, sizeof(CONFIG_BT_DEVICE_NAME) - 1),
};

void main(void) {
    gpio_pin_configure(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, GPIO_OUTPUT_HIGH); // LED3 on DK
    gpio_pin_configure(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 25, GPIO_INPUT | GPIO_PULL_UP); // BUTTON4 on DK
    nrf_gpio_cfg_sense_set(25, NRF_GPIO_PIN_SENSE_LOW);
    gpio_pin_set(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, 0);

    if (bt_enable(NULL)) {
        printk(&amp;quot;bt_enable() failed\n&amp;quot;);
        goto err;
    }

    if (bt_le_adv_start(BT_LE_ADV_CONN, ad_, ARRAY_SIZE(ad_), sd_, ARRAY_SIZE(sd_))) {
        printk(&amp;quot;bt_le_adv_start() failed\n&amp;quot;);
        goto err;
    }

    for (int i = 5; i &amp;gt;= 0; --i) {
        k_sleep(K_MSEC(1000));
        printk(&amp;quot;Shutting down the system in %d seconds...\n&amp;quot;, i);
    }

    // When bt_disable() is called, there is no wakeup issue.
    // bt_disable();
    
    gpio_pin_set(DEVICE_DT_GET(DT_NODELABEL(gpio0)), 15, 1);
    pm_state_force(0u, &amp;amp;(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0, 0});

err:
    while (1) {
        k_sleep(K_MSEC(2000));
        printk(&amp;quot;Error\n&amp;quot;);
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrf52_wakeup_issue/CMakeLists.txt:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# nrf52_wakeup_issue/CMakeLists.txt
cmake_minimum_required(VERSION 3.20.0)
# list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set_property(GLOBAL PROPERTY CSTD c11)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(wakeup_test)
file(GLOB APPLICATION_SOURCES src/main.c)
target_sources(app PRIVATE ${APPLICATION_SOURCES})
target_include_directories(app PRIVATE src)&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrf52_wakeup_issue/prj.conf:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;# nrf52_wakeup_issue/prj.conf
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_BT=y
CONFIG_NEWLIB_LIBC=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SMP=y
CONFIG_PM_DEVICE=y
CONFIG_NEWLIB_LIBC_MIN_REQUIRED_HEAP_SIZE=2048&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/442212?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2023 08:00:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4432b92c-449c-46c1-b76b-422f79e20cc4</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Thanks for the good explantion, I have forwarded the information to the dev teams for further input.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is one other thing we can check out. From the PS of the 52840 it states the following:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;Before entering System OFF mode, all on-going EasyDMA transactions need to have completed. See peripheral specific chapters for more information about how to acquire the status of EasyDMA transactions.&amp;quot;&lt;/p&gt;
&lt;div&gt;The BLE stack uses DMA, so it might be that the stars align and it&amp;#39;s powered down during advertisment. I have talked with a few collegues regarding what will happen&amp;nbsp; if this occure, and there was no clear answare.&amp;nbsp;&lt;/div&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fpower.html&amp;amp;cp=5_0_0_4_2_2&amp;amp;anchor=unique_220399309"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/442032?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 08:19:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc4a58e0-824b-49d3-bf04-353e68bf2478</guid><dc:creator>david4255334</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;Runar,&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m sorry, I did not make it clear - the code is running on our custom PCB that has nRF52840 on it. We power it from USB, and then the USB power goes through the power supply management chip to the nRF.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I&amp;#39;ll find out if I can prepare some small code that can reproduce it. But I would need to see if this can be reproduced on the DK.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I added code that immediately reads RESETREAS register after startup and saves it in a variable for printing it later. I do not clear RESETREAS register.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;helpers/nrfx_reset_reason.h&amp;gt;
static uint32_t reason___ = 0;
reason___ = nrfx_reset_reason_get();
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Shutdown code
const int ble_disable_err = bt_disable();
if (ble_disable_err) {
    NVIC_SystemReset();
}
k_sleep(K_MSEC(1000));
PowerSupply_vSys5vDisable();
pm_state_force(0u, &amp;amp;(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0, 0});
k_sleep(K_SECONDS(2U));
NVIC_SystemReset();&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With the code below, after wakeup, RESETREAS is equal to&amp;nbsp;0x00010000,&amp;nbsp;indicating &amp;quot;Reset due to wake up from System OFF mode when wakeup is triggered from DETECT signal from GPIO&amp;quot;. As expected.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then, I run exactly&amp;nbsp;the same code with only one&amp;nbsp;change - remove first 4 lines that disable BLE.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Shutdown code
//const int ble_disable_err = bt_disable();
//if (ble_disable_err) {
//    NVIC_SystemReset();
//}
k_sleep(K_MSEC(1000));
PowerSupply_vSys5vDisable();
pm_state_force(0u, &amp;amp;(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0, 0});
k_sleep(K_SECONDS(2U));
NVIC_SystemReset();&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;After many sleep-wakeup cycles, I expect the issue to occur again. I checked the logs with RESETREAS and there was one entry that instead&amp;nbsp;0x00010000 is showing&amp;nbsp;0x00010002, that indicates the&amp;nbsp;reset from watchdog, which confirms what I wrote in the previous post.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This is why in the old version of the code, without watchdog configured, the board was bricked. It somehow got stuck and without watchdog nothing could be done.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/442021?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 07:34:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:750d7c82-9787-4c5e-b50b-f5fdf02e2bb4</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi David&lt;/p&gt;
&lt;p&gt;its unfortunate that you can&amp;#39;t upload the project, it would make it eaiser for me to help you find the root cause. If I make this case private it would be&amp;nbsp;c&lt;span&gt;onfidential between you, Nordic Semiconductor and your chosen distributor(non in this case). Do you think you are able to create a small dummy version of the code?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you say powered over USB, which usb port are you using? If you are using J2 then the debugger is powered on&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&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/2845.pastedimage1692343825098v4.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regarding power measurement and how to prepear the DK we have a section on it on our &lt;a href="https://infocenter.nordicsemi.com/topic/ug_nrf52840_dk/UG/dk/hw_measure_current.html"&gt;infocenter&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The sleep current sounds very high for a sleep in my opinon, but its hard to say for sure when I&amp;#39;m nore sure about what&amp;#39;s beeing measured.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What log options have you enabled?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;As for the rest I need to investigate a bit and get back to you. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the update&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/441996?ContentTypeID=1</link><pubDate>Fri, 18 Aug 2023 05:22:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55593201-ed0a-417a-a9fe-4055c90f3827</guid><dc:creator>david4255334</dc:creator><description>&lt;p&gt;Hi Runar,&lt;/p&gt;
&lt;p&gt;thank you for you quick reply.&lt;/p&gt;
&lt;p&gt;Unfortunately, I cannot upload the project.&lt;/p&gt;
&lt;p&gt;When it comes to logs, when it&amp;#39;s stuck, I see nothing int the console. No system logs, and no logs from my application. I&amp;#39;ve never tweaked the OS logs to a custom setting, but I guess that system error logs would be printed by default.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When performing the tests, my debugger is always disconnected. The board is only powered from USB.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When it comes to current, there is no way to measure the current consumed by nRF only. When we put the board to sleep, we power off most of the power rails, byt there are still some components that are powered on. And the consumption is still a couple of mA even in the sleep mode.&lt;/p&gt;
&lt;p&gt;However, I connected the USB power meter&amp;nbsp;(Fnirsi FNB58) between&amp;nbsp;the power source and USB connector of the board to compare the consumption when it goes to sleep correctly and when it hangs.&lt;/p&gt;
&lt;p&gt;When it goes to sleep correctly, then I can see consumption around&amp;nbsp;~7.7 - 7.8 mA.&lt;/p&gt;
&lt;p&gt;When it hangs, the consumption is slightly higher:&amp;nbsp;~8.3 - 9.5 mA.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Another thing is that recently I added the watchdog functionality.&lt;/p&gt;
&lt;p&gt;I noticed, that even when the BLE is not disabled before going to sleep, but watchdog is enabled, the overnight test passes and the board does not hang. This looks to me like calling pm_state_force() causes the watchdog reset.&lt;/p&gt;
&lt;p&gt;Every time it hangs, I&amp;#39;m sure it entered the function where I call&amp;nbsp;pm_state_force(), because just before putting the board to sleep, I disable other power supplied and this turns off the LED indicating PSU state. This&amp;nbsp;disableOtherPsu() call is literally above&amp;nbsp;&lt;span&gt;pm_state_force(). I did not include this detail in the first post.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;disableOtherPsu(); // This calls gpio_pin_set() Zephyr API, and  results in turnign off PSUs and LED
pm_state_force(0u, &amp;amp;(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0, 0});
k_sleep(K_SECONDS(2U));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What&amp;nbsp;&lt;span&gt;pm_state_force() does, is making the Power Management thread setting the bit in&amp;nbsp;SYSTEMOFF (0x500) register? Do you think that setting that register manually instead of callibg pm_state_force() would help to troubleshoot it? Or is it a bad idea and we should control the power state by accessing&amp;nbsp;the registers directly?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52840 sometimes won't wake up.</title><link>https://devzone.nordicsemi.com/thread/441618?ContentTypeID=1</link><pubDate>Wed, 16 Aug 2023 12:55:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2e13b36c-d1fe-4c58-b0b5-5a03cc472354</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t say that understand at the moment why disabling BT would solve the problems.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Would it be possible for you to upload your project? I can set the case to private if you like.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any logs from when it hangs? It would be helpful while trying to figure out the root cause&lt;/p&gt;
&lt;p&gt;Is your debugger attached when you tried to set it into the power state? The debugger would prevent it from going into power down mode.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have any current measurements from the tests?&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>