This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

lpc1788 Cortex-m3 USB flash-fs micro sd, make it write protect for windows

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

Parents
  • 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,

    Wouter

Reply
  • 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,

    Wouter

Children