USB MSD using SPI FLASH

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

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

Tabulous
Posts: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

USB MSD using SPI FLASH

Postby Tabulous » Thu Mar 16, 2017 5:09 pm

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: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: USB MSD using SPI FLASH

Postby Tabulous » Thu Mar 16, 2017 5:41 pm

Or maybe easier is to use mmc_spi and change the required parts to suit

Tabulous
Posts: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: USB MSD using SPI FLASH

Postby Tabulous » Fri Mar 17, 2017 1:20 pm

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 183 times

User avatar
DeusExMachina
Posts: 223
Joined: Tue Apr 03, 2012 5:08 am
Location: South Korea
Has thanked: 3 times
Been thanked: 3 times

Re: USB MSD using SPI FLASH

Postby DeusExMachina » Mon Apr 03, 2017 3:17 am

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: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: USB MSD using SPI FLASH

Postby Tabulous » Mon Apr 03, 2017 11:42 am

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.


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 41 guests