NVRAM issue or something else?

I have 1 imp running this code:
function test(){
if ((“nv” in getroottable()) && (“count” in nv))
{
nv.count++;
}
else
{
nv <- {count = 1};
}
server.log(“Pass #” + nv.count);
server.log(imp.getsoftwareversion());
imp.wakeup(10,test);
}

imp.configure(“My Impee”, [], []);

test();

and I have another running imp:
// Update a field in the table if it is present
// else initialise the table with a field
if ((“nv” in getroottable()) && (“count” in nv))
{
nv.count++;
}
else
{
nv <- {count = 1};
}

// Configure a node on the Planner
imp.configure(“My Impee”, [], []);
server.log(imp.getsoftwareversion());
// Display the sleep count on our node
server.log(“Pass #” + nv.count);

// Enter deep sleep for 10s
server.sleepfor(10.0);

With the first imp, nv data is increasing every time the imp wakes up. With the second imp, its not happening. Nvram is reset every time it wakes up. Both have same software version and have tried changing impees but no success.
Anybody got into this before and has got a solution?

Many thanks.

What happens if you swap the imp cards? (Don’t change anything else)

Same issue.
I made my own april impee based on Sparkfun’s april impee with some addition (SHT1x sensor on board). Could it be due to anything gone wrong with the hardware? The sensor and the impee are working fine, can make measurements, but when it wakes from deep sleep, nvram content is lost.

So nvram isn’t lost on a real April but is on your board? What’s the power supply set up for your board?

What does the wakereason report as on wake from sleep?

There can be big inrush currents on startup, it’s possible without enough capacitance you could glitch the supply enough to lose nvram.

Wake reason is 1 (WAKEREASON_TIMER). I had put a 220uF capacitor to check it. Tried with both new set of 3xAAA battery and USB, but got the same result. This is happening only when waking from deep sleep. Could it be that TPS62172 going into powersave mode when imp is in deep sleep as imp is not drawing enough current to keep in active power state?
I have tried all I can imagine.
Otherwise, I might have to dump my 10 new Impees. :(.

62172 will be going into PFM mode but that happens all the time and shouldn’t be an issue. The DCDC is very sensitive to layout though, did you copy the april one or follow all the recommendations in the TI datasheet?

I copied the spakfun schematics and board. I don’t see any visible differences in sparkfun’s and my board.

Copied everything about the routing around the power supply, via positions included? I believe we did review their board’s layout…