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.

Linux/AM4376: QSPI flash error

Part Number: AM4376


Tool/software: Linux

Hello All,

We are trying to boot AM437x starter kit from QSPI NOR flash.

We are using ti sdk 4.0.

We are trying to flash rootfilesystem to /dev/mtd6 which is 54.8 MiB

Our rootfilesystem is around 23 MB.

We get core dump on

ubimkvol -N data -m /dev/ubi0

Is there any specific reason why we get core dump on above command?

Please find attach log.

root@am437x-evm:~#ubiformat /dev/mtd6
ubiformat: mtd6 (nor), size 57475072 bytes (54.8 MiB), 877 eraseblocks of 65536 bytes (64.0 KiB), min. I/O size 1 bytes
libscan: scanning eraseblock 876 -- 100 % complete  
ubiformat: 877 eraseblocks have valid erase counter, mean value is 2
ubiformat: formatting eraseblock 876 -- 100 % complete  
root@am437x-evm:~# ubiattach -m 6 /dev/ubi_ctrl 
[  359.648987] ubi0: attaching mtd6
[  359.862349] ubi0: scanning is finished
[  359.883954] ubi0: attached mtd6 (name "QSPI.FILESYSTEM", size 54 MiB)
[  359.890472] ubi0: PEB size: 65536 bytes (64 KiB), LEB size: 65408 bytes
[  359.915090] ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1
[  359.921315] ubi0: VID header offset: 64 (aligned 64), data offset: 128
[  359.931104] ubi0: good PEBs: 877, bad PEBs: 0, corrupted PEBs: 0
[  359.938969] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128
[  359.947879] ubi0: max/mean erase counter: 6/3, WL threshold: 4096, image sequence number: 1170464178
[  359.958681] ubi0: available PEBs: 873, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0
[  359.969549] ubi0: background thread "ubi_bgt0d" started, PID 853
UBI device number 0, total 877 LEBs (57362816 bytes, 54.7 MiB), available 873 LEBs (57101184 bytes, 54.5 MiB), LEB size 65408 bytes ()
root@am437x-evm:~# ubimkvol -N data -m /dev/ubi
ubi0      ubi_ctrl  
root@am437x-evm:~# ubimkvol -N data -m /dev/ubi0
Set volume size to 57101184
[  403.028376] ------------[ cut here ]------------
[  403.041052] WARNING: CPU: 0 PID: 854 at /home/gtbldadm/processor-sdk-linux-morty-build/build-CORTEX_1/arago-tmp-external-linaro-to8
[  403.073942] Writing at offset 64 into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.[ :
 bc_example(O) pru_rproc pruss_intc xhci_plat_hcd xhci_hcd usbcore pruss dwc3 udc_core usb_common sha512_generic sha512_arm sha256_ge)
