I was reading up on the flash eeprom and best I can tell for the stm32f chips this is needed. micromouseusa.com/
Has Keil mdk5 not provided a simple function?
Ok I have it working now, much clearer picture. I see now I'll need some type of shadow array to hold the writes as I progress thru the code as I can only write a page at a time. Using my last sector would be far to wasteful and using the first has that bootloader issue that can be addressed but is a pain to deal with at first.
I just want to rule out the hole in the middle possibility?
code fake eeprom or nvram code code code...
Is there anyway possibly of using IROM so that the code can be split up to have a hole in the middle for this fake nvram.
Use a scatter file that puts the vector/reset stuff low in flash, leaves space for your configuration flash area and add a section for everything else past the configuration flash area you want to use.
Along these lines?
LR_IROM1 0x08000000 0x00804000 { ; vector/reset ER_IROM1 0x08000000 0x08004000 { ; *.o (RESET, +First) *(InRoot$Sections) .ANY (+RO) } RW_IRAM1 0x08004000 0x08008000 { ; eeprom area .ANY (+RW +ZI) } }
LR_IROM2 0x08008000 0x08100000 { ER_IROM2 0x08008000 0x08100000 { ; remaining of code.. .ANY (+RO) } }
Hope this is more readable.
LR_IROM1 0x08000000 0x00804000 { ; vector/reset
ER_IROM1 0x08000000 0x08004000 { ;
*.o (RESET, +First)
*(InRoot$Sections)
.ANY (+RO)
}
RW_IRAM1 0x08004000 0x08004000 { ; eeprom area
.ANY (+RW +ZI)
LR_IROM2 0x08004000 0x08100000 {
ER_IROM2 0x08004000 0x08100000 { ; remaing of code..
This is something that you will understand best if you do it yourself. You should try to build with that scatter file and see what fails. You have a general idea of how to use the scatter file to do what you want to do, but have a few errors that you will go "why was I thinking that would work" once you figure them out.
One hint: +RW variables cannot go into flash. // this is actually more than 1 hint