Switching U-Boot versions on i.MX6

In our earlier post we described the what of the main-line based U-Boot sources for SABRE Lite and Nitrogen6X boards.

In this post, we’ll discuss the how.

To begin with, there’s the easy piece. We’ve published two Zip files that can upgrade or downgrade your U-Boot semi-automatically:

The reason for the term semi-automatically is that you will have to invoke the the upgrade or down-grade using the upgradeu command as discussed in our U-Boot conventions post:
U-Boot> run upgradeu

In each of these packages, you’ll see two files:

  • A boot script – named 6q_bootscript for the upgrade, and 6x_bootscript for the down-grade package, and
  • A U-Boot binary – named u-boot.imx for the upgrade, and u-boot-nopadding.bin in the down-grade.
If you look closely, you’ll see that we’re changing conventions[1]. We’re doing the same with the auto-boot script. We’re changing the name from 6q_bootscript to 6x_bootscript. The reason for the change is that these two versions have slight incompatibilities:

  • The new version contains support for the setexpr command, which prevents set from uniquely identifying setenv[2].
  • The new version has a slight difference in the syntax for sf probe. Specifically, it allows this form:
    sf probe [[bus:]cs] [hz] [mode]
    instead of this form:
    sf probe [bus:]cs [hz] [mode]
    In English: the chip-select is mandatory in U-Boot 2009.08. What’s worse is that it also has a different numbering scheme.
  • The primary outputs of the builds are different. U-Boot 2009.08 produced a file named u-boot.bin that contains the ROM header and 1024 bytes of padding at the start of the image. U-Boot 2012.10 produces a file named u-boot.imx which does not contain the header, so it needs to be burned to offset 0x400.
By changing the name along with the version bump, we can update each of our images to include support for either boot loader, and we’ll be doing that in the coming days.

In upcoming posts, we’ll fill you in on the details of how to get the sources for this latest version of U-Boot (they will be here). We’ll also add a check-list of each of the images on-line and a set of prototype boot scripts. In the mean-time, you can try these out and experience the new display and SATA support.

We can’t finish this post without referring you to the post on un-bricking your board. This process should be straightforward, but things happen and it’s always good to have the imx_usb tool handy.

Footnotes    (↵ returns to text)
  1. 6x_upgrade instead of 6q_upgrade
  2. U-Boot allows shortest-unique short-hand for command invocation. For example, fatl is normally interpreted as the full command fatload.


