We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi Everyone...........
I m working on a project in that I need USB mass storage implementation for external NAND flash.
I m using LPC2378 uC and I have an example code of USB MSC for LPC2300 that is implemented for internal flash memory of controller. This code is working well on my controller kit.
I do not have much knowledge of MSC. Now I want to use this code for external raw NAND flash.
Could I use this code for my application????
If yes, tehn what and where will I have to modify in the code???
If no, then kindly give me any other solution.........
Thanks in Advance,
Raj
> I just want to use this code to read constant data upto 256MB.
For a read-only drive, you don't need to implement wearout management. But I still recommend you to support SCSI Write(10) and erase sector. And a jumper on the board which enables this write command.
With this configuration, you can make up file system on the drive using OS utility. Also the file is written directly from OS. When finished, plug off the jumper to make it read-only. Otherwise, you have to prepare the file system records and file contents as a HEX data, to burn it over a programmer to the FLASH.
> where will I have to modify in this code???
In addition to above change of #define's on your post,
Memory[] array is a RAM media, which holds entire "disk" space. U8 Memory[MSC_MemorySize]; - mscuser.c
You don't need it any more, because it is replaced by NAND FLASH. At the top of main(), this array is initialized by ROM array DiskImage[] That is, this initialization routine and DiskImage[] are also to be deleted.
int main (void) { U32 n; for (n = 0; n < MSC_ImageSize; n++) { /* Copy Initial Disk Image */ Memory[n] = DiskImage[n]; /* from Flash to RAM */ }
Rewrite these routines so that it accesses to your DataBuffer[] or NAND FLASH MSC_MemoryRead(), MSC_MemoryWrite(), MSC_MemoryVerify() - mscuser.c
Tsuneo