# ULPM boot on GPIO 38 &39

**URL:** <https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258>\
**Category:** mangOH Green\
**Created:** [March 20, 2018, 2:47pm UTC](https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258 "2018-03-20T14:47:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnn](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@johnn](https://mangoh.discourse.group/u/johnn)\
**Post date:** [March 20, 2018, 2:47pm UTC](https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258/1 "2018-03-20T14:47:13Z")

</div>

Hi all,

Currently I am working with the mangoh Green development board with the WP7502 and our own custom board (also a WP7502).  
I would like to boot from ULPM with GPIO’s 36, 38 & 39.  
Waking up from GPIO 36 works with the pmtool.  
Unfornatally gpio’s 38 and 39 don’t work.

I’ve updated to the latest firmware versions taken from source.sierrawireless and the latest legato version.

> root@swi-mdm9x15:~# fwupdate query  
> Connecting to service …  
> Firmware Version: SWI9X15Y\_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017/11/29 18:24:42  
> Bootloader Version: SWI9X15Y\_07.12.14.00 r34472 CARMD-EV-FRMWR1 2017/11/29 18:24:42  
> Linux Version: 3.14.29ltsi-961ca71325\_ed9f616cc8 #2 PREEMPT Wed Nov 29 20:54:01 PST 2017
> 
> root@swi-mdm9x15:~# legato version  
> 18.02.0\_6a1c6bec4c64c1c94f06db8a010e7ef6

When I use:

> root@swi-mdm9x15:~# pmtool bootOn gpio 38 low  
> SUCCESS!  
> root@swi-mdm9x15:~# pmtool bootOn gpio 36 high  
> SUCCESS!  
> root@swi-mdm9x15:~# pmtool shutdown  
> Initiated shutdown of MDM

I can only wakeup from gpio 36.  
I have tried all possible configurations for gpio38 & 39.

I cannot readout the value from the GPIO through linux:

> root@swi-mdm9x15:~# echo 38 \> /sys/class/gpio/export  
> root@swi-mdm9x15:~# echo in \> /sys/class/gpio/gpio38/direction  
> root@swi-mdm9x15:~# cat /sys/class/gpio/gpio38/value  
> 1  
> it always returns 1.

Also trough atcommands I don’t see the gpio’s configured:  
root@swi-mdm9x15:~# microcom -E /dev/ttyAT  
at+wiocfg?  
+WIOCFG: 2,16,0,0,1,0,0  
+WIOCFG: 6,16,0,0,1,0,0  
+WIOCFG: 7,16,0,0,1,0,0  
+WIOCFG: 8,16,0,0,1,0,0  
+WIOCFG: 13,16,0,0,1,0,0  
+WIOCFG: 21,16,0,0,1,0,0  
+WIOCFG: 22,16,0,0,1,0,0  
+WIOCFG: 23,16,0,0,1,0,0  
+WIOCFG: 24,16,0,0,1,0,0  
+WIOCFG: 25,16,0,0,1,0,0  
+WIOCFG: 28,0,0,0,1,0,0  
+WIOCFG: 29,0,0,0,1,0,0  
+WIOCFG: 30,0,0,0,1,0,0  
+WIOCFG: 31,0,0,0,1,0,0  
+WIOCFG: 32,16,0,0,1,0,0  
+WIOCFG: 33,16,0,0,1,0,0  
+WIOCFG: 34,0,0,0,1,0,0  
+WIOCFG: 35,0,0,0,1,0,0  
+WIOCFG: 36,16,0,0,1,0,0  
+WIOCFG: 37,0,0,0,1,0,0  
+WIOCFG: 42,16,0,0,1,0,0

if i try to add them using:

> at+wiocfg=38,16  
> ERROR  
> or  
> at+wiocfg=38,16,0,0,1,0,0  
> ERROR  
> I returns an error.

How can I wake up from GPIO38 and GPIO39 ?

---

<div class="post-metadata">

**Author:** ![johnn](https://avatars.discourse-cdn.com/v4/letter/j/f0a364/32.png) [@johnn](https://mangoh.discourse.group/u/johnn)\
**Post date:** [March 22, 2018, 4:02pm UTC](https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258/2 "2018-03-22T16:02:21Z")

</div>

Someone from Sierra maybe?

---

<div class="post-metadata">

**Author:** ![rkirk](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@rkirk](https://mangoh.discourse.group/u/rkirk)\
**Post date:** [March 22, 2018, 5:41pm UTC](https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258/3 "2018-03-22T17:41:09Z")

</div>

Hi johnn, I tried this on my bench, and it was ok for me, using the same FW releases you showed in your log.

The lack of configuration of those pins via AT+WIOCFG is no problem. That’s because these pins are inaccessible from modem side, so there’s no modem configuration for them - they’re always allocated to Linux.

I think the inability to read a valid input from those pins is the key, since the pmtool app is allowing the bootOn configuration. If you can’t read a low while the system is up, I wouldn’t expect that to change in ULPM. When I bench tested this, I initially made a mistake mapping my pins on the IoT breakout board that comes with the MangOh, so I thought I was seeing the same as you. Aside from that, perhaps the external source is insufficient against the internal pull-up resistance?

Ryan

---

<div class="post-metadata">

**Author:** ![mrjoso](https://avatars.discourse-cdn.com/v4/letter/m/9e8a1a/32.png) [@mrjoso](https://mangoh.discourse.group/u/mrjoso)\
**Post date:** [March 23, 2018, 7:37pm UTC](https://mangoh.discourse.group/t/ulpm-boot-on-gpio-38-39/1258/4 "2018-03-23T19:37:38Z")

</div>

Hi Johnn,  
waking up WP7502 with GPIO38 from ULPM works on my Red board.  
I use le\_ulpm\_BootOnGpio() inside my app.  
But I’m convinced that there is a bug which disables to wake up the chip from suspend mode, and ChangeEventHandler does not work.  
More info [in this thread.](https://mangoh.discourse.group/t/wake-up-from-suspend-mode-on-gpio-interrupt/720)
