4.23. MMCSD

4.23.1. Introduction

MMCSD module provides an interface between CPU and any MMCSD-bus-compatible device that connects via MMCSD serial bus. External components attached to MMCSD bus can serially transmit/receive data to/from the CPU device through two-wire interface

Key Features

Type of transfers
  •  Read

  •  Write

  •  Write followed by read

Operating modes
  •  Blocking(interrupt or Non interrupt)

  •  Callback mode(interrupt)

Supports only master mode. Slave mode is not supported

4.23.2. User Interface

4.23.2.1. Driver Configuration

Board Specific Configuration

All board specific configurations eg:enabling clock and pin-mux for UART pins are required before calling any driver APIs.By default Board_Init() API supports all initialization sequence for TI supported EVMs. In addition it initializes UART instance for Console/STDIO. Once board specific configuration is complete MMCSD_init() API can be called to initialize driver.

MMCSD Configuration Structure

The MMCSD_soc.c file binds driver with hardware attributes on the board through MMCSD_config structure. This structure must be initialized before the MMCSD_init() function is called and cannot be changed afterwards. For details about the individual fields of this structure, see the API Guide.

4.23.3. Application

4.23.3.1. Examples & Unit tests

Name

Description

Expected Results

Supported SOCs

Build Type

MMCSD_TestApp

Unit Test application demonstrating write and read a fixed number of bytes into MMCSD card. Verifies written data pattern to conclude PASS/FAIL.

Prints on console All tests have passed

J721s2 J721e J7200 J784s4

Makefile

MMCSD_DMA_TestApp

Functionally same as MMCSD_TestApp but with DMA enabled

Prints on console All tests have passed

J721s2 J721e J7200 J784s4

Makefile

MMCSD_EMMC_TestApp

Unit Test application demonstrating write and read a fixed number of bytes into the onboard EMMC.Verifies written data pattern to conclude PASS/FAIL.

Prints on console All tests have passed

J721s2 J721e J7200 J784s4

Makefile

MMCSD_EMMC_DMA_TestApp

Functionally Same as EMMC_TestApp but using DMA mode

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_Baremetal_TestApp

Baremetal version of MMCSD_TestApp

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_Baremetal_DMA_TestApp

Baremetal version of MMCSD_EMMC_TestApp

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_Baremetal_EMMC_TestApp

Baremetal version of MMCSD_EMMC_TestApp

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_Baremetal_EMMC_DMA_TestApp

Functionally same as MMCSD_Baremetal_EMMC_TestApp but with DMA enabled

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_Regression_TestApp

Menu driven regression test which tests various configurations of SD card

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

MMCSD_EMMC_Regression_TestApp

Menu driven regression test which tests various configurations of EMMC

Prints on console All tests have passed

J7200 J721s2 J721e J784s4

Makefile

4.23.3.2. Benchmarking Read/Write Peformance

  • The MMCSD_<EMMC>_Regression_TestApp application (listed above) measures read/write throughput (in mega bytes per sec).

  • It measures the following

    1. RAW read/write throughput: This involves the reading/writing of a continuous block of data, say 1MB data buffer on to the SD/eMMC using MMCSD_Read()/MMCSD_Write().

    2. FATFS read/write (SD Only) throughput: This involves reading/writing of a 1MB buffer of data through f_read()/f_write(). Please note that FAT32 is tested with SD card only

  • The performance benchmarks on SD Read/Write can be done with the following steps

    1. Load the MMCSD_Regression_TestApp on mpu1_0/mcu1_0 core

    2. Insert SD Card formatted with FAT32 format preferably with allocation size=4096 bytes for better performance.

    3. Run the application. It presents with a menu of various modes the SD card which can be run on the UART console

    4. Select the desired mode from the list (say HS mode) and press Enter

    5. The test will run RAW & FATFS read/writes of various buffer sizes 256K, 512K, 1024K and 2048K. This might take a minute or two to complete.

    6. Two tables are printed at the end of the test run for this mode with RAW & FATFS throughput numbers for each buffer size.

    7. Note: Instead of running each mode seperately, you can select “All non powercycle tests” option (-1) which runs all the supported modes along with the throughput numbers for each of them.

  • EMMC performance benchmarks can be measured with the following steps

    1. Load the MMCSD_EMMC_Regression_TestApp on mpu1_0/mcu1_0 core

    2. Run the application. It presents with a menu of various eMMC modes which can be run on the UART console

    3. Select the desired mode from the list (say HS-DDR mode) and press Enter

    4. The test will run RAW read/writes of various buffer sizes 256K, 512K, 1024K and 2048K. This might take a minute or two to complete.

    5. A table is printed at the end of the test with the RAW throughput numbers for each buffer size.

    6. Note: Instead of running each mode seperately, you can select “All non powercycle tests” option (-1) which runs all the supported modes along with the throughput numbers for each of them.

4.23.4. Building MMCSD Test applications via makefiles

  • MMCSD Test applications and dependent libraries are built from the top level mmcsd makefile

  • Refer to the Processor SDK RTOS Getting Started Guide for details of how to setup the build environment. Once you have setup the build environment, issue the following commands:

    • cd <pdk>/packages/

    • To build: make mmcsd

    • To clean: make mmcsd_clean

  • Similarly, to build at the module level, issue the following commands for rebuilding :

    • cd <pdk>/packages/ti/drv/mmcsd

    • To build: make all

    • To clean: make clean