Problem with USBMSC_rom Example

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Sakphul on Mon May 30 13:47:53 MST 2011
I am trying to use the USB On-Chip Driver for MSC. I am using the example code from the example bundle:

After I build the code and plug in the USB cable the PC (Windows 7 x86) recognises a new Mass storage Device. The new Mass Storage Device is now listed in the Windows Explorer and the device manager. But i cannot open the Mass Storage Device. Windows Explorer tells me that is has a Size of 0 Bytes. It looks like the FAT area in the disimage.c example is broken. In My Project it looks like:

const unsigned char DiskImage[MSC_ImageSize] = {
Within Main this Data is moved from Flash to RAM:

for (n = 0; n < (1024*3); n++) {     /* Copy Initial Disk Image */
      Memory[n] = DiskImage[n];               /*   from Flash to RAM     */

  MscDevInfo.idVendor = USB_VENDOR_ID;
  MscDevInfo.idProduct = USB_PROD_ID;
  MscDevInfo.bcdDevice = USB_DEVICE;
  MscDevInfo.StrDescPtr = (uint32_t)&USB_StringDescriptor[0];
  MscDevInfo.MSCInquiryStr = (uint32_t)&InquiryStr[0];
  MscDevInfo.BlockSize = MSC_BlockSize;
  MscDevInfo.BlockCount = MSC_BlockCount;
  MscDevInfo.MemorySize = (1024*8);
  MscDevInfo.MSC_Read = MSC_MemoryRead;
  MscDevInfo.MSC_Write = MSC_MemoryWrite;

  DeviceInfo.DevDetailPtr = (uint32_t)&MscDevInfo;

  /* Enable Timer32_1, IOCON, and USBREG blocks */

  (*rom)->pUSBD->init_clk_pins();   /* Use pll and pin init function in rom */

  /* insert a delay between clk init and usb init */
  for (n = 0; n < 75; n++) {

  (*rom)->pUSBD->init(&DeviceInfo);  /* USB Initialization */
  init_msdstate();                     /* Initialize Storage state machine */
  (*rom)->pUSBD->connect(TRUE);      /* USB Connect */

  while (1)
      __WFI();                                /* Loop forever */

#if defined(__IAR_SYSTEMS_ICC__)
void USBIRQ_IRQHandler(void)
void USB_IRQHandler(void)
Has anyone run this example code successfully on his LPCxpresso Board? I would appreciate any help to solve this Problem.