I have several user entered parameters to store (integer values), such as
maxTime (time limit)
tripVoltage
maxSpeed
SoundLevel
These are to be restored upon power up…this is on a Cobra board…I think it should use EWR, but not sure. The posts I see generally say it doesn’t work, or there are multiple problems in getting it to work,as though its an ongoing issue. Does it really work & are there examples that do restore the values properly?
[quote]What about this nice utility (includes sample project for Cobra):
[/quote]
The utility allows you to:
LoadSettings from SD card
SaveSettings to SD card
Ummm… thanks but this link was for storing files on an SD card . I’m not interested in an SD card, just storing the values of a few integer variables on the board or processor memory, so that at power up these user values will be restored. This is probably 50 bytes worth of setup information. I’d expect some sort of write/store routine & a read routine that could be used at some point in the program.
what example(s)…that was my original question?! Is there one that works or a tutorial? Just trying to store a few integer values, as entered by the user so that these values can be restored after power removal.
And another easy reference is to click on the “Downloads & Tutorials” link above !! All the online documentation pointers can be found here, for both NETMF and GHI SDK specifics.
may do the trick …I will give it a try…it is the only thing I’ve seen that claims to work & is given in the form of a program.
even so it has a few strange descriptions:
[quote]Is ewr.Target = obj; enough to store the data in memory?..Yes. No other (strong) reference does prevent storing the data to the persistent storage, in opposite to standard WeakReference.
[/quote] …what ??
[quote]As it was already said, you have to set ewr.Target before calling Recover. So if you don’t recover, you don’t have to just to keep the data to the next start.[/quote]…I guess that just means no worries
@ Hoyt,
I agree with you that after reading several posts on this forum I got the feeling that EWR is not reliable. That it sometimes does not survive a hard reboot. I admit that I didn’t try using EWR myself, so I can’t say for certain that there problems, but I didn’t want to spend the time figuring it out. That is one reason why I wrote the utility at this link:
If you notice I defined a generic ISettingsProvider interface for the utility. The idea is that in the future I could replace the IniSettings class with an EWRSettings class and my project would still work the same.
To my own experience i think ewr is reliable. I have it running in production without any problems so far, but i had problems in the beginning to get it working reliable because, to my opinion, of poor and incomplete documentation. There is actually one issue that i have to cover, I had problems erasing memory using MFDeploy after using EWR. I have a sense of feeling, but not sure, there is a relation. The lack of time stops me for testing it.
A important GHI method you should pay attention to which in not in the miloush example is FlushExtendedWeakReferences() You can find it in the GHI Util class.
I just noticed the EMX datasheet mentions there is 4K for “direct storage”, as …I searched around here but see no mention of it or how it is used (well, I’m not sure how you search in titles, or what word combos/wildcards, etc may be used)…
is this 4K bank just as good/easy to use/reliable?
There is also 2KB battery backup memory available for emx. See BatteryRam class. Maybe this refers to the 4KB in the datasheet and probably 2KB is available to the user.
Maybe someone can confirm if this assumption is wrong or right.