Hi
"
Files of multiple 4k lengths can be saved". This is special for the last sectors in the LPC23XX FLASH (not for the main ones, which have a granularity of 32k). The uFileSystem handles the sectors automatically and so allows a file (at the end of FLASH) to also occupy them if necessary.
When working with the simulator make sure that the simulated FLASH is blank before performing your test (delete
FLASH_xxx.ini in the simulator directory). Depending on how the data is being saved, it may be that a FLASH programming rule is being broken (see the following for details about the special properties of the NXP FLASH:
http://www.utasker.com/forum/index.php?topic=136.0)
Check also whether the simulator is generating an exception using code like *(unsigned char *)0 = 0, and you may see a comment as to the reason. It sometimes generates an exception to point out that the FLASH may have been used incorrectly and it could thus fail on the target. Be careful with the fact that the uFileSystem uses large granularity mode (see:
http://www.utasker.com/docs/STR91XF/FileSystemSTR91X.PDF) which needs to be used with some care!
If the simulator crash can not be explained as above it may be a bug (possibly requiring a certain set up to see) so it would be useful to cure it.
You should be able to test operation with SPI FLASH in the simulator (at least with ATMEL FLASH), which would also allow you to verify the configuration. Don't forget to enable BOTH
SPI_FILE_SYSTEM AND
FLASH_FILE_SYSTEM for this work. Using a 1MByte SPI FLASH chip (
note that an AT45DB081 driver is supported but not the AT26DF081 - I believe this has different commands) it is possible to define 64 files of 16k FILE GRANULARITY. The file granularity can be a multiple of the FLASH GRANULARITY, so this may the be best configuration for you. As you known, one file can occupy also multiple file spaces, so you could still decide to save just 2 files of 512k each.
The uParameterSystem can be put to the last sectors of internal FLASH in order to keep the SPI FLASH for only uFileSystem data.
If you already know that you will never need more that 2 files it is also possible to to define 2 files or 512k FILE GRANULARITY (the granularity simply has to be a multiple of the physical FLASH granularity).
Generally the uFileSystem has proved to be very flexible in a number of project up to 32Meg SPI FLASH (which requires multiple SPI FLASH). Once you have the configuration right you shouldn't have any problems - also in the simulator this should work correctly.
regards
Mark