??? howto flash custom built yocto image to the eMMC?

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

??? howto flash custom built yocto image to the eMMC?

5,707 Views
pavel_
Contributor II

Hello,

With yocto we can create a custom sdcard image. Then boot it on iMX8MMini EVK

1. How to compile the bootloader (u-boot) which is compatible with UUU?

if I try to execute uuu -v -b emmc my_freshly_backed_u-boot.bin,

I get: Fail Can find validate IVT header,

and only bootloader bin files supplied with imx-yocto-L4.14.98_2.0.0_ga package can be flashed.

2. How to flash the bootloader from the userspace???

echo 0 > /sys/block/mmcblk2boot0/force_ro

dd if=/tmp/_flash.bin of=/dev/mmc2boot0 bs=1K seek=32

echo 1 > /sys/block/mmcblk2boot0/force_ro

what else???

Labels (1)
0 Kudos
4 Replies

4,253 Views
s_arendt
Contributor II

Flashing this with proper seek was not enough to get it working to boot from boot0. I changed partconf too. But no sign of life.

How can I know it starts reading data from boot0? Is there maybe something to change/configure in spl?

0 Kudos

4,904 Views
art
NXP Employee
NXP Employee

Please follow the attached documents.

Best Regards,
Artur

0 Kudos

4,904 Views
bernhardfink
NXP Employee
NXP Employee

The UUU utility follows a two-step approach to program something into flash memory:

  • First step is the download of a  secondary loader firmware
  • In a second step this firmware manages the download and programming of binaries/images/data into flash memory

         uuu  <commands>  <secondary loader firmware>  <binary>

We have prepared  the secondary loader firmware for different use cases, they can be found in the demo image package from our website here:  https://www.nxp.com/webapp/Download?colCode=L4.14.98_2.0.0_MX8MM&appType=license 

The name of the file describes rather well what it's used for:

  • imx-boot-imx8mmddr4evk-nand.bin-flash_ddr4_evk     (for the EVK board with DDR4 memory)
  • imx-boot-imx8mmddr4evk-sd.bin-flash_ddr4_evk         (for the EVK board with DDR4 memory)
  • imx-boot-imx8mmevk-fspi.bin-flash_evk_flexspi            (for the EVK board with LPDDR4 memory)
  • imx-boot-imx8mmevk-sd.bin-flash_evk                          (for the EVK board with LPDDR4 memory)

If you flash something into eMMC, then most likely it should be something bootable. This means you have to create a bootable image, u-boot is just one component in this bootable image. So you don't flash just a bootloader, you flash a complete boot image, which contains several components required for booting.

The utility mkimage is used to create such a bootable image:  GitHub - Freescale/imx-mkimage: FSLC Community fork of i.MX MkImage (original code in https://source...   (please use the project on the CodeAurora server)

Regards,

Bernhard.

4,904 Views
pavel_
Contributor II

Hello,

Thank you for the answer.

And is there a yocto recipe, that creates the bootable eMMC image?

(seems like imx-boot or virtual/bootloader targets are creating imx-boot-imx8mmevk-sd.bin-flash_evk file in deploy folder)

The second question remains:

How to flash a bootloader image into eMMC when booted from the SDCard, and not using the UUU tool?

And I have an answer for this too:

the bootable image imx-boot-imx8mmevk-sd.bin-flash_evk has to be located at /dev/mmcblkXboot0 with offset of 0x8400 (33K) as stated in IMX8MMRM Table 6-25.

The command sequence is, assuming that the board has booted from the SDCard:

echo 0 > /sys/block/mmcblk2boot0/force_ro

dd if=imx-boot-imx8mmevk-sd.bin-flash_evk of /dev/mmcblk2boot0 bs=1K seek=33

echo 1 > /sys/block/mmcblk2boot0/force_ro

-Pauli

0 Kudos