TS-TPC-7990 EMMC

From embeddedTS Manuals

This board includes a Micron eMMC. Our default builds are 4 GiB, but up to 64 GiB devices are available for custom builds. The eMMC flash appears to Linux as an SD card at /dev/mmcblk2. Our default programming will include one partition programmed with our Yocto image.

The eMMC devices are like SD cards in that they should not be powered down during a write/erase cycle. This eMMC device includes support for setting a fuse for a "Write Reliability" mode, and a "psuedo SLC" mode. When both of these are enabled all writes will be atomic to 512 B. If a sector is being written during a power loss, a block is guaranteed to have either the old or new data. This scheme is far more resilient to power loss than more traditional flash media. In cases of old 512 B data, fsck will likely be able to recover a mountable filesystem. In cases where the corrupted file is a database it may still require a separate mechanism for recovery.

When the pSLC mode is turned on it will reduce the available space to under half, and reduce the write speed.

See our post on preventing filesystem corruption.

The mmc-utils package is used to enable these modes. First determine the exact size of the flash you're using:

mmc extcsd read /dev/mmcblk2 | grep MAX_ENH_SIZE_MULT -A 1
Max Enhanced Area Size [MAX_ENH_SIZE_MULT]: 0x0001cd
 i.e. 1888256 KiB

So in this case, 1888256 KiB is the max size of the enhanced partition. This number should be used for the enh_area command:

mmc write_reliability set -n 0 /dev/mmcblk2
mmc enh_area set -y 0 1888256 /dev/mmcblk2
WARNING: Setting either of those modes is permanent. Using the wrong value it is possible to brick eMMC which will not be covered by the warranty. Evaluation units with fuses set will not be accepted through returns.

After this is run, reboot the whole unit. On all future boots the eMMC will be detected at the smaller size. Changing the enhanced area will erase the drive. After these mmc commands the disk will need to be rewritten.