<?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>nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25387/nrf52832-system-powers-off-and-wakes-up-it</link><description>Hi everyone, 
 I am developing a remote control using nRF52832 chip. My prototype is currently developed in PC10040 board. The IDE is Eclipse Oxygen, and the SDK is S132 v5.0.0. 
 I am trying to power off my system using NRF_POWER-&amp;gt;SYSTEMOFF = 0x01;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Sep 2017 11:09:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25387/nrf52832-system-powers-off-and-wakes-up-it" /><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100049?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 11:09:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e4762ef-5fe3-4545-bbd8-ba80c3a9c41d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;When the system wakes from SYSTEM OFF it will boot like there was a reset but from &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/power.html?cp=2_1_0_17_8_2#register.RESETREAS"&gt;&lt;code&gt;RESETREAS&lt;/code&gt; register you can get the reason&lt;/a&gt; and see that it wasn&amp;#39;t Power On Reset or other kind of restart. As you initiate UART afterwards during system start-up anyway (if you use it for debug;) then you simply print the same things like during any start-up but if you print that register you can see that it was trigger by button press. Also you can try to read PIN value over GPIO right after reset and print if it&amp;#39;s LOW or HIGH (to verify if the trigger came from particular PIN).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100048?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 10:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93764fd4-9220-42d6-aac4-8322c78e42cd</guid><dc:creator>huaminhtuan</dc:creator><description>&lt;p&gt;I want to ask another question: When the system is wake up from powered off, it will cause a reset procedure, so I can print some lines to debug this wake up, can&amp;#39;t I?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100044?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 10:12:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0bde8ae8-1f0e-46dd-b32f-986c97a06682</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;That would help but that&amp;#39;s already in SDK example so why would you implement it again???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100043?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 10:08:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b474882-07cd-44d6-92ec-89fe2b0b6d28</guid><dc:creator>huaminhtuan</dc:creator><description>&lt;p&gt;So firstly, I should implement UART(for debugging), GPIOTE (for power off and wake up button) and POWER (for system off function), aren&amp;#39; t I?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100046?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 09:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab70f9ed-f56f-4662-9c70-de4d212cac79</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Maybe you need some delay but having it done through some timer lib would be better. Anyway this is single function but what about the rest of your project? i recommend to firstly implement this &amp;quot;button press -&amp;gt; SYSTEM OFF -&amp;gt; button press -&amp;gt; SYSTEM ON&amp;quot; in some of SDK examples where you can easily get support here. Once it works and you see on UART debug line or similar that no reset or unintended wake-ups happen then you can port the code to your FW easily.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100045?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 09:41:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d267973-288a-4471-bf53-ab8c590f1322</guid><dc:creator>huaminhtuan</dc:creator><description>&lt;p&gt;That is one of my mistake, I will remove it, thanks for advising me :D&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100047?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 09:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4638f889-32ba-4bd3-8b98-ae4a89f9a2fa</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(I don&amp;#39;t see the problem right now but already the blocking FOR loop in the end makes me almost blind, come one, cannot you implement some better non-blocking waiting loop?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100050?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 09:02:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8867fb36-f239-4354-b86c-a0346d09a568</guid><dc:creator>huaminhtuan</dc:creator><description>&lt;p&gt;Hi endnode, I enable BLE stack before I power off the system using NRF_POWER-&amp;gt;SYSTEMOFF = 0x01;. I have tried comment out the BLE stack config and enable codes, but the problem still happens :((( Below is my piece of code I use to config the system:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**
 * @brief : Config system
 * @param :
 * @return:
 */
