1.32.16.5 NVMCTRL_BlockErase Function

C

bool NVMCTRL_BlockErase( uint32_t address)

Summary

Erases a Block in the NVM

Description

This function will erase one block in NVM. The address of the block to be erased is specified by the address parameter. This address can be any address in the block. Reading in a bank does not stall the bus when the other bank is being erased. If the interrupt operation was enabled and if a callback was registered, then the callback function will be called.

The NVMCTRL_IsBusy() function can be used to poll for completion of the operation. Once the operation is complete, the NVMCTRL_ErrorGet() function can be called to check whether there is any error. Erasing a block will erase all the contents of all the pages in the block.

Precondition

The NVMCTRL_Initialize() function should have been called once. Also validate if NVM controller is ready to accept new request by calling NVMCTRL_IsBusy().

Parameters

Param Description
address Any address in the block to be erased.

Returns

Always returns 'true'. The return value should be ignored at application level.

Example

// This code snippet shows how the NVMCTRL_BlockErase function is called to
// erase the block at location 0x30000.

NVMCTRL_Initialize();

// Erase the block. This will erase all the pages in the block.
NVMCTRL_BlockErase(0x00030000);
while(NVMCTRL_IsBusy());

Remarks

None.