Re: NAND Flash Issue Need Help!

From: Willy Tarreau
Date: Fri Mar 05 2021 - 14:36:55 EST


Hello,

On Fri, Mar 05, 2021 at 06:38:08PM +0000, Justin Mitchell wrote:
> Issue:
> Intermittent occurrence of failure to program new boards from CM.

No idea what "CM" is here, but that's not relevant here anyway.

> Primary partition mounted OK
> Loading file 'dtb/at91sam9g25ek.dtb' to addr 0x21000000 with size 25836 (0x000064ec)...
> Done
> DTB file loaded OK
> Loading file 'kernel/uImage' to addr 0x22000000 with size 2968536 (0x002d4bd8)...
> UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 1) UBIFS error (pid 0): ubifs_read_node: bad node at LEB 215:0 UBIFS error (pid 0): do_readpage: cannot read page 178 of inode 1244, error -22 Error reading file 'kernel/uImage'
> kernel/uImage not found!

But this is not a Linux issue if its U-boot which is failing to load the
kernel. Are you sure you didn't upgrade u-boot at the same time as your
kernel ?

> If I will do ubifscat kernel/uImage it starts to read the file and then I see this error:
>
> P?@ ???P?@ ???P?@ ??Q?? ?
(...)
> -- System haltedAttempting division by 0!stack-protector: Kernel stack is corrupted Uncompressing Linux...decompressor returned an error done, booting the kernel.
(...)

That's not an error :-) It's the contents of the bootstrap code in the
kernel that deals with very early issues such as decompression failures.
You're just dumping your kernel image to the screen here.

(...)
> ubifsmount <volume-name>
> - mount 'volume-name' volume
>
> And if I will do the same second time then it starts but getting no uImage error:
>
> DTB file loaded OK
> Loading file 'kernel/uImage' to addr 0x22000000 with size 2968536 (0x002d4bd8)...
> UBIFS error (pid 0): ubifs_read_node: bad node type (255 but expected 1) UBIFS error (pid 0): ubifs_read_node: bad node at LEB 215:0 UBIFS error (pid 0): do_readpage: cannot read page 178 of inode 1244, error -22 Error reading file 'kernel/uImage'
> kernel/uImage not found!
>
> Strange that I need to run same command twice and that uImage also can not be loaded from SystemB

So indeed that has nothing to do with Linux. Maybe your image is much larger
than the previous one and a bug in the u-boot code used to load the image
makes it randomly fail.

Hoping this helps,
Willy