chegewara / EspTinyUSB

ESP32S2 native USB library. Implemented few common classes, like MIDI, CDC, HID or DFU (update).
MIT License
488 stars 70 forks source link

USB Writeblocker #59

Open lukasloetkolben opened 2 years ago

lukasloetkolben commented 2 years ago

I want to make a USB Stick Writeblocker.

Is it possible to plug a USB-Stick to ESP32-S2 and emulate a USB device with the content of the actual USB-Stick to make it read only?

chegewara commented 2 years ago

I think i dont understand what this means.

lukasloetkolben commented 2 years ago

Sorry. I want to make a Hardware Writeprotection. Is it possible to connect a USB-Stick to the ESP and then connect the ESP to the PC so that a user can only view the files on the Stick, but can not edit or delete something from the Stick.

chegewara commented 2 years ago

No, its not possible, because esp32 S2/S3 have only 1 USB port which can work as host or device, not both at the same time.

lukasloetkolben commented 2 years ago

Ok thank you for your response, do you have any ideas to make my project workable?

chegewara commented 2 years ago

Sure, use 2 esp32 S2/S3 connected with SPI. One would work as host the other as master. But it would also require some effort from you to write host and edit msc device part, both are mostly done. Most work, i think, would be to write SPI master to slave bridge.