How to replace u-boot only on a Colibri iMX6

Is it possible to replace the u-boot only without any custom flash programming tool?
Instructions at this link seems obsolete and not working

Thank you

Hi,

After using run setupdate if you run update_uboot you can update uboot alone. I use an Apalis iMX6 and that’s my method of flashing parts of the image.

The same can be said for rootfs, kernel or device tree.

The link you posted has some obsolete commands for older modules I think… But the instructions posted after running update.sh are all valid.

Regards

Not working :frowning:

Colibri iMX6 # ver

U-Boot 2016.11-2.7.3+gf0e4149 (Jul 14 2017 - 06:02:28 -0700)
arm-angstrom-linux-gnueabi-gcc (Linaro GCC 6.2-2016.11) 6.2.1 20161016
GNU ld (GNU Binutils) 2.27.0.20160806

Colibri iMX6 # run setupdate
reading flash_blk.img
** Unable to read file flash_blk.img **
** Bad device usb 0 **
Using FEC device
TFTP from server 192.168.0.251; our IP address is 192.168.0.184
Filename 'flash_eth.img'.
Load address: 0x12000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...

Colibri iMX6 # print update_uboot
## Error: "update_uboot" not defined

There’s another reason behind it. You did not load the file that prepares the flashing process in run setupdate. None of the methods loaded flash_eth.img (applicable if you are flashing through TFTP) are you sure you have your TFTP connected properly?

Even this page won’t help
eMMC Based Modules (i.MX 6)

I am not using TFTP to load my new bootloader.
I copied it into the boot partition of the microSD card

Hi

What do you mean by microSD card? The eMMC or a physical connected card?

Can you see the flash_blk.img file from U-Boot? e.g.

Colibri iMX6 # ls mmc 1:1

Max

Hi Max,
I am using a physical connected SDcard on an Aster board.
I don’t understand what is the flash_blk.img file, sorry.
I built u-boot from sources (branch 2016.11-toradex) and I have u-boot.bin and SPL (no u-boot.imx though)

Hi Koan

You missed following the preparation step of the page you linked. After that step you have an SD-Card with the needed files including flash_blk.img. (Also referenced here).

Then you could replace U-Boot and SPL on the SD-Card, directory colibri-imx6. Note the following from here : ‘Starting with image V2.7 use the built u-boot-toradex/SPL and u-boot-toradex/u-boot.img files to replace SPL and u-boot.imx-spl on the update SD card (renaming u-boot.img to u-boot.imx-spl in the process).’

Max

Hi Max,
I prepared the SD as described using Colibri-iMX6_LXDE-Image_2.8b1.64-20171229.tar.bz2
Copied u-boot files (branch 2016.11-toradex)

cp u-boot-toradex/SPL  /media/mountpoint/SPL
cp u-boot-toradex/u-boot.img  /media/mountpoint/u-boot.imx-spl

Inserted the SD in my Aster and booted. Then:

Colibri iMX6 # run setupdate
reading flash_blk.img
710 bytes read in 12 ms (57.6 KiB/s)
## Executing script at 10800000
reading colibri_imx6/flash_blk.img
4261 bytes read in 22 ms (188.5 KiB/s)
## Executing script at 12000000
enter "run update" to update the entire module


Colibri iMX6 # run update_uboot
reading colibri_imx6/u-boot.imx-spl
361896 bytes read in 39 ms (8.8 MiB/s)
switch to partitions #1, OK
mmc0(part 1) is current device

MMC write: dev # 0, block # 138, count 707 ... 707 blocks written: OK
Unknown command 'updt_fuse' - try 'help'


Colibri iMX6 # mmc list
FSL_SDHC: 0 (eMMC)
FSL_SDHC: 1 (SD)

Unfortunately after reboot the u-boot version is always the same old one

Colibri iMX6 # ver

U-Boot 2015.04 (May 18 2015 - 14:17:54)
arm-angstrom-linux-gnueabi-gcc (Linaro GCC 4.9-2014.11) 4.9.3 20141031 (prerelease)
GNU ld (GNU Binutils) Linaro 2014.11-2 2.24.0.20141017

Hi

Then you could replace U-Boot and SPL on the SD-Card, directory colibri-imx6.

A strong hint could also be this line in the U-Boot output:

 Colibri iMX6 # run update_uboot
 reading colibri_imx6/u-boot.imx-spl

