1.11 SDMMC driver asynchronous - SDIO Read Write
This example application shows how to use the 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 Name | Description |
---|---|
sama5d29_curiosity.X | MPLABX project for SAMA5D29 Curiosity Development Board |
Setting Up the Hardware
The following table shows the target hardware for the application projects.
Project Name | Description |
---|---|
sama5d29_curiosity.X | SAMA5D29 Curiosity Development Board |
Setting Up SAMA5D29 Curiosity Development Board
- To run the demo, the following additional hardware are required:
- Connect the USB_A port on board to the computer using a USB-C type cable.
- Connect a FTDI cable from UART Debug (J28) port to computer.
- Insert ATWILC1000 SD Evaluation Kit in the SD Card slot (J7) on the development board.
Running the Application
- Open the Terminal application (Ex.:Tera term) on the computer
- Connect to the EDBG Virtual COM
port and configure the serial settings as follows:
- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None
- Build and Program the application using its IDE
- Insert the ATWILC1000 SD Evaluation Kit and observe the following output on the terminal