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

  • 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

  • If you would like it to resume from the previous point, rather than from reset, you will need to use SYSTEM_ON sleep.

    Hi Karl,

    Have a nice weekend! Do you have some examples about how to use SYSTEM_On sleep mode?

    Kind regards,

    Gaosheng

  • Hello again Gaosheng,

    lgs said:
    Have a nice weekend!

    Thank you for saying so - I hope you had a nice weekend as well!

    lgs said:
    Do you have some examples about how to use SYSTEM_On sleep mode?

    Yes, to see the SYSTEM_ON sleep mode demonstrated you could take a look at any of the BLE peripheral applications, such as the ble_app_uart, for instance.
    The idle_state_handler is the function that places the device in SYSTEM_ON sleep when there is nothing else that needs doing.
    The CPU will then wake up as soon as any events are generated.

    Best regards,
    Karl

Related