<?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>Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output</link><description>Hello, 
 I have a custom board built around Nordic&amp;#39;s nRF52833 SoC and I am trying to reduce the power consumption on it as much as possible. 
 I am thinking of putting the SoC in SYSTEM OFF mode but before I do that I would like to check that none of</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Dec 2023 15:21:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output" /><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460411?ContentTypeID=1</link><pubDate>Thu, 14 Dec 2023 15:21:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e4bea0e-6ed0-4898-9290-4d59fcb7e973</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Learner"]So, you have no spotted anything wrong with the way I am configuring my pin P0.18 in&amp;nbsp;io_charger_detect_initialise() and the overlay file.[/quote]
&lt;p&gt;No, the config looks ok to me.&lt;/p&gt;
[quote user="Learner"]&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;Note, P0.18 can also be the RESET pin&lt;/span&gt;. So, I have this config in prj.conf and mcuboot.conf,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_GPIO=y&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CONFIG_GPIO_AS_PINRESET=n&lt;/strong&gt;&lt;/p&gt;[/quote]
&lt;p&gt;This should be fine, as long as the PINRESET has not been previously enabled and the UICR was not erased between programming.&lt;/p&gt;
&lt;p&gt;You can check this by reading out the NRF_UICR-&amp;gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/uicr.html?cp=5_1_0_3_4_0_3#register.PSELRESET-0-1"&gt;PSELRESET[n]&lt;/a&gt;&amp;nbsp;registers using the debugger:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;gt;nrfjprog --memrd 0x10001200
0x10001200: FFFFFFFF                              |....|
&amp;gt;nrfjprog --memrd 0x10001204
0x10001204: FFFFFFFF                              |....|&lt;/pre&gt;&lt;/p&gt;
[quote user="Learner"]&lt;blockquote&gt;&lt;div&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460207"&gt;Learner said:&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;Digging a bit deeper I noticed (see line highlighted in yellow above) that &lt;span style="text-decoration:underline;"&gt;only 3 out of 4&lt;/span&gt; members of the the structure &lt;strong&gt;pm_state_info&lt;/strong&gt; are defined. Note, this line was taken from a Nordic example.&lt;/p&gt;
&lt;p&gt;Will this cause problems?&lt;/p&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;
&lt;p&gt;Any comment on the above question?&lt;/p&gt;[/quote]
&lt;p&gt;No, as far as I can see, only the state field of the struct is used in the &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/soc/arm/nordic_nrf/nrf52/power.c#L14-L19"&gt;pm_power_state_set&lt;/a&gt;() implementation on nRF52 series, which is called by &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.6.99-ncs1/subsys/pm/power.c#L162-L169"&gt;pm_power_state_force&lt;/a&gt;().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460308?ContentTypeID=1</link><pubDate>Thu, 14 Dec 2023 09:28:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d524205-cfef-456e-b2c1-ae1a7d8340af</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Good Morning Jorgen,&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;I will try your suggestions. So, you have no spotted anything wrong with the way I am configuring my pin P0.18 in&amp;nbsp;io_charger_detect_initialise() and the overlay file. &lt;span style="text-decoration:underline;"&gt;Note, P0.18 can also be the RESET pin&lt;/span&gt;. So, I have this config in prj.conf and mcuboot.conf,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;CONFIG_GPIO=y&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;CONFIG_GPIO_AS_PINRESET=n&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="92434" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460207"]&lt;p&gt;Digging a bit deeper I noticed (see line highlighted in yellow above) that &lt;span style="text-decoration:underline;"&gt;only 3 out of 4&lt;/span&gt; members of the the structure &lt;strong&gt;pm_state_info&lt;/strong&gt; are defined. Note, this line was taken from a Nordic example.&lt;/p&gt;
&lt;p&gt;Will this cause problems?&lt;/p&gt;[/quote]
&lt;p&gt;Any comment on the above question?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460232?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2023 21:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2713311-6b43-44f1-9ac4-e3bc52444707</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Learner"]&lt;p&gt;But I am seeing the device is rebooting as soon as the function&amp;nbsp;&lt;strong&gt;pm_power_state_force()&amp;nbsp;&lt;/strong&gt;is executed.&lt;/p&gt;
&lt;p&gt;Any idea what else I could be dong wrong?&lt;/p&gt;[/quote]
&lt;p&gt;You can read out the reason for the wakeup in the start of main() by reading the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/power.html#register.RESETREAS"&gt;NRF_POWER-&amp;gt;RESETREAS&lt;/a&gt;&amp;nbsp;register. If the wakeup is triggered by a GPIO (Field OFF set in the register), you should check that the state of the pin is correct compared to the sense level (that it is not pulled low externally), and that no other pins have SENSE enabled (you can read out the NRF_GPIO-&amp;gt;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/gpio.html?cp=5_1_0_5_7_1_9#register.PIN_CNF-0-31"&gt;PIN_CNF[n]&lt;/a&gt;&amp;nbsp;registers right before entering SystemOFF in the debug session.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460207?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2023 17:34:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03f675b9-87cc-451f-a6d2-45c05773c2dc</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Hi Jorgen,&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460166"]Which revision of the nRF52833 chip are you using?[/quote]
&lt;p&gt;QDAAB0&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460166"]Are you using an old version of nRF Connect SDK? Segger Embedded Studio support was deprecated in NCS v2.0.0.[/quote]
&lt;p&gt;Yes, I am using an old version of nRF Connect SDK.&lt;/p&gt;
&lt;p&gt;- Zephyr OS build v2.6.99-ncs1&lt;br /&gt;- nRF Connect SDK v1.7.0&lt;br /&gt;- nrfx 2.5.0 &lt;br /&gt;- MDK 8.40.2 -&amp;gt; it has support for QDAAB0&lt;br /&gt;- SEGGER Embedded Studio for ARM&lt;br /&gt; Release 5.60 Build 2021081102.47262&lt;br /&gt; Nordic Edition&lt;br /&gt; Windows x64&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460166"]If you are seeing 60uA from the nRF52833 itself, the chip is not in SystemOFF mode[/quote]
&lt;p&gt;The 60 uA&amp;nbsp;is from the whole system.&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/460166"]Have you configured any pins as wakeup source from SystemOFF? Only &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/gpio.html#concept_o12_bgv_bs"&gt;GPIOs with SENSE enabled&lt;/a&gt; will work as wakeup source.[/quote]
&lt;p&gt;No, I have not. I configured one of the pins as interrupt as shown in the attached code. This must be what I was doing wrong.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 *****************************************************************************************************************************************************
 *  io_charger_detect_intpt()
 *
 *  @brief  Callback that handles the INT Interrupt upon detecting the DC supply has been reconnected during SHUTDOWN.
 *  @param  [in]  None
 *  @return [out] None
 *
 *****************************************************************************************************************************************************
 */
