User`s manual

44 MiniCore RCM5600W
5.2.3 Serial Flash Memory Use
The RCM5600W module has a serial flash memory that contains the user block and stores
the application program. Two function calls are provided to work with the serial boot
flash. These function calls are in the Dynamic C
LIB\Rabbit4000\BIOSLIB\BOOTDEV_SFLASH.LIB library. The FAT file system func-
tion calls from in the Dynamic C LIB\FileSystem\FAT_CONFIG.LIB library are not
supported.
sbfRead
int sbfRead(void *dest, unsigned long offset, unsigned nbytes);
DESCRIPTION
Reads up to 64K from anywhere on the serial boot flash. This function call supports
both the blocking mode for use with µC/OS-II and a mutex for preemptive multitask-
ing, and the nonblocking mode for cooperative multitasking. See the description for
sbfWriteFlash()
for more information on using a µC/OS-II and a mutex with the
serial flash driver.
PARAMETERS
dest near pointer to the destination buffer
offset the physical offset into the serial flash
nbytes the number of bytes to read
RETURN VALUE
0 if successful.
The return values below apply only if
_SPI_USE_UCOS_MUTEX
is not
#defined
:
positive
N
to indicate that the SPI port is being used by device n
if more than
_SPI_MAXTIME
milliseconds elapse while waiting for the SPI port to become
available, one of the following two runtime errors will occur:
ERR_SPI_MUTEX_ERROR
(when using µC/OS-II) or
-ETIME
(if not using µC/OS-II).