Hi everyone...
I'm working with the SampleSoftware code bundle for LPC13xx from NXP For KEIL. It has a sample code for USB MSC on-chip driver for LPC1343. I have a LPCXpersso Baseboard mounted with LPC1343 and a ULINK2 debugger.I used uVision4 as debugger/compiler for the sample software of USB MSC and build the code then start debugging. The code sample didn't work well as being expected; the new USB MSC is been enumerated or the new removable drive icons have shown in the disk drives; but if you do a double click to the new removable disk drive it can't be opened it says that you need to format the removable disk before you can use it. Is their something wrong with the codes? Any idea what's going on with this sample? Thanks.
You seem to refer this sample bundle,
Sample Code Bundle for LPC13xx Peripherals using Keil's MDK-ARM V1.04 (May 24, 2010) ics.nxp.com/.../code.bundle.lpc13xx.keil.zip
The sample bundle has two Mass storage class examples, USBMem and USBMem_rom
Which one are you running? Sound like the low-level USB functions are working fine, because the device is enumerated correctly. Problem lies in SCSI direct media access protocol. Maybe it's a trouble on sector number - memory address mapping.
To prove this assumption, read out the sectors, MBR (1st), FAT (2nd), root directory (4th) and file contents (5th) of the device on your PC. Compare the contents of each sector with the contents of DiskImg.c Is there any gap between the read out and DiskImg.c?
DiskImg.c const unsigned char DiskImage[MSC_ImageSize] = { // The first sector (512 bytes) - MBR 0xEB,0x3C,0x90,0x4D,0x53,0x44,0x4F,0x53,0x35,0x2E,0x30,0x00,0x02,0x01,0x01,0x00, ... 0x72,0x74,0x0D,0x0A,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xAC,0xCB,0xD8,0x55,0xAA, // The second sector (512 bytes) - FAT 0xF8,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ... 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, ... ...
Do you have any disk editor tool? If you don't have, download one.
Disk Probe - Included in Windows install CD/DVD, in \Support\Tools folder or - Windows XP Service Pack 2 Support Tools " href= "www.theabsolute.net/.../dskinv.html">www.theabsolute.net/.../dskinv.html
Tsuneo
Hello Tsuneo,
Thanks a lot for your reply I really appreciate it.:) I run the USBMEM_ROM and yeah your right maybe its all about the memory mapping but unfortunately I can't understand what's inside with the diskimg.c, and I don't have any disk editor tool. I used Windows 7 not XP, Is there another tool for windows 7 like the one you give me? Thanks.
> unfortunately I can't understand what's inside with the diskimg.c
It's a disk image, as the filename tells. The sectors on the disk are concatenated in the order.
> I used Windows 7 not XP
Both of above tools work on Win7. Disk Investigator is simpler and it has enough function for this debug purpose.
Umm.. I feel uneasy about your PC literacy..
I aplogize about my PC literacy coz I'm not expert with PC hardware or some part for the PC application and it's been stated in the link that only run on the XP OS.
BTW, still I can't figure out the cause of the issue? Have you tried running the sample codes tsuneo?mainly the USB MSC on-chp driver..Have you encountered same as I am? Thanks.