"Not to be a broken record"
Not at all Rich. I guess the problem is, the area of memory/flash/etc is one that I think I have too little understanding, and unfortunatly, I don't have time to understand because I'm pushing a hard deadline.
So, I'll ask you a couple of questions and please feel free to call me an idiot when I'm done if I present myself as such because I'm fairly open to anything anyone has to say at this point. Please bear with me while I try to work this out in my head.
I've got my linker file set up, although you're recommending I end flash at 128k, and start informs_vars immediatly after it. I have to erase and write by the page size so I may as well make informs_vars 0x800 bytes. I presume this should be appropriate:
MEMORY
{
flash (RX) : ORIGIN = 0x00000000, LENGTH = 0x00020000
informs_vars (RX) : ORIGIN = 0x00020000, LENGTH = 0x00000800
vectorram(RWX) : ORIGIN = 0x20000000, LENGTH = 0x00000400
sram (RWX) : ORIGIN = 0x20000400, LENGTH = 0x00007C00
ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0
}
Next, say the end user has run through the configuration program and all of his/her answers have been stored temporarily to an array (I'm assuming the variables also have to be uint32 for simplicity so we'll say I have 20 variables to save and have them in uint32 temp[20]). He/she is ready to save the variables, I first want to run a lil something like this :
flash_erase_pages(0x20000, 1) <--- actually I'm pretty sure I'm misinterpreting what npages is.
I was assuming it was the number of pages I want to erase
(just one) but probably not since it's also a uint32. That
would be pretty serious overkill.
Next I would want to write them into the page I just erased using the function
flash_write_words(uint32 *addr, uint32 *data, uint32 nwords)
I'm guessing I could do something like
flash_write_words(0x20000, temp, 20) <-- again, with the last one, I'm unsure
Barring the couple of errors I'm sure I've made, is it just that simple? If so, I really am a moron.
Where does flash_initialize(void) come in. Also, in my linker file, I've created a section like this:
.informsArraySection :
{
*(.informsArrayZone)
}
Am I ever going to have anything explicitly in my code that's going to call that or do anything with that, or is it just implied when I'm doing my erase and write functions.
Thanks again Rich.
cmag