Max

Hi Max,
it was a typo in the post above.

 cp u-boot-toradex/SPL  /media/mountpoint/colibri_imx6/SPL
 cp u-boot-toradex/u-boot.img  /media/mountpoint/colibri_imx6/u-boot.imx-spl

I placed the new files in the right place of course, in fact the command printed out

 MMC write: dev # 0, block # 138, count 707 ... 707 blocks written: OK

The problem actually seems this message while the script is executed

 Unknown command 'updt_fuse' - try 'help'

Do you know why there is not ‘updt_fuse’?
Is ‘updt_fuse’ requred to replace the bootloader?

Have you tried this instructions with a Colibri iMX6DL V.1.0A ?

Thanks

FYI I opened another ticket dedicated to the recovery procedure

Do you know why there is not ‘updt_fuse’?

Yes, you are running U-Boot from an ancient BSP V2.5 and missed first properly migrating to a later version before attempting any separate single artefact update. Looking at the U-Boot update scripts you may realise that only the regular run setupdate; run update case handles such migration automatically. If a user attempts a separate single artefact update we assume he knows exactly what he is doing and won’t interfere.

Is ‘updt_fuse’ requred to replace the bootloader?

Not necessarily, no. But you would not be able to use the eMMC fast boot mode. Have a look at the following article on our developer website for more information.

So, again, considering my board bricked, what is the procedure to replace u-boot on a Colibri iMX6 ?

Just use the Toradex Easy Installer (;-p).

If I have to run a development cycle to customize the bootloader, would more effective a simple and clear procedure to reprogram the bootloader only.

It isn’t very smart to reflash everyting just to reprogram the bootloader, is it?

Do you have any document about that?

If you have a working U-Boot on your modul:

  -  prepare an SD card as described here
 https://developer.toradex.com/knowledge-base/flashing-linux-on-imx6-modules#Preparation
  - Build a new U-Boot
  - use the built u-boot-toradex/SPL and u-boot-toradex/u-boot.img files to
 replace SPL and u-boot.imx-spl on the
 update SD card (renaming u-boot.img to
 u-boot.imx-spl in the process).' As
 described here -
 https://developer.toradex.com/knowledge-base/build-u-boot-and-linux-kernel-from-source-code#vybrid-imx-6-amp-imx-7-based-modules
  - Insert prepared SD card.
  - do "run setupdate"
  - do "run update_uboot".

Hi Marcel,

I am trying to figure out how Toradex Easy Installer.
From the actual documentation is not clear how the u-boot reprogramming should work.

I have the following configuration file and as you can see I set “autoinstall”: true.

{
    "config_format": 1,
    "autoinstall": true,
    "name": "Toradex Easy Installer for u-boot reprogramming",
    "description": "u-boot reprogramming for Colibri iMX6.",
    "version": "1.3",
    "release_date": "20171201",
    "wrapup_script": "wrapup.sh",
    "icon": "tezi.png",
    "supported_product_ids": [
        "0014",
        "0015",
        "0016",
        "0017"
    ],
    "blockdevs": [
        {
            "name": "mmcblk0",
            "partitions": [
                {
                    "want_maximised": false,
                    "content": {
                        "filelist": [
                            "boot.scr",
                            "tezi.itb"
                        ],
                        "label": "BOOT",
                        "uncompressed_size": 19.44921875,
                        "filesystem_type": "FAT",
                        "mkfs_options": ""
                    },
                    "partition_size_nominal": 32
                }
            ]
        },
        {
            "name": "mmcblk0boot0",
            "content": {
                "rawfiles": [
                    {
                        "filename": "SPL",
                        "dd_options": "seek=2"
                    },
                    {
                        "filename": "u-boot.img",
                        "dd_options": "seek=138"
                    }
                ],
                "filesystem_type": "raw"
            }
        }
    ]
}

Now I start the script on the HOST side:

Colibri-iMX6_ToradexEasyInstaller_1.3-20171201$ ./recovery-linux.sh

But the TARGET refuses to accomplish the task:

SDP: initialize...e in place at 12000000, end 1200f146
SDP: handle requests...
Downloading file of size 314752 to 0x177fffc0... done
Jumping to header at 0x177fffc0
Header Tag is not a IMX image


U-Boot 2016.11-1.3.0+g52259cf (Nov 30 2017 - 11:22:54 +0100)

