Two MSC with TinyUSB
Posted: Wed Oct 02, 2024 11:49 am
I am developing a system based on an ESP32 S3 where I have two flash memories connected to an SPI port (SPI3) with different CS (chip select). The final goal is to make these memories mountable (as an MSC) on a PC when connecting the ESP32 via USB.
I can successfully mount them on the system (ESP32) by using and modifying the `ext_flash_fatfs` example. Then, based on the `tusb_msc` example, I can mount only one memory when connecting the ESP32 to the PC (acting as a device).
The problem arises when I try to make both appear as MSC devices when connecting the system to a PC. When I attempt to mount the second unit using the function `tinyusb_msc_storage_mount`, the error occurs indicating that I cannot initialize another handler for the second partition, so it only allows me to mount one. The specific part where the error occurs in this function is: `assert(s_storage_handle);`.
Is it possible to use a single USB port (as a device) to mount two flash units when connecting the device to a PC? Is there any available example (I haven’t found anything in the official examples)? Any advice on what the workflow for this might look like?
Best regards.
I can successfully mount them on the system (ESP32) by using and modifying the `ext_flash_fatfs` example. Then, based on the `tusb_msc` example, I can mount only one memory when connecting the ESP32 to the PC (acting as a device).
The problem arises when I try to make both appear as MSC devices when connecting the system to a PC. When I attempt to mount the second unit using the function `tinyusb_msc_storage_mount`, the error occurs indicating that I cannot initialize another handler for the second partition, so it only allows me to mount one. The specific part where the error occurs in this function is: `assert(s_storage_handle);`.
Is it possible to use a single USB port (as a device) to mount two flash units when connecting the device to a PC? Is there any available example (I haven’t found anything in the official examples)? Any advice on what the workflow for this might look like?
Best regards.