LPC1754 usb mass storage

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1754 usb mass storage

1,106 Views
jalilisahar
Contributor I

I have designed a board with LPC1754 and connected a nor flash W25Q64 to it via spi. As the nor flash is not formatable to FAT16  with cmsis FileSystem, I used chan's FatFs in my project and added keil mdk usb device mass storage with cmsis driver. While connecting to pc shows device descriptor correctly and Ii is recognized as a mass storage device but windows can not specify number of disk sectors correctly. Formating and exploring it is not possible.

I have formatted it within a firmware with f_mkfs function and I am almost sure that chan's FatFs works correctly in my project.

I wonder to know if someone have any related experience?

Labels (1)
0 Kudos
Reply
1 Reply

1,067 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @jalilisahar 

Maybe the following is one possible reason. Please check.

Windows USB Mass Storage Class (MSC) expects the logical block size to be 512 bytes by default.

Your W25Q64 is a NOR Flash (64 Mbit = 8 MB) with the following physical characteristics:

Page = 256 bytes    Erase Sector = 4 KB

If the SCSI READ CAPACITY (10) command in USB MSC does not return a block length of 512 bytes, or if the FatFs diskio layer does not abstract the media as 512-byte sectors, Windows will not be able to calculate the total number of disk sectors correctly.

 

BR

Alice

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2258626%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ELPC1754%20%20usb%20mass%20storage%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2258626%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20have%20designed%20a%20board%20with%20LPC1754%20and%20connected%20a%20nor%20flash%20W25Q64%20to%20it%20via%20spi.%20As%20the%20nor%20flash%20is%20not%20formatable%20to%20FAT16%26nbsp%3B%20with%20cmsis%20FileSystem%2C%20I%20used%20chan's%20FatFs%20in%20my%20project%20and%20added%20keil%20mdk%20usb%20device%20mass%20storage%20with%20cmsis%20driver.%20While%20connecting%20to%20pc%20shows%20device%20descriptor%20correctly%20and%20Ii%20is%20recognized%20as%20a%20mass%20storage%20device%20but%20windows%20can%20not%20specify%20number%20of%20disk%20sectors%20correctly.%20Formating%20and%20exploring%20it%20is%20not%20possible.%3C%2FP%3E%3CP%3EI%20have%20formatted%20it%20within%20a%20firmware%20with%20f_mkfs%20function%20and%20I%20am%20almost%20sure%20that%20chan's%20FatFs%20works%20correctly%20in%20my%20project.%3C%2FP%3E%3CP%3EI%20wonder%20to%20know%20if%20someone%20have%20any%20related%20experience%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2258626%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3Eonline%20debug%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2259622%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20LPC1754%20%20usb%20mass%20storage%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2259622%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F253152%22%20target%3D%22_blank%22%3E%40jalilisahar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3EMaybe%20the%20following%20is%20one%20possible%20reason.%20Please%20check.%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%3EWindows%20USB%20Mass%20Storage%20Class%20(MSC)%20expects%20the%20logical%20block%20size%20to%20be%20512%20bytes%20by%20default.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%3E%0A%3CP%3EYour%20W25Q64%20is%20a%20NOR%20Flash%20(64%20Mbit%20%3D%208%20MB)%20with%20the%20following%20physical%20characteristics%3A%3C%2FP%3E%0A%3CP%3EPage%20%3D%20256%20bytes%26nbsp%3B%20%26nbsp%3B%20Erase%20Sector%20%3D%204%20KB%3C%2FP%3E%0A%3CP%3EIf%20the%20SCSI%20%3CCODE%3EREAD%20CAPACITY%20(10)%3C%2FCODE%3E%20command%20in%20USB%20MSC%20does%20not%20return%20a%20block%20length%20of%20512%20bytes%2C%20or%20if%20the%20FatFs%20%3CCODE%3Ediskio%3C%2FCODE%3E%20layer%20does%20not%20abstract%20the%20media%20as%20512-byte%20sectors%2C%20Windows%20will%20not%20be%20able%20to%20calculate%20the%20total%20number%20of%20disk%20sectors%20correctly.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3EAlice%3C%2FP%3E%0A%3C%2FDIV%3E%3C%2FLINGO-BODY%3E