CPU:   Freescale i.MX6DL rev1.3 at 792 MHz
Reset cause: POR
I2C:   ready
DRAM:  512 MiB
PMIC:  device id: 0x10, revision id: 0x21, programmed
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Using default environment

In:    serial_mxc
Out:   serial_mxc
Err:   serial_mxc
Model: Toradex Colibri iMX6 DualLite 512MB V1.0A, Serial# 04944008
Serial Downloader recovery mode, using sdp command
Net:   using PHY at 0
FEC [PRIME]
Hit any key to stop autoboot:  0 
SDP: initialize...
SDP: handle requests...
Downloading file of size 20390284 to 0x12100000... done
Downloading file of size 308 to 0x12000000... done
Jumping to header at 0x12000000
Header Tag is not a IMX image
## Loading kernel from FIT Image at 12100000 ...
   Using 'config@1' configuration
   Trying 'kernel@1' kernel subimage
     Description:  Linux Kernel 4.1
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x121000dc
     Data Size:    5048824 Bytes = 4.8 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x11000000
     Entry Point:  0x11000000
     Hash algo:    md5
     Hash value:   c78d22a8746bbe58a12019b18525d355
   Verifying Hash Integrity ... md5+ OK
## Loading ramdisk from FIT Image at 12100000 ...
   Using 'config@1' configuration
   Trying 'ramdisk@1' ramdisk subimage
     Description:  SquashFS RAMdisk
     Type:         RAMDisk Image
     Compression:  uncompressed
     Data Start:   0x125d0bbc
     Data Size:    15294464 Bytes = 14.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: unavailable
     Entry Point:  unavailable
     Hash algo:    md5
     Hash value:   fa139823734e1b7c34ed182cdb064ee5
   Verifying Hash Integrity ... md5 error!
Bad hash value for 'hash@1' hash node in 'ramdisk@1' image node
Bad Data Hash
Ramdisk image is corrupt or invalid

Hi Alex.

I am trying also this procedure. It worked !

Copied my bootloader files on a USB device

  cp u-boot-toradex/SPL  /media/mountpoint/colibri_imx6/SPL
  cp u-boot-toradex/u-boot.img  /media/mountpoint/colibri_imx6/u-boot.imx-spl

Booted Colibri, and stopped the boot process:

U-Boot 2016.11-2.8.1+g30a1208 (Dec 29 2017 - 00:40:03 +0000)

CPU:   Freescale i.MX6DL rev1.3 at 792 MHz
Reset cause: POR
I2C:   ready
DRAM:  512 MiB
PMIC:  device id: 0x10, revision id: 0x21, programmed
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

auto-detected panel vga-rgb
Display: vga-rgb (640x480)
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri iMX6 DualLite 512MB V1.0A, Serial# 04944008
Net:   using PHY at 0
FEC [PRIME]
Hit any key to stop autoboot:  0 

Entered the commands below:

Colibri iMX6 # run setupdate
MMC: no card present
** Bad device mmc 1 **
starting USB...
USB0:   Port not available.
USB1:   USB EHCI 1.00
scanning bus 1 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
       scanning usb for ethernet devices... 0 Ethernet Device(s) found
reading flash_blk.img
710 bytes read in 23 ms (29.3 KiB/s)
## Executing script at 12000000
reading colibri_imx6/flash_blk.img
4261 bytes read in 35 ms (118.2 KiB/s)
## Executing script at 12000000
enter "run update" to update the entire module


Colibri iMX6 # run update_uboot
reading colibri_imx6/u-boot.imx-spl
362896 bytes read in 56 ms (6.2 MiB/s)
switch to partitions #1, OK
mmc0(part 1) is current device

MMC write: dev # 0, block # 138, count 709 ... 709 blocks written: OK
Fuse 0, 5:     5072
Fast boot mode already fused, no need to fuse

When I reboot the Colibri I have the NEW bootloader running:

U-Boot 2016.11-dirty (Mar 19 2018 - 17:40:00 -0700)

CPU:   Freescale i.MX6DL rev1.3 at 792 MHz
Reset cause: POR
I2C:   ready
DRAM:  512 MiB
PMIC:  device id: 0x10, revision id: 0x21, programmed
MMC:   FSL_SDHC: 0, FSL_SDHC: 1

Thank you