Jump to main content

##

# 2.72.15 NVM_PageErase Function

## C

    bool NVM_PageErase( uint32_t address )

## Summary

Erases a Page in the NVM

## Description

This function will erase one page in NVM. Calling this function will cause the CPU execution to stall, hence blocking execution of any other thread. Execution resumes when the Erase operation has completed.

If the interrupt operation was enabled and if a callback was registered, then the callback function will be called. The NVM_IsBusy() function can be used to poll for completion of the operation. The application should ensure that there are no other operations in progress before calling this function. Once the operation is complete, the NVM_ErrorGet() function can be called to check operation success.

## Precondition

Also validate if NVM controller is ready to accept new request by calling NVM_IsBusy().

## Parameters

Param | Description
--- | ---
address | start address of the page to be erased.

## Returns

Always return true.

## Example

    // This code snippet shows how the NVM_RowErase function is called to
    // erase the row at locatioin 0x9D100000.

    // Erase the row. This will erase all the pages in the row.
    NVM_PageErase(0x9D100000);
    while(NVM_IsBusy());

    if(NVM_ErrorGet() == NVM_ERROR_NONE)
    {
        // Operation was successful.
    }

## Remarks

None.