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.

SK-AM62B-P1: I want to create dual rootfs partitions from u-boot

Part Number: SK-AM62B-P1

Tool/software:

Hello TI Experts,

I want to create dual rootfs partitions from u-boot so, i created emmc partitions from u-boot. I have attached that log also, in that u can see the mmc partitions. Actually my goal is to create A/B partitioning scheme (dual copy) for the OTA.

=> printenv partitions
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
=> setenv uuid_gpt_disk 236a4745-e65b-4c99-990d-41b1def6e6ef
=> setenv uuid_gpt_boot 31e95878-d4b7-4380-ab65-74e2f4bd7e61
=> setenv uuid_gpt_rootfs1 62996702-d3eb-493f-9d5a-50caacf2cd53
=> setenv uuid_gpt_rootfs2 aace8f3a-d7c2-41c3-b31b-54626d4d7c75
=> setenv uuid_gpt_data d95900db-0f33-40b8-a6d7-1f7c14b4c910
=> mmc list
mmc@fa10000: 0 (eMMC)
mmc@fa00000: 1
=> printenv partitions
partitions=uuid_disk=236a4745-e65b-4c99-990d-41b1def6e6ef
=> setenv partitions
=> setenv partitions 'uuid_disk=${uuid_gpt_disk};name=boot,start=2MiB,size=32MiB,uuid=${uuid_gpt_boot};name=rootfs1,size=2GiB,uuid=${uuid_gpt_rootfs1};name=rootfs2,size=2GiB,uuid=${uuid_gpt_rootfs2};name=data,size=-,uuid=${uuid_gpt_data}'
=> printenv partitions
partitions=uuid_disk=${uuid_gpt_disk};name=boot,start=2MiB,size=32MiB,uuid=${uuid_gpt_boot};name=rootfs1,size=2GiB,uuid=${uuid_gpt_rootfs1};name=rootfs2,size=2GiB,uuid=${uuid_gpt_rootfs2};name=data,size=-,uuid=${uuid_gpt_data}'
=> gpt write mmc 0 ${partitions}
Writing GPT: success!
=> part list mmc 0

Partition Map for MMC device 0  --   Partition Type: EFI

Part    Start LBA       End LBA         Name
        Attributes
        Type GUID
        Partition GUID
  1     0x00001000      0x00010fff      "boot"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   31e95878-d4b7-4380-ab65-74e2f4bd7e61
  2     0x00011000      0x00410fff      "rootfs1"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   62996702-d3eb-493f-9d5a-50caacf2cd53
  3     0x00411000      0x00810fff      "rootfs2"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   aace8f3a-d7c2-41c3-b31b-54626d4d7c75
  4     0x00811000      0x03b47fde      "data"
        attrs:  0x0000000000000000
        type:   ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
        guid:   d95900db-0f33-40b8-a6d7-1f7c14b4c910

So when i am trying to boot the board from emmc it's not booting up the board, i have attached output log also.

=> ls mmc 0:2
=> mmc dev 0 0
switch to partitions #0, OK
mmc0(part 0) is current device
=> ls mmc 0:1
=> ls mmc 0:2
=> setenv mmcdev 0
=> setenv bootpart 0:2
=> boot
switch to partitions #0, OK
mmc0(part 0) is current device
SD/MMC found on device 0
Can't set block device
Can't set block device
## Error: "main_cpsw0_qsgmii_phyinit" not defined
Can't set block device
Can't set block device
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM64 Image magic!
switch to partitions #0, OK
mmc0(part 0) is current device
MMC: no card present
starting USB...
Bus usb@31100000: generic_phy_get_bulk : no phys property
Register 1000840 NbrPorts 1
Starting the controller
USB XHCI 1.10
scanning bus usb@31100000 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Device 0: unknown device
link up on port 1, speed 10, half duplex
BOOTP broadcast 1
BOOTP broadcast 2
BOOTP broadcast 3
BOOTP broadcast 4
BOOTP broadcast 5
BOOTP broadcast 6
BOOTP broadcast 7
BOOTP broadcast 8
BOOTP broadcast 9

Thank you for considering please get back soon.

Best Regards,

