first 2016/02 SDFileSystemDMA inherited from Official SDFileSystem.

Dependents:   SDFileSystemDMA-test DmdFullRGB_0_1

Fork of SDFileSystemDMA by mi mi

SDFileSystemDMA is enhanced SDFileSystem library for STM32 micros by using DMA functionality.
Max read transfer rate reaches over 2MByte/sec at 24MHz SPI clock if enough read buffer size is set.
Even though minimum read buffer size (512Byte) is set, read transfer rate will reach over 1MByte/sec at 24MHz SPI Clock.
( but depends on the ability of each SD card)

Test program is here.
https://developer.mbed.org/users/mimi3/code/SDFileSystemDMA-test/

/media/uploads/mimi3/sdfilesystemdma-speed-test3-read-buffer-512byte.png

/media/uploads/mimi3/sdfilesystemdma-speed-test-buffer-vs-spi-clock-nucleo-f411re-96mhz.png

Supported SPI port is shown below table.

(v): Verified. It works well.
(w): Probably it will work well. (not tested)
(c): Only compiled. (not tested)
(f): Over flash.
(r): Only read mode. (when _FS_READONLY==1)
(u) Under construction
(z): Dose not work.

Caution

If your board has SRAM less than or equal to 8KB, the buffer size must be set to 512 Bytes.

Supported Boards:
Cortex-M0

BoardSRAMSPI1SPI2SPI3
NUCLEO-F030R88KB(v)
DISCO-F051R88KB(w)
NUCLEO-F031K64KB(f)
NUCLEO-F042K66KB(r)
NUCLEO-F070RB16KB(w)
NUCLEO-F072RB16KB(w)
NUCLEO-F091RC32KB(c)

Cortex-L0

BoardSRAMSPI1SPI2SPI3
DISCO-L053C88KB(c)
NUCLEO-L053R88KB(c)
NUCLEO-L073RZ20KB(c)

Cortex-M3

BoardSRAMSPI1SPI2SPI3
DISCO-F100RB8KB(v)(v)-
BLUEPILL-F103CB20KB(w)(w)-
NUCLEO-F103RB20KB(v)(v)-
NUCLEO-L152RE80KB(v)(w)-
MOTE-L152RC32KB(w)(w)-

Cortex-M4
F3

BoardSRAMSPI1SPI2SPI3
DISCO-F303VC40KB-(v)(v)
NUCLEO-F303RE64KB(w)(w)(w)
NUCLEO-F302R816KB--(c)
NUCLEO-F303K812KB(c)--
DISCO-F334C812KB(c)--
NUCLEO-F334R812KB(c)--

F4

BoardSPI1SPI2SPI3
ELMO-F411RE(w)-(w)
MTS-MDOT-F411RE(u)-(u)
MTS-DRAGONFLY-F411RE(w)-(w)
NUCLEO-F411RE(v)-(v)
NUCLEO-F401RE(w)-(w)
MTS-MDOT-F405RG(u)-(u)
NUCLEO-F410RB(c)-(c)
NUCLEO-F446RE(c)-(c)
NUCLEO-F429ZI(c)-(c)
B96B-F446VE(c)-(c)
NUCLEO-F446ZE(c)-(c)
DISCO-F429ZI(u)-(u)
DISCO-F469NI(c)-(c)

Information

This library is set to use "short file name" in SDFileSystemDMA/FATFileSystem/ChaN/ffconf.h . ( _USE_LFN=0)
You can change this option to _USE_LFN=1 .

