Originally Posted by raskin
In mass-market USB storage devices there is a controller that abstracts out of the memory structure. It tries to distribute writes and work aroud bad blocks. Under some workloads it spoils things, though.
Many filesystems are capable to get a list of bad blocks during formatting and just not use them.
Also there are special filesystems that are designed for raw access to flash memory. They make better use of it than USB pen drive controllers..
From your description I cannot fully understand what goes on where. You have your test board with an embedded Linux installation on it as a USB "client" device and a Linux computer as a host? Do you check for device errors in the driver on the test board? Do you return any errors to host?
I my case there will not be any Filesystem coming into picture.
In that case , does it mean that I will have to write some code which will
take care of bad block. As my processor builtin "device controller" does not do it.For eg.
If PC (host) wants to write packets A,B,C to sector num 1 , 2, 3
Normally "device controller driver" and "g_file_storage" will write one to one i.e A on 1 , B on 2 , C on 3.
Now if sector 2 is bad: THen by some means this will happen
A on 1 , B on 3 (as 2 is bad), C on 4.
So there must be some map as to when ever Host wants to read "B" , it should be read from sector "3" and not "2".
Is there any code which does all this maping thing.