µTasker Forum

µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: AlexS on July 13, 2021, 06:47:49 PM

Title: SD Card Format Speed
Post by: AlexS on July 13, 2021, 06:47:49 PM
Hi,

Currently implementing the format function in the product, initial tests show ~6 minutes for formatting an 8GB card. Are there any tips to make it faster? I notice that the fnMassStorage() task is running for around 7ms each iteration.

Thanks!
Title: Re: SD Card Format Speed
Post by: mark on July 13, 2021, 07:13:20 PM
Alex

That is a long time for the formatting to take - I expect maybe 30s or a minute if doing a quick format (which deletes the FAT but not all sectors - a full format (also wiping out old data in the sectors) will take a lot longer.

The mass storage task will be doing this by deleting a sector at a time and the sector writes (setting content to 0) will usually take about 4ms each. Then the task allows other tasks to run and continues with the next, repeating until finished.

What is the time gap between each iteration? Is there something running between each which slows the overall operation?

Ultimately the format time is the sum of the time to erase each sector in the FAT table (whereby there are 2 copies maintained and so the overall time is double) plus any other time added between iterations.

Regards

Mark

Title: Re: SD Card Format Speed
Post by: AlexS on July 13, 2021, 07:21:52 PM
1. It takes about 8ms per run of fnMassStorage() task with 4ms in between iterations. This is how I'm starting the format:
Code: [Select]
utFormat(DISK_SDCARD, VOLUME_LABEL_STR, UTFAT_REFORMAT | UTFAT_FORMAT_32)
2. Is there any specific routines that must be called after the format completes?  I'm calling utAllocateDirectory() after detecting that the disk is mounted again and getting '0' returned.

Alex