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/PROCESSOR-SDK-AM437X: Kernel panic when mount root fs from NAND

Part Number: PROCESSOR-SDK-AM437X

Tool/software: Linux

Hi,

I transfer the images through TFTP in u-boot as following:

1)tftpboot 0x82000000 zImage

nand write 0x82000000 NAND.kernel

2)tftpboot 0x82000000 am437x-gp-evm.dtb

nand write 0x82000000 NAND.u-boot-spl-os

3)mw.b 0x82000000 0xff 0x8600000

4)tftpboot 0x82000000 arago-base-tisdk-image-am437x-evm.ubi

nand write 0x82000000 NAND.file-system

then, when power up, the  Kernel panic appear and system stop, the detail infromation is in the attach file <session.log>.

 Above zImage, am437x-gp-evm.dtb and arago-base-tisdk-image-am437x-evm.ubi  are from the SDK <ti-processor-sdk-linux-am437x-evm-05.01.00.11>.

My board is a custom board with no EEPROM to identify itself and has a different NAND which has been patched by Kemal R.Shakir in u-boot power up.

The problem may be in the ubi file and the different NAND config.

Best Regards!

8371.session.log
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
U-Boot SPL 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10)
Trying to boot from NAND
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!
U-Boot 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10 +0800)
CPU : AM437X-GP rev 1.2
Model: TI AM437x GP EVM
DRAM: 1 GiB
PMIC: TPS65218
NAND: 512 MiB
MMC: OMAP SD/MMC: 0
MMC: no card present
** Bad device mmc 0 **
Using default environment
Net: <ethaddr> not set. Validating first E-fuse MAC
cpsw, usb_ether
Hit any key to stop autoboot: 0
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
starting USB...
USB0: Register 2000440 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
Device 0: device type unknown
... is now current device
MMC: no card present
** Bad device mmc 0 **
** Bad device usb 0 **
Booting from nand ...
NAND read: device 0 offset 0x100000, size 0x80000
524288 bytes read: OK
NAND read: device 0 offset 0x300000, size 0x700000
7340032 bytes read: OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Device Tree to 8fff0000, end 8ffffe54 ... OK
Starting kernel ...
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.14.67-gd315a9bb00 (root@cr) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 PREEMPT Mon Dec 24 09:45:55 CST 2018
[ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt: Machine model: TI AM437x GP EVM
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 48 MiB at 0xbd000000
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM437x ES1.2 (sgx neon)
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260416
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 976228K/1048576K available (8192K kernel code, 328K rwdata, 2488K rodata, 1024K init, 276K bss, 23196K reserved, 49152K cma-reserved, 212992K highmem)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello user3529609,

    The arago-base-tisdk-image-am437x-evm.ubi image doesn't match your NAND device. Can you delete the content in <Processor SDK>/targetNFS/ and extract <Processor SDK>/filesystem/arago-base-tisdk-image-am437x-evm.tar.xz there. Change the MKUBIFS_ARGS and UBINIZE_ARGS arguments in <Processor SDK>/bin/create-ubifs.sh to MKUBIFS_ARGS="-F -m 2048 -e 253952 -c 6000" and UBINIZE_ARGS="-m 2048 -p 128KiB -s 2048 -O 2048" and create a new custom-am437x-evm-rootfs.ubi image by using this script. You may need also to change the timing parameters in nand &gpmc node in <Processor SDK>/board-support/linux-<version>/arch/arm/boot/dts/am437x-gp-evm.dts to match your NAND device's datasheet.

    Best regards,
    Kemal

  • Hi,

    I change the two ARGS definition in create-ubifs.sh file as you instructed. Then take following steps:

    1)extract to rootfs: tar -xf arago-base-tisdk-image-am437x-evm.tar.xz -C rootfs

    2)run the modified script: ./create-ubifs.sh ./rootfs


    Parameters:
    image_rootfs_dir ..... "./rootfs"
    image_name_prefix .... "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs"
    vol_name ............. "am437x-evm-rootfs"

    mkfs.ubifs
    root: ./rootfs/
    min_io_size: 2048
    leb_size: 253952
    max_leb_cnt: 6000
    output: /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs
    jrn_size: 8388608
    reserved: 0
    compr: lzo
    keyhash: r5
    fanout: 8
    orph_lebs: 1
    space_fixup: 1

    super lebs: 1
    master lebs: 2
    log_lebs: 4
    lpt_lebs: 2
    orph_lebs: 1
    main_lebs: 536
    gc lebs: 1
    index lebs: 10
    leb_cnt: 546
    UUID: 43A252F5-EF16-4C76-BD6A-CFED4D4A2B4A
    Success!
    ubinize: LEB size: 126976
    ubinize: PEB size: 131072
    ubinize: min. I/O size: 2048
    ubinize: sub-page size: 2048
    ubinize: VID offset: 2048
    ubinize: data offset: 4096
    ubinize: UBI image sequence number: 1211852519
    ubinize: loaded the ini-file "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubinize.cfg"
    ubinize: count of sections: 1

    ubinize: parsing section "ubifs"
    ubinize: mode=ubi, keep parsing
    ubinize: volume type: dynamic
    ubinize: volume ID: 0
    ubinize: volume size was not specified in section "ubifs", assume minimum to fit image "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs"138657792 bytes (132.2 MiB)
    ubinize: volume name: am437x-evm-rootfs
    ubinize: volume alignment: 1
    ubinize: autoresize flags found
    ubinize: adding volume 0
    ubinize: writing volume 0
    ubinize: image file: /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs

    ubinize: writing layout volume
    ubinize: done

    Success! The UBI image is available at "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubi"

    3)I transfer the custom-am437x-evm-rootfs.ubi to NAND

    4)When I reset my board, it still give kernel panic message the same as before.

    I don't change am437-gp-evm.dts, because when I transfer the old ubi(the old tisdk-rootfs-image-am437x-evm.tar.gz is too large to be in attachment ) to NAND, it seem work well.

    The old ubi is generated as following:

    1)Extract: tar -xvf tisdk-rootfs-image-am437x-evm.tar.gz -C rootfs

    2)generate ubifs.img: mkfs.ubifs -F -q -r rootfs -m 2048 -e 126976 -c 4095 -o ubifs.img

    3)generate ubi.img: ubinize -o ubi.img -m 2048 -p 128KiB ubinize.cfg

    ubinize.cfg is a file:

    [ubifs]

    mode=ubi

    image=ubifs.img

    vol_id=0

    vol_size=450MiB

    vol_type=dynamic

    vol_name=rootfs

    vol_flags=autosize


    I apply the same way with the new rootfs, the produced ubi.img is still kernel panic. the new rootfs and old rootfs is in different ubuntu system. the mtd-utils is also different. Is it releated?
  • No, is is less possible to be mtd-utils related. Probably the new kernel panic is about leb size. Can you change the arguments in the script to MKUBIFS_ARGS="-F -m 2048 -e 126976 -c 4095", UBINIZE_ARGS="-m 2048 -p 128KiB -s 2048 -O 2048" and retry?

  • Hi,

    I change the script to MKUBIFS_ARGS="-F -m 2048 -e 126976 -c 4095", UBINIZE_ARGS="-m 2048 -p 128KiB -s 2048 -O 2048" and try again, it is still kernel panic.

    Following is the custom-am437x-evm-rootfs.ubi produced result:

    root@cr:/media/Am437x/TouchScreen# ./create-ubifs.sh ./rootfs

    Parameters:
        image_rootfs_dir ..... "./rootfs"
        image_name_prefix .... "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs"
        vol_name ............. "am437x-evm-rootfs"

    mkfs.ubifs
        root:         ./rootfs/
        min_io_size:  2048
        leb_size:     126976
        max_leb_cnt:  4095
        output:       /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs
        jrn_size:     8388608
        reserved:     0
        compr:        lzo
        keyhash:      r5
        fanout:       8
        orph_lebs:    1
        space_fixup:  1
        super lebs:   1
        master lebs:  2
        log_lebs:     5
        lpt_lebs:     2
        orph_lebs:    1
        main_lebs:    1076
        gc lebs:      1
        index lebs:   20
        leb_cnt:      1087
        UUID:         305B10EF-7AFA-4839-B8B1-6D68B88498B8
    Success!
    ubinize: LEB size:                  126976
    ubinize: PEB size:                  131072
    ubinize: min. I/O size:             2048
    ubinize: sub-page size:             2048
    ubinize: VID offset:                2048
    ubinize: data offset:               4096
    ubinize: UBI image sequence number: 1632736484
    ubinize: loaded the ini-file "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubinize.cfg"
    ubinize: count of sections: 1

    ubinize: parsing section "ubifs"
    ubinize: mode=ubi, keep parsing
    ubinize: volume type: dynamic
    ubinize: volume ID: 0
    ubinize: volume size was not specified in section "ubifs", assume minimum to fit image "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs"138022912 bytes (131.6 MiB)
    ubinize: volume name: am437x-evm-rootfs
    ubinize: volume alignment: 1
    ubinize: autoresize flags found
    ubinize: adding volume 0
    ubinize: writing volume 0
    ubinize: image file: /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs

    ubinize: writing layout volume
    ubinize: done

    Success! The UBI image is available at "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubi"

    When I change the new file-system "custom-am437x-evm-rootfs.ubi " to the old "ubi.img" in NAND with others the same. it seem ok! I give the restart information in the attachment when reset:

    session_ok.log
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    U-Boot SPL 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10)
    Trying to boot from NAND
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    U-Boot 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10 +0800)
    CPU : AM437X-GP rev 1.2
    Model: TI AM437x GP EVM
    DRAM: 1 GiB
    PMIC: TPS65218
    NAND: 512 MiB
    MMC: OMAP SD/MMC: 0
    MMC: no card present
    ** Bad device mmc 0 **
    Using default environment
    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot: 0
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    starting USB...
    USB0: Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 0 Storage Device(s) found
    Device 0: device type unknown
    ... is now current device
    MMC: no card present
    ** Bad device mmc 0 **
    ** Bad device usb 0 **
    Booting from nand ...
    NAND read: device 0 offset 0x100000, size 0x80000
    524288 bytes read: OK
    NAND read: device 0 offset 0x300000, size 0x700000
    7340032 bytes read: OK
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff0000, end 8ffffe54 ... OK
    Starting kernel ...
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.14.67-gd315a9bb00 (root@cr) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 PREEMPT Mon Dec 24 09:45:55 CST 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: TI AM437x GP EVM
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] efi: Getting EFI parameters from FDT:
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] cma: Reserved 48 MiB at 0xbd000000
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM437x ES1.2 (sgx neon)
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260416
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Memory: 976228K/1048576K available (8192K kernel code, 328K rwdata, 2488K rodata, 1024K init, 276K bss, 23196K reserved, 49152K cma-reserved, 212992K highmem)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • user3529609 said:
    I change the script to MKUBIFS_ARGS="-F -m 2048 -e 126976 -c 4095", UBINIZE_ARGS="-m 2048 -p 128KiB -s 2048 -O 2048" and try again, it is still kernel panic.


    Can you attach the log with the kernel panic? Can you also try with the 512 sub-page size. MKUBIFS_ARGS="-F -m 2048 -e 126976 -c 4095", UBINIZE_ARGS="-m 2048 -p 128KiB -s 512 -O 2048" also the rootwait=1 in the cmdline shouldn't take any arguments please see this page, rootdelay= is the command which takes arguments.


    user3529609 said:
    When I change the new file-system "custom-am437x-evm-rootfs.ubi " to the old "ubi.img" in NAND with others the same. it seem ok! I give the restart information in the attachment when reset:

    How did you change the "custom-am437x-evm-rootfs.ubi " to the old "ubi.img" in NAND with others the same? Can you share the commands? Do you mean you only flashed "custom-am437x-evm-rootfs.ubi " without re-flashing the rest of the images? If so it is okay but you need to nand erase.part before flashing or use these similar commands.

  • Hi,

    I attach the log file with kernel panic the name session_page2048_panic.log.  I also try with the 512 sub-page, it is also kernel panic and I attach the log with name sessionJ_page512_panic.log here.

    the page 512 generated and the reusult is:

    root@cr:/media/Am437x/TouchScreen# ./create-ubifs.sh ./rootfs

    Parameters:
        image_rootfs_dir ..... "./rootfs"
        image_name_prefix .... "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs"
        vol_name ............. "am437x-evm-rootfs"

    mkfs.ubifs
        root:         ./rootfs/
        min_io_size:  2048
        leb_size:     126976
        max_leb_cnt:  4095
        output:       /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs
        jrn_size:     8388608
        reserved:     0
        compr:        lzo
        keyhash:      r5
        fanout:       8
        orph_lebs:    1
        space_fixup:  1
        super lebs:   1
        master lebs:  2
        log_lebs:     5
        lpt_lebs:     2
        orph_lebs:    1
        main_lebs:    1076
        gc lebs:      1
        index lebs:   20
        leb_cnt:      1087
        UUID:         75C741B2-D09D-4E02-8F46-C811EB27DFAD
    Success!
    ubinize: LEB size:                  126976
    ubinize: PEB size:                  131072
    ubinize: min. I/O size:             2048
    ubinize: sub-page size:             512
    ubinize: VID offset:                2048
    ubinize: data offset:               4096
    ubinize: UBI image sequence number: 2019124307
    ubinize: loaded the ini-file "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubinize.cfg"
    ubinize: count of sections: 1

    ubinize: parsing section "ubifs"
    ubinize: mode=ubi, keep parsing
    ubinize: volume type: dynamic
    ubinize: volume ID: 0
    ubinize: volume size was not specified in section "ubifs", assume minimum to fit image "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs"138022912 bytes (131.6 MiB)
    ubinize: volume name: am437x-evm-rootfs
    ubinize: volume alignment: 1
    ubinize: autoresize flags found
    ubinize: adding volume 0
    ubinize: writing volume 0
    ubinize: image file: /media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubifs

    ubinize: writing layout volume
    ubinize: done

    Success! The UBI image is available at "/media/Am437x/ti-sdk-05.01.00.11/filesystem/custom-am437x-evm-rootfs.ubi"

    When I change the ubi, I  erase all NAND chip(nand erase.chip) and transfer all images(MLO,u-boot.img,zImage,am437x-gp-evm.dtb,ubi.img) to NAND,only with the ubi.img different(the old ubi.img or the new generated custom-am437x-evm-rootfs.ubi).

    As for "rootwait=1", I don't know how to process it and don't take any arguments. can you show me a example?  All the images are from the SDK, I don't change any parameter now.

    session_page2048_panic.log
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    U-Boot SPL 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10)
    Trying to boot from NAND
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    U-Boot 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10 +0800)
    CPU : AM437X-GP rev 1.2
    Model: TI AM437x GP EVM
    DRAM: 1 GiB
    PMIC: TPS65218
    NAND: 512 MiB
    MMC: OMAP SD/MMC: 0
    MMC: no card present
    ** Bad device mmc 0 **
    Using default environment
    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot: 0
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    starting USB...
    USB0: Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 0 Storage Device(s) found
    Device 0: device type unknown
    ... is now current device
    MMC: no card present
    ** Bad device mmc 0 **
    ** Bad device usb 0 **
    Booting from nand ...
    NAND read: device 0 offset 0x100000, size 0x80000
    524288 bytes read: OK
    NAND read: device 0 offset 0x300000, size 0x700000
    7340032 bytes read: OK
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff0000, end 8ffffe54 ... OK
    Starting kernel ...
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.14.67-gd315a9bb00 (root@cr) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 PREEMPT Mon Dec 24 09:45:55 CST 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: TI AM437x GP EVM
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] efi: Getting EFI parameters from FDT:
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] cma: Reserved 48 MiB at 0xbd000000
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM437x ES1.2 (sgx neon)
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260416
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Memory: 976228K/1048576K available (8192K kernel code, 328K rwdata, 2488K rodata, 1024K init, 276K bss, 23196K reserved, 49152K cma-reserved, 212992K highmem)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    session_page512_panic.log
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    U-Boot SPL 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10)
    Trying to boot from NAND
    SPL: Please implement spl_start_uboot() for your board
    SPL: Direct Linux boot not active!
    U-Boot 2018.01-00444-ge782a78ca9-dirty (Jan 30 2019 - 10:21:10 +0800)
    CPU : AM437X-GP rev 1.2
    Model: TI AM437x GP EVM
    DRAM: 1 GiB
    PMIC: TPS65218
    NAND: 512 MiB
    MMC: OMAP SD/MMC: 0
    MMC: no card present
    ** Bad device mmc 0 **
    Using default environment
    Net: <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot: 0
    MMC: no card present
    MMC: no card present
    MMC: no card present
    MMC: no card present
    starting USB...
    USB0: Register 2000440 NbrPorts 2
    Starting the controller
    USB XHCI 1.00
    scanning bus 0 for devices... 1 USB Device(s) found
    scanning usb for storage devices... 0 Storage Device(s) found
    Device 0: device type unknown
    ... is now current device
    MMC: no card present
    ** Bad device mmc 0 **
    ** Bad device usb 0 **
    Booting from nand ...
    NAND read: device 0 offset 0x100000, size 0x80000
    524288 bytes read: OK
    NAND read: device 0 offset 0x300000, size 0x700000
    7340032 bytes read: OK
    ## Flattened Device Tree blob at 88000000
    Booting using the fdt blob at 0x88000000
    Loading Device Tree to 8fff0000, end 8ffffe54 ... OK
    Starting kernel ...
    [ 0.000000] Booting Linux on physical CPU 0x0
    [ 0.000000] Linux version 4.14.67-gd315a9bb00 (root@cr) (gcc version 7.2.1 20171011 (Linaro GCC 7.2-2017.11)) #1 PREEMPT Mon Dec 24 09:45:55 CST 2018
    [ 0.000000] CPU: ARMv7 Processor [412fc09a] revision 10 (ARMv7), cr=10c53c7d
    [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [ 0.000000] OF: fdt: Machine model: TI AM437x GP EVM
    [ 0.000000] Memory policy: Data cache writeback
    [ 0.000000] efi: Getting EFI parameters from FDT:
    [ 0.000000] efi: UEFI not found.
    [ 0.000000] cma: Reserved 48 MiB at 0xbd000000
    [ 0.000000] CPU: All CPU(s) started in SVC mode.
    [ 0.000000] AM437x ES1.2 (sgx neon)
    [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 260416
    [ 0.000000] Kernel command line: console=ttyO0,115200n8 root=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048 rootfstype=ubifs rootwait=1
    [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
    [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
    [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
    [ 0.000000] Memory: 976228K/1048576K available (8192K kernel code, 328K rwdata, 2488K rodata, 1024K init, 276K bss, 23196K reserved, 49152K cma-reserved, 212992K highmem)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hello user3529609,

    The kernel panic you see this time is different from the previous ones. It is caused by not matching ubi0: volume 0 ("am437x-evm-rootfs") and nandroot=ubi0:rootfs in U-Boot environments. To fix this you need to pass the -v rootfs to ./create-ubifs.sh script while creating the uibfs image or change the nandroot name in your U-Boot environments to am437x-evm-rootfs.

    ./create-ubifs.sh -v rootfs

    setenv nandroot ubi0:am437x-evm-rootfs rw ubi.mtd=NAND.file-system,2048

    To fix the rootwait, enter this command in U-Boot console.
    setenv nandrootfstype ubifs rootwait
    saveenv

    Best regards,
    Kemal

  • Dear Kemal,

    I pass the -v rootfs to ./create-ubifs.sh, and create the ubifs, when the ubi transfer to NAND, it  run well.

    Many thanks for your support! 

    As for the second way, the env   cann't save to NAND:

    => setenv nandroot ubi0:am437x-evm-rootfs rw ubi.mtd=NAND.file-system,2048
    => setenv nandrootfstype ubifs rootwait
    => saveenv
    Saving Environment to FAT...
    MMC: no card present
    ** Bad device mmc 0 **
    =>

    By the way, I use 512 sub-page size now, Is it better than 2048 sub-page? which one is better?

    Best regards

  • user3529609 said:
    As for the second way, the env   cann't save to NAND:


    You can change this in <Processor SDK>/board-support/u-boot-<version>/include/configs/am43xx_evm.h while compiling U-Boot or setup the CONFIG_ENV_IS_IN_NAND=y in <Processor SDK>/board-support/u-boot-<version>/configs/am43xx_evm_defconfig file to keep the U-Boot environment in NAND.


    user3529609 said:
    By the way, I use 512 sub-page size now, Is it better than 2048 sub-page? which one is better?

    It doesn't matter in your case, but it is always recommended to use sub-pages to lessen the flash space overhead.

  • Dear Kemal,

    Thanks for your support!

  • You are welcome user3529609.
  • Dear Kemal,

    When I setup the CONFIG_ENV_IS_IN_NAND=y in <Processor SDK>/board-support/u-boot-<version>/configs/am43xx_evm_defconfig for the NAND env. save and recompile u-boot, it gave following errors:

    In file included from ./include/common.h:728:0:
    include/environment.h:79:5: error: #error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
     #   error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
         ^~~~~
    In file included from ./include/common.h:728:0:
    include/environment.h:79:5: error: #error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
     #   error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
         ^~~~~
    In file included from ./include/common.h:728:0:
    include/environment.h:79:5: error: #error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
     #   error "Need to define CONFIG_ENV_OFFSET when using CONFIG_ENV_IS_IN_NAND"
         ^~~~~

    I don't know  how and where to define CONFIG_ENV_OFFSET.

    Best Regards!

  • Please, apply this patch to fix this issue.

    cd <Processor SDK>/board-support/u-boot-<version>/
    git apply 0001-AM437x-Custom-board-U-Boot-NAND-saveenv-configs.patch

  • Dear Kemal,

    Thanks for your support!

    Have a nice weekend!

    We have another problem:" How to build RAM filesystem and RAM disk with NAND" and I expect you can support us then.

    Best Regards!