[M480] SPI flash as a Storage for USB MSC

Post Reply
chhsieh3
Posts: 309
Joined: 13 Mar 2020, 09:08

28 Apr 2020, 15:56

  • Application: This sample code uses SPI Flash as back end storage through SPIM interface.
  • BSP Version: M480 Series BSP CMSIS V3.04.000
  • Hardware: NuMaker-PFM-M487 Ver 3.0
In the sample code, the M480 acts as a USB 2.0 flash drive. It uses the SPIM interface as an back end storage for SPI Flash and has a file system. This function can be used as an alternative to the SD card as a storage space. The write speed is approximately 128 bytes per second.

The user must set the storage memory starting position and the total memory space size through MSC_Init( SectorOffset, TotalSector). A Sector is 512 KB. Since the SPI Flash limit requires at least 4KB to be cleared at a time, 4KB of content is read first, and deleted and then rewritten. The USB handler is in MSC_ProcessCmd(), and M480 will perform the corresponding processing according to the received command.

You can download the sample code at https://www.nuvoton.com/resource-downlo ... 0326144017
Nuvoton

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 136 guests