Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 7/19/2024
Public
Document Table of Contents

A.2.6.6. Write Protection

You can program the controller to write protect a specific region of the Flash device. The protected region is defined as a set of blocks, specified by a starting and ending block. Writing to an area of protected Flash region memory generates an error and triggers an interrupt.

You define the block size by specifying the number of bytes per block through the number of bytes per block field (bytespersubsector) of the device size register (devsz). The lower write protection register (lowwrprot) specifies the first Flash block in the protected region. The upper write protection register (uppwrprot) specifies the last Flash block in the protected region.

The write protection enable bit (en) of the write protection register (wrprot) enables and disables write protection. The write protection inversion bit (inv) of the wrprot register flips the definition of protection so that the region specified by lowwrprt and uppwrprt is unprotected and all Flash memory outside that region is protected.