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

  • 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

  • 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

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

Children
No Data
Related