A microcontroller is, at heart, a set of different memory types wired around a CPU. Classifying those memories – by volatility, by bus, and by purpose – is the key to understanding how firmware is stored, how it runs, and how it can be read or protected. This page extends the CPU register discussion into the larger storage hierarchy, and it underpins the MCU flash EEPROM data cloning work we perform.

The first split is whether the memory keeps its contents without power. SRAM is volatile: fast, unlimited endurance, but it forgets the instant the supply drops. Flash and EEPROM are non-volatile: they hold firmware and calibration for years. A locked device’s secrets usually live in non-volatile memory, which is why reading it is the goal of most recovery jobs, while SRAM only matters while the chip is alive.
Program flash holds the executable code. Data EEPROM holds parameters that must survive writes across the product’s life – serial numbers, trim values, usage counters. Configuration words (or option bytes) are a small non-volatile region that sets the chip’s behaviour at reset: watchdog on or off, code protect enabled, oscillator selection. They are the lock itself, and the how the MCU memory works guide shows exactly where they sit.

Architecture decides how code and data share space. A von Neumann machine uses one bus for both, so code can be treated as data. A Harvard machine keeps program and data on separate buses, which is why an 8-bit PIC cannot execute from data memory and why its instruction fetch never collides with a variable read. Knowing which your target uses changes how you disassemble, where you look for tables, and how you reconstruct a working copy.
Many parts reserve a bootloader region – sometimes locked even against the user – and an info or auxiliary memory holding factory calibration, unique IDs, or security keys. This region is frequently the difference between a clone that merely runs and a clone that passes validation, because the original trimmed the analog blocks against those stored constants.
Every recovery plan starts by naming the memory map: which flash is protected, which EEPROM holds the state, where the config words hide. Mis-classifying a region leads to a copy that boots but misbehaves, or to a destructive erase that destroys the very data sought. Accurate classification is what turns a raw read into a usable, verified image, and it is the first step before any unlock microcontroller embedded memory engagement.
Flash and EEPROM wear out. Each technology specifies an endurance, the number of erase or write cycles a cell survives, and a retention time, how long it holds data without power. A counter that increments on every power-up can exhaust a region long before the product’s expected life, which is why well-designed firmware rotates through several cells. During recovery, a worn region may read inconsistently, and a region past its retention may have drifted – both are clues about how the original device was used and aged.
Before any read, the analyst builds the memory map from the datasheet: where flash starts and ends, which pages are the bootloader, where the EEPROM sits, and which bytes are configuration. Mistaking one region for another leads to a copy that boots but silently misbehaves, or to a destructive erase of the very data being sought. Accurate mapping is the first deliverable of a MCU flash EEPROM data cloning job, long before a programmer is ever connected.
Separating program from data, and locking configuration words apart from both, is itself a security measure. Code that cannot execute from data memory resists a whole class of injection attacks, and config words that refuse external reads keep the lock honest. The CPU register discussion complements this by showing where the running state lives during an attack, while the static regions described here show where it is stored when the power is off.
Memories are not one thing. Treat each class on a microcontroller by its own rules, and both the security model and the cloning path become clear.