LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Store values in flash memory LM3S8962

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

 

 

0 Kudos
Message 1 of 6
(7,470 Views)

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

Will
CLA, CLED, CTD, CPI
LabVIEW Champion
Choose Movement Consulting
choose-mc.com
Message 2 of 6
(7,418 Views)

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

0 Kudos
Message 3 of 6
(7,375 Views)

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.

0 Kudos
Message 4 of 6
(7,360 Views)

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.

0 Kudos
Message 5 of 6
(7,234 Views)

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

 

 

0 Kudos
Message 6 of 6
(7,231 Views)