After Nand Flash Getting ubifs error on Colibri-T20

I have followed below steps to flash

Below Commands I have executed in u-boot

  1. run setusbupdate
  2. run update

[upload|+Fs/GVcigIGsarIfaa8Y0eiqvKQ=]

Colibri T20 # run update

NAND read: device 0 offset 0x300000, size 0x64
 100 bytes read: OK
crc32 for 02000008 ... 0200000a ==> 108dd209 != 94305232 ** ERROR **

NAND read: device 0 offset 0x15c0000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ff41d912 != 94305232 ** ERROR **

NAND read: device 0 offset 0x1c80000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ff41d912 != 94305232 ** ERROR **

NAND read: device 0 offset 0x7380000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ff41d912 != 94305232 ** ERROR **

NAND read: device 0 offset 0x7900000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ff41d912 != 94305232 ** ERROR **
reading colibri_t20/colibri_t20-512-v12-nand.img
991232 bytes read in 108 ms (8.8 MiB/s)

NAND erase: device 0 offset 0x0, size 0x300000
Erasing at 0x2c0000 -- 100% complete.
OK


    NAND write: device 0 offset 0x0, size 0xf2000
     991232 bytes written: OK
    ubi0: default fastmap pool size: 200
    ubi0: default fastmap WL pool size: 100
    ubi0: attaching mtd1
    ubi0: scanning is finished
    ubi0: attached mtd1 (name "mtd=3", size 1020 MiB)
    ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
    ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
    ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
    ubi0: good PEBs: 4071, bad PEBs: 9, corrupted PEBs: 0
    ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
    ubi0: max/mean erase counter: 1/1, WL threshold: 4096, image sequence number: 0
    ubi0: available PEBs: 3994, total reserved PEBs: 77, PEBs reserved for bad PEB handling: 71
    Creating static volume kernel of size 8388608
    Creating static volume dtb of size 131072
    No size specified -> Using max size (1005395968)
    Creating dynamic volume rootfs of size 1005395968
    reading colibri_t20/zImage
    4086944 bytes read in 367 ms (10.6 MiB/s)
    4086944 bytes written to volume kernel
    reading colibri_t20/ubifs_248KiB.img
    200368128 bytes read in 16294 ms (11.7 MiB/s)
    200368128 bytes written to volume rootfs
    22 bytes written to volume dtb
    reading colibri_t20/tegra20-colibri-eval-v3.dtb
    ** Unable to read file colibri_t20/tegra20-colibri-eval-v3.dtb **
    size > volume size! Aborting!
    resetting ...

After above method I am getting ubifs error , I have tried to erase the ubi part according to below instruction. After erasing the ubi part tried to update the image again but same ubifs error occured

Nand Erase ubi part Details

[upload|FYIZoqVo8zzLVtpYk5rArdkDyJ8=]

Colibri T20 # run update
NAND read: device 0 offset 0x300000, size 0x64
 100 bytes read: OK
crc32 for 02000008 ... 0200000a ==> 108dd209 != 94305232 ** ERROR **

NAND read: device 0 offset 0x15c0000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ffffff00 != 94305232 ** ERROR **

NAND read: device 0 offset 0x1c80000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ffffff00 != 94305232 ** ERROR **

NAND read: device 0 offset 0x7380000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ffffff00 != 94305232 ** ERROR **

NAND read: device 0 offset 0x7900000, size 0x40
 64 bytes read: OK
crc32 for 02000008 ... 0200000a ==> ffffff00 != 94305232 ** ERROR **
reading colibri_t20/colibri_t20-512-v12-nand.img
991232 bytes read in 195 ms (4.8 MiB/s)

NAND erase: device 0 offset 0x0, size 0x300000
Erasing at 0x2c0000 -- 100% complete.
OK


NAND write: device 0 offset 0x0, size 0xf2000
 991232 bytes written: OK
ubi0: default fastmap pool size: 200
ubi0: default fastmap WL pool size: 100
ubi0: attaching mtd1
ubi0: scanning is finished
ubi0: empty MTD device detected
ubi0: attached mtd1 (name "mtd=3", size 1020 MiB)
ubi0: PEB size: 262144 bytes (256 KiB), LEB size: 253952 bytes
ubi0: min./max. I/O unit sizes: 4096/4096, sub-page size 4096
ubi0: VID header offset: 4096 (aligned 4096), data offset: 8192
ubi0: good PEBs: 4071, bad PEBs: 9, corrupted PEBs: 0
ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
ubi0: max/mean erase counter: 1/0, WL threshold: 4096, image sequence number: 0
ubi0: available PEBs: 3994, total reserved PEBs: 77, PEBs reserved for bad PEB handling: 71
Creating static volume kernel of size 8388608
Creating static volume dtb of size 131072
No size specified -> Using max size (1005395968)
Creating dynamic volume rootfs of size 1005395968
reading colibri_t20/zImage
4086944 bytes read in 368 ms (10.6 MiB/s)
4086944 bytes written to volume kernel
reading colibri_t20/ubifs_248KiB.img
200368128 bytes read in 16375 ms (11.7 MiB/s)
200368128 bytes written to volume rootfs
22 bytes written to volume dtb
reading colibri_t20/tegra20-colibri-eval-v3.dtb
** Unable to read file colibri_t20/tegra20-colibri-eval-v3.dtb **
size > volume size! Aborting!
resetting ...

