A N 3 7 0
72
Rev. 1.0
bNvm_CopyBlock
Description
: Copy a single NVM block of composed data from NVM. Based on the data
destination address found in the NVM block this function can copy data to CODE/
XDATA 4.5KB RAM, as well as to the DATA/IDATA internal RAM region.
Therefore, the user can use the NVM blocks to initialize the variables to desired initial val-
ues by loading them from the NVM.
The function starts copying from NVM address specified by vNvm_SetAddr() call or by a
previous call to bNvm_CopyBlock() for back to back blocks in NVM.
If an error is encountered while copying NVM data, value of 0xFF is returned. This can
happen in three possible scenarios:
1. The first byte of the NVM block was not a valid block start flag (0xFF).
2. During a copy process the NVM address entered invalid NVM region. That hap-
pens when the NVM address reaches the last 64 bytes of NVM, which are reserved
for factory use.
3. Special return jump inside the NVM block was used, but the next NVM address
was outside the valid NVM address space. This is an advanced feature supported
by special application note and not used by majority of users.
If no error is encountered, and the copy finishes successfully, the function returns an NVM
block return value byte found after the block end flag. For the User Application (overlay)
block in NVM the user NVM block return value is fixed to 1 when using Silicon Labs
NVM composer/programmer. The NVM block return value can be changed by advanced
NVM manipulation but there is no reason to do that for majority of users.
It is highly recommended that the NVM copy process is not interrupted and the interrupts
to be disabled around this function.
Inputs
:
None
Outputs
:
Return value/status: (BYTE) Either the error flag (0xFF), or the return value in the
byte following the block end flag in NVM. For user NVM block (overlay) the
NVM block return value is fixed to 1.