cancel
Showing results for 
Search instead for 
Did you mean: 

USB mass storage with external flash on QSPI and STM32H745BIT6

ATank.1
Associate III

Hi,

I am using STM32H745BIT6 controller and wish to use the external flash memory as a mass storage device. The external flash memory is connected on QSPI.

The application would be,

user will connect the USB cable to PC and PC should be able to show the external QSPI flash as a drive on PC i.e. as a mass storage device.

Is this possible with STM32H745BIT6 device?.

Please point me to some examples which can be refered.

Thanks

Anuj.

1 ACCEPTED SOLUTION

Accepted Solutions
gbm
Lead III

Start with CubeIDE USB mass storage device with storage volume implemented in MCU's RAM - you will find some guides at ST. Then implement and verify QSPI Flash operations. The funniest part is the implementation of your own FTL - Flash Translation Layer, for mapping logical 512 B sectors to blocks in Flash 4 KiB pages. You may skip the FTL and implement 4 KiB sectors directly but this may result in reduced Flash lifetime.

It is important to understand that the MSC-BOT-SCSI protocol does not directly allow for simultaneous file access via USB and locally by the MCU. If you need to access files from both sides at the same time, you must implement another protocol, commonly used by smartphones.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

View solution in original post

2 REPLIES 2
gbm
Lead III

Start with CubeIDE USB mass storage device with storage volume implemented in MCU's RAM - you will find some guides at ST. Then implement and verify QSPI Flash operations. The funniest part is the implementation of your own FTL - Flash Translation Layer, for mapping logical 512 B sectors to blocks in Flash 4 KiB pages. You may skip the FTL and implement 4 KiB sectors directly but this may result in reduced Flash lifetime.

It is important to understand that the MSC-BOT-SCSI protocol does not directly allow for simultaneous file access via USB and locally by the MCU. If you need to access files from both sides at the same time, you must implement another protocol, commonly used by smartphones.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice