Project

General

Profile

microSD Card

The MitySOM-QC6490 Development Kit has a microSD card slot that can be used for removable storage or as a boot medium (future support planned).

Supported Card Types

The MitySOM-QC6490 supports version 3.0 of the SD specification, including dual-voltage and cards up to UHS-I at SDR50, DDR50, and SDR104 rates.

Supported File Systems

For removable storage, the MitySOM-QC6490 supports the following file systems by default. Additional file system support can be added via additional kernel modules and/or a custom kernel.

  • ext2, ext3, ext4
  • VFAT (including FAT)

Partition tables may be either MBR or GPT format.

For use as the boot medium the microSD card will be partitioned and formatted as part of the flashing process.

Usage as Removable Storage

If your microSD card is already partitioned and formatted, simply plug it in until you feel a click. The system will auto-mount the first partition at /media/sdcard. If there are additional partitions, the system will not auto-mount them.

To eject your microSD card, push it until you feel a soft click and then release it. It should be partially ejected, and you can pull it the rest of the way out.

Important: To avoid risk of data loss, unmount all partitions of your microSD card before ejecting it. See Mounting and Unmounting below.

Device Enumeration

Your microSD card will enumerate as /dev/mmcblk<n>, where <n> may vary depending on whether the eMMC is in use. Each partition will also enumerate separately as /dev/mmcblk<n>p<p>, where <p> is the partition number.

You can check what devices are currently enumerated and whether/where they're mounted with the lsblk command. For example, the following shows a microSD card with two partitions, where the first is mounted at /media/sdcard. (/media/sdcard is a symlink to /var/rootdirs/media/sdcard.)

root@qcs6490-mitysom-devkit:~# lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
mmcblk1     179:0    0 119.4G  0 disk
|-mmcblk1p1 179:1    0   128M  0 part /var/rootdirs/media/sdcard
`-mmcblk1p2 179:2    0   128M  0 part

Note: The example above is abbreviated for clarity. You will normally see many additional devices when you run lsblk.

Mounting and Unmounting

If your microSD card has additional partitions that did not get auto-mounted, or you've unmounted a partition and want to remount it, the general command to mount a partition is:

mount <device-path> <mountpoint>

Where <device-path> is the path to a specific partition as determined above in Device Enumeration. For example, to mount the second partition at /mnt, the command would be:

mount /dev/mmcblk1p2 /mnt

The general command to unmount a partition is:

umount <mountpoint>

For example, to unmount a partition from /mnt, the command would be:

umount /mnt

Partitioning and Formatting

In general, you can use your favorite partitioning and formatting software on a Windows or Linux PC to set up your microSD card for use with the MitySOM-QC6490 as long as you select one of the Supported File Systems. Note however that partitioning setups and file systems are highly configurable, and you may encounter situations where a microSD card usable on a PC does not work with the MitySOM-QC6490. In this case, either adjust the options you selected in your PC partitioning and formatting software or follow the steps below for basic setup directly from the MitySOM-QC6490 Development Kit.

Basic Setup from the MitySOM-QC6490 Development Kit

The instructions that follow configure a single full-disk MBR partition with a VFAT file system; this should also be usable from most Windows and Linux PCs for easy file transfer. For more advanced configurations, consult the documentation for fdisk and mkfs.<fs> (where <fs> is the file system(s) you're interested in).

Important: The following instructions will permanently erase your microSD card. Be sure you have a backup of any important data on it. At any time fdisk is prompting for a command in the steps below, you can type q followed by enter to exit without saving any changes.

  1. Insert the microSD card, determine its device path as described in Device Enumeration above, and unmount any partitions that are mounted, as described in Mounting and Unmounting above.
    • Note: The remainder of these steps will use /dev/mmcblk1 as the device path as an example. Be sure to replace it if needed.
  2. Partition the microSD card:
    1. Run the command fdisk /dev/mmcblk1.
    2. Type o and press enter.
    3. Type n and press enter.
    4. Press enter.
    5. Press enter.
    6. Press enter.
    7. Press enter.
    8. Depending on what was previously on your microSD card, you may see a warning about a file system signature. Unless you need to exit to get data off the microSD card, you should generally type y and press enter.
    9. The next step will commit all changes; ensure there was no remaining data on the microSD card that you need.
    10. Type w and press enter. A full transcript of the above partitioning steps should look something like the following:
      root@qcs6490-mitysom-devkit:~# fdisk /dev/mmcblk1
      
      Welcome to fdisk (util-linux 2.39.3).
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.
      
      Command (m for help): o
      Created a new DOS (MBR) disklabel with disk identifier 0x86c77b7c.
      
      Command (m for help): n
      Partition type
         p   primary (0 primary, 0 extended, 4 free)
         e   extended (container for logical partitions)
      Select (default p):
      
      Using default response p.
      Partition number (1-4, default 1):
      First sector (2048-250347519, default 2048):
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-250347519, default 250347519):
      
      Created a new partition 1 of type 'Linux' and of size 119.4 GiB.
      Partition #1 contains a ext4 signature.
      
      Do you want to remove the signature? [Y]es/[N]o: y
      
      The signature will be removed by a write command.
      
      Command (m for help): w
      The partition table has been altered.
      Calling ioctl() to re-read partition table.
      Syncing disks.
      
      • Note: You may also see errors such as the following. These are harmless; they're caused by the system trying to auto-mount the new partition, which doesn't yet have a file system.
        [   58.831553][ T1648] EXT4-fs (mmcblk1p1): VFS: Can't find ext4 filesystem
        [   58.839780][ T1648] EXT4-fs (mmcblk1p1): VFS: Can't find ext4 filesystem
        [   58.847203][ T1648] EXT4-fs (mmcblk1p1): VFS: Can't find ext4 filesystem
        [   58.854583][ T1648] FAT-fs (mmcblk1p1): bogus number of reserved sectors
        
      • Note: In some cases, the kernel may succeed at mounting the new partition despite any file system errors it may print. In this case, unmount the new partition as described in Mounting and Unmounting above before continuing on to create the new file system.
  3. Create the file system:
    1. Run the command mkfs.vfat /dev/mmcblk1p1. This may take several seconds depending on the size of your microSD card.
  4. Mount the new partition as described in Mounting and Unmounting above.

Performance

Performance can vary significantly depending on the type of microSD card you're using and your specific workload, but for most cards you can expect to be able to achieve the performance indicated by the card's speed rating for sequential access.

If you do want to benchmark your microSD card or a specific workflow, fio is a highly flexible benchmarking utility that comes installed on the MitySOM-QC6490 Development Kit. You can read more at the link, but below are basic fio commands for testing sequential performance.

fio --name=sd --filename=/media/sdcard/test --size=128M --bs=256k --iodepth=4 --numjobs=1 --ioengine=libaio --direct=1 --rw=read
fio --name=sd --filename=/media/sdcard/test --size=128M --bs=256k --iodepth=4 --numjobs=1 --ioengine=libaio --direct=1 --rw=write

Usage as Boot Medium

Booting from microSD is planned for a future release.

Go to top
Add picture from clipboard (Maximum size: 1 GB)