# \[WP7702\] Recovery Mechanisms

**URL:** <https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159>\
**Category:** mangOH Yellow\
**Created:** [October 28, 2022, 7:22am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159 "2022-10-28T07:22:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeremylaharotte](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jeremylaharotte](https://mangoh.discourse.group/u/jeremylaharotte)\
**Post date:** [October 28, 2022, 7:22am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/1 "2022-10-28T07:22:10Z")

</div>

Hi,

I have a system that tends to reboot a lot:

> [@\[WP7702\] Can't go in ULPM Mode](https://mangoh.discourse.group/t/wp7702-cant-go-in-ulpm-mode/10030):
>
> Hello, We are currently using MangOH Yellow cards with a WP7702 chip. Some of our systems in the field have encountered a problem. They no longer go into ULPM mode. [image] We use the latest image of the MangOH Yellow software provided by the MangOH website: 0.7.0 With a slight modification of the Mango firmware: Modification of the accelerometer driver And modification of the Yocto: Modification of the curl package + addition of python library Method to switch to ULPM mode: We use a Le…

After some time the recovery mechanism is activated and we lose all our applications  
For our application, it looks like we can embed them in the legato.cwe .

But we also lose our files in the /home directory.  
The datasheet is not very clear on the effect of the recovery mode.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/9/9ad04737b098f388a566fa2052b5971f91449932.png)

Is there a command that protects the files from the recovery mechanism or is there a directory that is unaffected by the recovery mechanism?

Thank,  
Jérémy

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 28, 2022, 8:23am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/2 "2022-10-28T08:23:55Z")

</div>

I have done a test to see if a text file in /home/root will be lost after rollback, but i cannot reproduce your issue.  
Can you double confirm if your lost file is due to system rollback?

```auto
root@swi-mdm9x28-wp:~# ls /home/root/
123.txt
root@swi-mdm9x28-wp:~# legato status
Systems installed:
  6 [good]
  17 [tried 4] <-- current
Legato framework is running.
root@swi-mdm9x28-wp:~#
root@swi-mdm9x28-wp:~# cm info
Device: WP7608
IMEI: 352913090501857
IMEISV: 6
FSN: XG207430721010
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version: 002.011
PRI Part Number (PN): 9908665
PRI Revision: 001.004
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_003
SKU: 1104194
Last Reset Cause: Reset, User Requested
Resets Count: Expected: 13 Unexpected: 0
root@swi-mdm9x28-wp:~# legato version
19.02.0_4cb954265427b8c2c668a010ff5be274_modified
root@swi-mdm9x28-wp:~#

//here I reset the board

//the text file is still here
root@swi-mdm9x28-wp:~# ls /home/root/
123.txt
//system rollback and the legato app disappeared.
root@swi-mdm9x28-wp:~# legato status
Systems installed:
  6 [good] <-- current
Legato framework is running.

```

---

<div class="post-metadata">

**Author:** ![jeremylaharotte](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jeremylaharotte](https://mangoh.discourse.group/u/jeremylaharotte)\
**Post date:** [October 28, 2022, 9:16am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/3 "2022-10-28T09:16:02Z")

</div>

Hi,

I don’t lose a file when I do a reset (command or button or switch) but I lose my file when the system got corrupted (when I reboot a lot I guess)

Like in this case:

> [@\[WP7702\] Can't go in ULPM Mode](https://mangoh.discourse.group/t/wp7702-cant-go-in-ulpm-mode/10030/12):
>
> Hi, I don’t have the system with me. As I said in the previous post, I do a reboot if I can’t get into ULPM. But after some time the recovery mechanism is activated and I lose the Legato apps and the file on the system (I will write a new post about this). The log I am posting is from a system we recovered in the field after an I2C problem and before the recovery mechanism. It’s on this system that I do a hardware reboot (ON/OFF), and I can’t remember if the MCU version was missing. On a syst…

I think that to much reboot can create a file system corruption and activate the recovery mechanism that install a backup.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/mangoh/original/2X/2/210b6de62f0d1a3bac174c9fbba069b7532c44ef.png)

and when this happened my apps disappear and home directory is empty just with home directory /root

The system is in the same state as when the Mangoh was new and I had used WP77xx\_Release14.1\_SIERRA.exe or mangOH-yellow-wp77xx\_0.7.0.exe to update the board.

Jérémy

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 28, 2022, 9:28am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/4 "2022-10-28T09:28:00Z")

