µTasker Forum > utFAT

SD write speed and processor load

<< < (2/2)

mark:
Alex

SD cards can be written using SECTOR write or BLOCK write commands (and equivalent for reads).
The SECTOR write allows writing to ANY random sector on the card and so is fully flexible.
BLOCK write tells the SD card that you are about to send a number of sectors that are simply one after another, which can only be used when you really are going to do so (eg. when writing data to an empty cluster and not randomly updating file objects and such). Since the SD card knows that it is going to get this data it has the change to get itself ready for it and write time becomes a lot faster (it doesn't need to react randomly to a new address only when the next data is arriving).

The define UTFAT_MULTIPLE_BLOCK_WRITE enables the block mode support in utFAT. The user doesn't need to do anything differently when writing, BUT, it should not use more than one file at a time and a SD card detect based on a PIN must be used (and not the polling method) because once a BLOCK command of a certain length has been reported it is not possible to stop/abort it (due to bug in the Kinetis SDHC) - resulting in failure if a second file needs to be accessed during a write sequence.

Practically I only use block mode for USB-MSD where it is very suitable due to the fact that the host reads and writes in blocks. This however only when the application doesn't access the file system at the same time.

Regards

Mark

Navigation

[0] Message Index

[*] Previous page

Go to full version