We’ve encountered a problem with certain SanDisk flash drives (we use
SD25B-128 drives on an ATA bus) under QNX 4.25, and if any of you can shed
light on it, I’d appreciate it greatly.
We have code which uses a fairly simple sequence of fopen(),
fprintf()…fprintf(), fclose() calls to write to a file of approximately
2200 bytes. With certain of the SanDisk units*, the first 1024 bytes are
written, but not the rest of the data, even though the file size is updated
to indicate the correct length. Thus, when the data is read back later,
random, pre-existing data from the drive is returned at the end of the file.
Using a logic analyzer on the ATA bus, we have confirmed that no data beyond
the first 1024 bytes is provided to the drive.
- The units which fail in this manner appear to be working, but very slowly.
The “completed successfully” IRQ after the write of the first 1024 bytes
comes after about 24.5 msecs, whereas with other units not exhibiting this
problem, the IRQ comes after only about 2.5 msecs. Curiously, the drives
report themselves as “removeable”…
The system calls do not report any errors. Changing the system calls to
open(), write(), close() makes no difference. Likewise, using setbuf() to
disable buffering does not help. However, if Fsys is started with the ‘-d0’
option, and mount is given the ‘-s’ option, the drive units appear to
While the drives are abnormally slow, they can hardly be considered “faulty”
if they succeed at writing the data they are given, and are never given the
remaining data. The source code itself is beyond question. This appears to
be the fault of the QNX device driver at some low level. Does anyone know of
bugs or issues with the drivers which cause this sort of bad behavior?