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.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Bad Block Management
    1. 2.1 Block Failure
    2. 2.2 Feasibility of Reversing Bad Blocks
  6. 3Bad Block Management in ROM Bootloader
  7. 4Bad Block Management in TITM MCU+ SDK
    1. 4.1 Flash Read Operation Flow
    2. 4.2 Flash Write Operation Flow
    3. 4.3 Flash Erase Operation Flow
  8. 5Bad Block Management in TITM Processors SDK
    1. 5.1 Flash Read Operation Flow
    2. 5.2 Flash Write Operation Flow
    3. 5.3 Flash Erase Operation Flow
  9. 6Summary
  10. 7References

Flash Read Operation Flow

  1. Address Translation:
    1. UBIFS receives a read request from the application and translates the file offset to a Logical Erase Block (LEB) number.
    2. UBI consults its LEB-to-PEB mapping table to determine which Physical Erase Block holds the requested data.
    3. UBI calculates the physical flash address by multiplying the PEB number by the erase block size and adding the page offset.
  2. Bad Block Check:
    1. Before accessing physical flash, UBI verifies whether the target PEB is not marked bad.
    2. The MTD layer accesses the in-memory Bad Block Table, calculating byte offset and bit position.
    3. The 2-bit status code is extracted.
  3. Flash Read Execution:
    1. If the block is good, MTD invokes the NAND controller driver's read function with the physical address.
    2. The controller driver programs hardware registers with the flash address and issues the read command.
    3. The NAND flash chip reads the page into its internal buffer and transfers data to system memory.
  4. ECC Processing:
    1. The ECC engine processes the received data and ECC parity bytes from the OOB area.
    2. The engine performs syndrome calculation to detect bit errors.
    3. If errors are within correction capability, the engine corrects them, and the read succeeds.
    4. If errors exceed correction capability, the read fails, and the block is marked bad.
  5. Completion:
    1. Valid data passes from MTD -> UBI -> UBIFS -> application.
    2. UBI validates sequence numbers and CRC values in headers.
    3. If uncorrectable errors occur, error handling attempts recovery from alternate copies or returns I/O error to application.