RL78 EEPROM emulation gives embedded applications an EEPROM-like way to store values in a microcontroller’s Data Flash. Renesas’ EEPROM Emulation Library Type 02, known as Tiny EEL, manages the underlying flash operations and presents user-defined variables through an API. For automation engineers designing controllers, instruments, and other embedded systems, this can simplify persistent-data handling—but the library’s resource limits and operating model need to shape the application design.
Why use EEPROM emulation?
Data Flash is non-volatile memory, but it does not behave exactly like conventional EEPROM. On RL78 devices using MF3 Data Flash, erasure is performed a complete block at a time. Each block is 1 KB, while reading and writing can be performed on individual bytes or byte sequences. Flash blocks also have a finite number of program-erase cycles, so applications must manage how data is updated and where it is stored.
Tiny EEL abstracts much of that work. Developers define a set of variables at compile time and use library commands to read and write them at runtime. The library maintains the variable records and manages the Data Flash blocks used for emulation, allowing application code to work with values rather than individual flash addresses and erase sequences.
How the RL78 EEPROM emulation architecture works
The storage system is organized in layers. The physical Data Flash is accessed through the Data Flash Access Library (FDL), which provides the lower-level flash access functions. Tiny EEL sits above the FDL and offers the EEPROM-style variable interface; the application uses the EEL API rather than directly manipulating the EEL-managed storage.
Data Flash can be divided into two pools: an EEL pool for emulated variables and an FDL pool for data that the application manages directly through the FDL. This separation supports different storage needs in one application. For example, relatively infrequently changed configuration data may be managed directly through the FDL, while frequently updated values may be more conveniently handled as EEL variables. The application must respect each pool’s access path: the EEL pool is not available for direct FDL access.
Pool allocation is configured at compile time in the FDL descriptor and can only be assigned in whole flash blocks. EEL uses the lower-address Data Flash blocks assigned to its pool. The EEL itself does not access Data Flash independently of the FDL; the two libraries are designed to support use in the same application, though their operations are not performed in parallel.
Variable updates, block rotation, and reset behavior
When a variable is written, Tiny EEL stores a new instance rather than overwriting the previous instance in place. The newest complete instance is the one used when the variable is read. Each record contains a variable identifier, data, and reference information that marks the beginning and successful completion of the write. If a write is interrupted, an incomplete instance is ignored.
Only one EEL block is active at a time. As writes consume the available space, the active block can become full. A refresh then moves the current valid variable data to another eligible block, and the former active block is invalidated. The active block rotates through the blocks assigned to the EEL pool. Using multiple EEL blocks reduces repeated use of a single block and distributes erase activity across the pool.
This management supports reset-resistant updates, but it does not remove the need to follow the library’s documented command sequences and usage conditions. Tiny EEL also does not automatically add checksums to variable data. If an application requires content-level integrity checks, the developer must include appropriate checksum information in the stored data.
What Tiny EEL is designed to support
The Type 02 library is intended to reduce code, Data Flash, and RAM requirements compared with the more feature-rich Type 01 library. Its documented capabilities include:
- Up to 64 independently defined variables.
- Variable sizes from 1 to 255 bytes.
- Polling operation.
- Block rotation to balance Data Flash use.
- Operation with supported tool chains, including CA78K0R, IAR, GNU, CC-RL, and LLVM, subject to the library’s specific support notes.
Those resource savings come with trade-offs. Tiny EEL has no background maintenance process, so the application must trigger refresh when needed. It also uses only one active EEL block at a time, limits the available feature set, and assigns variable IDs according to their order in the descriptor rather than allowing arbitrary ID selection. These constraints matter when estimating storage needs and designing update behavior.
Integration considerations for automation projects
Before adopting Tiny EEL, confirm that the target RL78 device has compatible MF3 Data Flash and determine how many blocks can be assigned to each pool. The EEL requires the corresponding Tiny FDL Type 02 release; Renesas specifies using compatible library releases to avoid incompatibilities. Review the device documentation and current library manual for device-specific details.
Designers should also identify which values belong in the EEL pool and which are better suited to direct FDL management. Consider variable size, update frequency, the space consumed by both data and record references, and the application’s response when the pool becomes full. Tiny EEL requires at least two non-excluded blocks for normal operation. If too many blocks are excluded, reading and verification may remain possible, but writes and refresh cannot proceed; recovery can only be attempted by formatting the pool, which erases existing variable content.
Finally, treat persistent-data behavior as part of system-level reliability engineering. Follow the specified operating sequences, account for resets and interrupted operations, and assess the safety of the complete product or control system rather than relying on the library alone.
Conclusion
RL78 EEPROM emulation can make Data Flash practical for persistent, frequently changing application variables by placing a managed variable interface above the FDL. Tiny EEL adds block rotation and reset-resistant record handling while targeting small resource footprints. Its limited feature set, explicit refresh requirements, pool allocation rules, and lack of automatic data checksums should be incorporated into storage planning and application design from the outset.