1.1.8.4.7 DRV_SFDP_SectorErase Function

1.1.8.4.7 C

bool DRV_SFDP_SectorErase( const DRV_HANDLE handle, uint32_t address );

1.1.8.4.7 Summary

Erase the sector from the specified block start address.

1.1.8.4.7 Description

This function schedules a non-blocking sector erase operation of Flash memory. The sector size is determined from SFDP discovery (typically 4 KB).

The requesting client should call DRV_SFDP_TransferStatusGet() API to know the current status of the request.

1.1.8.4.7 Preconditions

The DRV_SFDP_Open() routine must have been called for the specified SFDP driver instance.

1.1.8.4.7 Parameters

ParametersDescription
handleA valid open-instance handle, returned from the driver's open routine
addressBlock start address from where a sector needs to be erased

1.1.8.4.7 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 sector erase command itself fails

1.1.8.4.7 Example

DRV_HANDLE handle; // Returned from DRV_SFDP_Open
uint32_t sectorStart = 0;

if(DRV_SFDP_SectorErase(handle, sectorStart) == false)
{
    // Error handling here
}

// Wait for erase to be completed
while(DRV_SFDP_TRANSFER_BUSY == DRV_SFDP_TransferStatusGet(handle));

1.1.8.4.7 Remarks

None.