XFlash_Erase - 2021.1 English

Xilinx Standalone Library Documentation OS and Libraries Document Collection (UG643)

Document ID
Release Date
2021.1 English

This function erases the specified address range in the flash device.

The number of bytes to erase can be any number as long as it is within the bounds of the device(s).

The device is polled until an error or the operation completes successfully.

Note: Due to flash memory design, the range actually erased may be larger than what was specified by the Offset & Bytes parameters. This will occur if the parameters do not align to block boundaries.


int XFlash_Erase(XFlash *InstancePtr, u32 Offset, u32 Bytes);


The following table lists the XFlash_Erase function arguments.

Table 1. XFlash_Erase Arguments
Type Name Description
XFlash * InstancePtr Pointer to the XFlash instance.
u32 Offset Offset into the device(s) address space from which to begin erasure.
u32 Bytes Number of bytes to erase.


  • XST_SUCCESS if successful.
  • XFLASH_ADDRESS_ERROR if the destination address range is not completely within the addressable areas of the device(s).