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.
Tool/software:
Hi Team
Hi Kishan,
Failed to load '//dtb/ti/k3-am62a7-sk.dtb'
U-Boot is looking for the kernel devicetree file under /boot/dtb/ti/ directory. Did you copy the file k3-am62a7-sk.dtb to the correct location before creating bootfs.img?
Hi Bin
Thank you for your response!
I have copied the boot directory from the file system to my build directory
tar -xvf tisdk-edgeai-image-am62axx-evm.tar.xz --strip-components=1 -C build/ /boot
Used below commands to create the bootfs.img
truncate -s 120M bootfs.img
dd if=/dev/null of=bootfs.img bs=1M seek=150
mkfs.ext4 -O ^metadata_csum -F bootfs.img
mkdir -p boot
sudo mount -t ext4 -o loop bootfs.img $(pwd)/boot
sudo cp -rv build/boot/* boot/
sync -f boot
sudo umount -l boot
using below command flashing the bootfs.img
Device:
> setenv dfu_alt_info ${dfu_alt_info_emmc}
> dfu 0 mmc 0
Host:
sudo dfu-util -a boot -D bootfs.img
kernel got tainted is there any other things I need to copy to boot directory or am I missing in flashing procedure?
Tainted kernel logs:
[ 3.542907] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
[ 3.551719] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
[ 3.559061] debugfs: Directory 'pd:182' with parent 'pm_genpd' already present!
[ 3.574179] ALSA device list:
[ 3.577243] No soundcards found.
[ 3.618855] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Quota mode: none.
[ 3.627472] VFS: Mounted root (ext4 filesystem) on device 179:1.
[ 3.634092] devtmpfs: error mounting -2
[ 3.638634] Freeing unused kernel memory: 1984K
[ 3.643269] Run /sbin/init as init process
[ 3.647565] Run /etc/init as init process
[ 3.651685] Run /bin/init as init process
[ 3.655773] Run /bin/sh as init process
[ 3.659659] Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for gui.
[ 3.673804] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 6.1.80-ti-g2e423244f8c0 #1
[ 3.681188] Hardware name: Texas Instruments AM62A7 SK (DT)
[ 3.686746] Call trace:
[ 3.689183] dump_backtrace.part.0+0xdc/0xf0
[ 3.693457] show_stack+0x18/0x30
[ 3.696767] dump_stack_lvl+0x68/0x84
[ 3.700426] dump_stack+0x18/0x34
[ 3.703735] panic+0x188/0x348
[ 3.706783] kernel_init+0x124/0x130
[ 3.710355] ret_from_fork+0x10/0x20
[ 3.713925] SMP: stopping secondary CPUs
[ 3.717844] Kernel Offset: disabled
[ 3.721320] CPU features: 0x00000,00800084,0000420b
[ 3.726186] Memory Limit: none
[ 3.729235] ---[ end Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rs-
Hi Kishan,
tar -xvf tisdk-edgeai-image-am62axx-evm.tar.xz --strip-components=1 -C build/ /boot
Used below commands to create the bootfs.img
truncate -s 120M bootfs.img
dd if=/dev/null of=bootfs.img bs=1M seek=150
If I am not wrong, are you trying to create a 120MB image file to host ~900MB eageai rootfs tarball?
Hi Bin
Do I need to create 900MB of bootfs.img ?
Only boot directory from the evm.tar.xz is enough or do we need to add anything else as well?
tar -xvf tisdk-edgeai-image-am62axx-evm.tar.xz --strip-components=1 -C build/ /boot
The size of bootfs.img should be big enough to host the rootfs of your choice, depending on the application of your project.
Hi Bin
Thank you,
is my bootfs.img creation is correct or do i need to add any other things in that?
Hi Kishan,
The command sequence to create the bootfs image seems to be correct, except you should know what file size to use, which is determined by the rootfs you use for your project. For example, the Processor SDK provides the following prebuilt rootfs images:
- tisdk-edgeai-image-am62axx-evm.tar.xz [899MB]
- tisdk-tiny-image-am62axx-evm.tar.xz [25MB]
Please note that these are compressed files. You would have to decompress it to see how much space is needed to host the root filesystem.
Hi Bin
Thank you very much for your support,
could you please guide me, how to flash the tar.xz file to emmc using dfu-util so I can flash complete device?
I am not able to find the exact steps to flash complete board over emmc using dfu-util.
tisdk-default-image-am62xx-evm.tar.xz
Hi Kishan,
Sorry, it is my bad, I didn't realize that your "flash_bootfs.sh" script only flashes to the eMMC boot partition, but not the rootfs, all our previous communication is invalid. Sorry for the confusion.
Can you please follow the instruction linked below for flashing the eMMC?
Hi Bin,
I am able to flash the rootfs system but if i generate bootfs.img with just Image and dtb file then i am not able to boot the device completely,
can you please share the process to prepare the kernel image and flash method using dfu-util ?
I am following below command to prepare the bootfs, where i copy Image and dtb file only
truncate -s 120M bootfs.img
dd if=/dev/null of=bootfs.img bs=1M seek=150
mkfs.ext4 -O ^metadata_csum -F bootfs.img
mkdir -p boot
sudo mount -t ext4 -o loop bootfs.img $(pwd)/boot
sudo cp -rv build/kishan/boot/* boot/
sync -f boot
sudo umount -l boot
Flash command:
# > setenv dfu_alt_info ${dfu_alt_info_emmc}
# > dfu 0 mmc 0
sudo dfu-util -a boot -D bootfs.img
In the e2e FAQ I linked above, it has the following instruction to create an rootfs image:
The following instructions can be used to prepare the <your_rootfs.ext4> using tisdk-base-image-am62xx-evm.tar.xz: $ cd <path-ti-psdk>/filesystem $ dd if=/dev/null of=tisdk-base.ext4 bs=1M seek=300 $ mkfs.ext4 -F tisdk-base.ext4 $ mkdir mnt_fs $ sudo mount -t ext4 tisdk-base.ext4 mnt_fs $ cd mnt_fs $ sudo tar xvf ../tisdk-base-image-am62xx-evm.tar.xz $ cd .. $ sudo umount mnt_fs
then you need the following command to flash the rootfs image to emmc. Please ensure you copied kernel image and dtb to the rootfs created using the instructions above.
$ sudo dfu-util -a rootfs -D <your_rootfs.ext4>
Hi Bin,
This step will flash full root file system I just want to flash the kernel and dtb.
I had tried this and flashed the device, but it will erase the complete device.
Is there any way we can prepare the bootfs.img and just update dtb and kernel image?
Hi Kishan,
To run Linux on the AM62Ax board, Linux rootfs is needed, where do you flash the rootfs to if bootfs.img has only kernel image and its dtb?
Hi Bin,
I have flashed the rootfs only, and this my question, can I flash only kernel and dtb image instead of rootfs?
because if I debug something in platform driver every time, I need to flash complete rootfs it erases everything's on device.
That is the reason to just flash kernel image and dtb on device.
Okay, now I understand the problem you are trying to resolve - just updating kernel in eMMC during software development.
I can think of two different solutions.
1. after initially flashed the entire Linux to eMMC and whenever you need to update the kernel image or dtb, boot your board from eMMC to Linux, then use whatever interface on your board to copy/download the individual files in Linux and write them to the corresponding locations in eMMC, then reboot your board. This is basically the same way that how to use a Linux computer.
Whenever the updated kernel image or dtb causes your board unable to boot, you would need to use DFU to flash the entire rootfs to recover.
-2. partition your eMMC to separate kernel image and dtb from the rootfs, so that both files are not in the rootfs. Then you can just use DFU to update the kernel image and dtb whenever you want to. You just need to modify U-Boot to load the kernel image and dtb from the new partition, but not from the rootfs.
Hi Bin,
Thank you very much for your support!
can you help to partition eMMC to separate kernel image and dtb from the rootf?
Any reference or steps would be appreciated.
Hi Kishan,
This is not supported in the SDK, so I don't have an example to show you. But I already explained it in my previous post, you should be able follow and implement it.
Hi Bin,
I have built the images using "MACHINE="am62axx-evm" bitbake -k tisdk-edgeai-image" command
and flash the rootfs from the below location but my kernel and dtb changes are not affected while booting the board.
build/deploy-ti/images/am62axx-evm/tisdk-edgeai-image-am62axx-evm-20240930132544.rootfs.tar.xz
Prepare the ext4 using below commands
mkdir -p mnt_fs
dd if=/dev/null of=tisdk-base.ext4 bs=1M seek=6144
mkfs.ext4 -F tisdk-base.ext4
sudo mount -t ext4 tisdk-base.ext4 mnt_fs
cd mnt_fs
sudo tar xvf ../tisdk-edgeai-image-am62axx-evm-20240930132544.rootfs.tar.xz
cd ../
sudo umount mnt_fs
flashing steps:
# U-Boot should be waiting for conneciton before running:
# > setenv dfu_alt_info ${dfu_alt_info_emmc}
# > dfu 0 mmc 0
sudo dfu-util -a rootfs -D tisdk-base.ext4
do i need to flash bootloader as explained in below command to flash my kernel and dtb ?
I have below configuration
ls -lrth /dev/block/platform/*
lrwxrwxrwx 1 root root 15 Jan 1 1970 /dev/block/platform/boot -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Jan 1 1970 /dev/block/platform/rootfs -> ../../mmcblk0p2
root@am62axx-evm:~# dmesg | grep -i 'mmc'
[ 0.982369] mmc0: CQHCI version 5.10
[ 1.023814] mmc0: SDHCI controller on fa10000.mmc [fa10000.mmc] using ADMA 64-bit
[ 1.098712] mmc0: Command Queue Engine enabled
[ 1.098730] mmc0: new HS200 MMC card at address 0001
[ 1.099359] mmcblk0: mmc0:0001 016G01 14.5 GiB
[ 1.102349] mmcblk0: p1 p2
[ 1.103025] mmcblk0boot0: mmc0:0001 016G01 8.00 MiB
[ 1.103919] mmcblk0boot1: mmc0:0001 016G01 8.00 MiB
[ 1.104808] mmcblk0rpmb: mmc0:0001 016G01 4.00 MiB, chardev (510:0)
[ 31.581167] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Quota mode: none.
[ 35.894032] EXT4-fs (mmcblk0p2): re-mounted. Quota mode: none.
[ 39.259037] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Quota mode: none.
lrwxrwxrwx 1 root root 15 Jan 1 1970 /dev/block/platform/boot -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Jan 1 1970 /dev/block/platform/rootfs -> ../../mmcblk0p2
Good, now your eMMC UDA has two partitions.
# > setenv dfu_alt_info ${dfu_alt_info_emmc}
I never did this, but you need to modify $dfu_alt_info_emmc, so that
sudo dfu-util -a rootfs -D tisdk-base.ext4
this "rootfs" points to mmcblk0p2, instead of mmcblk0 which is the default.
To dfu flash kernel image and dtb to mmcblk0p1, you need to add two entries to $dfu_alt_info_emmc so that both files can be written to mmcblk0p1 in FAT file format.
Hi Bin
Thank you for your reply!
I have print the env variables.
dfu_alt_info_emmc=rawemmc raw 0 0x800000 mmcpart 1; boot part 0 1; rootfs part 0 2; tiboot3.bin.raw raw 0x0 0x400 mmcpart 1; tispl.bin.raw raw 0x400 0x1000 mmcpart 1; u-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 07 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 0x6c000 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 par7 dfu_alt_info_ram=tispl.bin ram 0x80080000 0x200000; u-boot.img ram 0x81000000 0x400000
Hi Kishan,
Q1) could you please share how to update the "dfu_alt_info_emmc"?
I think you can refer to dfu_alt_info_mmc, which defines the files in FAT format.
Q2) do i need to flash bootloader as explained in below command to flash my kernel and dtb?
Yes, this way to flash u-boot binaries has no change. They are irrelevant to flashing kernel and dtb, which go to different partition and format.