Yocto build and SD card flashing guideline for iMX8M Plus

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

Yocto build and SD card flashing guideline for iMX8M Plus

Jump to solution
861 Views
soumyakk
Contributor II

We want to create a Yocto build for iMX8M Plus. We are following the instructions as mentioned in the following user guide.

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

The issue is we are confused as to which machine name do we need to use:

1. imx8mp-lpddr4-evk
2. imx8mp-ddr4-evk

For the moment we have used imx8mp-lpddr4-evk. For the distro we have used fsl-imx-xwayland. Once the build is done, we have used a 16 GB SD Card and flashed the wic using the following command:

zstdcat .wic.zst | sudo dd of=/dev/sd bs=1M conv=fsync

But when using the SD Card, the boot does not happen, and we are not able to see any logs in the minicom (it is connected to the debug port to the PC). We tried using /dev/ttyUSB0 but did not see any logs.

So please do let us know which machine name to use (1) or (2). What mistake are we making for which Yocto is not running on the iMX8m plus board

Tags (3)
0 Kudos
1 Solution
757 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @soumyakk !

Please, check your board, in the SOM has written the model, in my case, I have the LPDDR.

Chavira_0-1708961302411.jpeg

 

View solution in original post

0 Kudos
7 Replies
839 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @soumyakk!

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

Best Regards!

Chavira

0 Kudos
213 Views
srinivas_123
Contributor II

@Chavira 

i followed you flashing guidelines for imx8mplus evk , it is working.

On what basis we select partition1 first sector and end sector , second partition first sector and end  sector . where this information present .please help me out.

Thanks&Regards

0 Kudos
771 Views
soumyakk
Contributor II

Can you please let me know which option (machine name) do I need to select to build the Yocto image for iMX8 Plus 1. imx8mp-lpddr4-evk ---OR--- 2. imx8mp-ddr4-evk

0 Kudos
769 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @soumyakk !

Both are for imx8mp, the difference is the RAM (one uses lpddr4 and the other uses ddr4).
If you are not sure what board are you using, put the machine on "imx8mpevk" to generate both bootloaders.

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

Best Regards!

Chavira

0 Kudos
765 Views
soumyakk
Contributor II

Thanks for the quick response. But once the build is done, which image LPDDR or DDR image do I need to flash? I am using iMX8 Plus. Can I use either of them?

0 Kudos
758 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @soumyakk !

Please, check your board, in the SOM has written the model, in my case, I have the LPDDR.

Chavira_0-1708961302411.jpeg

 

0 Kudos
747 Views
soumyakk
Contributor II

Thank you. There I found it is LPDDR. Though it is blocked by the heatsink but found the info needed.

0 Kudos