Modify Mass Storage Device Example

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

Modify Mass Storage Device Example

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Wed Aug 29 02:50:30 MST 2012

Hi every body,

I have some question regarding Mass Storage Device Example.

1. If I want to change the Disk size, should I change ATA_RAM_VIRTUAL_SIZE? I have tried but It does not change any thing.

2. If I want to modify the thumb driver name , for example the default name is "nxpUSBlib". Where should I modify it in the source code ?

Thanks

Tung
Labels (1)
0 Kudos
5 Replies

702 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Wed Sep 19 18:02:24 MST 2012
Dear nxpUSBlib team,

Thanks for your great help.
I understand better now, even though the reply take quite sometimes but I am not in urgent so it is still very helpful.

Tung.
0 Kudos

702 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxpUSBlib team on Wed Sep 19 11:37:57 MST 2012
The volume lable you see in Windows file explorer (nxpUSBlib) is defined in the DiskImage buffer in bsp/DataRam.c. You will find it about half way down the array starting with this number sequence: 0x6E,0x78,0x70,0x55,0x53,0x42,0x6C,0x69,0x62,0x20,0x20,0x28

0 Kudos

702 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nxpUSBlib team on Wed Sep 19 11:26:14 MST 2012
In the file bsp/DataRam.h you will find these definitions:

#if defined(__LPC13UXX__)
#define DATA_RAM_START_ADDRESS0x20080000
#define DATA_RAM_PHYSICAL_SIZE0xa00
#define DATA_RAM_VIRTUAL_SIZE0x4000 /* fake capacity to trick windows */
#endif

DATA_RAM_PHYSICAL_SIZE tells the driver how much storage space there is on the device. This number is used to limit SCSI read and write requests from the host if the virtual size is larger than the physical size.

DATA_RAM_VIRTUAL_SIZE is the volume size reported to the host via the SCSI Read Capacity command and is the value that will show up in the Windows format dialog box.

In addition to these falues the file bin/DataRam.c contains a master boot record, a FAT (FAT12), and a directory entry. The MBR also contains a volume size which does not match DATA_RAM_VIRTUAL_SIZE. We added these first three sectors to this example so that it would work out of the box without the need to format the volume. This was done because Windows typically formats volumes with large FATs and directories which would not fit into the limited buffer space on our smaller parts, like the LPC1347 which uses those numbers above. This explains why the example first starts up with a 5k volume size but formats with a 16k volume. Also it explains why the format will not work.

To create a flash drive using this example you will:
  probably need a minimum of 16k bytes of storage, preferably more. It can be in SDRAM or external flash or SPIFI if the part you have selected can support these memories.
  need to fill in the MassStorage_Read and MassStorage_Write routines in bsp/<board>/<board>.c. There are examples that access SPIFI in bsp/NGX/bsp_NGX.c
  Adjust the values of DATA_RAM_PHYSICAL_SIZE and DATA_RAM_VIRTUAL_SIZE to match the size of the memories you have decided to use, minus a few sectors for the MBR, FATs, and directory.


0 Kudos

702 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Wed Sep 05 18:43:19 MST 2012
Hi nxpUSBlib team, could you please advise on this question ?
0 Kudos

702 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tungsys on Wed Aug 29 03:01:58 MST 2012
I mean , how to modify the thumb drive name . For example from "nxpUSBlib" to "NXP MSC DEMO"
0 Kudos