Tutorials
FPGA Flash Offsets: Check Image and Erase-Range Overlap
Published · Updated
Two images can occupy different bytes and still be unsafe to update independently. If the programmer erases a larger unit containing both, replacing one can destroy the other. Review the byte map and the erase operation as separate layers before writing configuration Flash.
Normalize addresses to one byte-addressed map

Write every region as a start address and length in bytes. Use one endpoint convention throughout the review. This worksheet uses half-open intervals: the start is included and the end is excluded. A region starting at 0 with length 16 therefore occupies [0,16). The next region can start at 16 without overlapping it.
Name each region and assign its role: write, preserve or forbidden. Include factory data and recovery images, not just the application being updated. If a region's location is unknown, the map is incomplete; a reassuring capacity total cannot resolve it.
Do not use an MCS file's size on disk as its occupied Flash length. Obtain the actual memory ranges from a verified generation report or parser. Likewise, a byte address in this table is not automatically the value to write into an FPGA configuration register.
Before assigning addresses, complete the capacity budget; sufficient total space does not prove the map is valid.
Check occupied ranges
For each region, calculate end = start + length. Reject negative or fractional byte counts and values outside the supported integer range. Report end greater than the device capacity as an overflow. A region ending exactly at capacity fits the address-space boundary.
Two half-open regions intersect when the larger start is smaller than the smaller end. Equality means adjacency, not an overlap. Testing this distinction matters because a boundary error can waste a slot or conceal a one-byte collision.
The total of all lengths is not a substitute for this pairwise check. Small images at fixed addresses can overlap while leaving most of the device unused. Conversely, gaps can be intentional reservations that should not be compacted by an automatic packing routine.
For a device that writes successfully but starts from the wrong image, check the boot address path.
Expand the map to the erase operation
For a confirmed uniform erase unit E, an illustrative erase interval for a write region is [floor(start/E) × E, ceil(end/E) × E). Compare that interval with every region that must survive. The formula describes a model; the programmer's actual erase strategy and the device geometry must be confirmed before it is used operationally.
Consider a 16-byte model device with an 8-byte erase unit. A new image occupies [0,4) and preserved data occupies [4,8). The data ranges do not overlap. Erasing the first unit nevertheless touches both. The useful result is an erase conflict, even though the byte-overlap check passes.
If the memory has nonuniform erase regions, do not apply one uniform number to the whole device. If erase geometry is unknown, report that the erase assessment is unknown. Neither condition should turn into a green safe-to-program result.
| Region in the 16-byte teaching model | Occupied bytes | Effect of an 8-byte erase |
|---|---|---|
| New application | [0,4) | Erase expands to [0,8) |
| Preserved record | [4,8) | Touched by the application's erase |
| Next empty slot | [8,16) | Outside that erase interval |
The deliberately small numbers make the boundary visible. Replace them with confirmed byte addresses and geometry for a real device; do not treat eight bytes as a Flash erase-sector recommendation.
When two image names are easily confused, identify the released images before reviewing their destinations.
Export a map the programmer can review
Save region names, roles, units, starts, lengths and the evidence behind the erase model. Keep the tool's data-overlap, capacity and erase-conflict findings separate. They describe different problems and can require different corrections.
A reviewed map should travel with the programming job. State whether the job is for an empty device, an update or rework, and identify the regions it must preserve. A full-device erase that is acceptable on an empty assembly may be unacceptable for a returned product.
The worksheet does not generate erase commands. Its purpose is to expose conflicts while there is still time to correct the plan. Bring the exported map and the exact Flash part to an engineering review if the tool's programming range or preservation behavior is unclear.
Include the reviewed map in the manufacturing package checklist so that preservation rules reach the operator.
Technical references for this scope: AMD UG835 2024.1 — write_cfgmem; AMD UG908 2024.1 — Programming a Configuration Memory Device; openFPGALoader — Advanced usage; AMD UG908 2024.1 — Example write_cfgmem Usage.
Highlight the three review items
Each highlight marks one item to review, not elapsed hardware time. The static figure contains the same information.

Enable JavaScript for the local Flash layout and erase-conflict checker. The article above provides the manual procedure; no data is submitted automatically.
Review and export your result before opening the engineering discussion entry. Attach the exported text yourself; opening the entry does not submit it.
Reference scope checked 15 November 2026. Calculations and conceptual diagrams describe the stated model. Commands and board behavior require validation in the actual tool and board environment.