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've used mass storage code from sample codes of KEIL on AT91SAM7x256. And it works correctly; Now I want to change the Memory size show in the My computer (it always show 6 kB!). I'v changed
MSC_MemorySize
but It still shows 6 KB! can anyone help me? thanks for your help!
After that I want to use another type of memory for example SD card instead of SRAM for memory use in this sample. This very important to me. I am so grateful for your help.
To make media content Write protect you need to return WP bit set to one in ModeSense response.
In mscuser.c module change ModeSense6/ModeSense10 functions:
void MSC_ModeSense6 (void) { if (!DataInFormat()) return; BulkBuf[ 0] = 0x03; BulkBuf[ 1] = 0x00; BulkBuf[ 2] = 0x80; <---- was 0x00 BulkBuf[ 3] = 0x00; ... } void MSC_ModeSense10 (void) { if (!DataInFormat()) return; BulkBuf[ 0] = 0x00; BulkBuf[ 1] = 0x06; BulkBuf[ 2] = 0x00; BulkBuf[ 3] = 0x80; <---- was 0x00 BulkBuf[ 4] = 0x00; BulkBuf[ 5] = 0x00; ... }
To retarget media from memory to SD Card you need to retarget read and writes from memory to SD Card. So you need to change functions MSC_MemoryRead, MSC_MemoryWrite and MSC_MemoryVerify functions in mscuser.c file to use SD Card write/read instead of memory write/read.
Dear Friends, i really appreciate your concern and help. I am going to do what yo said and read what you referenced.
Note that by making the media write-protected, all files will be write-protected.
This is different from adjusting the directory entry for readme.txt and just make that file read-only.
Dear Per, I think I noticed that they are different. I'm so thankful for the support.
Just note that you can take the DiskImage hex data and place in a little source file that you compile and that writes the data into a binary file on the PC.
Then open that binary file with a good hex editor that supports FAT data structures. Then you can edit the data and save.
Then use a program to convert the binary file to a C hex dump again.
Thanks Tsuneo for excellent explanation od DiskImage.
I have related question, I connected my mcb2300 board with lpc2378 controller to my PC, using ARM\Boards\Keil\MCB2300\RL\USB\Device\Memory example, and it works fine, I changed name of volume, txt file in DiskImage, but can I write some txt file to controller memory using windows, like to regular USB flash drive ?