This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM62A7: P-Fail and E-Fail Bad Block Markers

Part Number: AM62A7


Tool/software:

Currently on the AM62A TI EVM, we have a OSPI Serial NAND Flash from Winbond. 

The flash is: W35N01JWTBAG

Let us understand how the BBM is done with respect to some specific registers.

  • Understand how and where BBM(bad block management) is implemented in our MCU+ SDK offering:  [FAQ] AM62A7: Bad Block Implementation for NAND Flash Parts 

  • For erase API:

    I see that the user passes a block number to the function, then the function finds a next good block to erase. For example, if the current block passed is block number 5, and assume a scenario, where the blocks are as follows:

    ....., 5, 6, 7, 8, 9, 10, ......(Red denoting bad block and Green denoting good block).

    Then the erase function will erase block number 7. While erasing block number 7, there are two scenarios:

    • Scenario 1: while erasing block 7, erase is successful and we come out of the function.
    • Scenario 2: while erasing block 7, block goes bad, hence erase is unsuccessful, so we now mark block number 7 as bad and hence try erasing block 8.
    • This goes on in a loop until we erase a good block or reach the end of the maximum block count.

    For write API:

    User passes offset and number of bytes to be written to the write function. Based on the two inputs, block number is calculated. Lets suppose the block number is 5, and assume the same scenario as above:

    ....., 5, 6, 7, 8, 9, 10, ......(Red denoting bad block and Green denoting good block).

    On this note, the block to be written will be 7th one. There are two scenariois:

    • Scenario 1: Write is successful and we come out of the function.
    • Scenario 2: If while writing there is failure, then the block is marked as bad and we exit the function. This denotes the write has failed.

    Please note, while inside an erase or a write API, the way we denote a block has gone bad, is by reading the status of the E-Fail and P-Fail registers.

    For the flash: W35N01JWTBAG

    As far as erase is concerned, the E-FAIL bit is checked.

    Please browse through the file content at the following path: C:\ti\mcu_plus_sdk_am62ax_11_01_00_16\source\board\.meta\flash\serialFlash\W35N01JWTBAG.json

    Here you would come across two variables/params: "srProgStatus" and "srEraseStatus".

    They have values 3 and 2 respectively denoting the bit number. This value matches as what is shown in the datasheet snippet above.

    When we do erase operation, Flash_nandOspiCheckEraseStatus is responsible for checking the E-FAIL bit. If it checks and finds out that the E-FAIL bit is 1, then we mark the block as bad.

    Similarly, for write/program operation, Flash_nandOspiCheckProgStatus is responsible for checking the P-FAIL bit. If it is set to 1, then we mark the block as bad.