Hey Mark,
I am using LPC2388 controller, with 512 KB flash.
I have extended structure
PARS block with my application parameters , and size of total
PARS now goes to 2016 bytes,
and size of
TEMPPARS(which also contains object of
PARS goes to 2040 bytes.
I am making use of existing functions
fnSaveNewPars
,
It works parameters blocks size upto some 2046 bytes,
If I am adding more parameters after this, it is not working and I m getting garbage values for newly added parameters.
To accommodate more parameters (my req. is 5 KB of NV Variables to store at flash)
I have made following changes in various Macros values
I changed
#define uFILE_START (FLASH_START_ADDRESS + FLASH_SECTOR_15_OFFSET) (old was 17th sector, my code will take at most upto 13th sector)
#define FILE_SYSTEM_SIZE (3*FLASH_GRANULARITY_LARGE) (old was 5*FLASH_GRANULARITY_LARGE) + (4*FLASH_GRANULARITY_SMALL)
#define PARAMETER_BLOCK_GRANULARITY (FLASH_GRANULARITY_LARGE) (old was FLASH_GRANULARITY_SMALL)
#define PARAMETER_BLOCK_START FLASH_SECTOR_18_OFFSET (old was FLASH_SECTOR_26_OFFSET)
#define PAR_BLOCK_SIZE (4*PARAMETER_BLOCK_SIZE)
i keep set
#define USE_PARAMETER_BLOCK
#define USE_PAR_SWAP_BLOCKI tried to understand why 32 KB of flash sector only allow to store parameters values upto 2040 bytes?! . I
could find in the flash file system document that "If a device doesn’t support “accumulative writes” it is necessary to use one FLASH
word (size of word depends on device) per variable byte. An example of this is the
M9S12NE64, which uses 16 bit FLASH words and cannot perform accumulative
writes. When a block of user parameters is saved, each of the bytes in the block of
variables is saved in an individual word. A parameter block of 512 bytes (the FLASH
granularity in the NE64) can therefore save (512 – 4)/2 bytes [254] of user data."
I could understand (if so!) that with LPC2388 it can save ((32*1024) - 2(16))/16 , 2046 Bytes
of data due to flash word length is 16. isn't it?But sill I increase PAR_BLOCK_SIZE to (4*PARAMETER_BLOCK_SIZE) then it should work
for (2046*2)=4092 Bytes.... but it is still stores only 2046 bytesWill you pls tell me how can I accomplish storage of bigger data (parameters upto 5K) with uParameter System.-
Thanks
Saurabh