void ConfigSystem()
{
    // Config Log
    ConfigLog(TX_PIN_NUMBER, RX_PIN_NUMBER, CTS_PIN_NUMBER, RTS_PIN_NUMBER, HWFC, UART_BAUDRATE_115200);
    Print(&amp;quot;\n\n\n&amp;quot;);
    PrintInfo(&amp;quot;Headset for people with low vision project&amp;quot;);
    PrintAppInfo(&amp;quot;Log Initialized!&amp;quot;);

    // Config SPI
    // USE_SPI have to be defined if SPI is used
#ifdef USE_SPI
    SPIConfig.SPIBase = NRF_SPIM0;
    SPIConfig.pinCSN = CSN_PIN_NUMBER;
    SPIConfig.pinSCK = SCK_PIN_NUMBER;
    SPIConfig.pinMOSI = MOSI_PIN_NUMBER;
    SPIConfig.pinMISO = MISO_PIN_NUMBER;
    SPIConfig.role = SPI_ROLE;
    SPIConfig.mode = SPI_MODE;
    SPIConfig.order = SPI_BIT_ORDER;
    SPIConfig.freq = SPIM_FREQ_M8;
    ConfigSPI(SPIConfig);
    PrintAppInfo(&amp;quot;SPI Master Initialized!&amp;quot;);
#endif

    // Config I2C
    // USE_I2C have to be defined if I2C is used
#ifdef USE_I2C
    I2CMasterConfig.I2CBase = NRF_TWIM0;
    I2CMasterConfig.pinSCL = SCL_PIN_NUMBER;
    I2CMasterConfig.pinSDA = SDA_PIN_NUMBER;
    I2CMasterConfig.role = I2C_ROLE;
    I2CMasterConfig.frequency = I2CM_FREQ_K100;
    ConfigI2C(I2CMasterConfig);
    PrintAppInfo(&amp;quot;I2C Master Initialized!&amp;quot;);
#endif

    // Config indicators (GPIO pins used for controlling LEDs)
    ConfigIndicator();
    PrintAppInfo(&amp;quot;Indicator Initialized!&amp;quot;);

    //Config ADC
    ADC_Channel_Configuration_t ADCChannelConfig;
    ADCChannelConfig.ADCPosPin = ADC_PSELP_PIN;
    ADCChannelConfig.ADCNegPin = ADC_PSELN_PIN;
    ADCChannelConfig.resPinPos = ADC_RESISTOR_DISABLED;
    ADCChannelConfig.resPinNeg = ADC_RESISTOR_PULLDOWN;
    ADCChannelConfig.acqTime = ADC_ACQTIME_3US;
    ADCChannelConfig.burst = ADC_BURST_DISABLED;
    ADCChannelConfig.gain = ADC_GAIN_1_6;
    ADCChannelConfig.mode = ADC_MODE_DIFF;
    ADCChannelConfig.reference = ADC_REFERENCE_INTERNAL;
    ConfigADCChannel(ADC_CHANNEL, ADCChannelConfig);

    ADC_Configuration_t ADCConfig;
    ADCConfig.resolution = ADC_RESOLUTION;
    ADCConfig.samplerateMode = ADC_SAMPLERATE_MODE_TASK;
    ADCConfig.oversample = ADC_OVERSAMPLE_DISABLED;
    ADCConfig.buffer = &amp;amp;ADCBuffer;
    ADCConfig.bufferAmount = 1;
    ConfigADC(ADCConfig);
    PrintAppInfo(&amp;quot;ADC Initialized!&amp;quot;);

    // Config BLE and start advertising
    ConfigBLE();
    PrintAppInfo(&amp;quot;BLE Initialized!&amp;quot;);
    //  BLEStartAdvertising(BLE_ADV_MODE_FAST);
    //  PrintAppInfo(&amp;quot;Start advertising&amp;quot;);
    BLEStartScanning();
    PrintAppInfo(&amp;quot;Start scanning&amp;quot;);

    // Config Power
    ConfigPOWER();
    PrintAppInfo(&amp;quot;POWER Initialized!&amp;quot;);

    // delay a while for system to be ready
    int i;
    for(i = 0; i &amp;lt; 1000; i++)
    ;
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52832 system powers off and wakes up it</title><link>https://devzone.nordicsemi.com/thread/100042?ContentTypeID=1</link><pubDate>Fri, 22 Sep 2017 08:32:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c76ee761-7d42-4851-8354-fc9c87b26a05</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Well we will hardly help you not knowing what exactly you do in your code before you try to send the chip to SYSTEM OFF. E.g. if you are using Nordic BLE stack and Soft Device is enabled you cannot write to these registers directly but use dedicated &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___n_r_f___s_o_c___f_u_n_c_t_i_o_n_s.html?cp=2_3_0_1_0_2_7_2_25#ga774947ee0e200456ea3aec3fc7f8bd6b"&gt;&lt;code&gt;sd_power_system_off()&lt;/code&gt; function as per API description&lt;/a&gt;. Note that this isn&amp;#39;t magic cure to every problem with SYSTEM OFF mode, you need to take care about initialization/deinitialization of some things (at least that&amp;#39;s my experience). Also for wake-up you need to set the PIN specifically. Have you seen &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/pwr_mgmt_example.html?cp=4_0_0_4_5_17"&gt;the power management example from nRF5 SDK&lt;/a&gt;? Can you make your application working in the same way before even using BLE stack (Soft Device)? Only then you should try to achieve the same flow but with BLE stack enabled.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>