Suraj Singh

  • Hello,

    => setenv mmcdev 0
    => setenv bootpart 0:2
    => boot

    This setting will make U-Boot boot Linux Kernel & DTB from the eMMC UDA 2nd partition.

    Since, the command "ls mmc 0:2" doesn't list anything so the U-Boot rightfully fails to load anything.

    Please flash the rootfs filesystem into the partition from which you are trying to boot.

    Regards,

    Prashant

  • Hello Prashant,

    Please flash the rootfs filesystem into the partition from which you are trying to boot.

    I am glad to see you again, as you said to flash the roofs file system into the partition, so i am copying the image from sd card to emmc then from emmc i am trying to boot the board so while Flashing Kernel, Device Tree and Root File system to eMMC for that particular partition first using sd card i have to go to the u-boot and first i will do the emmc partition and then i have to go to root and then i have to flash!

    xzcat -dc phytec-qt5demo-image-phyboard-lyra-am62xx-2.wic.xz | dd of=/dev/mmcblk0 bs=4M conv=fsync
    Here, instead of /dev/mmcblk0 i have to give that particular partition from which i am trying to boot

    Am i correct no!

  • Hi Suraj,

    xzcat -dc phytec-qt5demo-image-phyboard-lyra-am62xx-2.wic.xz | dd of=/dev/mmcblk0 bs=4M conv=fsync

    The WIC image is a disk image. This means it itself defines the partition layout & accordingly contains the filesystem image. At least this is the case with the WIC images we provide.

    For flashing rootfs from SD card to eMMC, you may follow the below guide

    https://dev.ti.com/tirex/content/am62x_academy_9_02_00_00_v1/_build_am62x_academy_9_02_00_00_v1/source/linux/ch-develop/dev-flash-linux-emmc.html#flash-kernel-device-tree-and-root-filesystem-to-emmc

    On another note, may I know why are you choosing to flash to eMMC from SD card?

    According to your previous threads, I know you already have EXT4 filesystem for your rootfs and flashed it over DFU. So, you may use the same procedure to flash to 2nd partition of your eMMC UDA.

    Regards,

    Prashant

  • Hello Prashant,

    may I know why are you choosing to flash to eMMC from SD card?

    Because, for production purpose i can not use sd card so, our goal is to boot the board from emmc only, 

    you may use the same procedure to flash to 2nd partition of your eMMC UDA.

    As of my current situation i can not follow the DFU process because of hardware issue.That is why i am going in this way sd card to emmc. But you are telling that wic image already predefined the partition layout & accordingly contains the file system image.

    xzcat -dc phytec-qt5demo-image-phyboard-lyra-am62xx-2.wic.xz | dd of=/dev/mmcblk0 bs=4M conv=fsync
    Here, instead of /dev/mmcblk0 i have to give that particular partition from which i am trying to boot

    So, can i follow this?

    Regards,
    Suraj Singh

  • Hello,

    But you are telling that wic image already predefined the partition layout & accordingly contains the file system image.

    It depends on how are you creating the WIC image. The WIC image that we provide defines two partitions formatted with FAT and EXT4 respectively. The FAT formatted partition contains the U-Boot images while the EXT4 formatted partition contains the rootfs filesystem.

    Since you have already created partitions in eMMC UDA and assuming you have EXT4 filesystem image (.ext4), you may simply do the following:

    dd if=<path_to_.ext4> of=/dev/mmcblk0p<#partition> conv=fsync

    Regards,

    Prashant

  • Hello Prashant,

    So, first (.tar.gz) rootfs filesystem i have to convert into a EXT4 filesystem which needs to be flashed and then using SD card i have to copy to the device and then i can use following this 

    xzcat -dc <.ext4 file name> | dd if=<path_to_.ext4> of=/dev/mmcblk0 bs=4M conv=fsync

    Is this correct no! After this i have to Flash Kernel, Device Tree and Root Filesystem to eMMC of particular partition?

    Regards,

    Suraj Singh

  • Hello,

    xzcat -dc <.ext4 file name> | dd if=<path_to_.ext4> of=/dev/mmcblk0 bs=4M conv=fsync

    The .ext4 file is not compressed so you cannot use xzcat. Simply do the following to flash it to the 2nd partition.

    dd if=<path_to_.ext4> of=/dev/mmcblk0p2 bs=4M conv=fsync

    The filesystem itself should contain all the images including the Kernel and DTB. So, you do not need any other steps.

    The 

    Regards,

    Prashant

  • Hello Prashant,

    I flashed EXT4 filesystem image (.ext4) to the mmcblk0p2 partition and i have another rootfs partition (mmcblk0p3) in that also i was trying to flash the image but it is showing kernel panic, i have attached log also, so what i need to do please assist.
    My objective is to flash two different images into two different rootfs partition and then need to boot the board from any one of them based on what am i choose the option but should boot the board from both partitions.

    agl-ivi-demo-platform-flutter-am62xx-evm-20240724073304.rootfs.wic.xz  rootfs.ext4
    root@am62xx-evm:~# pwd
    /home/root
    root@am62xx-evm:~# lsblk
    NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
    mtdblock0     31:0    0  512K  0 disk 
    mtdblock1     31:1    0    2M  0 disk 
    mtdblock2     31:2    0    4M  0 disk 
    mtdblock3     31:3    0  256K  0 disk 
    mtdblock4     31:4    0  256K  0 disk 
    mtdblock5     31:5    0 55.8M  0 disk 
    mtdblock6     31:6    0  256K  0 disk 
    mmcblk0      179:0    0 29.6G  0 disk 
    |-mmcblk0p1  179:1    0   32M  0 part 
    |-mmcblk0p2  179:2    0    2G  0 part 
    |-mmcblk0p3  179:3    0    2G  0 part 
    `-mmcblk0p4  179:4    0 25.6G  0 part 
    mmcblk0boot0 179:32   0 31.5M  1 disk 
    mmcblk0boot1 179:64   0 31.5M  1 disk 
    mmcblk1      179:96   0 28.9G  0 disk 
    |-mmcblk1p1  179:97   0  128M  0 part /boot
    `-mmcblk1p2  179:98   0  4.5G  0 part /
    root@am62xx-evm:~# ls /dev/mmcblk*
    /dev/mmcblk0  /dev/mmcblk0boot0  /dev/mmcblk0boot1  /dev/mmcblk0p1  /dev/mmcblk0p2  /dev/mmcblk0p3  /dev/mmcblk0p4  /dev/mmcblk0rpmb  /dev/mmcblk1  /dev/mmcblk1p1  /dev/mmcblk1p2
    root@am62xx-evm:~# dd if=/home/root/rootfs.ext4 of=/dev/mmcblk0p2 bs=4M conv=fsync                                                                                                                          
    [ 4878.325754] BUG: Bad page state in process dd  pfn:bc9a7
    [ 4878.331110] page:00000000ffbd2ccc refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xbc9a7
    [ 4878.340423] flags: 0x4(uptodate|zone=0)
    [ 4878.344270] raw: 0000000000000004 dead000000000100 dead000000000122 0000000000000000
    [ 4878.352004] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
    [ 4878.359732] page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set
    [ 4878.366160] Modules linked in: can_raw can iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_mangle iptable_filter bluetooth ecdh_generic ecc rpmsg_ctrl rpmsg_char snd_so6
    [ 4878.426388] CPU: 1 PID: 7267 Comm: dd Tainted: G           O       6.1.836.1.80-Raptee-g80e0894a8142 #1
    [ 4878.435767] Hardware name:  Raptee VCU v5.0  (DT)
    [ 4878.440460] Call trace:
    [ 4878.442905]  dump_backtrace.part.0+0xdc/0xf0
    [ 4878.447187]  show_stack+0x18/0x30
    [ 4878.450498]  dump_stack_lvl+0x68/0x84
    [ 4878.454157]  dump_stack+0x18/0x34
    [ 4878.457464]  bad_page+0xe8/0x110
    [ 4878.460689]  check_new_pages+0xe0/0x110
    [ 4878.464520]  rmqueue_bulk+0x240/0x844
    [ 4878.468176]  get_page_from_freelist+0xd14/0x1190
    [ 4878.472786]  __alloc_pages+0x138/0xe20
    [ 4878.476530]  __folio_alloc+0x1c/0x5c
    [ 4878.480102]  __filemap_get_folio+0x1e4/0x424
    [ 4878.484374]  pagecache_get_page+0x1c/0x7c
    [ 4878.488381]  grab_cache_page_write_begin+0x18/0x24
    [ 4878.493166]  block_write_begin+0x30/0x100
    [ 4878.497173]  blkdev_write_begin+0x28/0x34
    [ 4878.501180]  generic_perform_write+0xac/0x1ec
    [ 4878.505532]  __generic_file_write_iter+0x110/0x1a0
    [ 4878.510315]  blkdev_write_iter+0x100/0x1a0
    [ 4878.514405]  vfs_write+0x228/0x2b4
    [ 4878.517804]  ksys_write+0x6c/0x100
    [ 4878.521200]  __arm64_sys_write+0x1c/0x30
    [ 4878.525119]  invoke_syscall+0x48/0x114
    [ 4878.528863]  el0_svc_common.constprop.0+0xd4/0xfc
    [ 4878.533561]  do_el0_svc+0x20/0x30
    [ 4878.536871]  el0_svc+0x28/0xa0
    [ 4878.539920]  el0t_64_sync_handler+0xbc/0x140
    [ 4878.544187]  el0t_64_sync+0x18c/0x190
    [ 4878.547843] Disabling lock debugging due to kernel taint
    [ 4879.675285] BUG: Bad page state in process dd  pfn:c12a7
    [ 4879.680658] page:00000000adfe40f3 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc12a7
    [ 4879.689978] flags: 0x4(uptodate|zone=0)
    [ 4879.693827] raw: 0000000000000004 dead000000000100 dead000000000122 0000000000000000
    [ 4879.701568] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
    [ 4879.709295] page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set
    [ 4879.715730] Modules linked in: can_raw can iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_mangle iptable_filter bluetooth ecdh_generic ecc rpmsg_ctrl rpmsg_char snd_so6
    [ 4879.775976] CPU: 1 PID: 7267 Comm: dd Tainted: G    B      O       6.1.836.1.80-Raptee-g80e0894a8142 #1
    [ 4879.785357] Hardware name:  Raptee VCU v5.0  (DT)
    [ 4879.790051] Call trace:
    [ 4879.792492]  dump_backtrace.part.0+0xdc/0xf0
    [ 4879.796784]  show_stack+0x18/0x30
    [ 4879.800097]  dump_stack_lvl+0x68/0x84
    [ 4879.803756]  dump_stack+0x18/0x34
    [ 4879.807063]  bad_page+0xe8/0x110
    [ 4879.810287]  check_new_pages+0xe0/0x110
    [ 4879.814115]  rmqueue_bulk+0x240/0x844
    [ 4879.817771]  get_page_from_freelist+0xd14/0x1190
    [ 4879.822382]  __alloc_pages+0x390/0xe20
    [ 4879.826125]  __folio_alloc+0x1c/0x5c
    [ 4879.829694]  __filemap_get_folio+0x1e4/0x424
    [ 4879.833966]  pagecache_get_page+0x1c/0x7c
    [ 4879.837974]  grab_cache_page_write_begin+0x18/0x24
    [ 4879.842759]  block_write_begin+0x30/0x100
    [ 4879.846770]  blkdev_write_begin+0x28/0x34
    [ 4879.850778]  generic_perform_write+0xac/0x1ec
    [ 4879.855128]  __generic_file_write_iter+0x110/0x1a0
    [ 4879.859910]  blkdev_write_iter+0x100/0x1a0
    [ 4879.864001]  vfs_write+0x228/0x2b4
    [ 4879.867400]  ksys_write+0x6c/0x100
    [ 4879.870796]  __arm64_sys_write+0x1c/0x30
    [ 4879.874714]  invoke_syscall+0x48/0x114
    [ 4879.878458]  el0_svc_common.constprop.0+0xd4/0xfc
    [ 4879.883157]  do_el0_svc+0x20/0x30
    [ 4879.886466]  el0_svc+0x28/0xa0
    [ 4879.889513]  el0t_64_sync_handler+0xbc/0x140
    [ 4879.893775]  el0t_64_sync+0x18c/0x190
    [ 4879.910258] BUG: Bad page state in process dd  pfn:c13a7
    [ 4879.915611] page:00000000062d07a1 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xc13a7
    [ 4879.924923] flags: 0x4(uptodate|zone=0)
    [ 4879.928774] raw: 0000000000000004 dead000000000100 dead000000000122 0000000000000000
    [ 4879.936505] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
    [ 4879.944231] page dumped because: PAGE_FLAGS_CHECK_AT_PREP flag(s) set
    [ 4879.950656] Modules linked in: can_raw can iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_mangle iptable_filter bluetooth ecdh_generic ecc rpmsg_ctrl rpmsg_char snd_so6
    [ 4880.010881] CPU: 1 PID: 7267 Comm: dd Tainted: G    B      O       6.1.836.1.80-Raptee-g80e0894a8142 #1
    [ 4880.020260] Hardware name:  Raptee VCU v5.0  (DT)
    [ 4880.024959] Call trace:
    [ 4880.027397]  dump_backtrace.part.0+0xdc/0xf0
    [ 4880.031693]  show_stack+0x18/0x30
    [ 4880.035005]  dump_stack_lvl+0x68/0x84
    [ 4880.038666]  dump_stack+0x18/0x34
    [ 4880.041973]  bad_page+0xe8/0x110
    [ 4880.045197]  check_new_pages+0xe0/0x110
    [ 4880.049026]  rmqueue_bulk+0x240/0x844
    [ 4880.052682]  get_page_from_freelist+0xd14/0x1190
    [ 4880.057297]  __alloc_pages+0x390/0xe20
    [ 4880.061041]  __folio_alloc+0x1c/0x5c
    [ 4880.064609]  __filemap_get_folio+0x1e4/0x424
    [ 4880.068874]  pagecache_get_page+0x1c/0x7c
    [ 4880.072881]  grab_cache_page_write_begin+0x18/0x24
    [ 4880.077666]  block_write_begin+0x30/0x100
    [ 4880.081674]  blkdev_write_begin+0x28/0x34
    [ 4880.085681]  generic_perform_write+0xac/0x1ec
    [ 4880.090030]  __generic_file_write_iter+0x110/0x1a0
    [ 4880.094812]  blkdev_write_iter+0x100/0x1a0
    [ 4880.098903]  vfs_write+0x228/0x2b4
    [ 4880.102302]  ksys_write+0x6c/0x100
    [ 4880.105699]  __arm64_sys_write+0x1c/0x30
    [ 4880.109616]  invoke_syscall+0x48/0x114
    [ 4880.113366]  el0_svc_common.constprop.0+0xd4/0xfc
    [ 4880.118064]  do_el0_svc+0x20/0x30
    [ 4880.121372]  el0_svc+0x28/0xa0
    [ 4880.124425]  el0t_64_sync_handler+0xbc/0x140
    [ 4880.128687]  el0t_64_sync+0x18c/0x190
    282+1 records in
    282+1 records out
    1184227328 bytes (1.2 GB, 1.1 GiB) copied, 13.9642 s, 84.8 MB/s
    root@am62xx-evm:~# ls
    agl-ivi-demo-platform-flutter-am62xx-evm-20240724073304.rootfs.wic.xz  rootfs.ext4  rootfs1.ext4
    root@am62xx-evm:~# dd if=/home/root/rootfs1.ext4 of=/dev/mmcblk0p3 bs=4M conv=fsync                                                                                                                                 
    [10722.387390] ------------[ cut here ]------------
    [10722.392064] kernel BUG at fs/buffer.c:349!
    [10722.396185] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
    [10722.402985] Modules linked in: can_raw can iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c iptable_mangle iptable_filter bluetooth ecdh_generic ecc rpmsg_ctrl rpmsg_char snd_soc_simpl6
    [10722.463246] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G    B      O       6.1.836.1.80-Raptee-g80e0894a8142 #1
    [10722.472990] Hardware name:  Raptee VCU v5.0  (DT)
    [10722.477699] pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [10722.484675] pc : end_buffer_async_write+0x19c/0x1b0
    [10722.489595] lr : end_bio_bh_io_sync+0x34/0x74
    [10722.493970] sp : ffff800008003e20
    [10722.497284] x29: ffff800008003e20 x28: ffff8000095c3240 x27: ffff8000095b99e0
    [10722.504428] x26: ffff8000093479f0 x25: 0000000000019000 x24: 000000000000000a
    [10722.511570] x23: 0000000000000000 x22: ffff000003cc3c80 x21: ffff8000095b99e0
    [10722.518718] x20: ffff800009346008 x19: ffff0000258ae700 x18: 0000000000000000
    [10722.525868] x17: ffff80006df51000 x16: ffff800008000000 x15: 0000000000000001
    [10722.533018] x14: 0000000000000000 x13: 00000000000003fb x12: 00000000110330d9
    [10722.540160] x11: 0000000000000040 x10: ffff000000004370 x9 : 0000000000000001
    [10722.547310] x8 : 0000000000000230 x7 : ffff80006df51000 x6 : ffffffffffffffff
    [10722.554490] x5 : fffffffffffd65cb x4 : 0000000000000000 x3 : ffffffffffffffff
    [10722.561640] x2 : 0000000000000019 x1 : 0000000000000001 x0 : ffff000024f5f6e8
    [10722.568781] Call trace:
    [10722.571229]  end_buffer_async_write+0x19c/0x1b0
    [10722.575788]  bio_endio+0x178/0x220
    [10722.579223]  blk_update_request+0x1e0/0x490
    [10722.583460]  mmc_blk_cqe_complete_rq+0xfc/0x170
    [10722.588068]  mmc_blk_mq_complete+0x2c/0x50
    [10722.592210]  blk_complete_reqs+0x54/0x70
    [10722.596173]  blk_done_softirq+0x20/0x30
    [10722.600067]  _stext+0x120/0x3b0
    [10722.603279]  ____do_softirq+0x10/0x20
    [10722.607000]  call_on_irq_stack+0x24/0x4c
    [10722.610933]  do_softirq_own_stack+0x1c/0x30
    [10722.615141]  __irq_exit_rcu+0xb4/0xe0
    [10722.618876]  irq_exit_rcu+0x10/0x20
    [10722.622416]  el1_interrupt+0x38/0x70
    [10722.626007]  el1h_64_irq_handler+0x18/0x2c
    [10722.630133]  el1h_64_irq+0x64/0x68
    [10722.633588]  arch_cpu_idle+0x18/0x2c
    [10722.637181]  default_idle_call+0x4c/0x178
    [10722.641203]  do_idle+0x248/0x2b4
    [10722.644449]  cpu_startup_entry+0x38/0x40
    [10722.648386]  rest_init+0xec/0xf0
    [10722.651628]  arch_post_acpi_subsys_init+0x0/0x18
    [10722.656258]  start_kernel+0x6b0/0x6f4
    [10722.659934]  __primary_switched+0xbc/0xc4
    [10722.663973] Code: b2780021 c8027c01 35ffffa2 17ffffab (d4210000) 
    [10722.670069] ---[ end trace 0000000000000000 ]---
    [10722.674700] Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt
    [10722.682097] SMP: stopping secondary CPUs
    [10722.686063] Kernel Offset: disabled
    [10722.689549] CPU features: 0x00000,00800084,0000420b
    [10722.694419] Memory Limit: none
    [10722.697475] ---[ end Kernel panic - not syncing: Oops - BUG: Fatal exception in interrupt ]---
    

    Regards,

    Suraj Singh

  • Hello Prashant,

    I flashed EXT4 filesystem image (.ext4) to the mmcblk0p2 and mmcblk0p3 both partitions 
    My objective is to flash two different images into two different rootfs partition and then need to boot the board from any one of them based on what am i choose the option but should boot the board from both partitions. Now can u check it out my u-boot environment which i have attached.

    Modifications in U-Boot Environment:-

    I created boot configuration for p2 and p3 partitions.
    I set up a variable to choose which configuration to use.
    I updated the main bootcmd to use this selection mechanism.

    => printenv
    addr_fit=0x90000000
    arch=arm
    args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${nbootpart} root=${nbootvolume} rootfstype=ubifs
    args_ospi_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${ospi_nand_bootpart} root=${ospi_nand_bootvolume} rootfstype=ubifs
    baudrate=115200
    board=am62x
    board_name=am62b_p1_skevm
    board_rev=unknown
    board_serial=unknown
    board_software_revision=unknown
    boot=mmc
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_ri
    boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_partition=2
    boot_prefixes=/ /boot/
    boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init; run boot_rprocs_mmc; fi;
    boot_rprocs_mmc=env set rproc_id; env set rproc_fw; env set secure_suffix; if test ${secure_rprocs} -eq 1; then env set secure_suffix -sec; fi; for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}"e
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_syslinux_conf=extlinux/extlinux.conf
    boot_targets=ti_mmc mmc0 mmc1 usb0 pxe dhcp 
    bootargs=console=ttyS2,115200n8 root=PARTUUID= rw rootfstype=ext4 rootwait
    bootcmd=if test ${boot_partition} = 2; then run bootcmd_p2; else run bootcmd_p3; fi
    bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_a;
    bootcmd_mmc0=devnum=0; run mmc_boot
    bootcmd_mmc1=devnum=1; run mmc_boot
    bootcmd_p2=setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}; mmc dev 1; mmc rescan; load mmc 1:2 ${loadaddr} ${bootdir}/${name_kern}; load mmc 1:2 ${fdta}
    bootcmd_p3=setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}; mmc dev 1; mmc rescan; load mmc 1:3 ${loadaddr} ${bootdir}/${name_kern}; load mmc 1:3 ${fdta}
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcmd_rootfs1=mmc dev 0; if mmc rescan; then echo Booting from mmc0:0:2 ...; load mmc 0:0:2 0x82000000 /boot/; load mmc 0:0:2 0x88000000 /boot/dtb/; booti 0x82000000 - 0x88000000; fi
    bootcmd_rootfs2=mmc dev 0; if mmc rescan; then echo Booting from mmc0:0:3 ...; load mmc 0:0:3 0x82000000 /boot/; load mmc 0:0:3 0x88000000 /boot/dtb/; booti 0x82000000 - 0x88000000; fi
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; ;
    bootcmd_usb0=devnum=0; run usb_boot
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootm_size=0x10000000
    bootpart=0:3
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyS2,115200n8
    cpu=armv8
    default_device_tree=ti/k3-am625-sk.dtb
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1; rootfs part 0 1; tiboot3.bin.raw raw 0x0 0x400 mmcpart 1; tispl.bin.raw raw 0x400 0x1000 mmcpart 1; u-boot.img.raw raw 0x1400 0x2000 mmcpart 1; u-env.r1
    dfu_alt_info_mmc=boot part 1 1; rootfs part 1 2; tiboot3.bin fat 1 1; tispl.bin fat 1 1; u-boot.img fat 1 1; uEnv.txt fat 1 1; sysfw.itb fat 1 1
    dfu_alt_info_nand=NAND.tiboot3 part 0 1; NAND.tispl part 0 2; NAND.tiboot3.backup part 0 3; NAND.u-boot part 0 4; NAND.u-boot-env part 0 5; NAND.u-boot-env.backup part 0 6; NAND.file-system part 0 7
    dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000; tispl.bin raw 0x080000 0x200000; u-boot.img raw 0x280000 0x400000; u-boot-env raw 0x680000 0x020000; sysfw.itb raw 0x6c0000 0x100000; rootfs raw 0x800000 00
    dfu_alt_info_ospi_nand=ospi_nand.tiboot3 part 1; ospi_nand.tispl part 2; ospi_nand.u-boot part 3; ospi_nand.env part 4; ospi_nand.env.backup part 5; ospi_nand.rootfs part 6; ospi_nand.phypattern part 7
    dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000; u-boot.img ram 0x81000000 0x400000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    dorprocboot=0
    dtboaddr=0x89000000
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadbootscript; then run bootscript; else if run loadbootenv; then echo Loaded env from ${bootenvfile}; run im;
    ethaddr=98:03:8a:7f:4c:8e
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=fd5e7600
    fdtoverlay_addr_r=0x89000000
    fileaddr=82000000
    filesize=1f000
    findfdt=setenv name_fdt ${default_device_tree}; if test $board_name = am62x_skevm; then setenv name_fdt ti/k3-am625-sk.dtb; fi; if test $board_name = am62b_p1_skevm; then setenv name_fdt ti/k3-am625-sk.d}
    finduuid=part uuid ${boot} ${bootpart} uuid
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
    get_fdt_nand=ubifsload ${fdtaddr} ${bootdir}/${fdtfile};
    get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/dtb/${fdtfile};
    get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
    get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
    get_fit_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_overlaystring=for overlay in $name_overlays; do; setexpr name_fit_overlay gsub / _ conf-${overlay}; setenv overlaystring ${overlaystring}'#'${name_fit_overlay}; done;
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/ti/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_nand=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_ospi_nand=fdt address ${fdtaddr} fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/dtb/${overlay} && fdt apply ${dtboaddr}; done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_nand=run args_all args_nand ubi_init
    init_ospi_nand=run args_all args_ospi_nand ospi_nand_ubi_init
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; devtype=mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadimage; then run args_mmc; if test ${boot_fit} -eq 1; then run run_fit; else;
    mmcdev=0
    mmcloados=if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT;
    mmcrootfstype=ext4 rootwait
    mtdids=spi-nand0=spi-nand0,nand0=omap2-nand.0
    mtdparts=mtdparts=spi-nand0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),98048k@32m(ospi.rootfs),256k@130816k(ospi.phypattern);omap2-nand.0:2m(NAND.tiboot3),2m(N)
    name_fit=fitImage
    name_kern=Image
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait
    nbootpart=NAND.file-system
    nbootvolume=ubi0:rootfs
    ospi_nand_bootpart=ospi_nand.rootfs
    ospi_nand_bootvolume=ubi0:rootfs
    ospi_nand_ubi_init=ubi part ${ospi_nand_bootpart}; ubifsmount ${ospi_nand_bootvolume};
    partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rd_spec=-
    rdaddr=0x88080000
    rproc_fw_binaries= 0 /lib/firmware/am62-mcu-m4f0_0-fw
    rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id}; fi; fi
    run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpartt
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_ee
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuini
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRe
    scriptaddr=0x80000000
    secure_rprocs=0
    serial#=0000000000000000
    soc=k3
    splashfile=ti_logo_414x97_32bpp.bmp.gz
    splashimage=0x80200000
    splashpos=m,m
    splashsource=mmc
    ubi_init=ubi part ${nbootpart}; ubifsmount ${nbootvolume};
    update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}
    usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
    vendor=ti
    

    Regards,

    Suraj Singh

  • Hello Prashant,

    => ls mmc 0:1       
    => ls mmc 0:2       
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    => ls mmc 0:3
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    

    I am trying to flash the boot loader to the eMMC first partition i.e. mmcblk0p1, because of not having writable permission it's unable to flash boot loader can you please suggest any approaches!  

    Regards,

    Suraj Singh

  • Hello Prashant,

    I am trying to flash the boot loader to the eMMC first partition i.e. mmcblk0p1, because of not having writable permission it's unable to flash boot loader can you please suggest any approaches!  

    Please give any approach to complete this, thanks for considering.

  • Hello Prashant,

    I am closing this thread, Thanks for considering.

    Best Regards,

    Suraj Singh

  • Hi Suraj,

    Apologies for the inactivity on the thread.

    Modifications in U-Boot Environment:-

    I would not recommend doing those many changes in the U-Boot Environment. Instead, you may just set the mmcdev and bootpart variable to the partition you want to boot from as explained here

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1197888/am6412-emmc-partition-for-multiple-root-file-systems/4525880#4525880

    I am trying to flash the boot loader to the eMMC first partition i.e. mmcblk0p1, because of not having writable permission it's unable to flash boot loader

    If you not have not already solved this, please share the relevant logs.

    Regards,

    Prashant

  • Hello Prashant,

    Now I consider you my friend because you are the one who solves my problems every time, so please do not embarrass me by saying sorry.

    Now I want to boot the board from the second partition of the eMMC,i.e rootfs1 so for that the boot loader should be present in the first partition mmcblk0p1.If boot loader is present in this partition mmcblk0boot0, then I want to know how board can boot from emmc!

    And also rying to flash the boot loader to the eMMC first partition i.e. mmcblk0p1, because of not having writable permission it's unable to flash boot loader.Please find attached logs.

    root@am62xx-evm:~# lsblk
    NAME         MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
    mtdblock0     31:0    0  512K  0 disk 
    mtdblock1     31:1    0    2M  0 disk 
    mtdblock2     31:2    0    4M  0 disk 
    mtdblock3     31:3    0  256K  0 disk 
    mtdblock4     31:4    0  256K  0 disk 
    mtdblock5     31:5    0 55.8M  0 disk 
    mtdblock6     31:6    0  256K  0 disk 
    mmcblk0      179:0    0 29.6G  0 disk 
    |-mmcblk0p1  179:1    0   32M  0 part 
    |-mmcblk0p2  179:2    0    2G  0 part 
    |-mmcblk0p3  179:3    0    2G  0 part 
    `-mmcblk0p4  179:4    0 25.6G  0 part 
    mmcblk0boot0 179:32   0 31.5M  1 disk 
    mmcblk0boot1 179:64   0 31.5M  1 disk 
    mmcblk1      179:96   0 28.9G  0 disk 
    |-mmcblk1p1  179:97   0  128M  0 part /boot
    `-mmcblk1p2  179:98   0  4.5G  0 part /
    root@am62xx-evm:~# echo 0 > /sys/class/block/mmcblk0/force_ro
    mmcblk0/      mmcblk0boot0/ mmcblk0boot1/ mmcblk0p1/    mmcblk0p2/    mmcblk0p3/    mmcblk0p4/    
    root@am62xx-evm:~# echo 0 > /sys/class/block/mmcblk0p1/force_ro                                                                                                                                             
    mmcblk0p1/
    root@am62xx-evm:~# echo 0 > /sys/class/block/mmcblk0p1/force_ro
    -sh: /sys/class/block/mmcblk0p1/force_ro: Permission denied
    root@am62xx-evm:~# dd if=/boot/tiboot3.bin of=/dev/mmcblk0boot0 count=1024 conv=fsync
    dd: writing to '/dev/mmcblk0boot0': Operation not permitted
    1+0 records in
    0+0 records out
    0 bytes copied, 0.00254288 s, 0.0 kB/s
    root@am62xx-evm:~# dd if=/boot/tispl.bin of=/dev/mmcblk0boot0 seek=1024 count=3072 conv=fsync
    dd: writing to '/dev/mmcblk0boot0': Operation not permitted
    1+0 records in
    0+0 records out
    0 bytes copied, 0.00291954 s, 0.0 kB/s
    root@am62xx-evm:~# dd if=/boot/u-boot.img of=/dev/mmcblk0boot0 seek=5120 count=3072 conv=fsync
    dd: writing to '/dev/mmcblk0boot0': Operation not permitted
    1+0 records in
    0+0 records out
    0 bytes copied, 0.00238804 s, 0.0 kB/s
    

    It is showing copied but boot loader is not flashed into mmcblk0p1.

    => ls mmc 0:1       
    => ls mmc 0:2       
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    => ls mmc 0:3
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    => ls mmc 0:4

    Best Regards,

    Suraj Singh

  • Hi Suraj,

    Thanks for understanding. We are always here and happy as well to help you out in your development with our products!!

    Now, since you have partitioned using GPT partition table, you may not flash the bootloader images to the eMMC UDA first partition (mmcblk0p1) because the AM62x ROM doesn't support booting from GPT partitions.

    Instead, you should flash the U-Boot images to eMMC Boot0 partition and use the eMMC alternate bootmode.

    The procedure to flash the U-Boot images to eMMC Boot0 partitions is described here

     https://dev.ti.com/tirex/content/am62x_academy_9_02_00_00_v1/_build_am62x_academy_9_02_00_00_v1/source/linux/ch-develop/dev-flash-linux-emmc.html#flash-u-boot-to-emmc

    Regards,

    Prashant

  • Hello Prashant,

    dev.ti.com/.../dev-flash-linux-emmc.html

    I followed this and then ext4 partition is created,

    tar -xvf ~/<Linux image file copied from the host> after this it's extracting but at the last moment is showing
    ./usr/share/vim/vim90/spell/check_locales.vim
    ./usr/share/vim/vim90/spell/cleanadd.vim
    ./usr/share/vim/vim90/spell/en.ascii.spl
    ./usr/share/vim/vim90/spell/en.ascii.sug
    ./usr/share/vim/vim90/spell/en.latin1.spl
    ./usr/share/vim/vim90/spell/en.latin1.sug
    ./usr/share/vim/vim90/spell/en.utf-8.spl
    tar: unexpected end of file
    tar: short read


    Next, as i told you before I am trying to switch between the two Rootfs and boot the board so first i extracts the contents of the Linux image
    into the first partition of emmc(mmcblk0p1), as it is i was trying to extracts the different linux image into the second partition(mmcblk0p2)
    but it shows like this.
    root@am62xx-evm:~# mkfs.ext4 /dev/mmcblk0p2
    mke2fs 1.46.5 (30-Dec-2021)
    Discarding device blocks: done                            
    Creating filesystem with 786432 4k blocks and 196608 inodes
    Filesystem UUID: 69dee69a-51d6-4123-adb9-ffd9a4b5c5c4
    Superblock backups stored on blocks: 
            32768, 98304, 163840, 229376, 294912
    
    Allocating group tables: done                            
    Writing inode tables: done                            
    Creating journal (16384 blocks): done
    Writing superblocks and filesystem accounting information: done 
    
    root@am62xx-evm:~# mkdir -p /mnt/temp2
    mkdir: cannot create directory '/mnt/temp2': No space left on device
    root@am62xx-evm:~# ^C
    root@am62xx-evm:~# df -h                                                                         
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/root       4.3G  4.3G     0 100% /
    devtmpfs        896M     0  896M   0% /dev
    tmpfs           961M     0  961M   0% /dev/shm
    tmpfs           385M   11M  374M   3% /run
    tmpfs           4.0M     0  4.0M   0% /sys/fs/cgroup
    tmpfs           961M     0  961M   0% /tmp
    tmpfs           961M  392K  961M   1% /var/volatile
    /dev/mmcblk1p1  128M   28M  101M  22% /boot
    tmpfs           193M     0  193M   0% /run/user/0
    

    For first partition temp1 i have created and for second partition temp2 but it shows no space left!

    Best Regards,
    SurajSingh

     

  • Hello Prashant,

    Part    Start Sector    Num Sectors     UUID            Type
      1     2048            6289409         e087491c-01     83
      2     6293504         6291456         e087491c-02     83
    => mmc dev 0 0
    switch to partitions #0, OK
    mmc0(part 0) is current device
    => ls mmc 0:1
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    => ls mmc 0:2
    <DIR>       4096 .
    <DIR>       4096 ..
    <DIR>      16384 lost+found
    <SYM>          7 bin
    <DIR>       4096 boot
    <DIR>       4096 dev
    <DIR>       4096 etc
    <DIR>       4096 home
    <SYM>          7 lib
                   7 log_lock.pid
    <DIR>       4096 media
    <DIR>       4096 mnt
    <DIR>       4096 proc
    <DIR>       4096 run
    <SYM>          8 sbin
    <DIR>       4096 srv
    <DIR>       4096 sys
    <DIR>       4096 tmp
    <DIR>       4096 usr
    <DIR>       4096 var
    => setenv mmcdev 0
    => setenv bootpart 0:1
    => boot
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    Failed to load 'boot.scr'
    Can't set block device
    ## Error: "main_cpsw0_qsgmii_phyinit" not defined
    25047552 bytes read in 152 ms (157.2 MiB/s)
    60941 bytes read in 16 ms (3.6 MiB/s)
    Working FDT set to 88000000
    Bad Linux ARM64 Image magic!
    switch to partitions #0, OK
    mmc0(part 0) is current device
    Scanning mmc 0:1...
    Working FDT set to 88000000
    MMC: no card present
    No EFI system partition
    No EFI system partition
    Failed to persist EFI variables
    "Synchronous Abort" handler, esr 0x96000044
    elr: 0000000080858f50 lr : 0000000080858eec (reloc)
    elr: 00000000fff5ef50 lr : 00000000fff5eeec
    x0 : 00000000fdf02980 x1 : ffffffffff700000
    x2 : fffffffffffca000 x3 : 0000000000000000
    x4 : 0000000000000000 x5 : 0000000000000000
    x6 : 00000000fdf02980 x7 : 0000000000000000
    x8 : 00000000fded7600 x9 : 0000000000000008
    x10: 00000000000024bc x11: 00000000fded4ecc
    x12: 0000000000002488 x13: 0000000000000000
    x14: 00000000fded7600 x15: 0000000000000002
    x16: 00000000fff5ef80 x17: 0000000000000000
    x18: 00000000fdee6d80 x19: 0000000000000000
    x20: 00000000fdeea650 x21: 00000000fded51c0
    x22: 00000000fffb5258 x23: 0000000000000003
    x24: 00000000fffe4334 x25: 0000000000000000
    x26: 0000000000000000 x27: 0000000000000000
    x28: 00000000fdf01fe0 x29: 00000000fded5160
    
    Code: f9401001 8b020022 eb02003f 54fffec2 (b8004433) 
    Resetting CPU ...
    
    
    
    
    
    
    U-Boot 2023.04-ti-gf9b966c67473 (May 06 2024 - 12:53:20 +0000)
    
    SoC:   AM62X SR1.0 HS-FS
    Model: Texas Instruments AM625 SK
    Board:  rev 
    DRAM:  no bloblist found!2 GiB
    Core:  72 devices, 32 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    => setenv mmcdev 0
    => setenv bootpart 0:2
    => boot
    switch to partitions #0, OK
    mmc0(part 0) is current device
    SD/MMC found on device 0
    Failed to load 'boot.scr'
    Can't set block device
    ## Error: "main_cpsw0_qsgmii_phyinit" not defined
    25047552 bytes read in 152 ms (157.2 MiB/s)
    60941 bytes read in 16 ms (3.6 MiB/s)
    Working FDT set to 88000000
    Bad Linux ARM64 Image magic!
    switch to partitions #0, OK
    mmc0(part 0) is current device
    Scanning mmc 0:1...
    Working FDT set to 88000000
    MMC: no card present
    No EFI system partition
    No EFI system partition
    Failed to persist EFI variables
    "Synchronous Abort" handler, esr 0x96000044
    elr: 0000000080858f50 lr : 0000000080858eec (reloc)
    elr: 00000000fff5ef50 lr : 00000000fff5eeec
    x0 : 00000000fdf02830 x1 : ffffffffff700000
    x2 : fffffffffffca000 x3 : 0000000000000000
    x4 : 0000000000000000 x5 : 0000000000000000
    x6 : 00000000fdf02830 x7 : 0000000000000000
    x8 : 00000000fded7600 x9 : 0000000000000008
    x10: 00000000000024bc x11: 00000000fded4ecc
    x12: 0000000000002488 x13: 0000000000000000
    x14: 00000000fded7600 x15: 0000000000000002
    x16: 00000000fff5ef80 x17: 0000000000000000
    x18: 00000000fdee6d80 x19: 0000000000000000
    x20: 00000000fdeea650 x21: 00000000fded51c0
    x22: 00000000fffb5258 x23: 0000000000000003
    x24: 00000000fffe4334 x25: 0000000000000000
    x26: 0000000000000000 x27: 0000000000000000
    x28: 00000000fdf01f20 x29: 00000000fded5160
    
    Code: f9401001 8b020022 eb02003f 54fffec2 (b8004433) 
    Resetting CPU ...
    

    Even i have tried to boot the board with both bootpart '1' , '2' but it is not booting.
    I have followed the way which you said, i have created 2 partitions into emmc and then i have flashed linux into the both partitions and also i have flashed the boot loader into the 'mmcblk0boot0' but even though board is not booting up.

    Best Regards,
    Suraj Singh

  • Hello Prashant,

    Please check it.Thanks for considering.

    U-Boot SPL 2023.04-ti-gf9b966c67473 (May 06 2024 - 12:53:20 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')
    SPL initial stack usage: 1856 bytes
    MMC: no card present
    ** Bad device specification mmc 1 **
    Couldn't find partition mmc 1:1
    Error: could not access storage.
    Trying to boot from MMC1
    Authentication passed
    Authentication passed
    
    => mmc info
    Device: mmc@fa10000
    Manufacturer ID: 13
    OEM: 4e
    Name: G1M15L 
    Bus Speed: 200000000
    Mode: HS200 (200MHz)
    Rd Block Len: 512
    MMC version 5.1
    High Capacity: Yes
    Capacity: 29.6 GiB
    Bus Width: 8-bit
    Erase Group Size: 512 KiB
    HC WP Group Size: 8 MiB
    User Capacity: 29.6 GiB WRREL
    Boot Capacity: 31.5 MiB ENH
    RPMB Capacity: 4 MiB ENH
    Boot area 0 is not write protected
    Boot area 1 is not write protected
    

    Best Regards,

    Suraj Singh

  • Hello Prashant,

    Please get back asap. Thanks for considering.

    Best Regards,

    Suraj Singh

  • Hi Suraj,

    25047552 bytes read in 152 ms (157.2 MiB/s)
    60941 bytes read in 16 ms (3.6 MiB/s)
    Working FDT set to 88000000
    Bad Linux ARM64 Image magic!

    This snap of your previously shared boot logs suggests that U-Boot could read the Linux Kernel & DTB successfully but aborted the boot because it could not verify the Linux Kernel image to be ARM64 executable.

    Regards,

    Prashant

  • Hello Prashant,

    Then what should i do now to approach this!

    And i have one concern i.e. in our customised built image in u-boot prompt "saveenv" command is not working, please this also have to resolve.

    Best Regards,

    Suraj Singh

  • Then what should i do now to approach this!

    How are you generating the Linux Kernel image?

    And i have one concern i.e. in our customised built image in u-boot prompt "saveenv" command is not working, please this also have to resolve.

    The "saveenv" command has been deprecated. You may modify the environment variables in the U-Boot source code if needed.

  • Hello Prashant,

    The "saveenv" command has been deprecated. You may modify the environment variables in the U-Boot source code if needed.

    Is there any alternative command to save the environment in u-boot itself.

    How are you generating the Linux Kernel image?

    I have used Yocto build image.

    Best Regards,

    Suraj Singh

  • Is there any alternative command to save the environment in u-boot itself.

    There is no other way. You will have to revive the "saveenv" command.

    I have used Yocto build image.

    Could you please share the Linux Kernel image that is flashed & apparently not booting?

  • Hello Prashant,

    Could you please share the Linux Kernel image that is flashed & apparently not booting?

    It is a compressed Linux Kernel image, Please find it asap.

    Best Regards,

    Suraj Singh

  • It is a compressed Linux Kernel image, Please find it asap.

    I am not seeing any files attached. Did you forget to attach?

    FYI, if you try to identify the Linux Kernel image on your host PC with the file command, you should get something like this

    ❯ file Image-6.1.83-ti-gc1c2f1971fbf
    Image-6.1.83-ti-gc1c2f1971fbf: Linux kernel ARM64 boot executable Image, little-endian, 4K pages

  • Hello Prashant,

    I have sent you kernel image in private. Please find attached file. 

    Best Regrads,

    Suraj Singh

  • Thanks for sharing the image!!

    It's working for me. So, I suspect some problem with your U-Boot environment. Can you run the "printenv" command & share the output?

  • Hello Prashant,

    => printenv
    addr_fit=0x90000000
    arch=arm
    args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${nbootpart} root=${nbootvolume} rootfstype=ubifs
    args_ospi_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${ospi_nand_bootpart} root=${ospi_nand_bootvolume} rootfstype=ubifs
    baudrate=115200
    board=am62x
    board_name=am62b_p1_skevm
    board_rev=unknown
    board_serial=unknown
    board_software_revision=unknown
    boot=mmc
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_ri
    boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init; run boot_rprocs_mmc; fi;
    boot_rprocs_mmc=env set rproc_id; env set rproc_fw; env set secure_suffix; if test ${secure_rprocs} -eq 1; then env set secure_suffix -sec; fi; for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}"e
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_syslinux_conf=extlinux/extlinux.conf
    boot_targets=ti_mmc mmc0 mmc1 usb0 pxe dhcp 
    bootcmd=run envboot; run distro_bootcmd;
    bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_a;
    bootcmd_mmc0=devnum=0; run mmc_boot
    bootcmd_mmc1=devnum=1; run mmc_boot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; ;
    bootcmd_usb0=devnum=0; run usb_boot
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootm_size=0x10000000
    bootpart=1:2
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyS2,115200n8
    cpu=armv8
    default_device_tree=ti/k3-am625-sk.dtb
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1; rootfs part 0 1; tiboot3.bin.raw raw 0x0 0x400 mmcpart 1; tispl.bin.raw raw 0x400 0x1000 mmcpart 1; u-boot.img.raw raw 0x1400 0x2000 mmcpart 1; u-env.r1
    dfu_alt_info_mmc=boot part 1 1; rootfs part 1 2; tiboot3.bin fat 1 1; tispl.bin fat 1 1; u-boot.img fat 1 1; uEnv.txt fat 1 1; sysfw.itb fat 1 1
    dfu_alt_info_nand=NAND.tiboot3 part 0 1; NAND.tispl part 0 2; NAND.tiboot3.backup part 0 3; NAND.u-boot part 0 4; NAND.u-boot-env part 0 5; NAND.u-boot-env.backup part 0 6; NAND.file-system part 0 7
    dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000; tispl.bin raw 0x080000 0x200000; u-boot.img raw 0x280000 0x400000; u-boot-env raw 0x680000 0x020000; sysfw.itb raw 0x6c0000 0x100000; rootfs raw 0x800000 00
    dfu_alt_info_ospi_nand=ospi_nand.tiboot3 part 1; ospi_nand.tispl part 2; ospi_nand.u-boot part 3; ospi_nand.env part 4; ospi_nand.env.backup part 5; ospi_nand.rootfs part 6; ospi_nand.phypattern part 7
    dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000; u-boot.img ram 0x81000000 0x400000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    dorprocboot=0
    dtboaddr=0x89000000
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadbootscript; then run bootscript; else if run loadbootenv; then echo Loaded env from ${bootenvfile}; run im;
    ethaddr=98:03:8a:7f:4c:89
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=fd5e7600
    fdtoverlay_addr_r=0x89000000
    findfdt=setenv name_fdt ${default_device_tree}; if test $board_name = am62x_skevm; then setenv name_fdt ti/k3-am625-sk.dtb; fi; if test $board_name = am62b_p1_skevm; then setenv name_fdt ti/k3-am625-sk.d}
    finduuid=part uuid ${boot} ${bootpart} uuid
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
    get_fdt_nand=ubifsload ${fdtaddr} ${bootdir}/${fdtfile};
    get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/dtb/${fdtfile};
    get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
    get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
    get_fit_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_overlaystring=for overlay in $name_overlays; do; setexpr name_fit_overlay gsub / _ conf-${overlay}; setenv overlaystring ${overlaystring}'#'${name_fit_overlay}; done;
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/ti/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_nand=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_ospi_nand=fdt address ${fdtaddr} fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/dtb/${overlay} && fdt apply ${dtboaddr}; done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_nand=run args_all args_nand ubi_init
    init_ospi_nand=run args_all args_ospi_nand ospi_nand_ubi_init
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; devtype=mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadimage; then run args_mmc; if test ${boot_fit} -eq 1; then run run_fit; else;
    mmcdev=1
    mmcloados=if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT;
    mmcrootfstype=ext4 rootwait
    mtdids=spi-nand0=spi-nand0,nand0=omap2-nand.0
    mtdparts=mtdparts=spi-nand0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),98048k@32m(ospi.rootfs),256k@130816k(ospi.phypattern);omap2-nand.0:2m(NAND.tiboot3),2m(N)
    name_fit=fitImage
    name_kern=Image
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait
    nbootpart=NAND.file-system
    nbootvolume=ubi0:rootfs
    ospi_nand_bootpart=ospi_nand.rootfs
    ospi_nand_bootvolume=ubi0:rootfs
    ospi_nand_ubi_init=ubi part ${ospi_nand_bootpart}; ubifsmount ${ospi_nand_bootvolume};
    partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rd_spec=-
    rdaddr=0x88080000
    rproc_fw_binaries= 0 /lib/firmware/am62-mcu-m4f0_0-fw
    rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id}; fi; fi
    run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpartt
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_ee
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuini
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRe
    scriptaddr=0x80000000
    secure_rprocs=0
    serial#=0000000000000000
    soc=k3
    splashfile=ti_logo_414x97_32bpp.bmp.gz
    splashimage=0x80200000
    splashpos=m,m
    splashsource=mmc
    ubi_init=ubi part ${nbootpart}; ubifsmount ${nbootvolume};
    update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}
    usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
    vendor=ti
    
    Environment size: 11336/126972 bytes
    

    I have attached U-Boot environment, Please find it.

    Thanks for considering.

    Best Regards,

    Suraj Singh

  • Hello,

    Are you sure this is the correct U-Boot environment because it doesn't have the correct commands in the "bootcmd_ti_mmc" environment variable?

    The "bootcmd_ti_mmc" variable should have been set like shown

    => printenv bootcmd_ti_mmc
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; run get_fit_overlaystring; run run_fit; else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;
    => 

    Regards,

    Prashant

  • Hello Prashant,

    The "bootcmd_ti_mmc" variable should have been set like shown

    => printenv bootcmd_ti_mmc
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; run get;
    

    This is the output now , how to solve this!

    Best Regards,

    Suraj Singh

  • This is the output now , how to solve this!

    What do you mean by the "output now"? Have you modified the U-Boot environment one way or another?

    With the U-Boot environment you shared, the U-Boot will not even load the Linux Kernel let alone failing to boot it.

  • Hello Prashant,

    Have you modified the U-Boot environment one way or another?

    I have tried to modify the U-Boot environment but the thing is "saveenv" command is not working in u-boot to save this modification! Can i add this modification into "ti/am62x/am62x.env" this file!

    Is there any other way to modify the u-boot environment!

    Best Regards,

    Suraj Singh

  • Hello Prashant,

    Whether i have to set the environment for every time booting or how can save the environment!

    Best Regards,

    Suraj Singh

  • Hello,

    I think you are not collecting the logs correctly? The logs you are sharing looks truncated probably because you don't have the line wrapping on in whatever UART terminal you are using.

    Please collect the logs from the command "printenv" properly & share the same.

    Thanks!

  • => printenv
    addr_fit=0x90000000
    arch=arm
    args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
    args_mmc=run finduuid;setenv bootargs console=${console} ${optargs} root=PARTUUID=${uuid} rw rootfstype=${mmcrootfstype}
    args_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${nbootpart} root=${nbootvolume} rootfstype=ubifs
    args_ospi_nand=setenv bootargs console=${console} ${optargs} ubi.mtd=${ospi_nand_bootpart} root=${ospi_nand_bootvolume} rootfstype=ubifs
    baudrate=115200
    board=am62x
    board_name=am62b_p1_skevm
    board_rev=unknown
    board_serial=unknown
    board_software_revision=unknown
    boot=mmc
    boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
    boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootaa64.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r}
     ${fdtcontroladdr};fi
    boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
    boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
    boot_fdt=try
    boot_fit=0
    boot_net_usb_start=usb start
    boot_prefixes=/ /boot/
    boot_rprocs=if test ${dorprocboot} -eq 1 && test ${boot} = mmc; then rproc init; run boot_rprocs_mmc; fi;
    boot_rprocs_mmc=env set rproc_id; env set rproc_fw; env set secure_suffix; if test ${secure_rprocs} -eq 1; then env set secure_suffix -sec; fi; for i in ${rproc_fw_binaries} ; do if test -z "${rproc_id}" 
    ; then env set rproc_id $i; else env set rproc_fw $i${secure_suffix}; run rproc_load_and_boot_one; env set rproc_id; env set rproc_fw; fi; done
    boot_script_dhcp=boot.scr.uimg
    boot_scripts=boot.scr.uimg boot.scr
    boot_syslinux_conf=extlinux/extlinux.conf
    boot_targets=ti_mmc mmc0 mmc1 usb0 pxe dhcp 
    bootcmd=run envboot; run distro_bootcmd;
    bootcmd_dhcp=devtype=dhcp; run boot_net_usb_start; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; setenv efi_old_vci ${bootp_vci};setenv efi_old_ar
    ch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00011:UNDI:003000;setenv bootp_arch 0xb;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr -q ${fdt_addr_r}; then bootefi
     ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_o
    ld_vci;
    bootcmd_mmc0=devnum=0; run mmc_boot
    bootcmd_mmc1=devnum=1; run mmc_boot
    bootcmd_pxe=run boot_net_usb_start; dhcp; if pxe get; then pxe boot; fi
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; r
    un get_fit_overlaystring; run run_fit; else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;
    bootcmd_usb0=devnum=0; run usb_boot
    bootdelay=2
    bootdir=/boot
    bootenvfile=uEnv.txt
    bootm_size=0x10000000
    bootpart=0:1
    bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
    console=ttyS2,115200n8
    cpu=armv8
    default_device_tree=ti/k3-am625-sk.dtb
    dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1; rootfs part 0 1; tiboot3.bin.raw raw 0x0 0x400 mmcpart 1; tispl.bin.raw raw 0x400 0x1000 mmcpart 1; u-boot.img.raw raw 0x1400 0x2000 mmcpart 1; u-env.ra
    w raw 0x3400 0x100 mmcpart 1; sysfw.itb.raw raw 0x3600 0x800 mmcpart 1
    dfu_alt_info_mmc=boot part 1 1; rootfs part 1 2; tiboot3.bin fat 1 1; tispl.bin fat 1 1; u-boot.img fat 1 1; uEnv.txt fat 1 1; sysfw.itb fat 1 1
    dfu_alt_info_nand=NAND.tiboot3 part 0 1; NAND.tispl part 0 2; NAND.tiboot3.backup part 0 3; NAND.u-boot part 0 4; NAND.u-boot-env part 0 5; NAND.u-boot-env.backup part 0 6; NAND.file-system part 0 7
    dfu_alt_info_ospi=tiboot3.bin raw 0x0 0x080000; tispl.bin raw 0x080000 0x200000; u-boot.img raw 0x280000 0x400000; u-boot-env raw 0x680000 0x020000; sysfw.itb raw 0x6c0000 0x100000; rootfs raw 0x800000 0x
    3800000
    dfu_alt_info_ospi_nand=ospi_nand.tiboot3 part 1; ospi_nand.tispl part 2; ospi_nand.u-boot part 3; ospi_nand.env part 4; ospi_nand.env.backup part 5; ospi_nand.rootfs part 6; ospi_nand.phypattern part 7
    dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000; u-boot.img ram 0x81000000 0x400000
    distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
    dorprocboot=0
    dtboaddr=0x89000000
    efi_dtb_prefixes=/ /dtb/ /dtb/current/
    envboot=mmc dev ${mmcdev}; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadbootscript; then run bootscript; else if run loadbootenv; then echo Loaded env from ${bootenvfile}; run imp
    ortbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi; fi; fi;
    ethaddr=98:03:8a:7f:4c:89
    fdt_addr_r=0x88000000
    fdtaddr=0x88000000
    fdtcontroladdr=fd5e7600
    fdtoverlay_addr_r=0x89000000
    findfdt=setenv name_fdt ${default_device_tree}; if test $board_name = am62x_skevm; then setenv name_fdt ti/k3-am625-sk.dtb; fi; if test $board_name = am62b_p1_skevm; then setenv name_fdt ti/k3-am625-sk.dt
    b; fi; if test $board_name = am62x_sip_skevm; then setenv name_fdt ti/k3-am625-sk.dtb; fi; if test $board_name = am62x_lp_skevm; then setenv name_fdt ti/k3-am62-lp-sk.dtb; fi; if test $board_name = am62x_
    beagleplay; then setenv name_fdt ti/k3-am625-beagleplay.dtb; fi; setenv fdtfile ${name_fdt}
    finduuid=part uuid ${boot} ${bootpart} uuid
    get_fdt_mmc=load mmc ${bootpart} ${fdtaddr} ${bootdir}/dtb/${name_fdt}
    get_fdt_nand=ubifsload ${fdtaddr} ${bootdir}/${fdtfile};
    get_fdt_ospi_nand=ubifsload ${fdtaddr} ${bootdir}/dtb/${fdtfile};
    get_fit_config=setexpr name_fit_config gsub / _ conf-${fdtfile}
    get_fit_mmc=load mmc ${bootpart} ${addr_fit} ${bootdir}/${name_fit}
    get_fit_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_ospi_nand=ubifsload ${addr_fit} ${bootdir}/${name_fit}
    get_fit_overlaystring=for overlay in $name_overlays; do; setexpr name_fit_overlay gsub / _ conf-${overlay}; setenv overlaystring ${overlaystring}'#'${name_fit_overlay}; done;
    get_kern_mmc=load mmc ${bootpart} ${loadaddr} ${bootdir}/${name_kern}
    get_kern_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_kern_ospi_nand=ubifsload ${loadaddr} ${bootdir}/${name_kern}
    get_overlay_mmc=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; load mmc ${bootpart} ${dtboaddr} ${bootdir}/dtb/ti/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_nand=fdt address ${fdtaddr}; fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/${overlay} && fdt apply ${dtboaddr}; done;
    get_overlay_ospi_nand=fdt address ${fdtaddr} fdt resize 0x100000; for overlay in $name_overlays; do; ubifsload ${dtboaddr} ${bootdir}/dtb/${overlay} && fdt apply ${dtboaddr}; done;
    importbootenv=echo Importing environment from mmc${mmcdev} ...; env import -t ${loadaddr} ${filesize}
    init_mmc=run args_all args_mmc
    init_nand=run args_all args_nand ubi_init
    init_ospi_nand=run args_all args_ospi_nand ospi_nand_ubi_init
    kernel_addr_r=0x82000000
    load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
    loadaddr=0x82000000
    loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenvfile}
    loadbootscript=load mmc ${mmcdev} ${loadaddr} boot.scr
    loadfdt=load ${devtype} ${bootpart} ${fdtaddr} ${bootdir}/dtb/${fdtfile}
    loadimage=load ${devtype} ${bootpart} ${loadaddr} ${bootdir}/${bootfile}
    mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
    mmcboot=mmc dev ${mmcdev}; devnum=${mmcdev}; devtype=mmc; if mmc rescan; then echo SD/MMC found on device ${mmcdev}; if run loadimage; then run args_mmc; if test ${boot_fit} -eq 1; then run run_fit; else 
    run mmcloados; fi; fi; fi;
    mmcdev=0
    mmcloados=if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run get_fdt_mmc; then bootz ${loadaddr} - ${fdtaddr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT;
     fi; fi; else bootz; fi;
    mmcrootfstype=ext4 rootwait
    mtdids=spi-nand0=spi-nand0,nand0=omap2-nand.0
    mtdparts=mtdparts=spi-nand0:512k(ospi.tiboot3),2m(ospi.tispl),4m(ospi.u-boot),256k(ospi.env),256k(ospi.env.backup),98048k@32m(ospi.rootfs),256k@130816k(ospi.phypattern);omap2-nand.0:2m(NAND.tiboot3),2m(NA
    ND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)
    name_fit=fitImage
    name_kern=Image
    nandargs=setenv bootargs console=${console} ${optargs} root=${nandroot} rootfstype=${nandrootfstype}
    nandboot=echo Booting from nand ...; run nandargs; nand read ${fdtaddr} NAND.u-boot-spl-os; nand read ${loadaddr} NAND.kernel; bootz ${loadaddr} - ${fdtaddr}
    nandroot=ubi0:rootfs rw ubi.mtd=NAND.file-system,2048
    nandrootfstype=ubifs rootwait
    nbootpart=NAND.file-system
    nbootvolume=ubi0:rootfs
    ospi_nand_bootpart=ospi_nand.rootfs
    ospi_nand_bootvolume=ubi0:rootfs
    ospi_nand_ubi_init=ubi part ${ospi_nand_bootpart}; ubifsmount ${ospi_nand_bootvolume};
    partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
    pxefile_addr_r=0x80100000
    ramdisk_addr_r=0x88080000
    rd_spec=-
    rdaddr=0x88080000
    rproc_fw_binaries= 0 /lib/firmware/am62-mcu-m4f0_0-fw
    rproc_load_and_boot_one=if load mmc ${bootpart} $loadaddr ${rproc_fw}; then if rproc load ${rproc_id} ${loadaddr} ${filesize}; then rproc start ${rproc_id}; fi; fi
    run_fit=run get_fit_config; bootm ${addr_fit}#${name_fit_config}${overlaystring}
    run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
    scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;run scan_dev_for_efi;
    scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart}
     bootfstype; then part uuid ${devtype} ${devnum}:${distro_bootpart} distro_bootpart_uuid ; run scan_dev_for_boot; fi; done; setenv devplist
    scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_ef
    i_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootaa64.efi; then echo Found EFI removable media binary efi/boot/bootaa64.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing.
    ..; fi; setenv efi_fdtfile
    scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_conf}; run boot_extlinux; echo EXTLINUX FAILED: continuing
    ...; fi
    scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRI
    PT FAILED: continuing...; fi; done
    scriptaddr=0x80000000
    secure_rprocs=0
    serial#=0000000000000000
    soc=k3
    splashfile=ti_logo_414x97_32bpp.bmp.gz
    splashimage=0x80200000
    splashpos=m,m
    splashsource=mmc
    ubi_init=ubi part ${nbootpart}; ubifsmount ${nbootvolume};
    update_to_fit=setenv loadaddr ${addr_fit}; setenv bootfile ${name_fit}
    usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
    vendor=ti
    
    Environment size: 11336/126972 bytes
    => printenv bootcmd_ti_mmc
    bootcmd_ti_mmc=run findfdt; run init_${boot}; if test ${do_main_cpsw0_qsgmii_phyinit} -eq 1; then run main_cpsw0_qsgmii_phyinit; fi; run boot_rprocs; if test ${boot_fit} -eq 1; then run get_fit_${boot}; r
    un get_fit_overlaystring; run run_fit; else; run get_kern_${boot}; run get_fdt_${boot}; run get_overlay_${boot}; run run_kern; fi;
    => saveenv
    Unknown command 'saveenv' - try 'help'
    => 
    
    

    Please collect the logs from the command "printenv" properly & share the same.

    Hello Prashant,

    Please find attached logs!

    Best Regards,

    Suraj Singh 

  • Hello,

    Now, the logs look good and the environment variables as well.

    When you run the boot command, do you still see the U-Boot failing to boot Linux Kernel? If so, can you once try booting the Linux Kernel manually with the following steps

    => load mmc ${bootpart} ${loadaddr} /boot/Image
    19376640 bytes read in 218 ms (84.8 MiB/s)
    => load mmc ${bootpart} ${fdtaddr} /boot/dtb/ti/k3-am625-sk.dtb
    59546 bytes read in 17 ms (3.3 MiB/s)
    => booti $loadaddr - $fdtaddr
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
    Working FDT set to 88000000
       Loading Device Tree to 000000008ffee000, end 000000008ffff899 ... OK
    Working FDT set to 8ffee000
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 6.1.83-ti-gc1c2f1971fbf (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Mon May 13 20:19:51 UTC 2024
    [    0.000000] Machine model: Texas Instruments AM625 SK

    Regards,

    Prashant

  • Hello Prashant,

    Thanks for helping. Now I have created two partitions in emmc and both have rootfs. The board is booting from both the partitions.

    Now my concern is that by default the board is booting from the first partition but if the board has to be booted from the second partition then should we boot the board without setting the environment in uboot?

    How will Uboot know for that whether we need to add any variable or we need  to add a config file!

    Best regards,

    Suraj Singh

  • Hello Prashant,

    Is there any way to tell the u-boot to boot the board by automated process means without giving command!

    Because end user or suppose any customer they won't be able to give command every time. In u-boot environment bootpart is defined as "0:1",  whether i need to add any variable or need to add a config file!

    Best Regards,

    Suraj Singh

  • Hello Prashant,

    can i add two variables into the uEnv.txt file first one is to detect the current boot partition and second variable to automatically switch between partitions and this will be the script which i can call in bootcmd variable? Whether it will reflect into u-boot environment that i have doubt!

    Please get back asap.

    Best Regards,

    Suraj Singh

  • Hello Prashant,

    I am closing this thread, Thanks for consideration.

    Best Regards,

    Suraj Singh