Setup Flash memory to act like USB stick

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,

Is it possible to setup the flash file system so it can act like a usb stick.
In short I would like that the flash memory appears in windows as a usb stick when I connect my board (RelaxKit) to my pc.
I think I need to integrate the Fat file system into the flash memory but I don't know how to do this.Also I need to setup the board as a device (slave) not as a host (master).
Is there anyone that can help me how to setup this system?
0 Likes
4 Replies
Not applicable
I think the best possible example to start from is USBD_MS_Example1
There is only one issue I cannot change the StorageMedia parameter from SD card to Flash
0 Likes
Not applicable
Hi preychler,

It is not that simple to use the on-chip flash memory.
For FAT file system, it will write to the same address memory again and again when there are any changes.
However, the on-chip flash on XMC4500 are not able to support this.
An erase is required when data has to be written to the same address again.
And each time you erase, it will erase the whole sector.
But the size for each write for FAT is just 512 byte.
Unless you have an EEPROM emulation on the flash, it is impossible to run the FAT file system on the on-chip flash.
0 Likes
Not applicable
Hi,

I'm speaking of the S25FL032 Flash (on the relax kit) not the on-chip flash. Is it possible using that to create something that appears like a usb stick
0 Likes
Not applicable
Hi preychler,

Then you just need to modify the driver SDCard.c (SDMMC commands) & SCSI.c (SCSI commands) located under ..\Dave\Generated\src\USBD_MS\storage_driver.

Best regards,
Sophia
0 Likes