I want to develop mass storage device using LPC2148.I am just referring code from Keil for USBMem. My problem is - I get Get_descriptor command from PC to which I respond with device descriptor. On receiving 8th byte it generates Reset. Then I get Set_address command. On response to it, I execute Set Address command in protocol engine. Then again I get Get_descriptor command (It should actually have index field of 18 but I receive with 64). Again after 8th byte it generates Reset and again gives Set_address command instead of Get_descriptor command for Configuration descriptor. What can be the problem?
Now, when i connect my LPC2148 board to PC, i get 'Disk in drive is not formatted. Do you want to format it now?'. And if i say, yes. Then it says, 'Disk in drive can't be formatted'. What is its meaning?
> Now, when i connect my LPC2148 board to PC, i get 'Disk in drive is not formatted. Do you want to format it now?'. And if i say, yes. Then it says, 'Disk in drive can't be formatted'. What is its meaning?
It means no partition structure (Master Boot Record, boot sector etc.) is assigned on your "disk". For "RAM" (SD card) based disk, make partition(s) on the disk before formatting. DOS command, FDISK, or Windows disk management does the job. www.vistarewired.com/.../how-to-resize-a-partition-in-windows-vista
For "ROM" based disk, you have to give the contents of the disk with your program code.
You'll find such a file in many USB examples
Keil "LPC2148 USB Mass Storage Device Example" - DiskImg.c http://www.keil.com/download/files/lpc2148_usbmem.zip
Microchip USB examples - Microchip Application Libraries v2010-02-09 ww1.microchip.com/.../MCHP_App_ Lib v2010_02_09_Installer.zip C:\MicrochipSolutions\USB Device - Mass Storage - Internal Flash\Firmware\Files.c
Microchip one is better than Keil's, because it has many comments.
To realize the FAT format, this MS FAT spec is required. "Microsoft Extensible Firmware Initiative FAT32 File System Specification" www.microsoft.com/.../fatgen.mspx
Tsuneo