套用的官方内部SRAM做U盘的例程,W25Q64外部flash,格式化后读写正常,每次插拔都要格式化
#define STORAGE_BLK_NBR 2048
#define STORAGE_BLK_SIZ 4096
static int8_t STORAGE_Read (uint8_t Lun,
uint8_t *buf,
uint32_t BlkAddr,
uint16_t BlkLen)
{
W25QXX_Read(buf, BlkAddr, BlkLen * STORAGE_BLK_SIZ);
return 0;
}
static int8_t STORAGE_Write (uint8_t Lun,
uint8_t *buf,
uint32_t BlkAddr,
uint16_t BlkLen)
{
W25QXX_Write(buf, BlkAddr, BlkLen * STORAGE_BLK_SIZ);
return 0;
}
每次插拔都要格式化,是什么地方出问题了吗 |