36

Running Linaro Ubuntu on i.MX6 (Sabre Lite and Nitrogen6X)

As mentioned in our post about BSPs for i.MX, there is a lot of motion on a number of projects in the i.MX world.

In this post, we’ll give a primer on how to get started with a Linaro Ubuntu image on a Sabre Lite or Nitrogen6X board.

For the impatient:

I’ll elaborate below, but if you want to boot a Linaro image on a Sabre Lite or Nitrogen6X, you can follow these simple steps:

On your host machine, grab the latest copies of the mx6 hardware pack and a filesystem image and use linaro-media-create to program your SD card:

~/linaro$ wget http://releases.linaro.org/latest/ubuntu/precise-hwpacks/hwpack_linaro-lt-mx6_20120525-101_armhf_supported.tar.gz
...
`hwpack_linaro-lt-mx6_20120525-101_armhf_supported.tar.gz' saved [26644843/26644843]

~/linaro$ wget http://releases.linaro.org/latest/ubuntu/precise-images/ubuntu-desktop/linaro-precise-ubuntu-desktop-20120524-177.tar.gz
...
`linaro-precise-ubuntu-desktop-20120524-177.tar.gz' saved [517238017/517238017]

~/linaro$ sudo linaro-media-create --mmc /dev/mmcblk0 --dev mx6qsabrelite 
          --hwpack hwpack_linaro-lt-mx6_20120525-101_armhf_supported.tar.gz 
          --binary linaro-precise-ubuntu-desktop-20120524-177.tar.gz
[sudo] password for user:
...
I see...
Device           Mount point      Size
/dev/mmcblk0     none             3823MB
/dev/mmcblk0p1   none             3MB
/dev/mmcblk0p2   none             52MB
/dev/mmcblk0p3   none             3767MB
/dev/sda         none             476940MB
/dev/sda1        /                230039MB
/dev/sda2        none             8432MB
/dev/sda3        /olddrive        238464MB
/dev/sda5        none             8432MB
/dev/sr0         none             0MB
Are you 100% sure, on selecting [/dev/mmcblk0] (y/n)? y
...
WARNING: The following packages cannot be authenticated!
  libnl-3-200 libnl-genl-3-200 wireless-regdb crda wireless-crda linux-image-3.2.1-42-linaro-lt-mx6 devio flash-kernel linux-firmware linux-image-linaro-lt-mx6
  linux-headers-3.2.1-42-linaro-lt-mx6 linux-headers-linaro-lt-mx6 hwpack-linaro-lt-mx6 iw u-boot-tools uboot-mkimage
Install these packages without verification [y/N]? y
...
Populating rootfs partition
Be patient, this may take a few minutes

... long time passes...

Updating /etc/network/interfaces

Done creating Linaro image on /dev/mmcblk0

Insert this into mmc 0 (top slot of a Nitrogen6X or the bottom full-sized slot on a Sabre Lite) and abort the boot through the serial console.

Enter these commands to set the boot mode to SDHC3 (mmc 0) and reset:

U-Boot> mw.l 0x020d8040 0x3040 && mw.l 0x020d8044 0x10000000
U-Boot> reset

The details

The first difficulty you’re likely to encounter is that the Linaro team creates an SD card image that’s inconsistent with what we ship. In particular, they create SD card images that have an unformatted first partition to hold a U-Boot image and a boot script named boot.scr in partition number 2.

The second difficulty is that the kernels Linaro is shipping are configured to support a device tree, which is not supported in the Freescale (or Boundary Devices) U-Boot releases. This part will be remedied as soon as we make the switch to main-line U-Boot. Stay tuned for updates.

In other words, in order to launch the Linaro build, we need to run Linaro’s U-Boot instead of booting first to serial EEPROM. On the Linaro Sabre Lite Wiki Page, they describe one method of getting around this, but it’s a bit intrusive. It suggests that you re-program your serial EEPROM with a shim.

An easier way

Thankfully, Troy found an easy work-around while creating a U-Boot command rstmode (or rsmode).

It turns out that with just a couple of register writes, you can set the boot mode (overriding the fuse settings) and force a boot to SD card, USB, NAND, et cetera.

The following is a rather lengthy example run on a Nitrogen6X. I aborted the initial boot of 2009.08-00495-g10adc6d by hitting the any key, then issued a command line with a couple of register writes (mw), followed by a reset.