30 Responses to “Switching U-Boot versions on i.MX6”

  1. ericn November 26, 2012 11:37 am #

    Quick notes on getting and building imx_usb:

    ~/$ git clone git://github.com/boundarydevices/imx_usb_loader.git
    ~/$ cd imx_usb_loader/
    ~/imx-usb-loader$ sudo apt-get install libusb-1.0-0-dev 
    ~/imx-usb-loader$ make
  2. Michael December 10, 2012 8:49 am #

    It appears that the upgrade does not replace the environment variables, and I no longer see the destroyenv command in the uboot help. Is there a way to make the new uboot restore the default environment variables?

    • ericn December 10, 2012 9:04 am #

      Hi Michael,

      I think you’re looking for ‘clearenv’, not ‘destroyenv’.

      And since this is itself an environment variable, it’s still there, but it probably won’t work.
      You can trash the saved environment like so:

      U-Boot> sf probe && sf erase 0xc0000 0x1000

      If you run ‘print’, you’ll see that the ‘clearenv’ command in the old U-Boot had a
      third parameter of 1, which doesn’t jive with the new implementation. In the new code base,
      the second parameter is a much more complicated combination of chip-select and GPIO number
      but thankfully defaults to the right thing.


      • blackdiamond December 10, 2012 9:10 am #

        It seems as though the clearenv command is not in the env.

        After do the sf probe… all the variables are still refuring to the 6q_bootscript not the 6x, did something go wrong with the upgrade of the uboot?

        this is the date if gave back, U-Boot 2013.01-rc1-00120-g7c28db0 (Nov 12 2012 – 09:15:04)

        • blackdiamond December 10, 2012 9:17 am #

          Actually after a reboot it apears to have worked fine. Thanks.

  3. Shanghui.Ye February 3, 2013 8:15 pm #

    Is there a prebuilt uboot image for imx6 sabre lite?
    I want to reversed to the version on my board: U-Boot 2013.01-rc1-02388-ga90f257 (Nov 27 2012 – 14:02:30)

    • ericn February 4, 2013 8:14 am #

      It appears that we don’t have a pre-built image on-line, but that’s easily remedied. Note that the version listed above is our current production version, matching the production branch of our Github tree.

      What in particular are you after?

      • Shanghui.Ye February 5, 2013 2:56 am #

        Thanks, I compiled the uboot image.

  4. Ari February 26, 2013 6:30 am #


    Firstly I unpacked [1] as sudo on a fresh formated ext3 SD.
    Secondly I loaded via USB the uboot from [2] to my target.

    After I could see via uart:

    U-Boot 2013.01-rc1-00120-g7c28db0 (Nov 12 2012 - 09:15:04)
    CPU:   Freescale i.MX6Q rev1.0 at 792 MHz
    Reset cause: POR
    Board: SABRE Lite
    DRAM:  1 GiB
    WARNING: Caches not enabled
    MMC:   FSL_SDHC: 0, FSL_SDHC: 1
    SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
    auto-detected panel Hannstar-XGA
    Display: Hannstar-XGA (1024x768)
    In:    serial
    Out:   serial
    Err:   serial
    Net:   FEC
    Warning: FEC using MAC address from net device
    Hit any key to stop autoboot:  0 
    mmc0 is current device
    ** Unrecognized filesystem type **
    255 bytes read
    ## Executing script at 10008000
    Unknown command 'set' - try 'help'
    3802076 bytes read
    ## Booting kernel from Legacy Image at 10800000 ...
       Image Name:   Linux-3.0.35-2026-geaaf30e-02064
       Image Type:   ARM Linux Kernel Image (uncompressed)
       Data Size:    3802012 Bytes = 3.6 MiB
       Load Address: 10008000
       Entry Point:  10008000
       Verifying Checksum ... OK
       Loading Kernel Image ... OK

    But then nothing happens !

    I think the uboot could successful load the kernel image.
    But dont understand why the system did not start.
    Any idea?

    [1] http://boundarydevices.com/eula/?file=LTIB-12.09.GA.tar.gz
    [2] http://commondatastorage.googleapis.com/boundarydevices.com/6q_upgrade-20121109.zip

    • ericn February 26, 2013 6:53 am #

      Hi Ari,

      Your message seems to hit a couple of things.

      First off, if you want to upgrade U-Boot, you’ll need to hit a key before the boot and run upgradeu at the U-Boot prompt:

      U-Boot > run upgradeu
      ...will take ~30 seconds or so, then tell you to hit **reset**

      The second issue is that the LTIB-12.09 image doesn’t seem to be booting for you. I’m a bit confused about this, and wonder if there’s something wrong in the image. You should at least see the kernel startup messages after the kernel load. The output you forwarded indicates that the kernel load was successful:

         Verifying Checksum ... OK
         Loading Kernel Image ... OK

      I’m a bit suspicious of the boot script because of this message:

      Unknown command 'set' - try 'help'

      Okay, I got it. Since you last ran the 2009.08 version of U-Boot, the bootcmd in your environment is still configured to load 6q_bootscript, which doesn’t have all of the automatic display detection and such. In order to clear this out, you’ll need to manually clear the environment like so:

      U-Boot > sf probe
      U-Boot > sf erase 0xc0000 0x1000
      U-Boot > reset

      You’ll want to run the upgradeu piece first so your machine will automatically boot to the latest U-Boot 2013.01.

  5. Ari February 26, 2013 11:45 am #

    Thank you for your reply. I will try your commands later.

    But there is still an other question for me:

    On the bootup I can see :
    CPU: Freescale i.MX6Q rev1.0 at 792 MHz
    Does this mean, that the board is only running with 792 MHz?
    Or is the board in a power on demand mode and will power up if i do more calculations?

    • ericn February 26, 2013 12:14 pm #

      Great question Ari (and one that we’ve been getting a lot lately).

      The 792MHz is just the fixed frequency used by U-Boot. As soon as Linux launches, the kernel will switch between a max of 1GHz (992 MHz to be precise) and 392MHz depending on load and temperature.

  6. hmarwan March 3, 2014 6:56 am #


    I have a problem with upgrading a system running U-Boot 2009.08 to U-Boot 2012.10.

    I have unzipped the zip on the SD card and I have launched the command “run upgradeu”.
    The process have succeded.

    Now when I try to start the sabre lite board, I have this error.

    U-Boot 2013.01-rc1-00120-g7c28db0 (Nov 12 2012 - 09:15:04)
    CPU:   Freescale i.MX6Q rev1.2 at 792 MHz
    Reset cause: POR
    Board: SABRE Lite
    DRAM:  1 GiB
    WARNING: Caches not enabled
    MMC:   FSL_SDHC: 0, FSL_SDHC: 1
    SF: Detected SST25VF016B with page size 4 KiB, total 2 MiB
    *** Warning - bad CRC, using default environment
    No panel detected: default to HDMI
    unsupported panel HDMI
    In:    serial
    Out:   serial
    Err:   serial
    Net:   FEC [PRIME]
    Warning: failed to set MAC address
    Hit any key to stop autoboot:  0
    AHCI 0001.0300 32 slots 1 ports 3 Gbps 0x1 impl SATA mode
    flags: ncq stag pm led clo only pmp pio slum part
    No port device detected!
    ** Bad device size - sata 0 **
    ** Bad device size - sata 0 **
    SATA device 1: unknown device
    ** Bad device sata 1 **
    ** Bad device sata 1 **
    MMC: no card present
    mmc0(part 0) is current device
    MMC: no card present
    ** Bad device mmc 0 **
    MMC: no card present
    ** Bad device mmc 0 **
    mmc1 is current device
    reading /6x_bootscript
    ** Unable to read file /6x_bootscript **
    Failed to mount ext2 filesystem...
    ** Unrecognized filesystem type **
    6x_bootscript not found
    serial console at 115200, 8N1
    details at http://boundarydevices.com/6q_bootscript

    Could someone help me please?

    • ericn March 3, 2014 7:08 am #

      It looks like you’ve successfully upgraded, but you’re now trying to boot with a disk that doesn’t have a Linux image.

      Do you still have the U-Boot upgrade SD card installed?

  7. Aditya Kousik March 9, 2014 2:11 am #

    Hello Eric,

    I’ve upgraded from the 2009 version to the recent production branch on the github repo. Has the ‘saveenv’ cmd overwritten somehow? It tries to save to mmc rather than flash. I’m unable to save the env variables now.

    Thanks in advance for your help,

    • ericn March 9, 2014 8:19 am #

      Hi Aditya,

      Did you perhaps choose mx6qsabrelite_config? That configuration is present primarily for Freescalers to make SABRE Lite look more like Freescale boards, and overrides the normal settings.

      Most people should use nitrogen6q_config.

  8. maddilety May 22, 2014 11:03 pm #

    i am checking GPIO commands in u-boot, and when i tested its not working
    following are the steps which i used
    added at nitrogen6q_config.h file
    #define CONFIG_CMD_GPIO
    then compiled and bring up the u-boot

    i am able to see the gpio command
    when i tested gpio set GPIO1_IO09 pin and i probed its high
    when i clear GPIO1_IO09 still high

    even i tested toggle, status its showing high all the times,
    can any one tested GPIO commands? if yes can you provide me the procedure so that i can speed up my things

    • ericn May 23, 2014 7:20 am #

      The GPIO1 pin is muxed as USB_OTG_ID on our Nitrogen6x board.

      Are you running this on a custom board? If so, you’ll need to configure the pin-mux properly.

  9. hwmstr July 26, 2014 10:43 am #

    Hello, it looks like the download links are broken.

    The specified key does not exist.

  10. jcprobert July 31, 2014 10:24 am #

    Hello, I need file 6q_upgrade-20121112.zip, I am stuck unable to upgrade u-boot, but as hwmstr says, the links are broken.

    • stuff August 5, 2014 4:04 pm #

      Hi, there are lots of documentation which is good. However, I am still confused whether I need to use the 6q_upgrade-20121112.zip which I am unable to access or go with the production image: http://commondatastorage.googleapis.com/boundarydevices.com/u-boot-production.tar.gz

      When I tried the u-boot-production image on my sabrelite board, the upgrade command is still looking for /6q_upgrade. I tried clearing the environment. Still no luck.

      My goal is to load android on this board. My present uboot is U-Boot 2009.08 (Aug 16 2012 – 10:06:42)

      Any advice appreciated.

      • Laci Tele August 8, 2014 4:03 am #

        Hi Stuff,

        I’d recommend u-boot-production.tar.gz , that is always the latest u-boot.

        “…the upgrade command is still looking for /6q_upgrade”

        Have you tried with the :

        U-Boot > bootfile=u-boot.nitrogen6q ; run upgradeu

        command ?

        If so, would you please list the u-boot environment for me :

        U-Boot > printenv

        The new Android is here:
        Not bad at all.

        But first we have to upgrade your u-boot successfully, its quite old.

  11. danhans115 August 19, 2014 8:52 am #


    I too am having issues updating uboot on my board..

    upgradeu comes up as not defined..

    printenv output is as follows….

    bootargs_base=setenv bootargs console=ttymxc0,115200
    bootargs_mmc=setenv bootargs ${bootargs} root=/dev/mmcblk1p1 rootwait rw video=mxcfb1:dev=ldb,LDB-XGA,if=RGB666 video=mxcfb0:dev=hdmi,1920x1080M@60,if=RGB24
    bootcmd=mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loaduimage; then run mmcboot; else run netboot; fi; fi; else run netboot; fi
    bootcmd_mmc=run bootargs_base bootargs_mmc;mmc dev 2;mmc read ${loadaddr} 0x800 0x2000;bootm
    bootscript=echo Running bootscript from mmc ...; source
    loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
    loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
    loaduimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}
    mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}
    mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;
    mmcroot=/dev/mmcblk0p2 rootwait rw
    netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
    netboot=echo Booting from net ...; run netargs; if test ${ip_dyn} = yes; then setenv get_cmd dhcp; else setenv get_cmd tftp; fi; ${get_cmd} ${uimage}; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if ${get_cmd} ${fdt_addr} ${fdt_file}; then bootm ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootm; else echo WARN: Cannot load the DT; fi; fi; else bootm; fi;

    any help would be greatly appreciated.

  12. darylgi October 16, 2014 5:02 pm #


    Where can I obtain the file 6q_upgrade-20121112.zip – the above link is broken.

    My board is a SabreLite and it came with the older 6q_bootscript .

    I have loaded your latest Trusty Ubuntu for iMX6 to a sdcard, but my UBoot is looking for 6q_bootscript.

    In case I am doing something wrong, here is my UBoot output.

    U-Boot 2009.08 (Aug 16 2012 – 10:06:42)

    CPU: Freescale i.MX 6 family 0.0V at 792 MHz
    Temperature: 19 C, calibration data 0x5934db7d
    mx6q pll1: 792MHz
    mx6q pll2: 528MHz
    mx6q pll3: 480MHz
    mx6q pll8: 50MHz
    ipg clock : 66000000Hz
    ipg per clock : 66000000Hz
    uart clock : 80000000Hz
    cspi clock : 60000000Hz
    ahb clock : 132000000Hz
    axi clock : 264000000Hz
    emi_slow clock: 29333333Hz
    ddr clock : 528000000Hz
    usdhc1 clock : 200000000Hz
    usdhc2 clock : 200000000Hz
    usdhc3 clock : 200000000Hz
    usdhc4 clock : 200000000Hz
    nfc clock : 24000000Hz
    Board: MX6Q-SABRELITE:[ POR]
    Boot Device: I2C
    I2C: ready
    DRAM: 1 GB
    JEDEC ID: 0xbf:0x25:0x41
    Reading SPI NOR flash 0xc0000 [0x2000 bytes] -> ram 0x276009b8

    In: serial
    Out: serial
    Err: serial
    Net: got MAC address from IIM: 00:00:00:00:00:00
    FEC0 [PRIME]
    Hit any key to stop autoboot: 0
    Card did not respond to voltage select!
    mmc0(part 0) is current device
    MMC: block number 0x1 exceeds max(0x0)
    ** Can’t read from device 0 **

    ** Unable to use mmc 0:1 for fatload **
    ** Bad partition 1 **
    mmc1 is current device
    reading /6q_bootscript

    ** Unable to read “/6q_bootscript” from mmc 1:1 **
    Loading file “/6q_bootscript” from mmc device 1:1 (xxb1)
    ** File not found /6q_bootscript

    • ericn October 16, 2014 5:56 pm #

      Hi Darylgi,

      We’ve started putting that into the tar-ball for each release. The latest is here:

      • darylgi October 16, 2014 9:50 pm #


        Thank up for the quick response.

        I have now found the 6q_upgrade file, but am still having problems.

        The sd card I have used is 32GByte, and after putting your ubuntu image on using dd, ends up as a 3.51 GB partition with the rest unallocated.

        The partition contains the 6x_upgrade & 6x_bootscript files + all the ubuntu files.

        Onto this I did a straight copy of 6q_upgrade & u-boot.nitrogen6q (which I copied and renamed u-boot.imx)

        I tried run upgradeu, the uboot output is -:

        mmc1 is current device
        reading /6q_upgrade

        ** Unable to read “/6q_upgrade” from mmc 1:1 **
        Loading file “/6q_upgrade” from mmc device 1:1 (xxb1)
        “” File not found /6q_upgrade

        • darylgi October 16, 2014 11:12 pm #


          I have managed to proceed a bit further, but still cannot complete the upgrade.

          It seems my u-boot (2009.08) does not support ext4 disk format – when I put your ubuntu image onto the disk using dd, it formats the disk as ext4.

          I reformated using GParted to ext3.
          Put 6q_upgrade on, and now upgradeu reads & executes 6q_upgrade.

          Result now is

          mmc1 is current device
          reading /6q_upgrade

          ** Unable to read “/6q_upgrade” from mmc 1:1 **
          Loading file “/6q_upgrade” from mmc device 1:1 (xxb1)
          1727 bytes read
          ## Executing script at 10008000
          check U-Boot
          ** No boot file defined **
          ** No boot file defined **
          No U-Boot image found on SD card

          • darylgi October 17, 2014 5:00 am


            I have now solved my problem, I have successfully updated u-boot, and running your Trusty Ubuntu on my Sabre Lite.

            From my original u-boot-:

            upgradeu=for disk in 0 1 ; do mmc dev ${disk} ;for fs in fat ext2 ; do ${fs}load mmc ${disk}:1 10008000 /6q_upgrade && source 10008000 ; done ; done

            It was failing in the 6q_upgrade script on the statement-:

            if ${fs}load ${dtype} ${disk}:1 12000000 u-boot.imx

            Not using the upgradeu but doing the following manually worked and upgraded u-boot -:

            > ext2load mmc 1:1 1000800 /6q_upgrade

            > dtype=mmc; disk=1; fs=ext2; source 10008000

            It was the adding “dtype=mmc; disk=1; fs=ext2;” before executing 6q_upgrade which did the trick.

          • ericn October 17, 2014 6:45 am

            Thanks for closing the loop on this.

Leave a Reply