</div>

does this help by using the “reserved” partition?

```auto

root@swi-mdm9x28-wp:~# more /proc/mtd
dev: size erasesize name
mtd0: 00280000 00040000 "sbl"
mtd1: 00280000 00040000 "mibib"
mtd2: 00680000 00040000 "backup"
mtd3: 00100000 00040000 "security"
mtd4: 00200000 00040000 "persist"
mtd5: 01180000 00040000 "efs2"
mtd6: 04f40000 00040000 "swifota"
mtd7: 00180000 00040000 "tz"
mtd8: 000c0000 00040000 "devcfg"
mtd9: 000c0000 00040000 "rpm"
mtd10: 02000000 00040000 "modem"
mtd11: 00100000 00040000 "aboot"
mtd12: 00f00000 00040000 "boot"
mtd13: 01e00000 00040000 "system"
mtd14: 008c0000 00040000 "lefwkro"
mtd15: 01900000 00040000 "swirw"
mtd16: 08300000 00040000 "userapp"
mtd17: 03680000 00040000 "reserved"
mtd18: 02180000 00040000 "slot_2"
mtd19: 02180000 00040000 "slot_1"
mtd20: 02180000 00040000 "slot_0"
root@swi-mdm9x28-wp:~# ubiformat /dev/mtd17 -y
ubiformat: mtd17 (nand), size 57147392 bytes (54.5 MiB), 218 eraseblocks of 262144 bytes (256.0 KiB), min. I/O size 4096 bytes
libscan: scanning eraseblock 217 -- 100 % complete
ubiformat: 218 eraseblocks are supposedly empty
ubiformat: formatting eraseblock 217 -- 100 % complete
root@swi-mdm9x28-wp:~# ls /dev/ubi*
/dev/ubi0 /dev/ubi1_0 /dev/ubi4 /dev/ubiblock1_0
/dev/ubi0_0 /dev/ubi2 /dev/ubi4_0 /dev/ubiblock2_0
/dev/ubi0_1 /dev/ubi2_0 /dev/ubi_ctrl
/dev/ubi0_2 /dev/ubi3 /dev/ubiblock0_0
/dev/ubi1 /dev/ubi3_0 /dev/ubiblock0_1
root@swi-mdm9x28-wp:~# ls /dev/ubi* -l
crw-rw---- 1 root root 238, 0 Jan 1 1970 /dev/ubi0
crw-rw---- 1 root root 238, 1 Jan 1 1970 /dev/ubi0_0
crw-rw---- 1 root root 238, 2 Jan 1 1970 /dev/ubi0_1
crw-rw---- 1 root root 238, 3 Jan 1 1970 /dev/ubi0_2
crw-rw---- 1 root root 234, 0 Jan 1 1970 /dev/ubi1
crw-rw---- 1 root root 234, 1 Jan 1 1970 /dev/ubi1_0
crw-rw---- 1 root root 236, 0 Jan 1 1970 /dev/ubi2
crw-rw---- 1 root root 236, 1 Jan 1 1970 /dev/ubi2_0
crw-rw---- 1 root root 237, 0 Jan 1 1970 /dev/ubi3
crw-rw---- 1 root root 237, 1 Jan 1 1970 /dev/ubi3_0
crw-rw---- 1 root root 235, 0 Jan 1 1970 /dev/ubi4
crw-rw---- 1 root root 235, 1 Jan 1 1970 /dev/ubi4_0
crw-rw---- 1 root root 10, 57 Jan 1 1970 /dev/ubi_ctrl
brw-rw---- 1 root root 253, 0 Jan 1 1970 /dev/ubiblock0_0
brw-rw---- 1 root root 253, 1 Jan 1 1970 /dev/ubiblock0_1
brw-rw---- 1 root root 253, 3 Jan 1 1970 /dev/ubiblock1_0
brw-rw---- 1 root root 253, 2 Jan 1 1970 /dev/ubiblock2_0
root@swi-mdm9x28-wp:~# ubiattach -m 17 -d 7
UBI device number 7, total 218 LEBs (55361536 bytes, 52.7 MiB), available 174 LEBs (44187648 bytes, 42.1 MiB), LEB size 253952 bytes (248.0 KiB)
root@swi-mdm9x28-wp:~# ubimkvol /dev/ubi7 -N test -s 42MiB
Volume ID 0, size 174 LEBs (44187648 bytes, 42.1 MiB), LEB size 253952 bytes (248.0 KiB), dynamic, name "test", alignment 1
root@swi-mdm9x28-wp:~# mkdir -p /tmp/customer
root@swi-mdm9x28-wp:~# mount -t ubifs /dev/ubi7_0 /tmp/customer
root@swi-mdm9x28-wp:~# ls /tmp/customer/
root@swi-mdm9x28-wp:~# echo safsdfasdf > /tmp/customer/test.txt
root@swi-mdm9x28-wp:~# cm info
Device: WP7608
IMEI: 352913090501857
IMEISV: 6
FSN: XG207430721010
Firmware Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
Bootloader Version: SWI9X07Y_02.28.03.03 000000 jenkins 2019/05/21 03:33:04
MCU Version: 002.011
PRI Part Number (PN): 9908665
PRI Revision: 001.004
Carrier PRI Name: GENERIC
Carrier PRI Revision: 002.068_003
SKU: 1104194
Last Reset Cause: Power Down
Resets Count: Expected: 15 Unexpected: 0
root@swi-mdm9x28-wp:~# cat /tmp/customer/test.txt
safsdfasdf

// power cycle the device

root@swi-mdm9x28-wp:~# mkdir -p /tmp/customer
root@swi-mdm9x28-wp:~# ubiattach -m 17 -d 7
UBI device number 7, total 218 LEBs (55361536 bytes, 52.7 MiB), available 0 LEBs (0 bytes), LEB size 253952 bytes (248.0 KiB)
root@swi-mdm9x28-wp:~# mount -t ubifs /dev/ubi7_0 /tmp/customer
root@swi-mdm9x28-wp:~# cat /tmp/customer/test.txt
safsdfasdf
root@swi-mdm9x28-wp:~#

```

