USB MSD using SPI FLASH

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

USB MSD using SPI FLASH

Post by Tabulous »

Hi Just looking at USB MSD and looking to use this on SPI flash.

The MSD Config struct requires a block device driver like SDC, but could we not use the new hal_flash driver here instead ?
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: USB MSD using SPI FLASH

Post by Tabulous »

Or maybe easier is to use mmc_spi and change the required parts to suit
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: USB MSD using SPI FLASH

Post by Tabulous »

Got it working using a hacked mmc_spi interface.

Attached are the files. This uses the same flash driver as in

http://www.chibios.com/forum/viewtopic.php?f=3&t=3320

The usb_msd.c is change to support 4096 blocks, i.e. the buffers.
Attachments
USB-MSD using SPI Flash.zip
(17.57 KiB) Downloaded 451 times
User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Has thanked: 3 times
Been thanked: 3 times

Re: USB MSD using SPI FLASH

Post by DeusExMachina »

Good job! How about speed? I am considering changing my eMMC to SPI flash in the future. Does it support some wear leveling?
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: USB MSD using SPI FLASH

Post by Tabulous »

DeusExMachina wrote:Good job! How about speed? I am considering changing my eMMC to SPI flash in the future. Does it support some wear leveling?


Ive not really done any performance testing but speed is not really an issue for me, writes to the flash i do very minimal. Its manly used for boot loading, so i can drag/drop new binaries on to it and then flash them to host MCU flash.

There is no wear leveling either.
Post Reply