1.36.6.11 EFC_PageBufferWrite Function

C

bool EFC_PageBufferWrite( uint32_t *data, const uint32_t address)

Summary

Writes data to the internal buffer of EFC known as the latch buffer

Description

Writes data to the internal buffer of EFC known as the latch buffer. Use this API if multiple updates are required to the same Flash page and to avoid erasing the page multiple times. When all the updates to the page are done, commit the data to the flash by calling the EFC_PageBufferCommit() API.

Precondition

The EFC_Initialize() function should have been called once.

Parameters

Param Description
data pointer to data buffer.
address Data Flash address to be modified.

Returns

true if the operation was successful, else returns false.

Example

uint32_t* data; //data - pointer to the buffer to be written to flash memory
uint32_t flashAddr; //flashAddr - variable containing flash address

//populate data and flashAddr

EFC_PageBufferWrite((uint32_t*)data, (uint32_t)flashAddr);

//update data here

EFC_PageBufferWrite((uint32_t*)data, (uint32_t)flashAddr);

//Commit the final data in the EFC internal page buffer to the flash memory
EFC_PageBufferCommit((uint32_t)flashAddr);

//Wait until the EFC controller is busy
while (EFC_IsBusy());

Remarks

None