iMX27 NAND bad blocks and barebox boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX27 NAND bad blocks and barebox boot

1,383 Views
metiu
Contributor I

Is it possible to boot barebox on iMX27 from a NAND flash which has bad eraseblocks in barebox' partition?

I am flashing barebox from a running copy in RAM which I'm loading through JTAG. Everything works well if there are no bad eraseblocks at the start of the NAND.

The original partition was 256kB, and there were 2 bad eraseblocks, so flashing it gave "no space left on device". I enlarged the partition to 384kB to stay on the safe side, and I could flash it from barebox.

Resetting the processor while the JTAG was still attached worked, so the device was able to boot from NAND. However, after a power down, the board is not able to boot anymore.

Is it at all possible to boot from a NAND with bad eraseblocks (dodging them of course), or the only option is to replace the defective chip?

Thank you

Tags (1)
0 Kudos
3 Replies

754 Views
PeterKardos
Contributor I

Can you check whether the part is in "bootstrap mode"?

If yes, the boot procedure obviously failed. This could mean that the flash header is wrong, ,wrong NAND config (ECC, pagesize, etc) wrong memory init., etc...

If it stops "mid boot", you can see that some parts of barebox are executed, i would check the "support bad block tables" feature...

0 Kudos

754 Views
metiu
Contributor I

The NAND is 64MB, the eraseblocks are 16kB, the first blocks are ok, the error was on one board on the 8th and 9th blocks, and in another on the 20th and 21st.

As I said, barebox was reporting 256kB for /dev/self_raw and 256-32kB for /dev/self0

We enlarged the partition description to add 128kB, so there was space for it. It worked only the first time, when I reset the CPU after copying from memory to /dev/self0

On a power up from off state, it wouldn't boot.

0 Kudos

754 Views
PeterKardos
Contributor I

What size are your pages? What kind of flash are you using?

If you're using a flash with 128k blocks, that means, that the first 2 blocks are bad. That also means, that's very probably the the first 2k page is labeled as "bad", or is part of the bad block. The CPU is reading/checking only the first page. If this is "BAD", or does not contain a valid flash header, the NAND boot is aborted.

If the first erase block is labeled as bad, you can't store data into the first page (page #0). The only solution is to replace the  flash...

0 Kudos