U-Boot 2009.08-00495-g10adc6d (Apr 24 2012 - 13:27:04)

CPU:   Freescale i.MX 6 family 0.0V at 792 MHz
Temperature:   can't get valid data!
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
MMC:   FSL_USDHC: 0,FSL_USDHC: 1
JEDEC ID: 0xbf:0x25:0x41
Reading SPI NOR flash 0xc0000 [0x2000 bytes] -> ram 0x276009b8
SUCCESS

In:    serial
Out:   serial
Err:   serial
Checking for recovery command file...
** Bad partition 6 **
Card did not respond to voltage select!
** Bad partition 6 **
MMC Device 2 not found
MMC Device 2 not found
** Block device MMC 2 not supported
Net:   got MAC address from IIM: 00:19:b8:00:eb:59
FEC0 [PRIME]
Hit any key to stop autoboot:  0
MX6Q SABRELITE U-Boot >
MX6Q SABRELITE U-Boot >
MX6Q SABRELITE U-Boot >
MX6Q SABRELITE U-Boot > mw.l 0x020d8040 0x3040 && mw.l 0x020d8044 0x10000000
MX6Q SABRELITE U-Boot > reset
resetting ...

U-Boot 2011.12 (Apr 08 2012 - 04:54:32)

CPU:   Freescale i.MX61 family rev1.0 at 792 MHz
Reset cause: unknown reset
Board: MX6Q-Sabre Lite
DRAM:  1 GiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   FEC
Hit any key to stop autoboot:  0
MX6QSABRELITE U-Boot >
MX6QSABRELITE U-Boot >

After the reset, you should notice that we’re actually running the Linaro version of U-Boot 2011.12 (Apr 08 2012 - 04:54:32).

In this example, I hit the any key. If I hadn’t, the Linaro startup would have continued to boot the nano image I had loaded in the top SD card slot of my Nitrogen6X.

In order to boot the bottom slot, I need to set different values:

U-Boot 2009.08-00495-g10adc6d (Apr 24 2012 - 13:27:04)

CPU:   Freescale i.MX 6 family 0.0V at 792 MHz
Temperature:   can't get valid data!
...
Environment size: 1101/8188 bytes
MX6Q SABRELITE U-Boot > mw.l 0x020d8040 0x3840 && mw.l 0x020d8044 0x10000000
MX6Q SABRELITE U-Boot > reset
resetting ...

U-Boot 2011.12 (Apr 08 2012 - 04:54:32)

CPU:   Freescale i.MX61 family rev1.0 at 792 MHz
Reset cause: unknown reset
Board: MX6Q-Sabre Lite
DRAM:  1 GiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
MMC init failed
Using default environment
...

MX6QSABRELITE U-Boot > set hello world
MX6QSABRELITE U-Boot > savee
Saving Environment to MMC...
MMC init failed
MX6QSABRELITE U-Boot >

Note that the Linaro U-Boot expects to store its’ environment variables on SDHC3, or mmc 0 in U-Boot naming. This is the top slot on a Nitrogen6X and the bottom (full-sized) SD card slot on a Sabre-Lite, so we received two error messages (MMC init failed) when U-Boot tried to load and save the environment.

Also note that the boot mode is somewhat sticky. If you use U-Boot’s reset command or reboot from Linux, you won’t see the 2009.08 version of U-Boot execute. In order to get back to the original, use the power-key or reset button.

While we’re working to get to mainline and pushing the rstmode patch through the process, we added a couple of convenience commands to our local U-Boot tree.

This makes the process much simpler:

MX6Q SABRELITE U-Boot > run bootsd0
resetting ...

U-Boot 2011.12 (Apr 08 2012 - 04:54:32)

CPU:   Freescale i.MX61 family rev1.0 at 792 MHz
Reset cause: unknown reset
Board: MX6Q-Sabre Lite
DRAM:  1 GiB
...
adminRunning Linaro Ubuntu on i.MX6 (Sabre Lite and Nitrogen6X)

