I am having trouble with flash file system. Whether I write to the flash using FTP or from an application thread, I get the same symptom. I am attempting to write 2 files that are 125,004 bytes. The first is written just fine. The second file gets truncated to 31,232. When using FTP, the error return is "critical error" as interpreted by the FTP program. When using fwrite() from an application program, fwrite() simply returns "0x00. " Flash #defines are as follows:
#define FS_VOLUME3_SIZE (4096 * 1024)
#define FS_VOLUME3 "FLASH0"
#define FS_VOLUME3_DIR FS_VOLUME3 "/"
#define FS_VOLUME3_SUB_DIR0 FS_VOLUME3 "/DIR0"
#define FS_VOLUME3_SUB_DIR0_1 FS_VOLUME3_SUB_DIR0 "/DIR00"
#define FS_VOLUME3_SUB_DIR1 FS_VOLUME3 "/DIR1"
#define MEDIA2_BLOCK_SIZE NAFS_BLOCK_SIZE_512 /* set flash up with 2K blocks */
#define FLASH0_STACK_SIZE 8 * 1024 /* 8k */
#define FLASH0_QUEUE_SIZE 128
#define FLASH0_BUFFERS_IN_POOL 20
#define FLASH0_VOLUME_NAME "FLASH0"
#define FLASH0_INODE_BLOCK_LIMIT 25
#define FLASH0_OPEN_DIRS 10
#define FLASH0_OPEN_FILES_PER_DIR 10
#define FLASH0_START_SECTOR 10 /* for NS7520 only */
#define FLASH0_END_SECTOR 16
#define FLASH0_OPTIONS NAFS_MOST_DIRTY_SECTOR | NAFS_TRACK_SECTOR_ERASES
#define FLASH0_COMPACTING_THRESHOLD 40
In attempting to use the RAM volume, I have no problems writing the same files. I get the same problem if I first write the files to RAM, and then copy them to FLASH.
Any advice would be very much appreciated.