# Ultra low power mode with WP7702

**URL:** <https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131>\
**Category:** Uncategorized\
**Created:** [March 10, 2022, 2:40am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131 "2022-03-10T02:40:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 2:40am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/1 "2022-03-10T02:40:11Z")

</div>

I am trying to setup a wp7702 in ultra low power mode but something is not working:  
Following this sample code:

> <https://github.com/legatoproject/legato-af/blob/master/apps/sample/textLoc/textLocComponent/textLoc.c>

but to start with, this will not work unless I set the shutdown strategy:

LE\_ERROR\_IF(le\_ulpm\_BootOnTimer(30) != LE\_OK, “Can’t set timer as boot source”);  
LE\_ERROR\_IF(le\_ulpm\_BootOnGpio(38, LE\_ULPM\_GPIO\_LOW) != LE\_OK, “Can’t set gpio38 as boot source”);  
LE\_ERROR\_IF(le\_ulpm\_SetShutDownStrategy(LE\_ULPM\_ULPM\_ONLY) != LE\_OK, “Can`t set the shutdown strategy”);  
// Initiate shutdown.  
LE\_ERROR\_IF(le\_ulpm\_ShutDown() != LE\_OK, “Can’t initiate shutdown”);

I can trigger the shutdown to ULPM but for some reason the device will wake up even if the GPIO38 is not connected to +Vref.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 10, 2022, 2:48am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/2 "2022-03-10T02:48:50Z")

</div>

have you tried with AT!POWERMODE and AT!POWERWAKE to verify first

---

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 2:53am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/3 "2022-03-10T02:53:27Z")

</div>

I am trying the the pmtool and that one will not work either, this is the version on  
Ultra Low Power Manager Firmware Version: 002.015  
root@fx30:~# pmtool bootOn gpio 36 rising  
SUCCESS!  
root@fx30:~# pmtool bootOn gpio 38 falling  
SUCCESS!  
root@fx30:~# pmtool bootOn timer 10000  
SUCCESS!  
root@fx30:~# pmtool shutdown  
Initiated shutdown of MDM

The unit doesn`t not power down and keeps running as normal.  
Is there any other service which is preventing the ULPM?

---

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 2:55am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/4 "2022-03-10T02:55:48Z")

</div>

AT!POWERMODE  
ERROR  
AT!POWERWAKE  
ERROR

This is what I get in reply

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 10, 2022, 2:56am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/5 "2022-03-10T02:56:02Z")

</div>

please see AT command user guide

---

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 4:29am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/6 "2022-03-10T04:29:05Z")

</div>

I can`t find that command in the user manual of the FX30, I did check with this:  
AT!POWERMODE?  
!POWERMODE: No request, status=2-Initialized

OK

do you have any link to how to use this AT command?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 10, 2022, 4:40am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/7 "2022-03-10T04:40:29Z")

</div>

you can download the WP77 AT command use guide

---

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 5:35am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/8 "2022-03-10T05:35:29Z")

</div>

I can set it into ULPM with the command:  
AT!POWERMODE=3  
but it doesn`t seems that GPI38 (IO2) is waking it up, this was set with:  
AT!POWERWAKE=2,38,high  
OK

I have also tried with the command:  
AT!POWERWAKE=2,38,low  
OK

the ULPM seems supported as if I change the timer:  
AT!POWERWAKE=1,10  
OK  
AT!POWERMODE=3

then the unit will switch off and then to turn back on after 10s.  
But I am unsure why the wakeup with GPIO38 is not working…  
ULPM WAKE2 GPIO38 (SPI2\_CLK) SWIMCU PTB0 SWIMCU PTB0  
Do I need to activate anything in the software before this is enabled?  
As I am connecting Ground (also tried with +Vref) to IO2 (GPIO21) and this doesn`t wake up the unit. But I am unsure if GPIO38 is internally linked to GPIO21 (they should be).

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 10, 2022, 6:46am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/9 "2022-03-10T06:46:00Z")

</div>

why do you set the edge trigger like that?

 ![image](https://us1.discourse-cdn.com/flex019/uploads/legato1/original/2X/7/7986d639fb69b2489c4bf6430e9f8538d5d110ef.png)

you can also see this document on how to set wakeup source (at least can make sure the GPIO pin is working fine):

> **[Wake up from suspend mode on GPIO interrupt](https://mangoh.discourse.group/t/wake-up-from-suspend-mode-on-gpio-interrupt/720/15)**
>
> You can see this document: How to use GPIO as wakeup source on WP77xx MangOH Red board.docx (277.1 KB)

---

<div class="post-metadata">

**Author:** ![ClaudioBaldo](https://avatars.discourse-cdn.com/v4/letter/c/b9bd4f/32.png) [@ClaudioBaldo](https://forum.legato.io/u/ClaudioBaldo)\
**Post date:** [March 10, 2022, 7:05am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/10 "2022-03-10T07:05:57Z")

</div>

ok, it does work by using the \<2\>, low level trigger.  
Still doesn`t work with the pmtool of legato…

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [March 10, 2022, 7:07am UTC](https://forum.legato.io/t/ultra-low-power-mode-with-wp7702/6131/11 "2022-03-10T07:07:14Z")

</div>

i never use pmtool  
you can send AT command for your application