[  403.150442] CPU: 0 PID: 854 Comm: ubimkvol Tainted: G           O    4.9.28-geed43d1050 #1
[  403.167841] Hardware name: Generic AM43 (Flattened Device Tree)
[  403.182113] Backtrace: 
[  403.184671] [<c010b7d0>] (dump_backtrace) from [<c010ba8c>] (show_stack+0x18/0x1c)
[  403.198259]  r7:00000009 r6:00000000 r5:c09e7db4 r4:edfadb18
[  403.209312] [<c010ba74>] (show_stack) from [<c03c0f18>] (dump_stack+0x24/0x28)
[  403.224064] [<c03c0ef4>] (dump_stack) from [<c012d370>] (__warn+0xe8/0x100)
[  403.231104] [<c012d288>] (__warn) from [<c012d3c8>] (warn_slowpath_fmt+0x40/0x48)
[  403.242750]  r9:edcddbc0 r8:edfadc08 r7:00000040 r6:ee8e9c18 r5:00000000 r4:c09e7ec0
[  403.250607] [<c012d38c>] (warn_slowpath_fmt) from [<c056bfc4>] (spi_nor_write+0x13c/0x1b8)
[  403.266247]  r3:00000040 r2:c09e7ec0
[  403.269854]  r4:00000040
[  403.275157] [<c056be88>] (spi_nor_write) from [<c0553868>] (part_write+0x48/0x50)
[  403.284513]  r10:f23a8000 r9:edcddbc0 r8:00000000 r7:00000000 r6:00000040 r5:00000000
[  403.294105]  r4:00930000
[  403.296690] [<c0553820>] (part_write) from [<c054fe9c>] (mtd_write+0x88/0xa0)
[  403.306608]  r5:00000000 r4:c0553820
[  403.310237] [<c054fe14>] (mtd_write) from [<c0579838>] (ubi_io_write+0x100/0x68c)
[  403.320653]  r7:00000106 r6:00000040 r5:00000040 r4:ede6c000
[  403.328107] [<c0579738>] (ubi_io_write) from [<c0579fd4>] (ubi_io_write_vid_hdr+0xe4/0x128)
[  403.338154]  r10:f23a8000 r9:00000000 r8:7fffefff r7:edcddbc0 r6:00000106 r5:ede6c000
[  403.347634]  r4:edcddbc0
[  403.350214] [<c0579ef0>] (ubi_io_write_vid_hdr) from [<c05763b8>] (try_write_vid_and_data+0x54/0x190)
[  403.363313]  r7:00000000 r6:ee4b5800 r5:00000106 r4:ede6c000
[  403.369031] [<c0576364>] (try_write_vid_and_data) from [<c0577924>] (ubi_eba_atomic_leb_change+0x18c/0x2c0)
[  403.381580]  r10:ee4b5800 r9:00000000 r8:ede6c414 r7:edcdd300 r6:edcddbc0 r5:00000004
[  403.391182]  r4:ede6c000
[  403.395402] [<c0577798>] (ubi_eba_atomic_leb_change) from [<c056e8d4>] (ubi_update_layout_vol+0x44/0x5c)
[  403.406580]  r10:ee496df4 r9:ede6c000 r8:ee496c00 r7:00000000 r6:ee4b5800 r5:00000001
[  403.416105]  r4:ede6c000
[  403.418695] [<c056e890>] (ubi_update_layout_vol) from [<c056eeb8>] (ubi_change_vtbl_record+0x64/0xe8)
[  403.430654]  r6:00000000 r5:edfadd44 r4:ede6c000
[  403.436961] [<c056ee54>] (ubi_change_vtbl_record) from [<c0570800>] (ubi_create_volume+0x57c/0x63c)
[  403.447807]  r7:00000000 r6:00000000 r5:ede6c000 r4:0f200001
[  403.455175] [<c0570284>] (ubi_create_volume) from [<c0573e08>] (ubi_cdev_ioctl+0x3e4/0x9dc)
[  403.465191]  r10:00000000 r9:be943950 r8:be943950 r7:00000003 r6:edfade38 r5:ede6c000
[  403.474810]  r4:ede6c3f4
[  403.477397] [<c0573a24>] (ubi_cdev_ioctl) from [<c0226610>] (do_vfs_ioctl+0xa8/0x980)
[  403.487989]  r10:00000000 r9:edfac000 r8:be943950 r7:00000003 r6:edc66480 r5:edfbc730
[  403.497513]  r4:be943950
[  403.500099] [<c0226568>] (do_vfs_ioctl) from [<c0226f24>] (SyS_ioctl+0x3c/0x64)
[  403.510296]  r10:00000000 r9:edfac000 r8:be943950 r7:40986f00 r6:edc66480 r5:00000003
[  403.519819]  r4:edc66480
[  403.524022] [<c0226ee8>] (SyS_ioctl) from [<c0107cc0>] (ret_fast_syscall+0x0/0x3c)
[  403.531644]  r9:edfac000 r8:c0107e84 r7:00000036 r6:00000003 r5:00000004 r4:be943a10
[  403.542393] ---[ end trace 8609e11da688cbea ]---
Volume ID 0, size 873 LEBs (57101184 bytes, 54.5 MiB), LEB size 65408 bytes (63.9 KiB), dynamic, name "data", alignment 1

  • Take a look at processors.wiki.ti.com/.../Linux_Core_QSPI_User's_Guide. I noticed a -s option was passed with the ubimkvol command. And this link www.linux-mtd.infradead.org/.../ubi.html also has -s passed. And this training also shows either -s or -m being passed.

    Steve K.
  • Hi Steve,

    Error still coming.

    Please find the log as below

    root@am437x-evm:~# ubiformat /dev/mtd6
    ubiformat: mtd6 (nor), size 57475072 bytes (54.8 MiB), 877 eraseblocks of 65536 bytes (64.0 KiB), min. I/O size 1 bytes
    libscan: scanning eraseblock 876 -- 100 % complete  
    ubiformat: 877 eraseblocks have valid erase counter, mean value is 5
    ubiformat: formatting eraseblock 876 -- 100 % complete  
    root@am437x-evm:~# ubiattach -p /dev/mtd6
    [  587.639067] ubi0: attaching mtd6
    [  587.826672] ubi0: scanning is finished
    [  587.848277] ubi0: attached mtd6 (name "QSPI.FILESYSTEM", size 54 MiB)
    [  587.857099] ubi0: PEB size: 65536 bytes (64 KiB), LEB size: 65408 bytes
    [  587.867016] ubi0: min./max. I/O unit sizes: 1/256, sub-page size 1                    
    [  587.875147] ubi0: VID header offset: 64 (aligned 64), data offset: 128                
    [  587.881719] ubi0: good PEBs: 877, bad PEBs: 0, corrupted PEBs: 0                      
    [  587.890788] ubi0: user volume: 0, internal volumes: 1, max. volumes count: 128        
    [  587.899822] ubi0: max/mean erase counter: 12/6, WL threshold: 4096, image sequence number: 11548538
    [  587.910815] ubi0: available PEBs: 873, total reserved PEBs: 4, PEBs reserved for bad PEB handling: 0
    [  587.921814] ubi0: background thread "ubi_bgt0d" started, PID 867
    UBI device number 0, total 877 LEBs (57362816 bytes, 54.7 MiB), available 873 LEBs (57101184 bytes, 54.5 MiB), LEB size 65408 bytes ()
    root@am437x-evm:~# ubimkvol /dev/ubi0 -N rootfs -s 54MiB
    [  630.667486] ------------[ cut here ]------------
    [  630.680210] WARNING: CPU: 0 PID: 868 at /home/gtbldadm/processor-sdk-linux-morty-build/build-CORTEX_1/arago-tmp-external-linaro-to8
    [  630.711763] Writing at offset 64 into a NOR page. Writing partial pages may decrease reliability and increase wear of NOR flash.[ :
     bc_example(O) pru_rproc pruss_intc xhci_plat_hcd xhci_hcd usbcore pruss dwc3 udc_core usb_common sha512_generic sha512_arm sha256_ge)
    [  630.789399] CPU: 0 PID: 868 Comm: ubimkvol Tainted: G           O    4.9.28-geed43d1050 #1
    [  630.802103] Hardware name: Generic AM43 (Flattened Device Tree)
    [  630.808079] Backtrace: 
    [  630.810613] [<c010b7d0>] (dump_backtrace) from [<c010ba8c>] (show_stack+0x18/0x1c)
    [  630.836990]  r7:00000009 r6:00000000 r5:c09e7db4 r4:ee449b18
    [  630.848146] [<c010ba74>] (show_stack) from [<c03c0f18>] (dump_stack+0x24/0x28)
    [  630.862694] [<c03c0ef4>] (dump_stack) from [<c012d370>] (__warn+0xe8/0x100)
    [  630.869735] [<c012d288>] (__warn) from [<c012d3c8>] (warn_slowpath_fmt+0x40/0x48)
    [  630.882388]  r9:ee3713c0 r8:ee449c08 r7:00000040 r6:ee8e9c18 r5:00000000 r4:c09e7ec0
    [  630.890245] [<c012d38c>] (warn_slowpath_fmt) from [<c056bfc4>] (spi_nor_write+0x13c/0x1b8)
    [  630.905510]  r3:00000040 r2:c09e7ec0
    [  630.909133]  r4:00000040
    [  630.911749] [<c056be88>] (spi_nor_write) from [<c0553868>] (part_write+0x48/0x50)
    [  630.923798]  r10:f23ac000 r9:ee3713c0 r8:00000000 r7:00000000 r6:00000040 r5:00000000
    [  630.931693]  r4:00930000
    [  630.944824] [<c0553820>] (part_write) from [<c054fe9c>] (mtd_write+0x88/0xa0)
    [  630.953649]  r5:00000000 r4:c0553820
    [  630.957275] [<c054fe14>] (mtd_write) from [<c0579838>] (ubi_io_write+0x100/0x68c)
    [  630.968364]  r7:00000112 r6:00000040 r5:00000040 r4:ee544000
    [  630.975659] [<c0579738>] (ubi_io_write) from [<c0579fd4>] (ubi_io_write_vid_hdr+0xe4/0x128)
    [  630.985552]  r10:f23ac000 r9:00000000 r8:7fffefff r7:ee3713c0 r6:00000112 r5:ee544000
    [  630.994954]  r4:ee3713c0
    [  630.997532] [<c0579ef0>] (ubi_io_write_vid_hdr) from [<c05763b8>] (try_write_vid_and_data+0x54/0x190)
    [  631.009248]  r7:00000000 r6:eea77800 r5:00000112 r4:ee544000
    [  631.016472] [<c0576364>] (try_write_vid_and_data) from [<c0577924>] (ubi_eba_atomic_leb_change+0x18c/0x2c0)
    [  631.027795]  r10:eea77800 r9:00000000 r8:ee544414 r7:ee371440 r6:ee3713c0 r5:00000004
    [  631.037176]  r4:ee544000
    [  631.039766] [<c0577798>] (ubi_eba_atomic_leb_change) from [<c056e8d4>] (ubi_update_layout_vol+0x44/0x5c)
    [  631.051753]  r10:ee3995f4 r9:ee544000 r8:ee399400 r7:00000000 r6:eea77800 r5:00000001
    [  631.061118]  r4:ee544000
    [  631.065178] [<c056e890>] (ubi_update_layout_vol) from [<c056eeb8>] (ubi_change_vtbl_record+0x64/0xe8)
    [  631.076075]  r6:00000000 r5:ee449d44 r4:ee544000
    [  631.080751] [<c056ee54>] (ubi_change_vtbl_record) from [<c0570800>] (ubi_create_volume+0x57c/0x63c)
    [  631.092412]  r7:00000000 r6:00000000 r5:ee544000 r4:0f200001
    [  631.098138] [<c0570284>] (ubi_create_volume) from [<c0573e08>] (ubi_cdev_ioctl+0x3e4/0x9dc)
    [  631.109003]  r10:00000000 r9:bec82950 r8:bec82950 r7:00000003 r6:ee449e38 r5:ee544000
    [  631.118366]  r4:ee5443f4
    [  631.120951] [<c0573a24>] (ubi_cdev_ioctl) from [<c0226610>] (do_vfs_ioctl+0xa8/0x980)
    [  631.131267]  r10:00000000 r9:ee448000 r8:bec82950 r7:00000003 r6:ee4f7b40 r5:ee3ac730
    [  631.140647]  r4:bec82950
    [  631.144671] [<c0226568>] (do_vfs_ioctl) from [<c0226f24>] (SyS_ioctl+0x3c/0x64)
    [  631.153536]  r10:00000000 r9:ee448000 r8:bec82950 r7:40986f00 r6:ee4f7b40 r5:00000003
    [  631.161409]  r4:ee4f7b40
    [  631.166440] [<c0226ee8>] (SyS_ioctl) from [<c0107cc0>] (ret_fast_syscall+0x0/0x3c)
    [  631.175559]  r9:ee448000 r8:c0107e84 r7:00000036 r6:00000003 r5:00000006 r4:bec82a10
    [  631.184898] ---[ end trace 8609e11da688cbea ]---
    Volume ID 0, size 866 LEBs (56643328 bytes, 54.0 MiB), LEB size 65408 bytes (63.9 KiB), dynamic, name "rootfs", alignment 1
    

    Output of mtdinfo -a

    root@am437x-evm:~# mtdinfo -a
    Count of MTD devices:           7
    Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6
    Sysfs interface supported:      yes
    
    mtd0
    Name:                           QSPI.U_BOOT
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          8 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:0
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd1
    Name:                           QSPI.U_BOOT.backup
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          8 (524288 bytes, 512.0 KiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:2
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd2
    Name:                           QSPI.U-BOOT-SPL_OS
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          1 (65536 bytes, 64.0 KiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:4
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd3
    Name:                           QSPI.U_BOOT_ENV
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          1 (65536 bytes, 64.0 KiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:6
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd4
    Name:                           QSPI.U-BOOT-ENV.backup
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          1 (65536 bytes, 64.0 KiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:8
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd5
    Name:                           QSPI.KERNEL
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          128 (8388608 bytes, 8.0 MiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:10
    Bad blocks are allowed:         false
    Device is writable:             true
    
    mtd6
    Name:                           QSPI.FILESYSTEM
    Type:                           nor
    Eraseblock size:                65536 bytes, 64.0 KiB
    Amount of eraseblocks:          877 (57475072 bytes, 54.8 MiB)
    Minimum input/output unit size: 1 byte
    Sub-page size:                  1 byte
    Character device major/minor:   90:12
    Bad blocks are allowed:         false
    Device is writable:             true