Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
105
of
174
With NAND flash memory technology some blocks will be bad from the factory, and more
bad blocks will appear due to wear. The driver itself does not manage bad blocks, but it will
supply the information needed for the application software to implement a system to keep
track of them. A common use for the page spare area is to hold ECC information. However,
this system has a more comprehensive EDAC solution, so the main use for the spare area is
to hold the factory bad block markers (first byte of the first page spare area is 0x00). Bad
blocks should never be erased or programmed.
The driver supports two chip types, Micron MT29F32G08AFABA and Micron
MT29F64G08AFAAA, both types will be presented as having the same size parameters.
5.12.4.2. Usage
The RTEMS driver provides the application software with a POSIX file interface for
accessing the functionality of the bare-metal driver. However, unlike the POSIX calls where
the offset is given in bytes, the Sysflash driver expects the offset to be in pages. The read
and write calls provide an abstraction to the page-by-page access in the bare-metal driver,
so multiple pages can be read/written with one call, but the application will still need to make
sure that pages are erased before they are written.
In RTEMS the device file must be opened to grant access to the system flash device. Once
opened, all provided operations can be used as described in section 5.12.3. And, if desired,
the access can be closed when not needed.
NOTE:
All calls to the RTEMS driver are blocking calls, though the driver uses interrupts
internally to ease processor load.
Figure 5-7 - RTEMS driver usage description