# Pmusleep not working?

**URL:** <https://forums.sifive.com/t/pmusleep-not-working/2523>\
**Category:** HiFive1 Rev B\
**Created:** [June 26, 2019, 1:55pm UTC](https://forums.sifive.com/t/pmusleep-not-working/2523 "2019-06-26T13:55:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Almindor](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/almindor/32/662_2.png) [@Almindor](https://forums.sifive.com/u/Almindor)\
**Post date:** [June 26, 2019, 1:55pm UTC](https://forums.sifive.com/t/pmusleep-not-working/2523/1 "2019-06-26T13:55:50Z")

</div>

I’m trying to get PMU to get the board to sleep. I’ve set the pmukey register correctly (checked by reading back and getting 1) but writing to pmusleep doesn’t do anything at all, that is execution continues without anything happening.

I’ve checked the sleep and wake program registers as well and they seem to have different values than the documentation would suggest.

I set them to the documented defaults (confirmed to have worked) but that still doesn’t seem to have fixed the problem.

Is there something I’m missing or is the PMU broken on the hifive1-revB?

---

<div class="post-metadata">

**Author:** ![Almindor](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/almindor/32/662_2.png) [@Almindor](https://forums.sifive.com/u/Almindor)\
**Post date:** [June 26, 2019, 7:54pm UTC](https://forums.sifive.com/t/pmusleep-not-working/2523/2 "2019-06-26T19:54:24Z")

</div>

It seems that pmusleep puts the board to sleep only every 2nd restart of the board (even if I always fill the pmusleeppm registers myself!).

First run nothing happens. Pressing the reset button it seems to work and the board goes to sleep. RTC wake doesn’t seem to trigger for some reason when enabled, but button wake does.

If I reset the board again using the reset button it goes into a “failed cycle” not sleeping again. And this just continues, on and off each time.

---

<div class="post-metadata">

**Author:** ![Almindor](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.sifive.com/almindor/32/662_2.png) [@Almindor](https://forums.sifive.com/u/Almindor)\
**Post date:** [July 25, 2019, 6:27pm UTC](https://forums.sifive.com/t/pmusleep-not-working/2523/3 "2019-07-25T18:27:23Z")

</div>

So the wakeup portion failing was my fault, I didn’t set the “alwayson” bit on the RTCCFG register.

The non-deterministric resets with the original sifive1 “bootloader” are still there. If I use my [custom protector](https://github.com/almindor/hifive1-protector) instead it works as expected, sleeps on each iteration and reset.
