# Backup Ram Stopped working (Issue with 0.4.9) (updated)

**URL:** <https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506>\
**Category:** Troubleshooting\
**Created:** [January 27, 2016, 4:56am UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506 "2016-01-27T04:56:06Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![brsavage2010](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@brsavage2010](https://community.particle.io/u/brsavage2010)\
**Post date:** [January 27, 2016, 4:56am UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/1 "2016-01-27T04:56:06Z")

</div>

I confirmed that the code below works correction on 0.4.7 but stopped working with 0.4.9. It appears that 0.4.9 has affected the way retained variables work

* * *

I had been using the back up ram via retained variables on a photon running successfully for a week. Then today I flashed the photon and now retained variables are no longer working. No matter what I try the values are no longer retained...

I simplified the code to:

```auto
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));

retained int value;

void setup() {
    Serial.begin(9600);
}

void loop() {
    Serial.println(value);
        Spark.publish("message-1",String(value),60,PRIVATE); delay(1000);
    value = 20;
    Serial.println(value);
    	     Spark.publish("message-2",String(value),60,PRIVATE); delay(5000);
    delay(1000); // Give the serial TX buffer a chance to empty
   System.sleep(SLEEP_MODE_DEEP, 10);

}

```

no matter what I do I get

> message 1= 0  
> message 2=20  
> over and over gain.

prior to today I would have had:

> Message 1=20  
> Message 2=20

Any suggestions?

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [January 27, 2016, 2:36pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/2 "2016-01-27T14:36:09Z")

</div>

Ping @mdma

---

<div class="post-metadata">

**Author:** ![Pixelmatix](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/pixelmatix/32/9357_2.png) [@Pixelmatix](https://community.particle.io/u/Pixelmatix)\
**Post date:** [January 27, 2016, 3:05pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/3 "2016-01-27T15:05:16Z")

</div>

It’s version “0.4.9”, to help people like me searching for this issue.

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [January 27, 2016, 4:42pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/4 "2016-01-27T16:42:49Z")

</div>

Thanks for reporting this. We’ve identified and resolved the issue. Please recompile and flash your application to get the fix. The fix does not affect system firmware - only the application code needs to be flashed.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 5, 2016, 2:35pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/5 "2016-03-05T14:35:10Z")

</div>

same issue right now on Electron?

```
STARTUP(System.enableFeature(FEATURE_RETAINED_MEMORY));

retained int value;

void setup() {
	Serial.begin(9600);
}

void loop() {
	Serial.println(value);
	// Spark.publish("message-1",String(value),60,PRIVATE); delay(1000);
	value++;
	Serial.println(value);
	// Spark.publish("message-2",String(value),60,PRIVATE); delay(5000);
	delay(3000); // Give the serial TX buffer a chance to empty
	System.sleep(SLEEP_MODE_DEEP, 5);
}

```

gives me on serial:

```
0
1
0
1

```

☹

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 5, 2016, 3:39pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/6 "2016-03-05T15:39:09Z")

</div>

just to clarify: same sketch runs perfectly on photon

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [March 5, 2016, 10:30pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/7 "2016-03-05T22:30:53Z")

</div>

Yes, there was a bug introduced in 0.4.8 that was fixed for 0.4.9, so I believe this is what’s causing the issue on the electron, which is based on 0.4.8. We will be posting a new release in a few weeks, if not sooner.

In the meantime,you could try building using the local toolchain.

---

<div class="post-metadata">

**Author:** ![autolib](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@autolib](https://community.particle.io/u/autolib)\
**Post date:** [March 9, 2016, 8:00pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/8 "2016-03-09T20:00:51Z")

</div>

@joky did building using the local toolchain work in keeping retained values? Briefly what is the process? Thanks.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 9, 2016, 8:06pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/9 "2016-03-09T20:06:00Z")

</div>

hi,  
didn't try yet, I've still 2 other open issues with my electrons, the first one is a real show-stopper right now:

> [@Electron: Entering listening mode (flashing blue) by error](https://community.particle.io/t/electron-entering-listening-mode-flashing-blue-by-error/20711):
>
> Hi everyone, I’d like to test-install my first electron project: A ultrasonic distance sensor mounted on a waterproof case containing the electron and the battery. The battery will be recharged by an small solar panel. The device should monitor and report the level of a river. To keep the device as long as possible online I turn the cellular off send the device to deep sleep mode (currently every 5 minutes). Instead of particle cloud I choose thinkspeak. The device itself works quite well (a…

> [@\[solved\] Electron: TCPClient weirdness](https://community.particle.io/t/electron-tcpclient-weirdness/20771):
>
> Hi @mdma! I came across some strange bugs with the Electron: I use the TCPClient to connect to a basic TCP server. The connection works fine, I send data to the TCP server, the data is received fine, and the server sends data back. The reception side does not really work. There are a couple of weird effects: Client.available() will not indicate reception of data Client.read() will return received data, but only after the sender side shutdown the connection and only if the data size is above …

I'll try to compile the firmware tomorrow, maybe one or two of the other issues are gone too 😄

regards

---

<div class="post-metadata">

**Author:** ![autolib](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@autolib](https://community.particle.io/u/autolib)\
**Post date:** [March 10, 2016, 6:19pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/10 "2016-03-10T18:19:03Z")

</div>

Hi @joky let us know how it goes.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 11, 2016, 10:30am UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/11 "2016-03-11T10:30:31Z")

</div>

sorry, had some issues compiling the firmware. When uploading user-firmware.bin or application.bin, the electron goes into magenta-breathing recovery mode,…

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [March 11, 2016, 1:32pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/12 "2016-03-11T13:32:23Z")

</div>

You’ll need to build from the modules folder rather than main, so that you update the system firmware too.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 11, 2016, 2:10pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/13 "2016-03-11T14:10:13Z")

</div>

thanks,… got system-part1.bin, system-part2.bin and application.bin newly compiled. I flashed them OTA but again - just breathing magenta,…

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [March 11, 2016, 2:51pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/14 "2016-03-11T14:51:23Z")

</div>

try `particle serial inspect` it will tell you why.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 11, 2016, 6:55pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/15 "2016-03-11T18:55:36Z")

</div>

Hi,  
I put the electron in listening mode and entered `particle serial inspect` and got:

```
User module #1 - version 3, main location, 131072 bytes max size
  UUID: 7BC1D5F608F7E663AD75BF5E3BB26392347DAFF79B6193EFE92C7BFCC78020DB
  Integrity: PASS
  Address Range: PASS
  Platform: PASS
  Dependencies: FAIL
      System module #2 - version 11
  empty - factory location, 131072 bytes max size

```

Only “Dependencies” failed, the other modules are all PASS.

regards

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [March 11, 2016, 8:35pm UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/16 "2016-03-11T20:35:37Z")

</div>

looks like you haven’t managed to successfully update system firmware. Pressing ‘v’ in listening mode should show the version as 0.4.9.

---

<div class="post-metadata">

**Author:** ![joky](https://avatars.discourse-cdn.com/v4/letter/j/d26b3c/32.png) [@joky](https://community.particle.io/u/joky)\
**Post date:** [March 12, 2016, 9:20am UTC](https://community.particle.io/t/backup-ram-stopped-working-issue-with-0-4-9-updated/19506/17 "2016-03-12T09:20:46Z")

</div>

right… `system firmware version: 0.4.8-rc.6`

flashed the same binaries (system-part1.bin, system-part2.bin and application.bin) again over serial and voila! **Backup RAM works now!** (using F/W 0.4.9)

thank you!
