Alex
Using the FreeRTOS configuration will not be any effort nor change the behavior (when it doesn't introduce new activity) however, when I re-read your requirement, I notice that you would like to write this data in "each" cycle and not as a parallel task, which means that I don't think that changing the config will help.
1. 20kBytes/s writes are about what I expect for random FAT writing.
2. Some cards may be faster but they are mainly optimised for large linear transfers (single file videos, big photos, etc.) and are not necessarily that fast when just writing small FAT chunks.
3. Block mode reads/writes are faster (which I presume is how the MBytes/s writes can be achieved). I know that I can achieve about 20MB/s read speed on a K66 to USB-MSD (HS USB and not FS, since FS itself limits to about 1MB/s) (including the USB part) when using block mode and it falls to about 600kB/s in sector read mode. I didn't get huge increased in write mode but that may also have been due to the more tricky USB direction but I was not that interested in the read speed when I did these tests.
4. Also consider using the file open modes with UTFAT_WITH_DATA_CACHE and UTFAT_COMMIT_FILE_ON_CLOSE (see the utFAT option for details):
- the caching mode is useful to avoid small writes (allowing lots of small writes to cache and committing only when sector content is available)
- the ON_CLOSE option means that data can be written to the file (data content and FAT clusters) without updating the file object, which reduces the write content needed (beware that even writing large data content still needs some random write to the cluster area which reduces speed) and the file object is updated only when the file is closed. The downside is that if a file is not closed (crash, reset, power cycle) data content will be lost even though it was physically written to the card since the file object doesn't know about it (thinks the file is still empty). If you can accept such data loss it is however somewhat faster.
5. If you have a single file the block mode option could be used and may give a useful increase in performance (it effectively tells the card that it is going to receive a write to a number of sectors in a row and so it can already do preparation before subsequent writes are made, which saves the waits on each new sector write). I don't have a great deal of experience with this because I haven't generally used it much (due to multi-file restrictions) but it may be suitable for you.
6. Avoid writing non-512 byte chunks if possible (buffer in RAM until you can commit a chunk) to avoid writing a sector more than once with partial data because the second write to a sector means the SD card needs to swap blocks around that slows it down. If the file cache option is enabled the cache will in fact control this (but needs a close to commit any final caches data).
Practically it may also be an idea to increase your data write size from 1.4k to exactly (3 x 512) bytes so that you always write 3 sectors per cycle rather than it varying between 2 and 3 when caching.
With some of these options you can probably avoid a number of (unnecessary) writes and get the time down somewhat (at least to prove the effects).
Regards
Mark