1.10 SDMMC driver asynchronous - SDIO Read Write

This example application shows how to use the SDMMC (SDIO) driver in asynchronous mode to perform read/write operations on the ATWILC1000 SDIO card.

Description

  • This example uses the SDIO driver in asynchronous mode and demonstrates read/write operations using CMD52 (single byte read/write) and CMD53 (multi-byte and block transfers).
  • The application reads and writes following registers:

    1. Read Card Capability Register using CMD52

    2. Read FN0 Block Size Register (16-bits) using CMD53

    3. Write FN0 Block Size Register to 256 using CMD53

    4. Read back and confirm if the FN0 Block Size Register is updated to 256

    5. Write FN0 Block Size Register back to 512 using two CMD52 commands and Read after Write enabled

    6. Confirm that FN0 Block Size Register is set back to 512

    7. Read all 512 bytes of Card Common Control Register (CCCR) using CMD53 Block transfer

    8. Enable FN1 CSA - Code Storage Area - by writing to address 0x100 in Function Basic Registers (FBR) region using CMD52

    9. Read back and verify the value of FBR register at address 0x100

    10. Write 3 bytes of Function 1 Code Storage Area (CSA) at address 0x10C to value 0x1000 using CMD52

    11. Read 4 bytes of Chip ID from address 0x1000 using CMD53. The read chip ID must be 0x1003A0

Downloading and Building the Application

To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Path of the application within the repository is apps/driver/sdmmc/async/sdio_read_write.

To build the application, refer to the following table and open the project using its IDE.

Project NameDescription
sam_9x60_curiosity.XMPLABX project for SAM9X60-Curiosity board

Setting Up AT91Bootstrap loader

To load the application binary onto the target device, we need to use at91bootstrap loader. Refer to the at91bootstrap loader documentation for details on how to use it to bootstrap the application binaries.

Setting Up the Hardware

The following table shows the target hardware for the application projects.

Project NameDescription
sam_9x60_curiosity.XSAM9X60-Curiosity board

Running the Application

  1. Open the Terminal application (Ex.:Tera term) on the computer
  2. Connect the COM port and configure the serial settings as follows :
    • Baud : 115200
    • Data : 8 Bits
    • Parity : None
    • Stop : 1 Bit
    • Flow Control : None
  3. Build and program the application using its IDE
  4. Observe the following messages on serial terminal