DRV_MX25L_BlockErase Function
C
bool DRV_MX25L_BlockErase( const DRV_HANDLE handle, uint32_t address );
Summary
Erase a block from the specified block start address.
Description
This function schedules a non-blocking block erase operation of Flash memory. The block size can be 8 KB, 32 KB or 64 KB.
The requesting client should call DRV_MX25L_TransferStatusGet() API to know the current status of the request.
The request is sent in QUAD_MODE to Flash device.
Preconditions
The DRV_MX25L_Open() routine must have been called for the specified MX25L driver instance.
Parameters
| Parameters | Description |
|---|---|
| handle | A valid open-instance handle, returned from the driver's open routine |
| address | block start address to be erased |
Returns
True:
- if the erase request is successfully sent to the Flash
False:
- if Write enable fails before sending sector erase command to Flash
- if block erase command itself fails
Example
DRV_HANDLE handle; // Returned from DRV_MX25L_Open
uint32_t blockStart = 0;
if(DRV_MX25L_SectorErase(handle, blockStart) == false)
{
// Error handling here
}
// Wait for erase to be completed
while(DRV_MX25L_TransferStatusGet(handle) == DRV_MX25L_TRANSFER_BUSY);
Remarks
This routine will block wait until erase request is submitted successfully.
Client should wait until erase is complete to send next transfer request.
