The phyCORE-AM65x SOM brings out a 4-bit wide MMC data bus to the standard SDHC card slot at X13. Power to the card slot is supplied by inserting the appropriate card into the SD/MMC1 connector, which features card detection. This interface shares a bus with the WiFi module on the SOM, but is available on the development kit as an SD card interface for external media or as a bootable interface.
When an external SD Card is inserted, it will be available as /dev/mmcblk1 in Linux.
Mount the SD Card
- Create a temporary directory and mount an SD card partition using the below commands:
mkdir /home/root/temp mount /dev/mmcblk1p1 /home/root/temp
Write to the SD Card
- You can use basic Linux commands to create and write files to the SD card. Below is an example:
echo "Hello World" > test.txt cp test.txt /home/root/temp/
Read from the SD Card
- To read what was just written to the SD card in the previous example, use the following command:
cp /home/root/test.txt read.txt
- To check that the read file (read.txt) is the same as the one that was written (test.txt) you can use md5sum to compare and verify the data transfer was successful:
md5sum /home/root/test.txt && md5sum read.txt
- The above command will generate a long and seemingly random string of characters for both files. This long string is called a "hash" and it uniquely identifies the files. If the hash for both files match then you can be confident that both files (down to each bit) are identical.
root@am65xx-phycore-kit:~# md5sum /home/root/test.txt && md5sum read.txt e59ff97941044f85df5297e1c302d260 /home/root/test.txt e59ff97941044f85df5297e1c302d260 read.txt
Unmounting the SD Card
- Before unplugging the device from the development kit, make sure to unmount it in software. You can do this by running the following command: