AnsweredAssumed Answered

Problem creating a new file in USB key, error: FS_SECTOR_NOT_FOUND

Question asked by Mirko Fortunato on Jun 28, 2013
Latest reply on Jul 12, 2013 by Mirko Fortunato

Good morning,

I tried to write a file in a USB key but the MQX libraries give me an error which is FS_SECTOR_NOT_FOUND: which is the meaning of this error? The USB key is empty and it is a 4GB key. I wrote in the file a page of 257 bytes for 4096 pages. Why do I get this type of error?

The USB key is a Trascend of 4GB.

Following an extract of the code:

// +++++++++++

#define  DIM_BUF_HWK         257

memset(BufferPage[0], 0xFF, DIM_BUF_HWK);

for (k=0; k< 4098; k++)


    err_w= write(pFile, BufferPage[0], DIM_BUF_HWK);           


// +++++++++++


In the table of USB I defined the USB key as following:


static const USB_HOST_DRIVER_INFO ClassDriverInfoTable[] =

   /* Vendor ID Product ID Class Sub-Class Protocol Reserved


   /* USB 2.0 hard drive */

   {{0x00,0x00}, {0x00,0x00}, USB_CLASS_MASS_STORAGE, USB_SUBCLASS_MASS_SCSI, USB_PROTOCOL_MASS_BULK, 0, usb_host_mass_device_event},



   /* End of list */

   {{0x00,0x00}, {0x00,0x00}, 0,0,0,0, NULL}




Do anyone have any idea?


Thank you