Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
104
of
174
Return value
Description
0
Operation successful.
-1
See errno values.
errno values
EINVAL
Page number is out of range
or
Buffer is NULL
EIO
Program failed on chip level, block should be
considered bad.
5.12.3.6.8. Factory bad block check
Reads the factory bad block marker from a block and reports status.
NOTE:
This only gives information about factory marked bad blocks. Bad blocks that arise
during use need to be handled by the application software.
Return value
Description
AAC_SYSFLASH_
FACTORY_BAD_
BLOCK_CLEARED
Block is OK.
AAC_SYSFLASH_
FACTORY_BAD_
BLOCK_MARKED
Block is marked bad.
errno values
EINVAL
The block number is out of range
5.12.4. Usage description
5.12.4.1. Overview
In NAND flash the memory area is divided into
pages
that have a data area and a spare
area. The pages are grouped into
blocks
. Before data can be programmed to a page it must
be erased (all bytes are 0xFF). The smallest area to erase is a block consisting of a number
of pages, so if the block contains any data that needs to be preserved this must first be read
out. The driver defines some constants for the application software to use when handling
blocks and pages. There are SYSFLASH_BLOCKS blocks starting from block number 0 and
SYSFLASH_PAGES_PER_BLOCK pages within each block starting from page 0. Each
page data area is SYSFLASH_PAGE_SIZE bytes. Each page also has a spare area that is
SYSFLASH_PAGE_SPARE_AREA_SIZE bytes. Partial pages can be read/programmed,
but reading/programming always starts at the beginning of the page (or spare area). Pages
(including spare area) must be programmed in sequence within a block.
Command
Value type Direction Description
SYSFLASH_IO_BAD_BLOCK_CHECK
uint32_t
in
Block number.