Committer:
mimi3
Date:
Sun Jan 22 23:13:11 2017 +0900
Revision:
38:7077795dbf81
Parent:
10:b48d3ace55db
change: table.md

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mimi3 10:b48d3ace55db 1 /*-----------------------------------------------------------------------/
mimi3 10:b48d3ace55db 2 / Low level disk interface modlue include file (C)ChaN, 2014 /
mimi3 10:b48d3ace55db 3 /-----------------------------------------------------------------------*/
mimi3 10:b48d3ace55db 4
mimi3 10:b48d3ace55db 5 #ifndef _DISKIO_DEFINED
mimi3 10:b48d3ace55db 6 #define _DISKIO_DEFINED
mimi3 10:b48d3ace55db 7
mimi3 10:b48d3ace55db 8 #ifdef __cplusplus
mimi3 10:b48d3ace55db 9 extern "C" {
mimi3 10:b48d3ace55db 10 #endif
mimi3 10:b48d3ace55db 11
mimi3 10:b48d3ace55db 12 #define _USE_WRITE 1 /* 1: Enable disk_write function */
mimi3 10:b48d3ace55db 13 #define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
mimi3 10:b48d3ace55db 14
mimi3 10:b48d3ace55db 15 #include "integer.h"
mimi3 10:b48d3ace55db 16
mimi3 10:b48d3ace55db 17
mimi3 10:b48d3ace55db 18 /* Status of Disk Functions */
mimi3 10:b48d3ace55db 19 typedef BYTE DSTATUS;
mimi3 10:b48d3ace55db 20
mimi3 10:b48d3ace55db 21 /* Results of Disk Functions */
mimi3 10:b48d3ace55db 22 typedef enum {
mimi3 10:b48d3ace55db 23 RES_OK = 0, /* 0: Successful */
mimi3 10:b48d3ace55db 24 RES_ERROR, /* 1: R/W Error */
mimi3 10:b48d3ace55db 25 RES_WRPRT, /* 2: Write Protected */
mimi3 10:b48d3ace55db 26 RES_NOTRDY, /* 3: Not Ready */
mimi3 10:b48d3ace55db 27 RES_PARERR /* 4: Invalid Parameter */
mimi3 10:b48d3ace55db 28 } DRESULT;
mimi3 10:b48d3ace55db 29
mimi3 10:b48d3ace55db 30
mimi3 10:b48d3ace55db 31 /*---------------------------------------*/
mimi3 10:b48d3ace55db 32 /* Prototypes for disk control functions */
mimi3 10:b48d3ace55db 33
mimi3 10:b48d3ace55db 34
mimi3 10:b48d3ace55db 35 DSTATUS disk_initialize (BYTE pdrv);
mimi3 10:b48d3ace55db 36 DSTATUS disk_status (BYTE pdrv);
mimi3 10:b48d3ace55db 37 DRESULT disk_read (BYTE pdrv, BYTE* buff, DWORD sector, UINT count);
mimi3 10:b48d3ace55db 38 DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, UINT count);
mimi3 10:b48d3ace55db 39 DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
mimi3 10:b48d3ace55db 40
mimi3 10:b48d3ace55db 41
mimi3 10:b48d3ace55db 42 /* Disk Status Bits (DSTATUS) */
mimi3 10:b48d3ace55db 43
mimi3 10:b48d3ace55db 44 #define STA_NOINIT 0x01 /* Drive not initialized */
mimi3 10:b48d3ace55db 45 #define STA_NODISK 0x02 /* No medium in the drive */
mimi3 10:b48d3ace55db 46 #define STA_PROTECT 0x04 /* Write protected */
mimi3 10:b48d3ace55db 47
mimi3 10:b48d3ace55db 48
mimi3 10:b48d3ace55db 49 /* Command code for disk_ioctrl fucntion */
mimi3 10:b48d3ace55db 50
mimi3 10:b48d3ace55db 51 /* Generic command (Used by FatFs) */
mimi3 10:b48d3ace55db 52 #define CTRL_SYNC 0 /* Complete pending write process (needed at _FS_READONLY == 0) */
mimi3 10:b48d3ace55db 53 #define GET_SECTOR_COUNT 1 /* Get media size (needed at _USE_MKFS == 1) */
mimi3 10:b48d3ace55db 54 #define GET_SECTOR_SIZE 2 /* Get sector size (needed at _MAX_SS != _MIN_SS) */
mimi3 10:b48d3ace55db 55 #define GET_BLOCK_SIZE 3 /* Get erase block size (needed at _USE_MKFS == 1) */
mimi3 10:b48d3ace55db 56 #define CTRL_TRIM 4 /* Inform device that the data on the block of sectors is no longer used (needed at _USE_TRIM == 1) */
mimi3 10:b48d3ace55db 57
mimi3 10:b48d3ace55db 58 /* Generic command (Not used by FatFs) */
mimi3 10:b48d3ace55db 59 #define CTRL_POWER 5 /* Get/Set power status */
mimi3 10:b48d3ace55db 60 #define CTRL_LOCK 6 /* Lock/Unlock media removal */
mimi3 10:b48d3ace55db 61 #define CTRL_EJECT 7 /* Eject media */
mimi3 10:b48d3ace55db 62 #define CTRL_FORMAT 8 /* Create physical format on the media */
mimi3 10:b48d3ace55db 63
mimi3 10:b48d3ace55db 64 /* MMC/SDC specific ioctl command */
mimi3 10:b48d3ace55db 65 #define MMC_GET_TYPE 10 /* Get card type */
mimi3 10:b48d3ace55db 66 #define MMC_GET_CSD 11 /* Get CSD */
mimi3 10:b48d3ace55db 67 #define MMC_GET_CID 12 /* Get CID */
mimi3 10:b48d3ace55db 68 #define MMC_GET_OCR 13 /* Get OCR */
mimi3 10:b48d3ace55db 69 #define MMC_GET_SDSTAT 14 /* Get SD status */
mimi3 10:b48d3ace55db 70
mimi3 10:b48d3ace55db 71 /* ATA/CF specific ioctl command */
mimi3 10:b48d3ace55db 72 #define ATA_GET_REV 20 /* Get F/W revision */
mimi3 10:b48d3ace55db 73 #define ATA_GET_MODEL 21 /* Get model name */
mimi3 10:b48d3ace55db 74 #define ATA_GET_SN 22 /* Get serial number */
mimi3 10:b48d3ace55db 75
mimi3 10:b48d3ace55db 76 #ifdef __cplusplus
mimi3 10:b48d3ace55db 77 }
mimi3 10:b48d3ace55db 78 #endif
mimi3 10:b48d3ace55db 79
mimi3 10:b48d3ace55db 80 #endif