We have found that the i.MX28 boot ROM is ignoring the DBBT tables.
Below is a dump of the NAND where we have one bad block at index 0xD0.
It is marked in the DBBT but the system will not boot the primary image.
We are creating and writing the images to nand using stock freescale kobs-ng.
Also we took a unit with no bad blocks and changed kobs-ng to put some fake bad
blocks just in the DBBT but the system still booted just fine. (If the boot ROM
was reading the DBBT it would have not booted since the bad blocks in the DBBT
did not match what was written to NAND)
Here us a hand annotated hexdump of NAND flash
First FCB:
00000000 00 00 00 00 00 00 00 00 00 00 00 00 7f fc ff ff |................|
00000010 46 43 42 20 00 00 00 01 50 3c 19 06 00 00 00 00 |FCB ....P<......|
00000020 00 08 00 00 40 08 00 00 40 00 00 00 00 00 00 00 |....@...@.......|
00000030 00 00 00 00 00 00 00 00 04 00 00 00 00 02 00 00 |................|
00000040 00 02 00 00 04 00 00 00 0a 00 00 00 03 00 00 00 |................|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000070 00 00 00 00 00 02 00 00 00 29 00 00 0e 0d 00 00 |.........)......|
00000080 0e 0d 00 00 00 01 00 00 cf 07 00 00 00 00 00 00 |................|
00000090 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000000a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
Hamming codes:
00000200 00 00 00 00 00 00 00 00 00 00 00 00 08 0c 06 06 |................|
00000210 10 1f 03 07 00 00 00 1c 0f 17 1f 05 00 00 00 00 |................|
00000220 00 19 00 00 15 19 00 00 15 00 00 00 00 00 00 00 |................|
00000230 00 00 00 00 00 00 00 00 13 00 00 00 00 16 00 00 |................|
00000240 00 16 00 00 13 00 00 00 0f 00 00 00 0a 00 00 00 |................|
00000250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000270 00 00 00 00 00 16 00 00 00 02 00 00 1c 16 00 00 |................|
00000280 1c 16 00 00 00 1c 00 00 1b 19 00 00 00 00 00 00 |................|
00000290 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000002a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000800 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Second FCB:
00021000 00 00 00 00 00 00 00 00 00 00 00 00 7f fc ff ff |................|
00021010 46 43 42 20 00 00 00 01 50 3c 19 06 00 00 00 00 |FCB ....P<......|
00021020 00 08 00 00 40 08 00 00 40 00 00 00 00 00 00 00 |....@...@.......|
00021030 00 00 00 00 00 00 00 00 04 00 00 00 00 02 00 00 |................|
00021040 00 02 00 00 04 00 00 00 0a 00 00 00 03 00 00 00 |................|
00021050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00021060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00021070 00 00 00 00 00 02 00 00 00 29 00 00 0e 0d 00 00 |.........)......|
00021080 0e 0d 00 00 00 01 00 00 cf 07 00 00 00 00 00 00 |................|
00021090 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000210a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
Hamming codes:
00021200 00 00 00 00 00 00 00 00 00 00 00 00 08 0c 06 06 |................|
00021210 10 1f 03 07 00 00 00 1c 0f 17 1f 05 00 00 00 00 |................|
00021220 00 19 00 00 15 19 00 00 15 00 00 00 00 00 00 00 |................|
00021230 00 00 00 00 00 00 00 00 13 00 00 00 00 16 00 00 |................|
00021240 00 16 00 00 13 00 00 00 0f 00 00 00 0a 00 00 00 |................|
00021250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00021260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00021270 00 00 00 00 00 16 00 00 00 02 00 00 1c 16 00 00 |................|
00021280 1c 16 00 00 00 1c 00 00 1b 19 00 00 00 00 00 00 |................|
00021290 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000212a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00021800 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Third FCB:
00042000 00 00 00 00 00 00 00 00 00 00 00 00 7f fc ff ff |................|
00042010 46 43 42 20 00 00 00 01 50 3c 19 06 00 00 00 00 |FCB ....P<......|
00042020 00 08 00 00 40 08 00 00 40 00 00 00 00 00 00 00 |....@...@.......|
00042030 00 00 00 00 00 00 00 00 04 00 00 00 00 02 00 00 |................|
00042040 00 02 00 00 04 00 00 00 0a 00 00 00 03 00 00 00 |................|
00042050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00042060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00042070 00 00 00 00 00 02 00 00 00 29 00 00 0e 0d 00 00 |.........)......|
00042080 0e 0d 00 00 00 01 00 00 cf 07 00 00 00 00 00 00 |................|
00042090 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000420a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
Hamming codes:
00042200 00 00 00 00 00 00 00 00 00 00 00 00 08 0c 06 06 |................|
00042210 10 1f 03 07 00 00 00 1c 0f 17 1f 05 00 00 00 00 |................|
00042220 00 19 00 00 15 19 00 00 15 00 00 00 00 00 00 00 |................|
00042230 00 00 00 00 00 00 00 00 13 00 00 00 00 16 00 00 |................|
00042240 00 16 00 00 13 00 00 00 0f 00 00 00 0a 00 00 00 |................|
00042250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00042260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00042270 00 00 00 00 00 16 00 00 00 02 00 00 1c 16 00 00 |................|
00042280 1c 16 00 00 00 1c 00 00 1b 19 00 00 00 00 00 00 |................|
00042290 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000422a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00042800 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Forth FCB:
00063000 00 00 00 00 00 00 00 00 00 00 00 00 7f fc ff ff |................|
00063010 46 43 42 20 00 00 00 01 50 3c 19 06 00 00 00 00 |FCB ....P<......|
00063020 00 08 00 00 40 08 00 00 40 00 00 00 00 00 00 00 |....@...@.......|
00063030 00 00 00 00 00 00 00 00 04 00 00 00 00 02 00 00 |................|
00063040 00 02 00 00 04 00 00 00 0a 00 00 00 03 00 00 00 |................|
00063050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00063060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00063070 00 00 00 00 00 02 00 00 00 29 00 00 0e 0d 00 00 |.........)......|
00063080 0e 0d 00 00 00 01 00 00 cf 07 00 00 00 00 00 00 |................|
00063090 00 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000630a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
Hamming codes:
00063200 00 00 00 00 00 00 00 00 00 00 00 00 08 0c 06 06 |................|
00063210 10 1f 03 07 00 00 00 1c 0f 17 1f 05 00 00 00 00 |................|
00063220 00 19 00 00 15 19 00 00 15 00 00 00 00 00 00 00 |................|
00063230 00 00 00 00 00 00 00 00 13 00 00 00 00 16 00 00 |................|
00063240 00 16 00 00 13 00 00 00 0f 00 00 00 0a 00 00 00 |................|
00063250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00063260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00063270 00 00 00 00 00 16 00 00 00 02 00 00 1c 16 00 00 |................|
00063280 1c 16 00 00 00 1c 00 00 1b 19 00 00 00 00 00 00 |................|
00063290 00 19 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000632a0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00063800 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
First DBBT header:
00084000 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 44 42 |..............DB|
00084010 42 54 00 00 00 01 01 00 00 00 01 00 00 00 00 00 |BT..............|
00084020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
00084200 00 00 00 00 00 00 00 00 00 00 37 a7 79 1c d7 41 |..........7.y..A|
00084210 c2 b0 99 0b c3 e1 c6 00 00 00 00 00 00 00 00 00 |................|
00084220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
00084800 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00084810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00084820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00084830 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
00084840 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
First BBTN: note the bad block index, 0xD0, on second line
00086100 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 01 00 |................|
00086110 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00086120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
00086300 00 00 00 00 00 00 00 00 00 00 3d 5c c3 ed cd f2 |..........=\....|
00086310 e2 a6 67 37 70 8f 06 00 00 00 00 00 00 00 00 00 |..g7p...........|
00086320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
00086900 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00086910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00086920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00086930 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
00086940 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Second DBBT header:
000a5000 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 44 42 |..............DB|
000a5010 42 54 00 00 00 01 01 00 00 00 01 00 00 00 00 00 |BT..............|
000a5020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000a5200 00 00 00 00 00 00 00 00 00 00 37 a7 79 1c d7 41 |..........7.y..A|
000a5210 c2 b0 99 0b c3 e1 c6 00 00 00 00 00 00 00 00 00 |................|
000a5220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000a5800 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a5810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a5830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a5830 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000a5840 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Second BBTN:
000a7100 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 01 00 |................|
000a7110 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a7120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000a7300 00 00 00 00 00 00 00 00 00 00 3d 5c c3 ed cd f2 |..........=\....|
000a7310 e2 a6 67 37 70 8f 06 00 00 00 00 00 00 00 00 00 |..g7p...........|
000a7320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000a7900 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a7910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a7920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000a7930 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000a7940 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Third DBBT header:
000c6000 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 44 42 |..............DB|
000c6010 42 54 00 00 00 01 01 00 00 00 01 00 00 00 00 00 |BT..............|
000c6020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000c6200 00 00 00 00 00 00 00 00 00 00 37 a7 79 1c d7 41 |..........7.y..A|
000c6210 c2 b0 99 0b c3 e1 c6 00 00 00 00 00 00 00 00 00 |................|
000c6220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000c6800 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c6810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c6820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c6830 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000c6840 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Third BBTN:
000c8100 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 01 00 |................|
000c8110 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c8120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000c8300 00 00 00 00 00 00 00 00 00 00 3d 5c c3 ed cd f2 |..........=\....|
000c8310 e2 a6 67 37 70 8f 06 00 00 00 00 00 00 00 00 00 |..g7p...........|
000c8320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000c8900 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c8910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c8920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000c8930 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000c8940 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Forth DBBT header:
000e7000 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 44 42 |..............DB|
000e7010 42 54 00 00 00 01 01 00 00 00 01 00 00 00 00 00 |BT..............|
000e7020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000e7200 00 00 00 00 00 00 00 00 00 00 37 a7 79 1c d7 41 |..........7.y..A|
000e7210 c2 b0 99 0b c3 e1 c6 00 00 00 00 00 00 00 00 00 |................|
000e7220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000e7800 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e7810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e7820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e7830 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000e7840 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
Forth BBTN:
000e9100 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 01 00 |................|
000e9110 00 00 d0 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e9120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000e9300 00 00 00 00 00 00 00 00 00 00 3d 5c c3 ed cd f2 |..........=\....|
000e9310 e2 a6 67 37 70 8f 06 00 00 00 00 00 00 00 00 00 |..g7p...........|
000e9320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
BCH-ECC?:
000e9900 ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e9910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e9920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000e9930 00 92 2a bd 77 36 7e e7 bd 28 20 22 28 92 00 00 |..*.w6~..( "(...|
000e9940 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
*
00108000
Stuart
This discussion is closed since no activity. If you still need help, please feel free to reply with an update to this discussion, or create another discussion.
Thanks,
Yixing
Stuart
Had your issue got resolved? If yes, we are going to close the discussion in 3 days. If you still need help, please feel free to reply with an update to this discussion.
Thanks,
Yixing
MX28 ROM code checks the bad block table in DBBT. Can you run "kobs-ng init -v $FILE" to dump the FCB structure?
In your DBBT header, DBBT fingerprint starts at byte 14.
First DBBT header:
00084000 00 ff ff ff ff ff ff ff ff ff 00 00 00 00 44 42 |..............DB|
00084010 42 54 00 00 00 01 01 00 00 00 01 00 00 00 00 00 |BT..............|
00084020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
But the definition of boot block is 4 bytes checksum followed by 4 bytes fingerprint and 4 bytes version number.
typedef struct _BootBlockStruct_t
{
uint32_t m_u32Checksum; //!< First fingerprint in first byte.
uint32_t m_u32FingerPrint; //!< 2nd fingerprint at byte 4.
uint32_t m_u32Version; //!< 3rd fingerprint at byte 8.
Grace