How to Build Reliability into Embedded Systems using eMMC Flash

How to Build Reliability into Embedded Systems using eMMC Flash

While NAND Flash has been a popular storage technology for many years, it’s become more complex to design into an embedded system as it reaches higher densities. That’s where eMMC Flash—which has its own integrated NAND controller—can come in handy.


Supported by a JEDEC standard that defines all the interface requirements, embedded MultiMedia Card (eMMC) flash memory makes the process of integrating flash with embedded controllers more straightforward. While many system-level technical issues remain, we’ll investigate how eMMC Flash offers promise for the application developer to build reliability into the design. We will investigate the advantages of eMMC Flash and how it can be used to make sure your file system and its contents stay intact.

eMMC flash was originally developed by Siemens and Sandisk and is now widely used in devices such as smartphones, digital cameras, point of sale terminals, industrial controllers, etc. Since it was designed for embedded systems, it makes integration extremely easy by taking care of some of the more complex flash handling operations. The built-in NAND controller means that it can be connected to any processor with a compatible memory interface such as MMC/SDIO, and it handles block management, wear leveling, and error correction code (ECC) internally.

eMMC for Simplified System Design

One of the main benefits of eMMC is that it presents a simple interface to the application processor, simplifying system design. This also means the developer can choose from a much wider range of embedded processors since the processor only needs a simple interface to use the flash device. This can help increase the flexibility of the design and may provide options to reduce system cost.

Normally supplied in small form-factor BGA packaging (Figure 1), eMMC can be easily designed-in but cannot be unplugged in the same way as an SD/MMC card. This means it can be used in a high integrity, fail-safe ‘by design’ system, but this functionality is not provided by the eMMC chip. In order for eMMC to be completely reliable and fail-safe, there must be a system-level design that incorporates a power management strategy. Each layer in the system, from application to driver interface, must provide a defined service to the other.  This allows the data and file system to guarantee no data loss or a potentially catastrophic file system failure.

Figure 1
BGA-packaged eMMC chips can be mounted on a range of printed circuit boards developed by HCC to further aid the test and validation process for customers.

How Does eMMC Compare to NAND and SD Card Flash?

While NAND flash is the leading flash storage technology used for large quantities of data, there are several important things to consider when using it. The error characteristics of each NAND device type are different, such as the number of bad blocks, bad block markers, and ECC requirements. This means the error correction code (ECC) requirement has to be matched to the microcontroller’s NAND controller interface. NAND flash also needs complex management services such as wear-leveling and bad-block management.

In the case of the SD card, there is no concept of fail-safety or of data commit points where the state of a card can be guaranteed. This is a real problem for fail-safe operation and presents a risk to data and to the file system integrity. Most SD cards are optimized for high speed at the expense of correctly defined behavior in the event of unexpected reset. Also there is no method for differentiating between critical and non-critical operations. One advantage of SD is that it is removable; a benefit for consumer goods but more problematic for industrial applications like data loggers. Removable media can lead to uncertainty of data and also creates contact/vibration issues.

eMMC addresses many of these issues, thanks to several features such as a simple block mode interface that hides all the intricacies of the underlying flash from the user while the level of service is given by the manufacturer at the block level. There are different write modes that allow the user to optimize performance depending on whether the data being written is critical or not. Typically file system meta-data is critical and file data is not so critical – but that also depends on the application and the level of fail-safety provided by the file system.

There is also a bi-directional parameter exchange that in particular, allows the card to optimize its operations based on the properties of the host system. And finally, eMMC reduces vibration and unplanned removal issues, because it is provided as a solid-state chip integrated on the target board.

File Systems and Reliability

It can be a serious quality issue for an embedded system if the file system, or its contents, become corrupt. To establish tests and verification at the design and implementation stage, the designer has to address some fundamental design challenges, including how to handle file operations and directory structures, how to deal with the integrity of data during power loss or unexpected reset, and how to verify correct operation of the flash.

Traditionally the handling of file and directory operations is delegated to an embedded file system. An application gets significant benefits from using a file system: the abstraction of the storage media to a set of data files. However, a file system alone cannot guarantee the integrity of data and the file system itself. Whatever method of ensuring fail-safety is used, the system remains dependent on the storage media and must define a required level of service from that media. A system designed to ensure reliability must include a clear understanding of the critical exceptions – such as unexpected reset or power loss – and how each part of the system will meet the requirements of the components using it when this occurs. Simply using a file system that claims fail-safe operation or journaling has no chance of guaranteeing reliable operation without defining these things.

eMMC devices can provide a fundamental building block in a reliable or deterministic storage system with clear advantages over other similar technologies. But as with any concept of determinism or reliability, the whole system has to be taken into consideration and the various components validated both individually and in the context of the complete system.

A typical file storage system will consist of four layers that need to be consistent; the generic description is shown in (Figure 2) on the left and the fail-safe eMMC components on the right.

Figure 2
A typical file storage system, showing fail-safe eMMC components on the right.

Some file systems, such as HCC Embedded’s SafeFAT (Figure 3), achieve fail-safety by:

Figure 3
HCC Embedded’s SafeFAT file system tests and validates that the driver and eMMC function as required to guarantee the system is genuinely fail-safe.

1. Exactly defining what is guaranteed by the fail-safe properties of the file system to the storage application.

2. Exactly defining what is required of the media driver (and its storage medium) to provide that level of service.

To validate this, the HCC Embedded system tests and validates that the driver and the media (eMMC) function as required to guarantee the system is genuinely fail-safe.

Real-life Media Testing Example

In its labs, HCC Embedded has developed an eMMC test rig that allows HCC to run different test suites. These stress tests help to validate the reliability of both the eMMC media driver and the eMMC used.

An SD form factor module has been created to mount eMMC devices for easy handling (Figure 4). On each line A software-controlled relay is placed between the SD/MMC interface controller and the eMMC module,. The test software is used to write test patterns to the module and resets are induced on the control and data lines. The stored data is then verified to ensure it is correct and has no indeterminate sectors and no corrupt sectors. This test is then repeated thousands of times. The test cases are varied to test different use patterns such as large reads, random reads, etc. An additional layer of file system test is also applied to try to isolate problems that may be caused by more complex interactions.

Figure 4
Customers can plug a variety of PCBs, offered by HCC, into a wide range of standard development board sockets such as MMC/SD interfaces, as well as HCC’s eMMC test and verification platform, thereby eliminating the expense of acquiring pre-installed eMMC boards.

These tests are not proof in themselves that the system is fail-safe but they do give a high level of confidence that the system handles even extreme failure events deterministically in the way it was designed. As embedded systems approach higher densities, eMMC Flash answers the call for reliable forms of data storage – offering simplified design, lower costs, and increasingly reliable data security.

HCC Embedded
Austin, TX
(512) 318-2419