09-15-2010 01:17 PM
Hi,
Is there any way to save variables values which are in the RAM to the flash ROM, so that after a power cycle or reset values are not lost.
SD card is no good because I am using the display at the same time.(or if there is an way around that limitation...)
thx
Lukasz
09-21-2010 12:08 PM
Hi Lukasz,
Unfortunately LV for ARM doesn't have this functionality built in. But you can look at the following resources to see how you might implement it manually. You will need to be careful though, as the same flash is used to hold the program itself.
http://focus.ti.com/lit/an/spma030/spma030.pdf
http://www.zlgmcu.com/luminary/download/LM3SAPP_Flash_Program_OnChip_en.pdf
http://www.smileymicros.com/download/EEPROM/EEPROM%20Memory.pdf
09-27-2010 09:23 AM
I used the Luminary EEPROM emulation and it works, only limitation is it s 8bit addressing... 256x16bits, but for a few variables storage it s plenty. It s just strange that they allow such big page sizes and so few variables, why not use the direct real flash memory addresses instead of the 8bits?
Thx again
09-28-2010 09:05 AM
We honestly only use the flash libraries that Keil provides so it was built into that already (http://digital.ni.com/public.nsf/allkb/1416FED9DA9F212F862576EB0075EDD6?OpenDocument). I would personally argue for the full address for added flexibility but I don't know what decisions were made for the 8-bit argument.
10-14-2010 02:03 PM
Flash memories are erased in large pages (KB) while EEPROMs stores small piece of data, so they require erasing few bytes (1, 2 4 Bytes). To emulate an EEPROM in Flash LMI/TI engineers choused to store an address-data pair for each byte. When a value has to be modified then the old location is invalidated (all bits 0) and a new pair is written: address-new value. This method prevents erasing of an entire page for each byte modification, which affects not only writing time, but safety as well.
Note that here it's about the address from the emulated EEPROM, not locations in Flash.
10-14-2010 02:44 PM
Thx for the reply,
My inquiry is more about the fact that you can define pages much larger than the 8bitsx16bits data sets you are allowed to store...what s the point?
1KB=x400 == 254 data entries of 16bits
minimum EEPROM size is x1000/x400 = 4 pages, where only 2 are actually required for a circulating buffer structure ...
2 pages are wasted and not used.....
Also: increasing the page size over 1KB makes no sense as the 8bits addressing doesn t allow to make full usage of it and will only slow down pages swapping