Skip to main content
Visitor II
January 11, 2023
Solved

USB mass storage with external flash on QSPI and STM32H745BIT6

  • January 11, 2023
  • 2 replies
  • 2775 views

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.

    This topic has been closed for replies.
    Best answer by gbm

    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.

    2 replies

    gbmAnswer
    Graduate
    January 11, 2023

    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.

    Graduate II
    January 15, 2023