# How to activate Data retention in Sleep or Standby mode AMB82 mini

**URL:** <https://forum.amebaiot.com/t/how-to-activate-data-retention-in-sleep-or-standby-mode-amb82-mini/3596>\
**Category:** SDK\
**Tags:** evb-amb82, rtl8735b\
**Created:** [December 3, 2024, 8:57am UTC](https://forum.amebaiot.com/t/how-to-activate-data-retention-in-sleep-or-standby-mode-amb82-mini/3596 "2024-12-03T08:57:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tail](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tail](https://forum.amebaiot.com/u/tail)\
**Post date:** [December 3, 2024, 8:57am UTC](https://forum.amebaiot.com/t/how-to-activate-data-retention-in-sleep-or-standby-mode-amb82-mini/3596/1 "2024-12-03T08:57:49Z")

</div>

Hello  
I used arduino 2.3.3 and lastest sdk arduino. (board AMB82 mini)

I need to do i program that periodically wake up execute some tasks and then go back to sleep (to save energy).  
I tried the function “PowerMode.begin” with DEEPSLEEP\_MODE et STANDBY\_MODE but it seems like there is no data retention at wake up. Variables reset to init values. Which is a problem, for example if I configure the RTC or another peripheral, i don’t want to re-init it at wakeup.

Question : When using one of the sleep mode, how to you do or activate the retention of data/variables?

Thank you

---

<div class="post-metadata">

**Author:** ![Kelvin\_Huang](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.amebaiot.com/kelvin_huang/32/2130_2.png) [@Kelvin\_Huang](https://forum.amebaiot.com/u/Kelvin_Huang)\
**Post date:** [December 4, 2024, 6:43am UTC](https://forum.amebaiot.com/t/how-to-activate-data-retention-in-sleep-or-standby-mode-amb82-mini/3596/2 "2024-12-04T06:43:39Z")

</div>

Hi @tail,

One possible way I could think of is to store the data in flash and read from the flash when wake up.

Thank you.

---

<div class="post-metadata">

**Author:** ![tail](https://avatars.discourse-cdn.com/v4/letter/t/e9c0ed/32.png) [@tail](https://forum.amebaiot.com/u/tail)\
**Post date:** [December 4, 2024, 7:52am UTC](https://forum.amebaiot.com/t/how-to-activate-data-retention-in-sleep-or-standby-mode-amb82-mini/3596/3 "2024-12-04T07:52:28Z")

</div>

Thank Kelvin  
Yes, this can be a solution. Just need to be careful with the wear out of the flash.

Cheers
