Either don't reset or keep data through reset

Hi,

The problem I am trying to solve is to keep track of time while out of communication with the PC connected via USB.

I am using an Artemis Nano that has battery backup.

When the PC is up and running it can inform the Nano of what time it is and the Nano can then increment time as it passes.

This context is lost if the Nano gets rebooted by the PC.

Since I want to be accurate to within a few seconds, writing the current value to EEPROM (emulated via flash) is not an option. It would slow things down (EEPROM writes take time) and burn it out (yes flash is better than EEPROM, but writing once/sec would still burn it out).

I have not been able to figure out a way to prevent the PC from rebooting the Nano if AC fails on the PC and then the PC gets power again. During the Windows initialization, the Nano gets rebooted. Until my PC app is invoked, the Nano doesn’t know what time it is.

I see a couple option:

  1. Is there a way to prevent the Nano from being rebooted during Windows initialization?

  2. I have attempted to get the variable attribute ‘noinit’ to work. It compiles and I see a ‘noinit’ section in the memory map, but it is still being initialized to zero on startup.

Can you help me with either of the above or is there another way?

Looking through the map, I did see a section named ‘.uninitialized’ and tried using that section. No joy.

You could try using an RTC like https://www.sparkfun.com/products/16281 and fetch the time from it.

This is a solution where we could be needing thousands of these devices. Adding that expensive of an additional part seems excessive to get around the boot loader clearing RAM that it shouldn’t.