Ok, so I had a crazy idea, and I wanted the community input. My idea falls along the "save and retrieve user parameters" subject. First, I need to save several structures in memory before I load my program. If I make a loader program that will save a struct to NV RAM, and then I reflash the system with a new program, will it wipe or preserve the NV RAM data? I guess I'm asking if the software loader clears the NV RAM or if that's something only I can do manually. I don't want the data stored in the NV RAM to be visible in my code, only accessed when the code is run. Basically a form of idiot-proofing so to speak. Long story. Possible?
Secondly, and here's the crazy in me... can I store a small class of "hidden" functions in NV RAM and not only retrieve but also initialize and execute them? Total newb question to ask, I know. But it's been wiggling around in my brain for a week and it almost seems as if it could be possible... to me at least... Someone fill me in if this is possible or if I'm dreaming. I haven't tried this yet, mostly because I'm still trying to understand how to implement it once I retrieve it.
Thanks for the input folks!
saving settings then re-flashing
Re: saving settings then re-flashing
For your first question, the 'UserParameter' area is NOT changed by a code update. Each module has a document showing the memory map. There is an application note somewhere on 'How to Increase User Flash Storage'.
For your second question, this sounds very interesting, and feasible, the code is executing out of RAM so it may be possible to copy code from NVRAM into RAM and then execute it.
My suggestion is 'use the force'
For your second question, this sounds very interesting, and feasible, the code is executing out of RAM so it may be possible to copy code from NVRAM into RAM and then execute it.
My suggestion is 'use the force'
-
- Posts: 192
- Joined: Mon Dec 17, 2012 6:24 am
Re: saving settings then re-flashing
Thanks roland.ames - I'm going to have to mess with it I guess.
Anyone else have any input?
Anyone else have any input?
Re: saving settings then re-flashing
Copying a function from code space (not sure about nvram) to ram and execute can be done. This is a trick sometimes used to execute a function in the 0 wait state on-chip SRAM, which is faster than external SDRAM, for faster execution times. I suppose you could copy functions to the external SDRAM as well, just need to know where its located and not have other things write over it. So yes, it can be done. I do not have an example for you or more info than that though. But as Roland said, you do have the force on your side Probably lots of experimentation and crashes before getting everything right.