牛卧堂MCU技术交流

标题: [M480] SPI flash as a Storage for USB MSC [打印本页]

作者: admin    时间: 2022-8-25 10:58
标题: [M480] SPI flash as a Storage for USB MSC


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





欢迎光临 牛卧堂MCU技术交流 (http://www.nuvoton-mcu.com/) Powered by Discuz! X3.2