UBIFS Error Details

             Starting Rebuild Journal Catalog...                                                                                                                                 [377/1909][  OK  ] Started Flush Journal to Persistent Storage.
    [  OK  ] Started Load/Save Random Seed.
    [   20.301567] UBIFS error (pid 116): ubifs_read_node: bad node type (119 but expected 2)
    [   20.315036] UBIFS error (pid 116): ubifs_read_node: bad node at LEB 163:67784, LEB mapping status 1
    [   20.332906] Not a node, first 24 bytes:
    [   20.336769] 00000000: 20 0b a1 01 31 34 a1 01 54 35 ad 04 77 36 ad 04 77 2e ae 04 77 45 b0 b9       
                        ...14..T5..w6..w...wE..
    [ [   20.363532] [<c00143c8>] (unwind_backtrace+0x0/0xe8) from [<c0560b80>] (dump_stack+0x20/0x24)
     OK     20.377193] [<c0560b80>] (dump_stack+0x20/0x24) from [<c01dfaec>] (ubifs_read_node+0x1e8/0x288)
    m] Start[   20.390887] [<c01dfaec>] (ubifs_read_node+0x1e8/0x288) from [<c01f9d2c>] (ubifs_tnc_read_nod
    e+0x90/0x12c)
    ed Rebui[   20.409656] [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0x12c) from [<c01e065c>] (tnc_read_node_n
    m+0xc8/0x1c4)
    ld Journ[   20.428638] [<c01e065c>] (tnc_read_node_nm+0xc8/0x1c4) from [<c01e3eec>] (ubifs_tnc_next_ent
    +0x168/0x19c)
    al Catal[   20.447947] [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0x19c) from [<c01d8080>] (ubifs_readdir+0
    x368/0x444)
    og.
    [   20.467549] [<c01d8080>] (ubifs_readdir+0x368/0x444) from [<c00f2f30>] (vfs_readdir+0x7c/0xac)
    [   20.481203] [<c00f2f30>] (vfs_readdir+0x7c/0xac) from [<c00f3338>] (sys_getdents64+0x6c/0xc4)
    [ [   20.495970] [<c00f3338>] (sys_getdents64+0x6c/0xc4) from [<c000e000>] (ret_fast_syscall+0x0/0x30)
     OK     20.510519] UBIFS error (pid 116): ubifs_readdir: cannot find next direntry, error -22
    m] Started udev Kernel Device Manager.
             Starting Create Volatile Files and Directories...
    [   20.666038] UBIFS error (pid 116): ubifs_read_node: bad node type (119 but expected 2)
    [   20.679079] UBIFS error (pid 116): ubifs_read_node: bad node at LEB 163:67784, LEB mapping status 1
    [   20.698209] Not a node, first 24 bytes:
    [   20.701991] 00000000: 20 0b a1 01 31 34 a1 01 54 35 ad 04 77 36 ad 04 77 2e ae 04 77 45 b0 b9       
                        ...14..T5..w6..w...wE..
    [   20.730139] [<c00143c8>] (unwind_backtrace+0x0/0xe8) from [<c0560b80>] (dump_stack+0x20/0x24)
    [   20.743922] [<c0560b80>] (dump_stack+0x20/0x24) from [<c01dfaec>] (ubifs_read_node+0x1e8/0x288)
    [   20.757985] [<c01dfaec>] (ubifs_read_node+0x1e8/0x288) from [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0
    x12c)
    [   20.778117] [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0x12c) from [<c01e065c>] (tnc_read_node_nm+0xc8/0
    x1c4)
    [   20.798365] [<c01e065c>] (tnc_read_node_nm+0xc8/0x1c4) from [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0
    x19c)
    [  OK     20.819726] [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0x19c) from [<c01d8080>] (ubifs_readdir+0x3
    68/0x444)
    m] Started Create Volatile Files and Directories.
    [   20.840616] [<c01d8080>] (ubifs_readdir+0x368/0x444) from [<c00f2f30>] (vfs_readdir+0x7c/0xac)
    
