dev_msc_sdcard set read only

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

dev_msc_sdcard set read only

530 Views
vasudhevan
Contributor V

Hi,

    We have refereed evkmimxrt1064_dev_msc_sdcard_bm example code.

    It was working fine but from pc we can able to delete or write or format the drive.

    But we want to set read only customer should not delete or write or format the driver.

    I have seen macro for formatted device but we don't know how to use.

/*! @brief Unformatted Media - Maximum formatting capacity for this cartridge*/
#define USB_DEVICE_MSC_UFI_UNFORMATTED_MEDIA 0x01U

    

usb_device_mode_parameters_header_struct_t g_ModeParametersHeader = {
    /*refer to ufi spec mode parameter header*/
    0x0000, /*!< Mode Data Length*/
    0x00,   /*!<Default medium type (current mounted medium type)*/
    0x00,   /*!MODE SENSE command, a Write Protected bit of zero indicates the medium is write enabled*/
    {0x00, 0x00, 0x00, 0x00} /*!<This bit should be set to zero*/
};

     How to set properly configure to avoid write or delete or modify or format the drive ?

Thanks & Regards,

        Vasu

 

 

0 Kudos
1 Reply

522 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
According to your description, it seems that you want to simulate a CD-ROM device instead of a U-disk, to make it, it needs more code modification than you expect actually and you can learn more details by review the link: https://www.usbcopier.com/usb-write-protection/#a

Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos