<< Previous | Next >>

readUserBlockArray

int readUserBlockArray( void * dests[], unsigned numbytes[], int numdests, unsigned addr );

Description

Reads a number of bytes from the User block on the primary flash to a set of buffers in root memory. This function is usually used as the inverse function of writeUserBlockArray().

This function was introduced in Dynamic C version 7.30.

NOTE Portions of the User block may be used by the BIOS to store values such as calibration constants. See the manual for your particular board for more information before overwriting any part of the User block.
NOTE When using a board with serial bootflash (e.g., RCM4300, RCM4310), readUserBlockArray() should be called until it returns zero or a negative error code. A positive return value indicates that the SPI port needed by the serial flash is in use by another device. However, if using µC/OS-II and _SPI_USE_UCOS_MUTEX is #defined, then this function only needs to be called once. If the mutex times out waiting for the SPI port to free up, the run time error ERR_SPI_MUTEX_ERROR will occur. See the description for _rcm43_InitUCOSMutex() for more information on using µC/OS-II and _SPI_USE_UCOS_MUTEX.

Parameters

dests
Pointer to array of destinations to copy data to.

numbytes
Array of numbers of bytes to be written to each destination.

numdests
Number of destinations.

addr
Address offset in User block to read from.

Return value

 0: Success
-1: Invalid address or range
-2: No valid System ID block found (block version 3 or later)
The return values below are applicable only if _SPI_USE_UCOS_MUTEX is not #defined:
-ETIME: (Serial flash only, time out waiting for SPI)
postive N: (Serial flash only, SPI in use by device N)

Library

IDBLOCK.LIB

See also

writeUserBlockArray, readUserBlock


Dynamic C Functions << Previous | Next >> rabbit.com