Questions on USB Mass Storage for LPC1343

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

Questions on USB Mass Storage for LPC1343

569 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wsyuen on Tue Nov 23 21:29:34 MST 2010
[FONT=Arial][SIZE=2]I tested the "USBMem" project in the sample code, it works and the computer can recognise it as a USB Mass Storage device.[/SIZE][/FONT]
[FONT=Arial][SIZE=2][/SIZE][/FONT]
[FONT=Arial][SIZE=2]However, I got several questions on it, e.g.[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- W[/SIZE][/FONT][FONT=Arial][SIZE=2]hat is the meaning of the content of DiskImage?[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Can I change the size of Device? (now the Drive is only few kb)[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Now, the storage is put in the RAM of MCU, can I copy files from computer to the Flash of LPC1343 or other storage device?[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Can I use MCU's existing API calls to communicate with PC? If yes, which API should I use?[/SIZE][/FONT]

[FONT=Arial][SIZE=2]Thank you very much.[/SIZE][/FONT]
0 Kudos
Reply
1 Reply

528 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by NXP_USA on Wed Nov 24 15:59:16 MST 2010

Quote: wsyuen
[FONT=Arial][SIZE=2]I tested the "USBMem" project in the sample code, it works and the computer can recognise it as a USB Mass Storage device.[/SIZE][/FONT]
[FONT=Arial][SIZE=2][/SIZE][/FONT]
[FONT=Arial][SIZE=2]However, I got several questions on it, e.g.[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- W[/SIZE][/FONT][FONT=Arial][SIZE=2]hat is the meaning of the content of DiskImage?[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Can I change the size of Device? (now the Drive is only few kb)[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Now, the storage is put in the RAM of MCU, can I copy files from computer to the Flash of LPC1343 or other storage device?[/SIZE][/FONT]
[FONT=Arial][SIZE=2]- Can I use MCU's existing API calls to communicate with PC? If yes, which API should I use?[/SIZE][/FONT]

[FONT=Arial][SIZE=2]Thank you very much.[/SIZE][/FONT]


The size of the disk can be changed, but there is very little room because it is stored in RAM on the LPC1343 and there is only 8K of RAM on that part. To change the size, more RAM has to be allocated, also the FAT table contents (initialized from Flash) have to be changed. The current disk image is in FAT12 format and you will need FAT12 documentation to manually edit the FAT to enlarge the disk. Moving the disk to on-chip flash is possible but the on-chip flash is in 4K sectors yet the disk is read and written in 64 byte sections. Because of this the USB device needs to make a buffer in RAM to hold the current flash sector and write it back to flash periodically to avoid loosing any data.

The disk can be built with data from external flash such as a serial flash device. To make this work, implement versions of MSC_MemoryRead and MSC_MemoryWrite in msccallback.c or mscuser.c that read and write the external memory device. If the disk is made larger this way, then PC tools can be used to format the disk in FAT16 or FAT32 or other filesystems.
0 Kudos
Reply