How to flash bootloader,kernel and root-fs to sd-card and emmc for imx8m-mini dev board (imx8mmevk)?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to flash bootloader,kernel and root-fs to sd-card and emmc for imx8m-mini dev board (imx8mmevk)?

Jump to solution
674 Views
vivek338
Contributor IV

Hi,

Please guide me to flash boot-loader, dts, kernel and root-fs in sd-card as well as emmc for imx8m-mini evk.

Labels (1)
0 Kudos
1 Solution
644 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @vivek338 !

Let me provide the steps I have followed and tested on my side that should work.

Format SD card connected to my Linux PC, listed as sdb
$ sudo fdisk /dev/sdb
Type the following parameters (each followed by
p [lists the current partitions]


d [to delete existing partitions. Repeat this until no unnecessary partitions are reported by the 'p' command to start fresh.]


n [create a new partition]


p [create a primary partition - use for both partitions]


1 [the first partition]


20480 [starting at offset sector]


1024000 [ending position of the first partition to be used for the boot images]


p [to check the partitions]


n

p

2

1228800 [starting at offset sector, which leaves enough space for the kernel, the bootloader and its configuration data]


<enter> [using the default value will create a partition that extends to the last sector of the media]


p [to check the partitions]


w [this writes the partition table to the media and fdisk exits]

Change directory to where I have all my files, ubot, rootfs, dtb, etc.
$ cd LF_v5.15.32-2.0.0_images_imx8mnevk/

Copy bootloader to SD card
$ sudo dd if=imx-boot-imx8mnevk-sd.bin-flash_evk of=/dev/sdb bs=1k seek=32 conv=fsync

Create a VFAT partition where kernel and dtb will be stored
$ sudo mkfs.vfat /dev/sdb1

Create a directory where SD partition will be mounted; next mount the partition
$ mkdir mountpoint
$ sudo mount /dev/sdb1 mountpoint

Copy and rename kernel image and dtb (here the documentation is not clear, so this may be the cause of your issue) uboot expects that kernel image is named Image and dtb imx8mq-evk.dtb
$ sudo cp Image-imx8mnevk.bin ./mountpoint/Image
$ sudo cp imx8mq-evk.dtb ./mountpoint/imx8mq-evk.dtb

Unmount the partition
$ sudo umount mountpoint

Format partition that will store the root file system
$ sudo mkfs.ext4 /dev/sdb2

Mount the partiotion
$ sudo mount /dev/sdb2 mountpoint/

Create a directory and extract root file system
$ mkdir rootfs
$ cd rootfs/
$ tar -jxvf ../imx-image-full-imx8mnevk.tar.bz2

Copy root file system to the mounted partition
$ sudo cp -a * ../mountpoint

Unmount partition and sync
$ sudo umount ../mountpoint
$ sync

You may unplug your SD card now and try it on your board, if you find any issue please do let me know.

https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf

View solution in original post

0 Kudos
4 Replies
657 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @vivek338!
Thank you for contacting NXP Support!

You have to use a UUU tool.

You can download the tool and the documentation of this tool by following the link:

https://github.com/nxp-imx/mfgtools/releases/tag/uuu_1.5.125

You can download our precompiled images and the documentation on the next link:

https://www.nxp.com/design/design-center/software/embedded-software/i-mx-software/embedded-linux-for...


Best Regards!
Chavira

0 Kudos
654 Views
vivek338
Contributor IV

Hi @Chavira ,

Thanks for replying !

I am able to flash "*wic.bz2" file which contains whole thing i.e. boot-loader,kernel, dts and root-fs on sd-card as well as emmc. But I want to load boot-loader,kernel, dts and root-fs separately on sd-card and emmc.

I have go through IMXLUG, but it seems not much explainable or clear to me to how to do that. Following IMXLUG only bootloader is working, but its not loading kernel. It stucks on uboot.

Please guide on this, like documentation or link.

0 Kudos
645 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @vivek338 !

Let me provide the steps I have followed and tested on my side that should work.

Format SD card connected to my Linux PC, listed as sdb
$ sudo fdisk /dev/sdb
Type the following parameters (each followed by
p [lists the current partitions]


d [to delete existing partitions. Repeat this until no unnecessary partitions are reported by the 'p' command to start fresh.]


n [create a new partition]


p [create a primary partition - use for both partitions]


1 [the first partition]


20480 [starting at offset sector]


1024000 [ending position of the first partition to be used for the boot images]


p [to check the partitions]


n

p

2

1228800 [starting at offset sector, which leaves enough space for the kernel, the bootloader and its configuration data]


<enter> [using the default value will create a partition that extends to the last sector of the media]


p [to check the partitions]


w [this writes the partition table to the media and fdisk exits]

Change directory to where I have all my files, ubot, rootfs, dtb, etc.
$ cd LF_v5.15.32-2.0.0_images_imx8mnevk/

Copy bootloader to SD card
$ sudo dd if=imx-boot-imx8mnevk-sd.bin-flash_evk of=/dev/sdb bs=1k seek=32 conv=fsync

Create a VFAT partition where kernel and dtb will be stored
$ sudo mkfs.vfat /dev/sdb1

Create a directory where SD partition will be mounted; next mount the partition
$ mkdir mountpoint
$ sudo mount /dev/sdb1 mountpoint

Copy and rename kernel image and dtb (here the documentation is not clear, so this may be the cause of your issue) uboot expects that kernel image is named Image and dtb imx8mq-evk.dtb
$ sudo cp Image-imx8mnevk.bin ./mountpoint/Image
$ sudo cp imx8mq-evk.dtb ./mountpoint/imx8mq-evk.dtb

Unmount the partition
$ sudo umount mountpoint

Format partition that will store the root file system
$ sudo mkfs.ext4 /dev/sdb2

Mount the partiotion
$ sudo mount /dev/sdb2 mountpoint/

Create a directory and extract root file system
$ mkdir rootfs
$ cd rootfs/
$ tar -jxvf ../imx-image-full-imx8mnevk.tar.bz2

Copy root file system to the mounted partition
$ sudo cp -a * ../mountpoint

Unmount partition and sync
$ sudo umount ../mountpoint
$ sync

You may unplug your SD card now and try it on your board, if you find any issue please do let me know.

https://www.nxp.com/docs/en/user-guide/IMX_LINUX_USERS_GUIDE.pdf

0 Kudos
622 Views
vivek338
Contributor IV

Hi @Chavira ,

Thanks a lot for your support!!

Now I am able to boot board, also I need to do same on emmc.How to do same process for emmc on board.

Please help !

0 Kudos