Loading another U-Boot version

Hello,

I am using an iMX7Dual V1.1D on a Viola V1.2B Board
There are some problems with loading another linux as already discussed partly in this thread:

I want to reinstall any Toradex Easy Installer in order to be able to load another Linux. Unfortunately the current U-Boot seems to have some bugs (or missing features) that prevent me from succeeding. The version of current U-Boot is 2019.07-0 which I loaded with the Qt demo image.

SD boot seems to be unavailable for this u-boot version, as an answer in the above thread says.

Running distroboot with Easy installer on SD card leads to the following error, because FIT image is not supported:

     Colibri iMX7 # run distro_bootcmd                                               
     switch to partitions #0, OK                                                     
     mmc0 is current device                                                          
     Scanning mmc 0:1...                                                             
     Found U-Boot script /boot.scr                                                   
     523 bytes read in 14 ms (36.1 KiB/s)                                            
     ## Executing script at 87000000                                                 
     31013732 bytes read in 1362 ms (21.7 MiB/s)                                     
     Wrong Image Format for bootm command                                            
     ERROR: can't get kernel image!                                                  
     SCRIPT FAILED: continuing...

An Answer in the other Thread says that this would be fixed with newer U-Boot version with this patch:
https://git.toradex.com/cgit/u-boot-toradex.git/commit/?h=toradex_2019.07-next&id=b90d461f8277f03a498644d1252a061d245633ed

So my aim is now to load another u-boot version that is able to load the Easy Installer. As I already did this successfully before I assume that other u-boot versions (not only with the patch) also would work. But how can I load a new bootloader on the system?

I can see that in the different distributions there are u-boot.imx files. I assume I have to somehow get them into RAM and boot them? But what are the necessary steps? Does the SD card need specific partitions or does it not matter as long as the current u-boot can read the file?

By the way: What is the difference between

  • u-boot.imx
  • u-boot.imx-emmc
  • u-boot.imx-rawnand

Which one do I have to use?

Best regards

Further internet search suggests that loading u-boot from RAM would not be a good idea. For example:

If I want to load it directly into NAND-memory, what are the commands I have to run in order to safely load the new u-boot?

As it seems the SD boot is available. I was able to boot the Angstrom demo. Probably there was a problem with the partitions when I tried this the last time…

But the problem still remains: How can I start the Easy Installer? Is there a download available with zImage and device tree instead of FIT image? Or do I have to build it from source somehow?

In another thread it says that i can extract the kernel, device tree and filesystem from the FIT image with:

     ./tools/dumpimage -T flat_dt -i tezi.itb -p 0 zImage
     ./tools/dumpimage -T flat_dt -i tezi.itb -p 1 tezi-run-colibri-imx6.squashfs
     ./tools/dumpimage -T flat_dt -i tezi.itb -p 2 zImage-imx6dl-colibri-eval-v3.dtb

And indeed, this way I can get 3 files from the tezi.itb
Now, is it enough to place the image and device tree into first partition and squashfs into second? If yes how can I do that with squashfs? (In the working example I get all folders by untaring the rootfs file into the second partition)

Hi @msx23

Thanks for writing to the Toradex Support.

For your issue, you should extract the Bsp 3.0.4 image on the media of your choice and make a custom version of u-boot-nand.imx and replace the one in the download Bsp 3.0.4 image with the compiled one.

Best regards,
Jaski

That was not really what I was asking for, but thanks anyway. The problem just was that there were 5 files inside the FIT image instead of 3. With selecting the correct 3 out of the 5 I was able to use SD boot again

So here is the solution that worked for me. It is applicable without building an own image and by just using the images provided by Toradex:

  1. Download Toradex Easy installer (stable or beta does not matter)
  2. install u-boot-tools on your host machine for using the tool dumpimage (attention I had to download a new version manually because old versions do not include dumpimage)
  3. with dumpimage extract the downloaded FIT image file “tezi.itb”, make sure to have all necessary files afterwards
  4. Make two partitions on an SD card, first as FAT32, second as ext4
  5. Copy extracted zImage and device tree to first partition (select the correct devicetree if multiple are available from FIT image extraction)
  6. Extract the filesystem (which was extracted from FIT image) to the second partition
  7. insert SD card into target and run sdboot from u-boot

This way you can start the easy installer if the u-boot version does not support FIT-images. With the help of the Easy Installer (which runs just in RAM at this point) you can install any other image and therefore replace the u-boot

A simpler way should be to replace the u-boot directly in Flash memory. This seems to be more risky/difficult, but I´m pretty sure it is possible. But right now I was not able to write the u-boot-nand.imx into the correct memory adress. Further advice would be nice but it´s not that important anymore, since I discovered the workaround described above.

Perfect that it works. Thanks for the feedback.