getStandbyFlag()

Home Forums mDot/xDot getStandbyFlag()

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #18022
    Mark Ruys
    Participant

    Hi,

    I wonder when getStandbyFlag() is true? Nor after a cold power cycle, nor when it returns from a deep sleep, it returns true. The documentation says:

    /** Returns boolean indicative of start-up from standby mode
    * @returns true if dot woke from standby
    */

    Doesn’t deep sleep is a standby mode?

    #18026

    Hi Mark,

    Please see the section on Deepsleep functionality change…
    https://developer.mbed.org/platforms/MTS-mDot-F411/#lora-stack-libmdot

    Kind regards,
    Leon

    #18064
    Mark Ruys
    Participant

    Well it’s actually an xDot. And I erred, as getStandbyFlag() is always false instead of true in my case.

    But now I understand why. I assumed that when you power cycle the MCU while in a deep sleep, it will restart from scratch. Likewise after you perform a hard reset. What I missed is that the session is stored in some persistent memory, preserving the session this. Only reflashing will remove this session state (or eraseFlash() I guess). And only then getStandbyFlag() will be false.

    The STM32L151CC datasheet mentions a 8 KB EEPROM and 128 bytes backup registers. The nvmWrite() and nvmRead() from mDot.h gave access to 6 KB. So I guess that the ‘missing’ 2 KB is used by the xDot library to store the session state.

    #18065

    Hi Mark,

    When getStandbyFlag() is called, it should simply return the state of the standby flag directly from the processor which should function as follows…
    Standby flag:
    This bit is set by hardware and cleared only by a POR/PDR (power on reset/power down reset) or by setting the CSBF bit in the PWR power control register (PWR_CR)
    0: Device has not been in Standby mode
    1: Device has been in Standby mode
    The xDot should enter standby mode when deep sleep in invoked. So you should see the standby flag set if it came out of deep sleep.

    Stored settings do consume part of the EEPROM.

    Kind regards,
    Leon

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.