This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Resume the state of registers and memory

Hi There,

I try to develop an application in intermittent conditions,  it will off work frequently as for lacking the energy. 

I try to resume the application from the last losing point rather than the starting point.

How should I do?

Regards,

Gaosheng Liu

  • Hello,

    I try to develop an application in intermittent conditions,  it will off work frequently as for lacking the energy. 

    How frequent and how long are these sleep intervals?

    I try to resume the application from the last losing point rather than the starting point.

    If you would like it to resume from the previous point, rather than from reset, you will need to use SYSTEM_ON sleep.
    In SYSTEM_ON sleep the CPU is idling in a low-power state, and will wake on any event.
    SYSTEM_OFF sleep has the lowest power consumption, but it will reset on wake.

    You could see how SYSTEM_ON sleep is implemented and used in the ble_peripheral examples of the SDK. The idle_state_handler function puts the CPU in SYSTEM_ON sleep from the main context.

    Best regards,
    Karl

  • How frequent and how long are these sleep intervals?

    Hi, it is a regular thing. Imaging it is in a stable ambient condition. The sleep intervals are about 50us to 100 us.

    If you would like it to resume from the previous point, rather than from reset, you will need to use SYSTEM_ON sleep.
    In SYSTEM_ON sleep the CPU is idling in a low-power state, and will wake on any event.
    SYSTEM_OFF sleep has the lowest power consumption, but it will reset on wake.

    You could see how SYSTEM_ON sleep is implemented and used in the ble_peripheral examples of the SDK. The idle_state_handler function puts the CPU in SYSTEM_ON sleep from the main context

    Hi, I will try it later. If I have further questions, I will let you. Thank you very much for your rapid and professional response!

    Regards,

    Gaosheng Liu

  • Puls a question, How much the system status can be stored?  what's the time and energy consumption of the resuming?

  • Hello again, Gaosheng Liu

    lgs said:
    Thank you very much for your rapid and professional response!

    No problem at all, I am happy to help! :)

    lgs said:
    it is a regular thing. Imaging it is in a stable ambient condition. The sleep intervals are about 50us to 100 us.

    Thank you for clarifying. SYSTEM_ON sleep is a great fit for this. 

    lgs said:
    I will try it later. If I have further questions, I will let you.

    Great! Please do not hesitate to ask if you should encounter any issues or questions. 

    lgs said:
    How much the system status can be stored?  what's the time and energy consumption of the resuming?

    In SYSTEM_ON sleep the entire system is retained - the device does not power off any peripherals, or clear any registers, when entering SYSTEM_ON sleep. The main difference is that the CPU is put into the low-power idle state, waiting for an event to wake it again.
    You can read more about the SYSTEM_ON sleep details in its documentation.

    Best regards,
    Karl

  • Thank you for clarifying. SYSTEM_ON sleep is a great fit for this. 

    Hi Karl,

    Sorry for disturbing you again!

    I wonder my clarification is not clear enough. I mean it doesn't sleep but powers off. To be more specific, the device power off, it needs to preserve the necessary states, when the device power on it can resume from the breaking point.

    Best regards,

    Gaosheng Liu

Related