www.bcl.de

Important information about the IPC@CHIP drives and filesystem
(Limited Number of Flash write cycles per sector)



The sectors of the internal Flash of the IPC@CHIP (used for drive A: and memory for @CHIP-RTOS Code) has limited write cycles. So you should avoid cyclic write access like writing into a logfile every hour.
We guarantee 10.000 write cycles per sector. Note that one write access in your program (fwrite or write) could cause more than one write access on the @CHIPs flashdisc.


Optimizations:

To decrease the flash write accesses in your program, you should follow the hints below:
1. Use fopen, fwrite, ...
2. Use setvbuf with a size of 1024 bytes.


Description:

fopen internally works with a 512 byte stream buffer. The filesystem sectors have a size of 512 bytes. Flash physical sector size can be 256 or 1024 bytes, depending on the used flash memory. Setting the stream buffered size to 1024 helps to avoid additional flash writes. Note: The fwrite function in Borland C 5.02 has an unexpected behaviour when the size of data exceeds the buffered size (512 bytes default or size set with setvbuf). Then the data blocks execeeding the buffered size are always written unbuffered instead of splitting them to smaller packets.


How will a flash defect detected:

The damaging write access respectivly the return code tells you that the write access was not successful. That it is a flash defect can you see if you reboot your @CHIP. There you get an error message ("Flash error at sector: xx") on the boot text. Also the execution of the AUTOEXEC.BAT will be avoid.


Workaround:

If you need to generate logfile anyway, you should use the RAM Disc to store the file. To save the file when the power goes down, you could use the NMI feature (more about NMI is available in the API Docu -> Hardware API).
Another option is to use an IDE Drive (Harddisc, Compactflash, ..) to store the log file. How to connect an IDE Drive to the IPC@CHIP is explained in the API Docu.

End of document