I have a board with an STM32F407 plus an SD card interface and a 25Q32 flash memory. I followed examples in the documentation and can access both devices using FlashFS. I also can connect to a PC and "see" the SD card as an external device using the USB port. However can't do the same with the flash memory chip. How should I use USBD_MSC0_SetMediaOwnerUSB() function to use the 25Q32 chip ?
USBD_MSC0_SetMediaOwnerUSB is only used to switch who owns the media (FileSystem or USB at a certain point in time), it is not used to switch media layer.
If you want to change media at runtime you will have to change the implementation in the USBD_User_MSC.c file.
Otherwise, you can also change MEDIA_DRIVE define in the USBD_User_MSC.c file to change the media at compile-time.
Best regards, Milorad
Thank you for your reply. Will see that file and report
Apparently it does not work with spi devices.
Hi Viktor, on the serial SPI Flash the MDK File System will use the Embedded File System instead of FAT. So the SPI Flash can't be read by the PC, as it does not understand this File System.
Understood. Thank you