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

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

  • 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

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

    Hi Karl,

    Exactly I mean this. In fact, this is called intermittent computing, you can know the paradigm here.

    I am sorry for bothering you once more time!

    Best wishes,

    Gaosheng Liu

  • Hello again, Gaosheng Liu

    lgs said:
    I am sorry for bothering you once more time!

    No need to apologize - we're here to help and happy to do so! 

    lgs said:
    Exactly I mean this. In fact, this is called intermittent computing, you can know the paradigm here.

    Which of the two requirements I detailed is the one you are referring to?
    In your reply you have quoted both, so I am not sure which of them is exactly what you mean.

    Best regards,
    Karl

  • Which of the two requirements I detailed is the one you are referring to?
    In your reply you have quoted both, so I am not sure which of them is exactly what you mean.

    Hi Karl,

    Nice to see you again! According to your indications, I am reading the corresponding doc and try to see if can achieve the aim. It may need much time to do it. I will let you know the result then.

    Best,

    Gaosheng

  • lgs said:
    Nice to see you again!

    Likewise, Gaosheng!

    lgs said:
    According to your indications, I am reading the corresponding doc and try to see if can achieve the aim. It may need much time to do it. I will let you know the result then.

    In my previous question I asked which of the two scenarios I detailed (SYSTEM_ON vs SYSTEM_OFF) that applied to your situation - because I have not fully understood which of the two you mean when you talk about sleep and the requirements of your system.
    Taking your last question about SYSTEM_ON sleep into account, I suppose I can assume you meant SYSTEM_ON sleep - in which case it should not take too long for you to try out / utilize, since you can make use of the power management module to configure and use the SYSTEM_ON sleep, like shown in the BLE peripheral examples I mentioned.

    Please do not hesitate to ask if you should have any questions about this, or if you encounter any issues!

    Best regards,
    Karl

Reply
  • lgs said:
    Nice to see you again!

    Likewise, Gaosheng!

    lgs said:
    According to your indications, I am reading the corresponding doc and try to see if can achieve the aim. It may need much time to do it. I will let you know the result then.

    In my previous question I asked which of the two scenarios I detailed (SYSTEM_ON vs SYSTEM_OFF) that applied to your situation - because I have not fully understood which of the two you mean when you talk about sleep and the requirements of your system.
    Taking your last question about SYSTEM_ON sleep into account, I suppose I can assume you meant SYSTEM_ON sleep - in which case it should not take too long for you to try out / utilize, since you can make use of the power management module to configure and use the SYSTEM_ON sleep, like shown in the BLE peripheral examples I mentioned.

    Please do not hesitate to ask if you should have any questions about this, or if you encounter any issues!

    Best regards,
    Karl

Children
Related