Comments 36

  1. Jeremy

    I can’t simply wget the files from linaro like that. One needs to agree to the EULA in order to download the real archives. wget gives you something with the correct filename, but it isn’t the tar.gz archive.
    To top it off, the specified release archives can’t be navigated to on the linaro.org site right now.

  2. Post
    Author
    ericn

    Hi Jeremy,

    Thanks for the comment.

    I just confirmed that the releases/latest folder doesn’t contain the package listed above but a release
    is available under 12.05/ubuntu, and it appears to be available using wget and without the need for a click-through license agreement.

    I’m able to grab this link just fine using wget.

    Where are you finding a link to a EULA?

    Please advise,

    Eric

  3. Jeremy

    Thanks for the quick reply.
    I’m not sure if it was the configuration on my machine, however wget and the chrome browser were giving me problems on the linaro server for a while.

    It appears that the problem has been fixed.

    Thank you,

    1. Post
      Author
      ericn

      Hi Wei,

      I believe the command to be this (0x20 into address 0x020d8040):

      mw.l 0x020d8040 0x20 && mw.l 0x020d8044 0x10000000 && reset

      I’m not in a position to test it at the moment. If you are, can you confirm?

      1. wei

        Ericn, appreciate your quick response. I did confirm it boots successfully from SATA using 0x20. Thank you very much.

        1. Post
          Author
      2. ka

        Could you please tell me , How to calculate this value (0×20 into address 0x020d8040) for SATA
        I would like to adapt with other device such as eMMC, SDx.
        Or advice me what chapter in reference manual should be read.

        Thank you

        1. Post
          Author
          ericn

          I’m not really sure what you’re asking.

          You can write to memory location 0x20d8040 in U-Boot like this:

          U-Boot > mw.l 0x020d8040 0x20
          

          In the latest U-Boot, there’s support for the bmode command. You’ll likely just want to use that.

  4. Rune K. Svendsen

    So how stable are these boards running Ubuntu? I just got a Raspberry Pi board, and I’m honestly not satisfied with the speed (armv6k 700 MHz CPU). I’m thinking of switching to a board like this to use as my server that downloads torrent files, plays audio on my stereo (controlled through my phone), and all sorts of other fun stuff that I can use it for.

    But it’s a necessity for me that it’s stable. Is this the case? Has anyone had it running for months as a server without problems?

    Also, has ARM/Linux development come so far that I can just grab an image from Linaro and put it on various boards? Last time I researched the subject, custom images were needed from the manufacturer, which obviously isn’t ideal.

    Thanks!

    1. Post
      Author
      ericn

      I feel pretty safe in saying that the boards haven’t been around long enough for “months” of life testing, but we’ve done a lot of multi-day testing of hardware and the Linux kernel(s). Most of our testing uses an embedded Linux variant of one form or another though.

      You also can’t just grab ‘the Linaro image’ or ‘the Ubuntu image’ and plop it on any ARM platform. You’ll at least need to take control over your kernel, which contains a lot of very hardware-specific stuff. If you want hardware-accelerated graphics or video, you’ll also need to layer in some additional packages.

      If you want a graphical desktop, you should plan on using SATA, since SD card I/O is slow and out of the box, nearly everything is set to pollute /var/log and friends.

      Having said all of that, the Sabre Lite and Nitrogen6X boards are in a totally different class from RPI.

      1. Rune K. Svendsen

        Thanks for the answer. I’m tempted to buy a board anyway, just to get to play with it. My biggest fear, though, is that I will experience some – to me – irreperable hardware error, and if no one else is willing to fix it for me, I’ll just have to live with it. Is there an active community surrounding the Sabre Lite/Nitrogen6X board? RPI has a large community it seems, so many problems get solved by either the community or the foundation.
        Is there any form of support included when buying a board from you? I don’t expect to be able to wake you up in the middle of the night to investigate why Tuxkart isn’t working for me, but just some sort of obligation that you are willing to work with me if I find what might be a hardware/firmware bug, given that I’m able to provide you with the information you need to fix the bug, or just diagnose the problem.

        Also, do you have any European retailers that sell your board? If I wait two months for the price drop to $199, the cheapest shipping option to Denmark ($120) will add 60% to the price of the board. Surely, shipping 100 units to retailers in Europe would save some that unnecessary cost.

        Cheers! :)

        1. Post
          Author
          ericn

          Hi Rune,

          We support the kernel and U-Boot through e-mail, (we charge a little more for middle of the night phone access and have to draw the line on TuxKart).

          There are a number of active communities who support Sabre Lite in particular including i.MX Community.

          We also support the hardware directly, and a number of others are supporting various software environments. Please refer to our community page and the BSP blog post for some details.

          We distribute through Arrow Electronics, and purchasing through that route may yield better prices on shipments.

          1. Rune K. Svendsen

            Sounds good. It also helps knowing that Freescale supports Ubuntu themselves. At least Ubuntu was one of their target OSes for the i.MX53 platform.

            Two more questions :)

            1. What are the differences between the Nitrogen6X board and the Sabre Lite board? I don’t see much of a difference, except the “TiWi 802.11 b/g/n WiFi+BT optional” bullet point on the Nitrogen6X specifications page. I presume this is some connector that connects to a WiFi add-on? Is this the only difference?

            2. On the Sabre Lite page on the Linaro site (https://wiki.linaro.org/Boards/MX6QSabreLite) under “Known Issues” is mentioned problems with the Gigabit ethernet. Is this something that will be solved at a later tape-out, more precisely: will it be solved when you start selling the boards for $199 in October?

            Thanks!

          2. Post
            Author
            ericn

            Hi Rune,

            1.) The primary difference is the addition of WiFi+BT, which required that we move the audio channel, but there are a couple of other more minor changes. A complete description is available in in this post.

            2.) The issue mentioned on the Linaro page came from confusion about the proper connection of one of the PHY pins (Pin 9 on the ethernet jack). In the earliest shipments of Sabre Lite, this was connected to a power supply (3.3V), and it should be left floating. Once we worked through the issue with Micrel (in January 2012), we altered the layout and all boards shipped afterwards have this pin disconnected. You can see the difference by examining the underside of the combination USB/Ethernet connector. On new boards, you’ll see exposed copper on one of the through-hole vias. This issue did not affect any Nitrogen6X boards.

          3. Post
            Author
            ericn

            To elaborate a bit on the Ethernet issue: On Rev D of the Sabre Lite board, the problem was resolved elsewhere, and exposed copper is not visible.

            Rev D and later have the revision on the silk screen as shown in this photo.

            Rev C and earlier boards have just a date code.

            Less than 10% of the boards in the field are affected by this issue.

  5. Rune K. Svendsen

    I have on extra question: why do you clock the cores at 1 GHz each? Is it possible to raise the clock to, say, 1.2 GHz? As far as I understand, Freescale says the cores are able to run up to 1.2 GHz each. Is it because of heat production that you clock them at 1 GHz?

    1. Post
      Author
      ericn

      Hi Rune,

      The answer is simpler: inertia… We haven’t had anybody ask until now. We’ve had enough trouble getting all four cores running with GPU and VPU.

      1. Post
        Author
  6. shaoyuguang

    Hello, I am using the development board is Nitrogen6X Linaro Ubuntu desktop system, I would like to support NTFS file system with the development of on-board SATA successful security

    Installed ntfs-3g and fuse-2.9.1.tar.gz, but when hung in NTFS format disk is still prompt: FATAL: Module fuse not found How do I fix it? Thank you

    1. Post
      Author
      ericn

      Having never run NTFS or FUSE, I don’t think we’ll be able to help on this one. Googling “Module fuse not found” shows a number of promising results, though.

    1. Post
      Author
  7. Nil

    I have followed above instructions and create an SD card.
    When I put it in Sabre Lite board.

    During Boot Procedure :
    //=================================
    .
    .
    .
    Begin: Mounting root file system … Begin: Running /scripts/local-top … done.
    [ 4.121841] mmc0: new high speed SDHC card at address 1234
    [ 4.135648] mmcblk0: mmc0:1234 SA04G 3.67 GiB (ro)
    [ 4.151617] mmcblk0: p1 p2 p3
    [ 4.483541] mxc_hdmi mxc_hdmi: No modes read from edid
    [ 4.490071] mxc_hdmi mxc_hdmi: create default modelist
    [ 4.496579] mxc_hdmi mxc_hdmi: Default modelist,the video mode may not support by monitor.
    Begin: Running /scripts/local-premount … done.
    [ 5.087291] EXT4-fs (mmcblk0p3): INFO: recovery required on readonly filesystem
    [ 5.094843] EXT4-fs (mmcblk0p3): write access unavailable, cannot proceed
    mount: mounting /dev/disk/by-uuid/72599a64-40da-43a1-8e1d-b6c4c836efc9 on /root failed: Invalid argument
    Begin: Running /scripts/local-bottom … done.
    done.
    Begin: Running /scripts/init-bottom … mount: mounting /dev on /root/dev failed: No such file or directory
    done.
    mount: mounting /sys on /root/sys failed: No such file or directory
    mount: mounting /proc on /root/proc failed: No such file or directory
    Target filesystem doesn’t have requested /sbin/init.
    No init found. Try passing init= bootarg.

    BusyBox v1.18.5 (Ubuntu 1:1.18.5-1ubuntu4) built-in shell (ash)
    Enter ‘help’ for a list of built-in commands.

    (initramfs)
    //=================================

    What is wrong here ? I had repeat the procedure twice but output is same.

    1. Post
      Author
      ericn

      Hi Nil,

      The problem seems to be here:

      [ 4.135648] mmcblk0: mmc0:1234 SA04G 3.67 GiB (ro)

      Note the ‘ro’ flag. Are you booting to the micro SD or the full-sized SD card slot? If the former, this is likely a kernel bug, since a micro SD card doesn’t have a write protect pin. If you used the full-sized slot, you might want to check the write-protect tab on the SD.

      You might also want to test one of the newer releases:
      http://boundarydevices.com/tag/linaro/

      1. Nil

        Hi ericn,

        Thank you, for answer.

        I had used and Micro SD card(4GB) inserted into SD card Adapter.
        This combination i have plugged into SD3 connector. The Lock pin is not at lock state.

        Also this combination is working fine on my pc during the image writing.

        some time i got the terminal on serial port but i cant change anything in file system it says read only file system.

        what should i have to use ?

        Nil

          1. Nil

            I have also tested new release “linaro-precise-alip-20121124-519.tar.gz” It also contains same problem of read only file system.
            //======
            root@linaro-alip:~# mkdir a
            mkdir: cannot create directory `a': Read-only file system
            root@linaro-alip:~#
            //=======

          2. nil

            I want to confirm that the card holder that is connected on my board is working properly for lock mechanism.

            Because both the Ubuntu from linaro and from freescale show same (ro) read only file system.

            i think there is problem in my board which dose not get correct status on wp pin of card holder.

            if card is locked the wp pin should be open and if unlocked then it should be closed. this status must be convey to processor.

            is their any chance of faulty board, or any other issue?

          3. Post
            Author
          4. nil

            The problem was Unsoldered pin11 of SD card holder on board.

            Now i can use the SD card with r/w permission.

            Now i have ported Ubuntu (linaro) 12.05. But it have some problems.
            1) Error in Software center package
            2) it took more than half ram of board(540MB out of 1GB) (compare to Ubuntu 11.04 on another board 280MB/1GB)
            3)very low memory available for user.
            4)after some USB plug/unplug events Ubuntu gets hanged. it dose not reposnd to anything.

  8. jean-francois simon

    Hi,
    On my sabrelite board, I have tried this and it works great: I can boot u-boot from the SD card.

    But when I look at the two i.MX6 registers involved (0x020d8040 and 0x020d8044) in the
    Freescale manual, the doc says these are general purpose registers. And I don’t see how this could override the boot fuses setting.
    Any ideas? thanks a lot

  9. jtheath

    Just received a couple SABRE Lite boards. The uSD is loaded with TimeSys demo and that runs well. Unfortunately no tools installed so decided to look around and the Linaro packages looked “best” for writing evaluation apps. Get them loaded and things look good – for a minute or two. Seeing several odd things ranging from SD card read failures to kernel page errors. Have tried Linaro Ubuntu 12.04, 12.05 developer and full desktop. Can’t say they behave similarly except both choke after a few minutes, between one and four. Serial debug just goes dead – no key processing and messages just stop. Hitting the green reset button cycles things but the reboot hangs at “Starting Kernel…” Power cycling brings it back.

    Tried changing SD cards, moving from class 4 to class 10. No improvement. Grabbed a second target board and tried things there. Same story.

    Looking for a relatively stable non-Android distro on which to build an embedded engine. Any suggestions?

    Thank you, Joe

  10. jtheath

    Got the oneiric-imx6-20130307.tar.gz package (Freescale/Linaro Ubuntu 11.10) running late yesterday evening. No sign of the instability seen with the other releases. Is there some additional setup needed to load and run the later builds?

    Much thanks for the “how to unbrick your board” post as that allowed me to undo the Linaro-suggested NOR changes.

Leave a Reply

Your email address will not be published. Required fields are marked *