Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
99
of
174
5.12. System flash
5.12.1. Description
The System flash holds the software images for the system as described in section 8.4. This
section details the RTEMS interface to the System flash driver.
5.12.2. Data structure types
5.12.2.1. Type sysflash_cid_t
This struct type holds the result of reading the system flash chip ID. The byte array
constants
sysflash_cid_MT29F32G08AFABA
and
sysflash_cid_MT29F64G08AFAAA
are
provided as chip id references for the possible chip types
Type
Name Purpose
Array of 2 uint32_t
chip0
Byte array for chip 0 ID
5.12.2.2. Type sysflash_ioctl_spare_area_args_t
This struct is used by the RTEMS API as the target when reading or writing the spare area.
Type
Name
Purpose
uint32_t page_num What page to read/write.
Values: [0 - (SYSFLASH_MAX_NO_PAGES-1)]
uint32_t raw
Ignored parameter, programming is always done with EDAC and
interleaving active,
uint8_t * data_buf
Pointer to buffer in which the data is to be stored or to the data that is
to be written.
uint32_t size
Size to read/write in bytes.
Values: [1 - SYSFLASH_PAGE_SPARE_AREA_SIZE]
5.12.3. RTEMS API
This API represents the driver interface from a user application’s perspective for the RTEMS
driver. The driver functionality is accessed through RTEMS POSIX API for ease of use. In
case of failure on a function call, the errno value is set for determining the cause.
5.12.3.1.
Function int open(…)
Opens access to the driver. The device can only be opened by one user at a time.
Argument name
Type
Direction Description
filename
char *
in
The absolute path to the file that is to be opened.
System flash device is defined as
SYSFLASH_DEVICE_NAME.
oflags
int
in
Device must be opened by exactly one of the symbols
defined in Table 5-4.