November 9, 2012

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.

[[1]]6x_upgrade instead of 6q_upgrade[[1]] [[2]]U-Boot allows shortest-unique short-hand for command invocation. For example, fatl is normally interpreted as the full command fatload.[[2]]

Comments 27

  1. Post

    Quick notes on getting and building imx_usb:

    ~/$ git clone git://
    ~/$ cd imx_usb_loader/
    ~/imx-usb-loader$ sudo apt-get install libusb-1.0-0-dev
    ~/imx-usb-loader$ make
  2. Michael

    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?

    1. Post

      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.

      1. blackdiamond

        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)

  3. Shanghui.Ye

    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)

    1. Post

      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?

  4. Ari


    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. Post

      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

    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?

    1. Post

      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


    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

    Could someone help me please?

    1. Post

      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

    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,

    1. Post
  8. alucardku

    I’m trying to update a sabrelite board

    MX6Q SABRELITE U-Boot > version
    U-Boot 2009.08-00495-g10adc6d (Apr 24 2012 – 13:27:04)

    however the given link
    seems to be down

    Also, I’ve tried the u-boot-2014-04-release-mx6 but I get the following error:
    MX6Q SABRELITE U-Boot > ext2load mmc 0 10008000 u-boot.nitrogen6q
    Loading file “u-boot.nitrogen6q” from mmc device 0:1 (xxa1)
    384000 bytes read
    MX6Q SABRELITE U-Boot > run upgradeu
    mmc0 is current device
    reading /6q_upgrade

    ** Unable to read “/6q_upgrade” from mmc 0:1 **
    Loading file “/6q_upgrade” from mmc device 0:1 (xxa1)
    1727 bytes read
    ## Executing script at 10008000
    check U-Boot
    ** Block device 0:1 301989888 not supported
    ** Block device 0:1 301989888 not supported
    No U-Boot image found on SD card
    Card did not respond to voltage select!
    mmc1(part 0) is current device
    MMC: block number 0x1 exceeds max(0x0)
    ** Can’t read from device 1 **

    ** Unable to use mmc 1:1 for fatload **
    ** Bad partition 1 **

    Could y’all redirect me on what to do if I want the newest (production) u-boot version on my sabrelite?

  9. Marcin

    Any idea why the link for the upgrade scripts no longer work?
    I have an linux image which currently works with the 2009 uboot. Will it still work when I upgrade?

  10. Ali

    It seems that there is an error, I am not able to download the upgrade u-boot by clicking on the download link.

  11. Patrik.ms94

    I can’t download ,
    please upgrade link for download or can someone send me it on e-mail(

        1. Patrik.ms94

          Hi, I have Debian Jessie on microSD and i can’t ‘run upgradeu’, when i do this i have inscription – ‘loading /6q_bootscript’ more than 10 minutes and nothing happens, how can i run my image and change u-boot?


    Hi, I have Nitrogen6X board i want to flush android on it.
    Could you please send me the link from where i can download 6X_bootscript and binary image file.Please tell me the steps to flush binary image file using SDcard from Ubuntu OS.

Leave a Reply