Hello All,
I get stuck on this one,
I have:
an Embedded Artists LPC1788 cortex-m3 developers board. using TCP-net and Flash-fs and RTX kernel i've managed to use all TCP functions (in tasks, like TCP sockets, TFTP server, HTTP) and also using my microSD card (2 GB sandisk) with FAT etc. I have USB mass storage class working that directly can access my microsd card. so in windows i get a disk that has 2 GB size with my files. (yeah it works :D )
Now I want to make it write protect for windows, I want read access to the microSD in windows, but the user may not delete or manipulate the data. At this time I made in mscuser.c that the functions MSC_MemoryWrite and MSC_MemoryVerify don't access the microSD. In windows I can read the microSD now, but when I write/delete files it is only in the cache of windows. when I unplug and plug in my device, I see my original microSD again.
what do I want: ok what I have can work.. but I want that windows knows that my microSD is an write protected device, so that you'll get an error if you try to write of delete files.
my device may access the microSD to store files by himself (logging) but only by USB mass storage it must be blocked.
Is there any way to set this? like in the function MSC_Inquiry, maybe some parameter of bulbuf?
I hope that someone can help me with this.
Greetings,
Wouter
It seems then that the same SCSI commands are used to deliver file system image details as are used to deliver data. I thought there might be a way to coax a device to reveal its file system structure, but not to allow read access to the content of the file system.
Then you should look at the USB bootloader examples with CRP. when CRP is enabled, the mass storage device is loaded but you can't read the file (firmware), you can only update it. looking at the code in the read function it returns 0x00 each byte if CRP 2 or 3 is enabled. but the FAT system is static here, don't know how to do it on your sdcard which is dynamic.