SPVA070
June
2026
AM2752-Q1 , AM2754-Q1 , AM620-Q1 , AM623 , AM625 , AM625-Q1 , AM62A1-Q1 , AM62A3 , AM62A3-Q1 , AM62A7 , AM62A7-Q1 , AM62D-Q1 , AM62P , AM62P-Q1
-
1
-
Abstract
-
Trademarks
-
1Introduction
-
2Bad Block Management
- 2.1
Block Failure
- 2.2
Feasibility of Reversing Bad Blocks
-
3Bad Block Management in ROM Bootloader
-
4Bad Block Management in TITM MCU+ SDK
- 4.1
Flash Read Operation Flow
- 4.2
Flash Write Operation Flow
- 4.3
Flash Erase Operation Flow
-
5Bad Block Management in TITM Processors SDK
- 5.1
Flash Read Operation Flow
- 5.2
Flash Write Operation Flow
- 5.3
Flash Erase Operation Flow
-
6Summary
-
7References
5.1 Flash Read Operation Flow
- Address Translation:
- UBIFS receives a read request from the application and translates the file offset to a Logical Erase Block (LEB) number.
- UBI consults its LEB-to-PEB mapping table to determine which Physical Erase Block holds the requested data.
- UBI calculates the physical flash address by multiplying the PEB number by the erase block size and adding the page offset.
- Bad Block Check:
- Before accessing physical flash, UBI verifies whether the target PEB is not marked bad.
- The MTD layer accesses the in-memory Bad Block Table, calculating byte offset and bit position.
- The 2-bit status code is extracted.
- Flash Read Execution:
- If the block is good, MTD invokes the NAND controller driver's read function with the physical address.
- The controller driver programs hardware registers with the flash address and issues the read command.
- The NAND flash chip reads the page into its internal buffer and transfers data to system memory.
- ECC Processing:
- The ECC engine processes the received data and ECC parity bytes from the OOB area.
- The engine performs syndrome calculation to detect bit errors.
- If errors are within correction capability, the engine corrects them, and the read succeeds.
- If errors exceed correction capability, the read fails, and the block is marked bad.
- Completion:
- Valid data passes from MTD -> UBI -> UBIFS -> application.
- UBI validates sequence numbers and CRC values in headers.
- If uncorrectable errors occur, error handling attempts recovery from alternate copies or returns I/O error to application.