The phyCORE-AM65x SOM comes with a 4GB eMMC by default and can be optionally populated with a larger eMMC storage device up to 32 GB in size. This guide provides steps to mount, read from, and write to the phyCORE-AM65x onboard eMMC.
Viewing available eMMC partition information
Be careful with the fdisk command. You can accidentally delete the contents of other memory devices connected to the system.
The eMMC corresponds to /dev/mmcblk0 in Linux. You can verify the eMMC partitions by using the following command:
fdisk -l /dev/mmcblk0CODE
An example of a list of partitions on an eMMC device is shown below:
root@am65xx-phycore-rdk:~# fdisk -l /dev/mmcblk0 Disk /dev/mmcblk0: 3.6 GiB, 3850371072 bytes, 7520256 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: F7B887C4-C9D8-4C35-9E70-566EE5F80C56 Device Start End Sectors Size Type /dev/mmcblk0p1 34 7520222 7520189 3.6G Microsoft basic dataCODE
Mounting the eMMC
In order to read and write to the eMMC, you will need to create a directory; then mount the desired partition to that directory. Follow the steps below to mount partition 1 of the eMMC:
mkdir temp mount /dev/mmcblk0p1 temp/CODE
Use the following command to see the contents of the mounted memory device.
An example of what the contents would look like is provided below:
root@am65xx-phycore-rdk:~# ls temp bin dev home lib media opt run srv tmp var boot etc include lost+found mnt proc sbin sys usr wwwCODE
Writing to the eMMC
You can write to the eMMC by using the copy or move commands, just like in Linux.
echo "Hello World" > test.txt cp test.txt tempCODE
Use the following command again to see the contents of the eMMC:
An example of what the contents now look like following the copy is provided below:
root@am65xx-phycore-rdk:~# ls temp bin dev home lib media opt run srv test.txt usr www boot etc include lost+found mnt proc sbin sys tmp varCODE