---

<div class="post-metadata">

**Author:** ![jeremylaharotte](https://avatars.discourse-cdn.com/v4/letter/j/f19dbf/32.png) [@jeremylaharotte](https://mangoh.discourse.group/u/jeremylaharotte)\
**Post date:** [October 28, 2022, 9:49am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/5 "2022-10-28T09:49:36Z")

</div>

Hi,

This could be a good solution.  
I will try.

Jeremy

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea2.discourse-cdn.com/flex016/user_avatar/mangoh.discourse.group/jyijyi/32/997_2.png) [@jyijyi](https://mangoh.discourse.group/u/jyijyi)\
**Post date:** [October 29, 2022, 3:37am UTC](https://mangoh.discourse.group/t/wp7702-recovery-mechanisms/10159/6 "2022-10-29T03:37:11Z")

</div>

You can also see here to split the userapp partition or system partition:

> **[\[WP7607\] Data deletion after power loss](https://forum.sierrawireless.com/t/wp7607-data-deletion-after-power-loss/26944/10)**
>
> Got a solution for this problem! After I saw this post: Free (small) partition for storing serial number? - #15 by sierra-wireless I thought about formatting the userapp MTD16 partition and splitting it into two UBI volumes (the first gets a quarter...

> **[Free (small) partition for storing serial number?](https://forum.sierrawireless.com/t/free-small-partition-for-storing-serial-number/24001/15)**
>
> In case others google their way to here: I finally managed to crack this challenge … The solution was to create extra ufs partitions in the “system” (mtd13) mtd partition with my data. This way, all can be restored, even if (when) /mnt/flash...