void io_charger_detect_intpt(const struct device *dev, struct gpio_callback *cb,uint32_t pins)
{
    if ( ( flash_static_data_copy_hb.shutdown_flag == POWER_SHUTDOWN_SOURCE_FORCED )      ||
         ( flash_static_data_copy_hb.shutdown_flag == POWER_SHUTDOWN_SOURCE_LOW_BATTERY )    )
    {
        /* Flag that causes the device to wake-up and exit the SHUTDOWN state */
        g_charger_detect = true;
//      io_led_on( GREEN_LED );
    }

    /* Log the new lid button state. */
    LOG_DBG(&amp;quot;Charger Interrupt Detected at %&amp;quot; PRIu32 &amp;quot;\n&amp;quot;, k_cycle_get_32());
}



/**
 *****************************************************************************************************************************************************
 *  io_charger_detect_initialise()
 *
 *  @brief  Callback that handles the INT Interrupt upon detecting the DC supply has been reconnected during SHUTDOWN.
 *  @param  [in]  None
 *  @return [out] None
 *
 *****************************************************************************************************************************************************
 */
void io_charger_detect_initialise(void)
{
    uint8_t                       ret;
    static struct gpio_callback   charger_cb_data;

    /* Setup the INT pin (P0.18) */
    io_charger_dev = device_get_binding( DT_GPIO_LABEL( DT_ALIAS( charger_int ), gpios ) );
    if ( io_charger_dev )
    {
        ret = gpio_pin_configure( io_charger_dev,
                                  DT_GPIO_PIN( DT_ALIAS( charger_int ), gpios ),
                                  GPIO_INPUT | DT_GPIO_FLAGS( charger_int, gpios ) | GPIO_PULL_UP );
        if ( ret == 0 )
        {
            // Read the initial status of the INT pin (P0.18).
            if ( !gpio_pin_get_raw( io_charger_dev, DT_GPIO_PIN(DT_ALIAS(charger_int), gpios) ) )
            {
                /* Log the state of the INT pin (P0.18). */
                LOG_WRN( &amp;quot;INT state is 0\n&amp;quot; );
            }
            else
            {
                /* Log the state of the INT pin (P0.18). */
                LOG_INF( &amp;quot;INT state is 1\n&amp;quot; );
            }

            g_charger_detect = false;

            /* Enable the charger INT interrupt */
            ret = gpio_pin_interrupt_configure( io_charger_dev,
                                                DT_GPIO_PIN(DT_ALIAS(charger_int), gpios),
                                                GPIO_INT_EDGE_TO_ACTIVE                     );
            if ( ret == 0 )
            {
                gpio_init_callback( &amp;amp;charger_cb_data, io_charger_detect_intpt, BIT( DT_GPIO_PIN( DT_ALIAS( charger_int ), gpios ) ) );
                if ( gpio_add_callback( io_charger_dev, &amp;amp;charger_cb_data ) &amp;lt; 0 )
                {
                    LOG_ERR( &amp;quot;charger_cb_data is NULL&amp;quot; );
                }
            }
            else
            {
                LOG_ERR( &amp;quot;Charger Detect interrupt not configured&amp;quot; );
            }
        }
        else
        {
            LOG_ERR( &amp;quot;Charger Detect pin not configured&amp;quot; );
        }
    }
    else
    {
        LOG_ERR( &amp;quot;Charger Detect not registered&amp;quot; );
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I am configuring my &amp;#39;charger_int&amp;#39; pin in the attached overlay file as follows,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/ {
    leds {
        compatible = &amp;quot;gpio-leds&amp;quot;;
        led0: led_0 {
            gpios = &amp;lt;&amp;amp;gpio0 5 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;Red Led&amp;quot;;
        };
        led1: led_1 {
            gpios = &amp;lt;&amp;amp;gpio0 20 GPIO_ACTIVE_LOW&amp;gt;;
            label = &amp;quot;Green Led&amp;quot;;
        };
    };

    pwmsnd {
        compatible = &amp;quot;pwm-leds&amp;quot;;
        pwm_led00: pwm_led_0 {
            pwms = &amp;lt;&amp;amp;pwm0 4&amp;gt;;
            };
        pwm_led10: pwm_led_1 {
            pwms = &amp;lt;&amp;amp;pwm0 5&amp;gt;;
            };  
    };

    buttons {
        compatible = &amp;quot;gpio-keys&amp;quot;;
        tamper: button_0 {
            gpios = &amp;lt;&amp;amp;gpio0 29 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
            label = &amp;quot;Tamper Button&amp;quot;;
        };
        ambsns: button_1 {
                        gpios = &amp;lt;&amp;amp;gpio0 30 GPIO_ACTIVE_HIGH&amp;gt;;
            label = &amp;quot;Ambient Sensor&amp;quot;;
                };
        charger_det: button_2 {
            gpios = &amp;lt;&amp;amp;gpio0 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
            label = &amp;quot;Charger INT&amp;quot;;
        };
    };
    
     aliases {
        redled = &amp;amp;led0;
        blueled = &amp;amp;led1;
        snd-p = &amp;amp;pwm_led00;
        snd-n = &amp;amp;pwm_led10;
        tamper-button = &amp;amp;tamper;
        adcctl = &amp;amp;adc;
        ambient = &amp;amp;ambsns;
        charger-int = &amp;amp;charger_det;
    };
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So, I modified my code and it now looks like this,&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;nrf_gpio_cfg_input( DT_GPIO_PIN( DT_ALIAS( charger_int ), gpios ), GPIO_PULL_UP );&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;NRF_GPIO_PIN_SENSE_LOW );&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;nrf_gpio_cfg_sense_input( DT_GPIO_PIN( DT_ALIAS( charger_int ), gpios ), GPIO_PULL_UP, NRF_GPIO_PIN_SENSE_LOW);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;/* Before we disabled entry to deep sleep. Here we need to override&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt; * that, then force a sleep so that the deep sleep takes effect.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt; */&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;pm_power_state_force((&lt;span style="background-color:#ffff00;"&gt;struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0}&lt;/span&gt;);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#0000ff;font-size:75%;"&gt;&lt;strong&gt;LOG_INF(&amp;quot;CPU IN SLEEP MODE&amp;quot;);&amp;nbsp; &amp;nbsp;/* As expected, this line is never executed */&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;But I am seeing the device is rebooting as soon as the function&amp;nbsp;&lt;strong&gt;pm_power_state_force()&amp;nbsp;&lt;/strong&gt;is executed.&lt;/p&gt;
&lt;p&gt;Any idea what else I could be dong wrong?&lt;/p&gt;
&lt;p&gt;Digging a bit deeper I noticed (see line highlighted in yellow above) that &lt;span style="text-decoration:underline;"&gt;only 3 out of 4&lt;/span&gt; members of the the structure &lt;strong&gt;pm_state_info&lt;/strong&gt; are defined. Note, this line was taken from a Nordic example.&lt;/p&gt;
&lt;p&gt;Will this cause problems?&lt;/p&gt;
&lt;p&gt;This is how the &lt;strong&gt;pm_state_info&lt;/strong&gt; structure is&amp;nbsp;defined in &lt;strong&gt;v1.7.0\zephyr\include\pm\state.h&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;struct pm_state_info&lt;/strong&gt; {&lt;br /&gt; &lt;span style="background-color:#ffff00;"&gt;enum pm_state state;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * Some platforms have multiple states that map to&lt;br /&gt; * one Zephyr power state. This property allows the platform&lt;br /&gt; * distinguish them. e.g:&lt;br /&gt; *&lt;br /&gt; * power-states {&lt;br /&gt; * state0: state0 {&lt;br /&gt; * compatible = &amp;quot;zephyr,power-state&amp;quot;;&lt;br /&gt; * power-state-name = &amp;quot;suspend-to-idle&amp;quot;;&lt;br /&gt; * substate-id = &amp;lt;1&amp;gt;;&lt;br /&gt; * min-residency-us = &amp;lt;10000&amp;gt;;&lt;br /&gt; * exit-latency-us = &amp;lt;100&amp;gt;;&lt;br /&gt; * };&lt;br /&gt; * state1: state1 {&lt;br /&gt; * compatible = &amp;quot;zephyr,power-state&amp;quot;;&lt;br /&gt; * power-state-name = &amp;quot;suspend-to-idle&amp;quot;;&lt;br /&gt; * substate-id = &amp;lt;2&amp;gt;;&lt;br /&gt; * min-residency-us = &amp;lt;20000&amp;gt;;&lt;br /&gt; * exit-latency-us = &amp;lt;200&amp;gt;;&lt;br /&gt; * };&lt;br /&gt; * }&lt;br /&gt; */&lt;br /&gt; &lt;span style="background-color:#ffff00;"&gt;uint8_t substate_id;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * Minimum residency duration in microseconds. It is the minimum&lt;br /&gt; * time for a given idle state to be worthwhile energywise.&lt;br /&gt; *&lt;br /&gt; * @note 0 means that this property is not available for this state.&lt;br /&gt; */&lt;br /&gt; &lt;span style="background-color:#ffff00;"&gt;uint32_t min_residency_us;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;/**&lt;br /&gt; * Worst case latency in microseconds required to exit the idle state.&lt;br /&gt; *&lt;br /&gt; * @note 0 means that this property is not available for this state.&lt;br /&gt; */&lt;br /&gt; &lt;span style="background-color:#ffff00;"&gt;uint32_t exit_latency_us;&lt;/span&gt;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;Kind regards&lt;/p&gt;
&lt;p&gt;Mohamed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460166?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2023 14:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2e703d9-fae7-4917-b111-9f32fec309c2</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>[quote user="Learner"]While running in debug mode I am sending the nrfjprog command and it works the first time around as shown above but not on subsequent tries. Why?[/quote]
&lt;p&gt;Which revision of the nRF52833 chip are you using?&lt;/p&gt;
[quote user="Learner"]I am running a debug build and so, I am disabling the readback protection to allow debug in Segger Embedded Studio NE.&amp;nbsp;[/quote]
&lt;p&gt;Are you using an old version of nRF Connect SDK? Segger Embedded Studio support was deprecated in NCS v2.0.0.&lt;/p&gt;
[quote user="Learner"]I am sending the SoC into SYSTEM OFF mode using the code below. I believe this is working fine because I can see the current dropping to about 60 uA.[/quote]
&lt;p&gt;If you are seeing 60uA from the nRF52833 itself, the chip is not in SystemOFF mode, but if this is from the entire system, it could be correct. &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/_tmp/nrf52833/autodita/CURRENT/parameters.i_sleep.html"&gt;SystemOFF current should be below 2uA&lt;/a&gt;. There is a system_off sample in Zephyr that can be used to test this. In the latest SDK version there is a &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.4.99-ncs1/samples/boards/nrf/system_off/src/main.c#L76"&gt;new API to enter SystemOFF directly&lt;/a&gt;.&lt;/p&gt;
[quote user="Learner"]However, I do not seem to be able to&amp;nbsp;wake the SoC&amp;nbsp;up despite sending a 50 us interrupt pulse to one of the GPIO pins.[/quote]
&lt;p&gt;Have you configured any pins as wakeup source from SystemOFF? Only &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/gpio.html#concept_o12_bgv_bs"&gt;GPIOs with SENSE enabled&lt;/a&gt; will work as wakeup source.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/460103?ContentTypeID=1</link><pubDate>Wed, 13 Dec 2023 10:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ced779b-91bc-4ff9-9e70-34ebf6228ae6</guid><dc:creator>Learner</dc:creator><description>&lt;p&gt;Good Morning Jorgen,&lt;/p&gt;
&lt;p&gt;Thank you for your tips.&lt;/p&gt;
&lt;p&gt;I am running a debug build and so, I am disabling the readback protection to allow debug in Segger Embedded Studio NE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;While running in debug mode I am sending the nrfjprog command and it works the first time around as shown above but not on subsequent tries. Why?&lt;/p&gt;
[quote userid="14926" url="~/f/nordic-q-a/106555/using-nrfjprog-to-read-out-the-gpio-registers-to-check-if-any-of-the-gpios-are-configured-as-output/459972"]I&amp;#39;m not sure which firmware you run on the board, but wakeup from System OFF will trigger a chip reset.[/quote]
&lt;p&gt;I am sending the SoC into SYSTEM OFF mode using the code below. I believe this is working fine because I can see the current dropping to about 60 uA. However, I do not seem to be able to&amp;nbsp;wake the SoC&amp;nbsp;up despite sending a 50 us interrupt pulse to one of the GPIO pins.&lt;/p&gt;
&lt;p&gt;Any suggestions?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;pm_power_state_force((struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;k_sleep( K_SECONDS(1) );&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/* k_sleep should never exit, so the code below should never be executed&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; * if system off was correct. On the other hand if something has gone wrong&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; * then we will see it on terminal and LED.&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; */&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt; LOG_INF(&amp;quot;CPU IN SLEEP MODE&amp;quot;);&lt;/strong&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Kind regards&lt;/div&gt;
&lt;div&gt;Mohamed&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using nrfjprog to read out the GPIO registers to check if any of the GPIOs are configured as output</title><link>https://devzone.nordicsemi.com/thread/459972?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2023 15:36:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1786df61-cf9e-4a18-bfd0-ee1d7b604b78</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Like the error message says, this means that the readback protection is enabled in your device. You can read more about this in the&amp;nbsp;&lt;a title="Access port protection" href="https://infocenter.nordicsemi.com/topic/ps_nrf52833/dif.html?cp=5_1_0_3_7_1#concept_udr_mns_1s"&gt;Access port protection&lt;/a&gt;&amp;nbsp;chapter in the Product Specifications. Depending on the &lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf52833/COMP/nrf52833/nRF52833_ic_revision_overview.html"&gt;chip&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/topic/comp_matrix_nrf52833/COMP/nrf52833/nRF52833_ic_rev_comp_with_dev_hw.html"&gt;DK&lt;/a&gt; revision, the protection might be enabled by default if it is not disabled by the firmware. Our latest SDK versions should disable this by default to allow debugging the applications, see more details in&amp;nbsp;&lt;a title="IN149 Informational Notice v1.1" href="https://infocenter.nordicsemi.com/pdf/in_149_v1.1.pdf?cp=5_1_2_6"&gt;IN149 Informational Notice v1.1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure which firmware you run on the board, but wakeup from System OFF will trigger a chip reset. If the access port protection was not disabled by the firmware, and the chip is reset, you will likely see this behavior when you attach the debugger&amp;nbsp;and the chip resets. The chip should still function when you see this error, it is just the debug interface that is disabled to protect the content of the chip from unauthorized access.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>