,             Starting Rebuild Journal Catalog...                                                                                                                                 [377/1909][  OK  ] Started Flush Journal to Persistent Storage.
    [  OK  ] Started Load/Save Random Seed.
    [   20.301567] UBIFS error (pid 116): ubifs_read_node: bad node type (119 but expected 2)
    [   20.315036] UBIFS error (pid 116): ubifs_read_node: bad node at LEB 163:67784, LEB mapping status 1
    [   20.332906] Not a node, first 24 bytes:
    [   20.336769] 00000000: 20 0b a1 01 31 34 a1 01 54 35 ad 04 77 36 ad 04 77 2e ae 04 77 45 b0 b9       
                        ...14..T5..w6..w...wE..
    [ [   20.363532] [<c00143c8>] (unwind_backtrace+0x0/0xe8) from [<c0560b80>] (dump_stack+0x20/0x24)
     OK     20.377193] [<c0560b80>] (dump_stack+0x20/0x24) from [<c01dfaec>] (ubifs_read_node+0x1e8/0x288)
    m] Start[   20.390887] [<c01dfaec>] (ubifs_read_node+0x1e8/0x288) from [<c01f9d2c>] (ubifs_tnc_read_nod
    e+0x90/0x12c)
    ed Rebui[   20.409656] [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0x12c) from [<c01e065c>] (tnc_read_node_n
    m+0xc8/0x1c4)
    ld Journ[   20.428638] [<c01e065c>] (tnc_read_node_nm+0xc8/0x1c4) from [<c01e3eec>] (ubifs_tnc_next_ent
    +0x168/0x19c)
    al Catal[   20.447947] [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0x19c) from [<c01d8080>] (ubifs_readdir+0
    x368/0x444)
    og.
    [   20.467549] [<c01d8080>] (ubifs_readdir+0x368/0x444) from [<c00f2f30>] (vfs_readdir+0x7c/0xac)
    [   20.481203] [<c00f2f30>] (vfs_readdir+0x7c/0xac) from [<c00f3338>] (sys_getdents64+0x6c/0xc4)
    [ [   20.495970] [<c00f3338>] (sys_getdents64+0x6c/0xc4) from [<c000e000>] (ret_fast_syscall+0x0/0x30)
     OK     20.510519] UBIFS error (pid 116): ubifs_readdir: cannot find next direntry, error -22
    m] Started udev Kernel Device Manager.
             Starting Create Volatile Files and Directories...
    [   20.666038] UBIFS error (pid 116): ubifs_read_node: bad node type (119 but expected 2)
    [   20.679079] UBIFS error (pid 116): ubifs_read_node: bad node at LEB 163:67784, LEB mapping status 1
    [   20.698209] Not a node, first 24 bytes:
    [   20.701991] 00000000: 20 0b a1 01 31 34 a1 01 54 35 ad 04 77 36 ad 04 77 2e ae 04 77 45 b0 b9       
                        ...14..T5..w6..w...wE..
    [   20.730139] [<c00143c8>] (unwind_backtrace+0x0/0xe8) from [<c0560b80>] (dump_stack+0x20/0x24)
    [   20.743922] [<c0560b80>] (dump_stack+0x20/0x24) from [<c01dfaec>] (ubifs_read_node+0x1e8/0x288)
    [   20.757985] [<c01dfaec>] (ubifs_read_node+0x1e8/0x288) from [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0
    x12c)
    [   20.778117] [<c01f9d2c>] (ubifs_tnc_read_node+0x90/0x12c) from [<c01e065c>] (tnc_read_node_nm+0xc8/0
    x1c4)
    [   20.798365] [<c01e065c>] (tnc_read_node_nm+0xc8/0x1c4) from [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0
    x19c)
    [  OK     20.819726] [<c01e3eec>] (ubifs_tnc_next_ent+0x168/0x19c) from [<c01d8080>] (ubifs_readdir+0x3
    68/0x444)
    m] Started Create Volatile Files and Directories.
    [   20.840616] [<c01d8080>] (ubifs_readdir+0x368/0x444) from [<c00f2f30>] (vfs_readdir+0x7c/0xac)

What image have had before?

Could you try

# env default -a

# saveenv

before setusbupdate

Hi after resetting the u-boot same issue was observed ,
and presently I dont have the previous image details

Hi Team
Please update, still issue persist

While I have not seen it to be that bad for robust NAND functionality on T20 I would recommend either using later mainline Linux kernel (not really available/supported from us out-of-the-box) or the good old fully validated stable BSP V2.3.