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

Parents
  • 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

Reply
  • 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

Children
  • 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

  • lgs said:
    Sorry for disturbing you again!

    No problem at all, do not worry about disturbing me! :) 

    lgs said:
    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.

    Perhaps I have misunderstood you here - can you elaborate what you mean when you say 'preserve the necessary states and resume from the breaking point'? Do you mean resume from breaking point as in as if the power off never occurred - with all peripherals still enabled and ready to go immediately?
    Or do you mean resume from breaking point as in remembering the previous number in a sequence (such as a state for a statemachine) before the power off?
    Furthermore, is your intention to have the power to the nRF device cut externally during this time, so that there is no other option than going to SYSTEM_OFF sleep?

    In case of there being no other options than SYSTEM_OFF sleep you should look at the description in its documentation for details, but in essence this will mean that the device is completely off, retaining only a few registers through the sleep and needing a full system reset on wakeup (peripherals needs to be configured and enabled again before use, etc).

    Best regards,
    Karl

Related