How to flash new device tree to iMX7

I simply want to update the device tree. Instructions found on:

seem incomplete or out of date. Another toradex souce implied I could copy the dtb file to a USB stick and

run setupdate, which looks for Colibri_imx7/flash_blk.img, which is not mentioned anywhere

followed by run update_fdt, which is not a known command.

Where do I go from here?

Thanks

Hi @bobpbbd104,

What version of our Linux software are you running on your i.MX7?

hi,
I’m using 2.7 linux

We are using UBI/UBIFS on our Colibri iMX7 512MB modules. There are 4 UBI partitions (type ubi info l at U_Boot or ubinfo -a at Linux for more info)

  •       kernel
    
  •       dtb
    
  •       m4firmware
    
  •       Rootfs
    

First 3 has no file system on them. So we store one file per partition as binary. At Linux they are represented as /dev/ubi0_0 /dev/ubi0_1 /dev/ubi0_2 /dev/ubi0_3. You can updates binary on first 3 partitions (including a dtb which hold a Device tree) using commands ubiupdatevol at Linux or ubi write at U_Boot

The legacy update method is fairy deprecated. Starting with version 2.7 onward of our BSP we’d prefer if customers use our Easy Installer utility in order to install/update your device binaries.

The process is described here: Build U-Boot and Linux Kernel from Source Code | Toradex Developer Center

Please let me know if this solution works for you.

Best Regards,
Jeremias

Thanks Alex and jeremias, that process works and I was able to flash 2.8 from uboot. Your Toradex easy install directory has 2.8b6 and your git has 2.8b5, from which I will rebuild kernel. Will I have any problems if I copy over only zImage or do I have to grab all binaries that I rebuilt?

Our git has a 2.8b6:

tag name Colibri-iMX7_LXDE-Image_2.8b6.184-20190401 (dd5bb22d540bdd108dd5a1fc38362e65a4c25165)

tag date 2019-04-10 10:27:14 +0000

commit d899927728beca8357a5b4120b690cb3c1d80844 (patch)

tree ccb170439cc8638d71f6120ae08a6faded46db98

zImage is kernel image and it’s separate from a Device Tree. So I’m confused now - do you need to replace a kernel or Device Tree?

Alex, that’s right. But on my first attempt I copied only the dtb, and Linux did not boot. Apparently, the error: zImage magic! was wrong and U-boot would only do a bootp so it tried 15 times to bootp. When I copied next time I did run update replacing everything and all was well. Since I copy all, might as well try building and replacing the kernel too. Not sure if other binaries besides zImage needed? Assume the dynamic libraries are separate from zImage?

Replacing dtb only should not prevent kernel from start booting even if Device Tree is completely wrong. Of cause kernel may crash in last case due to problem with HW init. Error about zImage magic indicate that kernel binary was corrupted during dtb replacement. I’d recommend you download Linux image here . Unpack it to SD card or USB drive and replace device tree file imx7d-colibri-eval-v3.dtb with yours keeping same name. Then use a Toradex Easy installer to re-flash your system as described here - Downloads & Installers | Toradex Developer Center