build imx-boot image in Yocto

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

build imx-boot image in Yocto

Jump to solution
1,516 Views
AlekseyM
Contributor III

Hello! I'm trying to create an imx-boot image but something goes wrong.
Could you add instructions for Yocto?
I see instructions for the standalone version
4.5.13 How to build imx-boot image by using imx-mkimage
But I didn't see any like u-boot/tools/mkimage/ or imx-mkimage/

Which command I should use? bitbake imx-mkimage ?

Labels (1)
0 Kudos
1 Solution
1,458 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Got it, to do that process as you mentioned in your post, it is necessary to follow the next steps:

###### Host package setup ######
$ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool rsync curl

###### Execute script for SDK installation ######
$ chmod a+x fsl-imx-internal-xwayland-glibc-x86_64-test-internal-qt6-armv8a-imx8mpevk-toolchain-5.15-kirkstone.sh

##### To obtain the SDK (.sh file) you have to do it in Yocto with: #####

$ bitbake imx-image-core -c populate_sdk

###### Set environment for build ######
$ . /opt/fsl-imx-internal-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux 
$ export ARCH=arm64

###### Build Uboot  ######
$ mkdir uboot_build
$ cd uboot_build
$ git clone https://github.com/nxp-imx/uboot-imx -b lf_v2022.04

$ cd uboot-imx
$ make clean
$ make imx8mm_evk_defconfig
$ make

###### Build ARM Trusted Firmware (ATF) ######
$ cd ..
$ git clone https://github.com/nxp-imx/imx-atf -b lf_v2.6
$ cd imx-atf/
$ make PLAT=imx8mm bl31

###### Download the DDR training bin ######
$ cd ..
$ mkdir firmware-imx
$ cd firmware-imx
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.16.bin 
$ chmod a+x firmware-imx-8.16.bin
$ ./firmware-imx-8.16.bin

###### Download imx-mkimage and build the boot image ######
$ cd ~
$ git clone https://github.com/nxp-imx/imx-mkimage -b lf-5.15.32_2.0.0
$ cd imx-mkimage

###### Now you may copy all the files need for build boot image (flash.bin) ######
$ cp ../uboot-imx/spl/u-boot-spl.bin iMX8M/
$ cp ../uboot-imx/u-boot-nodtb.bin iMX8M/
$ cp ../uboot-imx/arch/arm/dts/imx8mm-evk.dtb iMX8M/
$ cp ../imx-atf/build/imx8mm/release/bl31.bin iMX8M/
$ cp ../firmware-imx/firmware-imx-8.16/firmware/ddr/synopsys/lpddr4_pmu_train_* iMX8M/
$ cp ../uboot-imx/tools/mkimage iMX8M/mkimage_uboot
$ make SOC=iMX8MM flash_evk

Best regards.

View solution in original post

0 Kudos
3 Replies
1,488 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

To create imx-boot image in Yocto you need to follow the next steps:

1. Follow the steps of chapters 3 and 4 called "Host Setup" and "Yocto Project Setup" on i.MX Yocto Project User's Guide.

2. After the command "repo sync" you have to put the next command:

 

DISTRO=fsl-imx-xwayland MACHINE=<machine> source imx-setup-release.sh -b <build directory>

 

Where:

<machine> is the board that you are using.

Jorge7u7_0-1688076602604.png

Jorge7u7_0-1688076704663.png

<build directory> the name of the directory where you want to deploy all the generated files.

3. Compile your boot image with the next command:

 

bitbake -c deploy imx-boot

 

4. You will have the outputs in the next folder:

/imx-yocto-bsp/<build directory>/tmp/deploy/images/<machine>

Best regards.

0 Kudos
1,475 Views
AlekseyM
Contributor III

Thanks! I was not precise in the question, I wanted to make small changes to the spl and dtb files.
I should change those files in u-boot-imx directory, right? 
I mean I should do next step


bitbake -c compile u-boot-imx


Here I changed spl and dts, with patches or manually

bitbake u-boot-imx

Here I should make cp like in 4.5.13 How to build imx-boot image by using imx-mkimage, but I can't find u-boot/tools/mkimage,  u-boot/spl/u-boot-spl.bin, u-boot-nodtb.bin
I find these bin files in u-boot-imx dir with another path, but u-boot/tools/mkimage I can't find anywhere


bitbake -c deploy imx-boot 


Am I right?

 

0 Kudos
1,459 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Got it, to do that process as you mentioned in your post, it is necessary to follow the next steps:

###### Host package setup ######
$ sudo apt install gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint3 xterm python3-subunit mesa-common-dev zstd liblz4-tool rsync curl

###### Execute script for SDK installation ######
$ chmod a+x fsl-imx-internal-xwayland-glibc-x86_64-test-internal-qt6-armv8a-imx8mpevk-toolchain-5.15-kirkstone.sh

##### To obtain the SDK (.sh file) you have to do it in Yocto with: #####

$ bitbake imx-image-core -c populate_sdk

###### Set environment for build ######
$ . /opt/fsl-imx-internal-xwayland/5.15-kirkstone/environment-setup-armv8a-poky-linux 
$ export ARCH=arm64

###### Build Uboot  ######
$ mkdir uboot_build
$ cd uboot_build
$ git clone https://github.com/nxp-imx/uboot-imx -b lf_v2022.04

$ cd uboot-imx
$ make clean
$ make imx8mm_evk_defconfig
$ make

###### Build ARM Trusted Firmware (ATF) ######
$ cd ..
$ git clone https://github.com/nxp-imx/imx-atf -b lf_v2.6
$ cd imx-atf/
$ make PLAT=imx8mm bl31

###### Download the DDR training bin ######
$ cd ..
$ mkdir firmware-imx
$ cd firmware-imx
$ wget https://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-8.16.bin 
$ chmod a+x firmware-imx-8.16.bin
$ ./firmware-imx-8.16.bin

###### Download imx-mkimage and build the boot image ######
$ cd ~
$ git clone https://github.com/nxp-imx/imx-mkimage -b lf-5.15.32_2.0.0
$ cd imx-mkimage

###### Now you may copy all the files need for build boot image (flash.bin) ######
$ cp ../uboot-imx/spl/u-boot-spl.bin iMX8M/
$ cp ../uboot-imx/u-boot-nodtb.bin iMX8M/
$ cp ../uboot-imx/arch/arm/dts/imx8mm-evk.dtb iMX8M/
$ cp ../imx-atf/build/imx8mm/release/bl31.bin iMX8M/
$ cp ../firmware-imx/firmware-imx-8.16/firmware/ddr/synopsys/lpddr4_pmu_train_* iMX8M/
$ cp ../uboot-imx/tools/mkimage iMX8M/mkimage_uboot
$ make SOC=iMX8MM flash_evk

Best regards.

0 Kudos