Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By androidfanboy
#73915 I'm running into some weird issues with RTC memory. Here's my initialization stuff above setup():

Code: Select allextern "C" {
#include "user_interface.h"
}

typedef struct {
  boolean var1 = false;
  uint8_t var2 = 0;
  uint8_t var3 = 0;
} rtcStore;

rtcStore RTCvals;


And here's a line that works:

Code: Select allsystem_rtc_mem_write(64, &RTCvals, sizeof(RTCvals));


This also works to store one variable starting at bucket 64:

Code: Select allsystem_rtc_mem_write(64, &RTCvals.var1, 4);


However, the problem is storing an individual variable from RTCvals at any other bucket number, like 65 or 66:

Code: Select allif (!system_rtc_mem_write(65, &RTCvals.var2, 4)) Serial.println("FAILED!");


The line above will print "FAILED!". I'm also pretty sure it used to work before, so I'm a bit baffled. Any ideas what's going on here?

Thanks!