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
I suspect you're substantially underestimating the scope of the problem you've created there.
Even reading that file system from the Windows side won't work reliably while you're secretly also writing to it behind Windows' back. Windows strictly assumes itself to be the only system accessing those files. It may appear to work, but ultimately it won't.
Dear Hans-Bernhard,
I know that you may not manipulate the microSD at the same time. In my code I check if the USB is connected otherwise the ARM will not access the microSD by himself. Like your Android mobile phone. If you connect the phone to your pc and you want mass storage access, the microSD will be unmounted (MCU cannot access the microSD directly anymore).
your sdcard reader must check if the write protect is on (SD-card switch on the left side). it must say in some way to windows that it is write protected.
my only question is: How can I say to windows that a USB mass storage device is write protected (read only)
regards,
Maybe there is a SCSI command for that - I don't know if that code is available anymore with the recent "let hide everything that we can make money with" move by Keil (oh, yeah). Either way, you can always power down USB while addressing the SD card from the microcontroller side, remounting later.
<quote>"let hide everything that we can make money with" move by Keil (oh, yeah).</quote>
Tapeer,
yew are a cynic.
in case yoo donot understand plz check hear
dictionary.reference.com/.../cynic
Always yo're freind.
Zeusti
Hi,
I've got it working, my mass storage device is now write protected. Searched for SCSI commands with write protection parameters, but this didn't work.
just comment out the SCSI_WRITE10 and SCSI_WRITE12 commands in function MSC_GetCBW in mscuser.c if windows tries a write command, it will go to fail. Windows then responds that it is write protected!
Yes, I thought it would be something like that. Congratulations.
<quote>Yes, I thought it would be something like that.</quote>
LMFAO
View all questions in Keil forum