System Power Off

I am working on a device that I want to be able to store powered off for long periods of time. Ideally, I could enter a low power state that the user can exit by plugging in a USB cable.

I was able to find this older devzone post, and want to be able to accomplish "If you manage to put the board in System Off, then it should automatically do a wakeup from System off when the valid VBUS voltage has been detected."

 https://devzone.nordicsemi.com/f/nordic-q-a/89069/wake-device-using-usb-in-zephyr 

How can I configure this in Zephyr? I tried to use the sys_poweroff command, but it behaves like a system restart instead. Is there a specific power state I need to force, and do I need to make any modification to the .dts so that the vbus signal acts like an interrupt? 

https://docs.zephyrproject.org/latest/services/poweroff.html

Parents Reply Children
  • Thank you Jørgen for the response.

    The system off command used in the sample is the same that I have been trying to use in code. The device does seem to power off, but then almost immediately starts back up. The VBUS pin is low, and I have both disconnected the JTAG and restarted the device. Is there a way to record what is causing the power on event? Are there any other systems similar to USB VBUS where they are enabled by default to power on the device? I have nothing in my board file setup to be a wakeup source.

  • Maybe disable the NFC pins (if enabled):

    "In System OFF, the NFCT Low Power Field Detect function can wake the system up through a reset. 
    If the system is put into System OFF mode while a field is already present, the NFCT Low Power Field
    Detect function will wake the system up right away and generate a reset"

    We save the RESETREAS register before the errata are applied.

    Edit: note a coil is not required for System Off reset, just a differential 1.2 volts between the 2 pins, such as a finger touch or photodiode .. might try this, be a useful feature for low-power wakeup. The NFC pins are high-impedance in System OFF; thus sensitive to noise.

  • Actually I tried applying an NFC field to see what happens, but NFC Sense only seems to force a wakeup and reset if TASKS_SENSE is previously enabled, which is not the default (tested on nRF52832, not nRF52840).

        // This might be a secondary reset due to NFC or port io wakeup or first power-on reset
        if ((NRF_POWER->RESETREAS & 0x90000) == 0)
        {
           NRF_NFCT->TASKS_SENSE = 1;
           NRF_POWER->SYSTEMOFF = 1;
        }

    Maybe on the nRF52840 the VDD feeds back to VBUS in the absence of USB and trips a wakeup if the VBUS voltage is above 3.4 volts range; depends a little on circuit configuration; easy to check by logging RESETREAS

  • How can I verify if the VDD feedback to VBUS is triggering a wakeup due to the VBUS voltage exceeding the 3.4-volt range, considering the circuit configuration? dinosaur game

  • If wakeup from SystemOFF was caused by VBUS, bit "I" (0x00100000) in RESETREAS register will be set on wakeup.

Related