Flash#

Interface to internal flash.

Used for writing application images to the main flash.

Used for writing/reading/erasing data to the main flash.

Functions#

bool
flash_erasePage(uint32_t address)

Erase a flash page.

bool
flash_writeBuffer_dma(uint32_t address, const void *data, size_t length, int ch)

Write buffer to internal flash.

bool
flash_writeBuffer(uint32_t address, const void *data, size_t length)

Write buffer to internal flash.

int32_t
storage_eraseRaw(uint32_t address, size_t length)

Erase the raw storage.

int32_t
storage_writeRaw(uint32_t address, const uint8_t *buffer, size_t length)

Write a number of words to raw storage.

int32_t
storage_readRaw(uint32_t address, uint8_t *buffer, size_t length)

Read number of words from raw storage.

Macros#

#define
SL_GBL_MSC_LDMA_CHANNEL 2

DMA Channel for MSC write.

Function Documentation#

flash_erasePage#

bool flash_erasePage (uint32_t address)

Erase a flash page.

Parameters
TypeDirectionArgument NameDescription
uint32_t[in]address

Start address of the flash page to erase.

Returns

  • True if operation was successful


flash_writeBuffer_dma#

bool flash_writeBuffer_dma (uint32_t address, const void * data, size_t length, int ch)

Write buffer to internal flash.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aaddress

Starting address to write data to. Must be half-word aligned.

const void *N/Adata

Data buffer to write to internal flash

size_tN/Alength

Amount of bytes in the data buffer to write

intN/Ach

DMA channel to use

Returns

  • True if operation was successful


flash_writeBuffer#

bool flash_writeBuffer (uint32_t address, const void * data, size_t length)

Write buffer to internal flash.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aaddress

Starting address to write data to. Must be half-word aligned.

const void *N/Adata

Data buffer to write to internal flash

size_tN/Alength

Amount of bytes in the data buffer to write

Returns

  • True if operation was successful


storage_eraseRaw#

int32_t storage_eraseRaw (uint32_t address, size_t length)

Erase the raw storage.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aaddress

Start address of the region to erase

size_tN/Alength

Number of bytes to erase

Note

  • Some devices, such as Flash-based storages, have restrictions on the alignment and size of erased regions. The details of the limitations of a particular storage can be found by reading the BootloaderStorageInformation_t struct using storage_getInfo.

Returns


storage_writeRaw#

int32_t storage_writeRaw (uint32_t address, const uint8_t * buffer, size_t length)

Write a number of words to raw storage.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aaddress

The raw address of the storage.

const uint8_t *N/Abuffer

Pointer to data to write.

size_tN/Alength

Length of data to write. Must be a multiple of 4.

Returns


storage_readRaw#

int32_t storage_readRaw (uint32_t address, uint8_t * buffer, size_t length)

Read number of words from raw storage.

Parameters
TypeDirectionArgument NameDescription
uint32_tN/Aaddress

The raw address of the storage.

uint8_t *N/Abuffer

Pointer to the buffer to store read data in.

size_tN/Alength

Number of bytes to read.

Returns