Sunday, October 31, 2010

Installing Angstrom on the BeagleBoard-xM

This tutorial will show you how to set up Angstrom Embedded Linux on the BeagleBoard-xM.  Thanks to the works of others this is a much easier process that it use to be.

I am using Ubuntu 10.4 as my development machine and I am using the BeagleBoard-xM as the target.  Most of this should apply to other Linux Distributions and the original BeagleBoard.

First, we need to find out where your sd-card is mounted.  Plug in a sd-card into your computer wait for it to mount.  Then run the following command.

df -h

You will see something like this:
/dev/sda5              98G   56G   38G  61% / 
none                  1.5G  316K  1.5G   1% /dev 
none                  1.5G  724K  1.5G   1% /dev/shm 
none                  1.5G  336K  1.5G   1% /var/run 
none                  1.5G     0  1.5G   0% /var/lock 
none                  1.5G     0  1.5G   0% /lib/init/rw 
none                   98G   56G   38G  61% /var/lib/ureadahead/debugfs 
/dev/sdb1              15G  8.0K   15G   1% /media/FAE3-DCE5 

Look for a line that starts with /dev/sdXX in it; generally it will be mounted to the /media directory (on Ubuntu anyway).  Make sure the size of the sd-card is right to verify.  My sd-card is /dev/sdb.   [/dev/sdb1 is the first partition of the /dev/sdb drive].  You will need this device directory further in this exercise.

Setting up the sd-card.

For Angstrom to run you will need to have a sd-card with two partitions; one fat partition to hold the boot files and then a ext3 partition with the root file system on it.  Thanks to Graeme Gregory there is a nice script to set up you sd-card.    Execute the following commands which will make a working directory, download Graeme's script and execute it.  Be sure to substitue your sd-card device directory (from above) for /dev/sdX below. 

mkdir ~/angstrom-wrk
cd ~/angstrom-wrk
wget http://cgit.openembedded.org/cgit.cgi/openembedded/plain/contrib/angstrom/omap3-mkcard.sh
chmod +x omap3-mkcard.sh
sudo ./omap3-mkcard.sh /dev/sdX 
sync
Remove the card, wait two/three seconds, plug it back in.  Wait a few seconds and verify the sd-card is mounted by executing:

df -h

You should have two new mounted partitions:

/media/boot
/media/Angstrom

The card is now ready.  You only need to do this process once for the life of the card.

Generating a build:

 Go to the Narcissus website and generate a build.  A good place to start is to select: BeagleBoard (the original BeagleBoard and BeagleBoard-xM both use the same build); simple; and console only.  In the “Platform Specific Packages” check “Texas Instruments OMAP3x/AM3x family:-->Bootloader Files (x-load/u-boot/scripts)”.  Now click the “build me!” button on the bottom of the page and wait for the “builder” to generate the “*.tar.gz” file.  Download the “*.tar.gz” file into your working directory.  Don't worry about the second file.

Setup the boot partition:

There are only three files that are mandatory for boot partition.  The following lines will extract the files from the download build and copy those to the boot partition on the sd-card.

# extract the files to the ./boot directory
tar --wildcards -xjvf [YOUR-DOWNLOAD-FILE].tar.bz2 ./boot/*

# copy the files to sc-card boot partition.
cp boot/MLO-* /media/boot/MLO
cp boot/uImage-* /media/boot/uImage
cp boot/u-boot-*.bin /media/boot/u-boot.bin
sync

Last thing to do is to copy the root filesystem over.

sudo tar -xvj -C /media/Angstrom -f [YOUR-DOWNLOAD-FILE].tar.bz2
sync

Now make it safe to remove your sd-card.

sync 
umount /media/boot
umount /media/Angstrom

Your done; remove the sd-card and plug it into your BeagleBoard-xM and apply power to the board.

74 comments:

  1. I'm new to Linux so please forgive me but....
    I tried this method, when I booted my xM board the activity lights on each side of the micro SD flashed for a while and the screen displayed the Beagle Board logo and that's all. How long before I should see anything else?

    ReplyDelete
  2. The time it took was directly related to the packages I included, the more you select the longer it takes to launch the for the first time. Now I have run into a different matter, I included the X11 interface and I'm unable to login I keep getting login failures and I am not sure what to use as the user-name and password.

    ReplyDelete
    Replies
    1. after start up press ctrl ALT F1
      this will bring up a tty console, login as root, no password. Then create a newuser with a password. then
      ctrl ALT F2 to return to X11
      log in with new user and password

      Delete
    2. I am too having log in problems I installed X11 with gnome, I get to the log in screen but I can't log in with username:root, password: also ctrl ALT F1 from startup not working

      Delete
  3. Great tutorial, I never quite understood how OE worked. This way I can get something that works and I can start poking at it. Congratulations. There is an error in the "Setting up the sd-card" section. You write
    "mkdir ~/angstom-wrk
    cd ~/angstrom-wrk"
    As you can see it should be "mkdir angstrom-wrk". Besides this simple typo, the tutorial is perfect. Kudos

    ReplyDelete
  4. Hi ,
    I created my own uImage for the board.Now If I replace the image with my own uImage.Booting was stopped at the uncompressing linux.Since two days I am trying for that Can anyone please help me to do this one.Just I want to replace uImage in the sd card.
    Regards,
    Ravat

    ReplyDelete
  5. While I am new to Linux I am able to get Android, Angstrom Demo, Ubuntu Netbook preinstalled and others up and running on BBxM, there is still the known problem of having to add a user to be able to use a GUI with Narcissus builds. If anyone has clear instructions on how to do this it would be greatly appreciated.

    ReplyDelete
  6. AR, how did you make the image? What toolchain did you use? What did you compile it on?

    ReplyDelete
  7. Lony, Are you trying to get a GUI desktop up and running? If so might want to try the demo build at this URL.

    http://www.angstrom-distribution.org/demo/beagleboard/

    This is a full xfce desktop environment.

    ReplyDelete
  8. Hi trey,
    I am using arm-tool chain.I am using the linux.2.6.32 kernel from the git repository, its booting fine now. And the problem is I am unable to find the eth0 interface and any devices connected to the usb port on my BB-xM.Can you please tell me what driver I need to configure so that it works fine. Is that stable kernel for the bb-xM or not.

    Regards,
    RV

    ReplyDelete
    Replies
    1. Hi AR,

      How did you make it work? I also created my own uImage but also stopped at uncompressing kernel.
      Thanks.

      Delete
  9. Thanks Trey
    That was one of the first ones I checked out
    I have found quite a few .imgs, extracted .tars, onto SD cards and got them all up and running, I especially like Maverick Meerkat with the Unity GUI. My problem is that when I build via Narcissus and include a GUI such as xfce when I am confronted with the GUI login when setting up the Beagleboard I always get "Authentication Failure". I've done some research and from what I can find this is common with Narcissus builds and in order to get beyond this point I must use adduser. Is this truly the case or have I been misguided?

    ReplyDelete
  10. hi Trey. I just can follow your step through the SD partition setup. There is no MLO, boot.bin from the package i downloaded from your link.

    anw, I set it up with files from this
    http://www.angstrom-distribution.org/demo/beagleboard/
    is it ok if i used another uimage version for angstrom-demo-image? (ofc with same module version)

    ReplyDelete
  11. btw, i booted BB with COMtoUSB cable from my PC and i got this
    Beagle xM Rev A
    Die ID #225800011ff00000015739eb0c030012
    Hit any key to stop autoboot: 0
    mmc1 is available
    The user button is currently NOT pressed.
    reading boot.scr
    ** Unable to read "boot.scr" from mmc 1:1 **
    its still going up to the angstrom login thingy, but idk if boot.scr is a problem coz i dont even know what its for :(

    ReplyDelete
  12. If you don't have the MLO, boot.bin then your forgot this step.

    "In the “Platform Specific Packages” check “Texas Instruments OMAP3x/AM3x family:-->Bootloader Files (x-load/u-boot/scripts)”."

    ReplyDelete
    Replies
    1. Hello Trey

      I really need some help with the angstrom login. So i did everythin like you said and i also included the X11 GNOME package. But when my beagle board xM loads the OS does not seem to load... also the login problem with everybody.. what is the initial login/ password for angstrom?

      Delete
    2. The included X11 does not accept root as username. You need to create a new user. You can do it via the serial console or by pressing ctrl+alt+F1 at the login screen.

      Delete
  13. i tried but getting the below error whats wrong sir??
    Kernel panic - not syncing: Fatal exception in interrupt

    ReplyDelete
    Replies
    1. Press anykey to stop autoboot, then you should try:
      setenv mmcroot /dev/mmcblk0p2 rw

      Delete
  14. Thanks - I don't think I would have figured out the process of creating the boot partition without this page.

    Angstrom is crazy fast on the Beagleboard XM. I was very unhappy with the performance of Ubuntu. The BogoMIPS score is about 50% higher with Angstrom.

    I did run into one problem with the instructions on this page - the following command didn't work:

    tar --wildcards -xjvf [YOUR-DOWNLOAD-FILE].tar.bz2 ./boot/*

    I'm not sure if you meant that the download file from Narcissus should end with .tar.bz2 - mine ended with gz. Replacing the j with a z in the options did the trick:

    tar --wildcards -xzvf random--image-beagleboard.tar.gz ./boot/*


    Also, I noticed that Narcissus displayed a big red X next to the "angstrom-uboot-scripts" option when it built the image, but I don't think that affected the process at all.

    Thanks again,

    Dan.

    ReplyDelete
  15. Would any development machine work for the downloaded files?

    ReplyDelete
  16. And what is image for?

    ReplyDelete
  17. I'm just starting on my new legs in Linux so I got nearly no clue on just about anything in this field. Can someone help me? And do all of these pre-written program commands only work on Ubuntu 10.4?

    ReplyDelete
  18. Hello, nice tutorial. I could install Angstrom quickly (which failed for others).

    Even i have selected xfce 4.6 desktop environment, i could see the Angstrom ASCII text logo with a login prompt.

    How can i get to GUI ?

    -Aadeesh

    ReplyDelete
  19. Is there a way to get a reliable wireless connection? If so, can you put down a tutorial.

    ReplyDelete
  20. Don't you have to configure the screen resolution?

    ReplyDelete
  21. Having trouble booting my new BB xm. After power up user leds flash momentarily then user0 double flashes continually. TX line toggles RX line does not.

    Set up:
    External 5V supply
    Serial to USB cable
    Host: Windows Xp with hyperterminal
    SD boot disk that came with board.

    Any help appreciated.
    DC

    ReplyDelete
  22. Hi I got my new BB C3 , I tried with buitin images and board got booted ,.. later I started building my own images but stuck in building root file system image .... can u help me out with this issue?

    ReplyDelete
  23. Hey,

    thanks for the tutorial. I just wanted to report that I had problems with Graeme Gregory's script. It created the partition table on the SD card but couldn't create the partitions.

    I had to use gparted and create them manually, then I could go on further.

    Hope this helps someone :)

    ps: I use Ubuntu 10.10 on a laptop with a built-in cardreader.

    ReplyDelete
  24. anyone has success installing V4L2 on Angstrom for Beagleboard XM?

    i want to use a webcam

    ReplyDelete
  25. Hi do you know what is the login and password for the hawkboard generated rootfs files?
    Thanks

    ReplyDelete
  26. After partitioning a new micro SD card as specified, powering the BB-xM with the card in place, connecting to PC using minicom and setting the interfaces, it displays
    "6---------------------"
    What is wrong I have done in partioning or copying the Angstrom contents?

    ReplyDelete
    Replies
    1. I think you did a wrong format SDcard.
      You could try this link:
      http://circuitco.com/support/index.php?title=BeagleBoard-xM

      Good luck.

      Delete
  27. Hello,

    I get the following output on the terminal and the booting halts. What might be going wrong here?

    Texas Instruments X-Loader 1.4.4ss (Jul 28 2010 - 16:59:13)
    Beagle xM Rev A
    Reading boot sector
    Loading u-boot.bin from mmc


    U-Boot 2010.12-rc3 (Jan 06 2011 - 09:52:08)

    OMAP3630/3730-GP ES2.0, CPU-OPP2, L3-165MHz, Max CPU Clock 1 Ghz
    OMAP3 Beagle board + LPDDR/NAND
    I2C: ready
    DRAM: 512 MiB

    ReplyDelete
  28. Hey ! wonderful tutorial that .. Just had a query concerning the latest rev C board , the onboard USB hub in rev C does not list usb devices when connected, i have tried both Angstrom and ubuntu but to no avail.
    Has anyone found a workaround ?? please share

    ReplyDelete
  29. hi, i just got a new beagleboard-xm with angstrom linux pre loaded in it. pls help on how to install gcc and package management utilities on angstrom.

    ReplyDelete
  30. I was not able to partition the disk as u specified i am getting following errors

    Re-reading the partition table ...
    BLKRRPART: Success

    If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
    to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
    (See fdisk(8).)
    ./omap3-mkcard.sh: line 37: kpartx: command not found
    Cant find boot partition in /dev
    umount: /dev/mapper/mmcblk0p2: not found
    mke2fs 1.41.11 (14-Mar-2010)
    Could not stat /dev/mapper/mmcblk0p2 --- No such file or directory

    The device apparently does not exist; did you specify it correctly?

    ReplyDelete
  31. I solved the above problem using a Disk Utility in system. I formatted the mmc using Master Boot Partition and left .
    But We could not see the partition ..... for the command df -h
    . So just neglect it. You will get your /dev/SdX ...from the disk Utility itself use that. ....


    Hope this will give help for some one like me.:)

    ReplyDelete
  32. After a recent build, I couldn't find the files referenced in the blog. The extensions were different. For example, I didn't have a u-boot.bin. After some research, I ended up doing this:

    cp MLO /media/boot/MLO
    cp uImage-beagleboard.bin /media/boot/uImage
    cp u-boot.img /media/boot/u-boot.img
    sync
    tar -xvj -C /media/Angstrom/ -f console-image-beagleboard.tar.bz2
    sync

    I also had to make the partitions by hand and format them. Ubuntu 11.10 is doing something funny with USB mounted SD cards. Use omap-mkcard.sh as a guid. When the steps above were complete, I issued an 'eject /dev/sdX' command to make sure all the files were completely written to the card. This worked on a beagleboard xm.

    ReplyDelete
  33. Texas Instruments X-Loader 1.5.1 (Oct 24 2011 - 23:55:51)

    Beagle xM

    Reading boot sector

    Loading u-boot.bin from mmc

    After that it hangs here without giving any error or warning.
    Any information will be appreciated.

    ReplyDelete
  34. Hi all,

    I have a beagle board xm and am trying to set up Angstrom. I set up the sd card with two partitions as mentioned above boot and Angstrom.
    Boot Partition: MLO, boot.scr, u-boot.img, uImage
    Angstrom Partition: untarred the Angstrom tar file

    I am now trying to boot up but I don't see anything in my terminal. I have the board hooked up with a 5V supply. When the board is powered D13 (red LED) lights up. Are there other LED's that should light up? I am using GTKTerm and my port setting parameters are port: /dev/ttyUSB0, speed: 115200, parity: none, Bits:8, stopbits:1,flowcontrol: 0. I don't see any output on gtkTerm. I am using a belkin serial to USB and I don't see the Tx let light up at all. I see the Rx light up when I send data from GTKTerm confirming I have a link setup.

    ReplyDelete
    Replies
    1. Hi Abid Bodal, I think your 5V external power supply > 5.2V so the red light is on.
      You should change another 5V supply.
      Good luck.

      Delete
  35. Hi all,
    I followed all the steps in the tutorial. But when I boot my BeagleBoard Xm, all I get is a Beagleboard.org picture on my lcd via the hdmi port. I waited for 10-15 min but nothing changed. The D6, D7 LED beside the sd card keep blinking. What am I doing wrong?

    Also, I have connected a serial to USB cable to the BeagleBoard Xm. But I am not getting any output on minicom.

    Please help me out.

    Cheers,
    Jayneil.

    ReplyDelete
    Replies
    1. Try this commmand:
      setenv mmcroot /dev/mmcblk0p2 rw

      Delete
  36. I am facing a similar problem to JD... Please help...

    ReplyDelete
  37. I'm using BB-xM, I did everything above,
    But finally,the board stopped at:
    "Starting kernel ...
    Uncompressing Linux....."
    How can I fix it?
    Thank you so much.

    ReplyDelete
    Replies
    1. Cuongle,
      I had the same problem before. I got around it by entering the bootloader command-line and changing the settings of the /dev/mmc.. card device to rw, as it was read-only by default:
      setenv mmcroot /dev/mmcblk0p2 rw

      Did anyone else have the same issue as "AnonymousSep 14, 2011 10:10 PM" above, where booting stops at line:
      Loading u-boot.bin from mmc

      I have a BeagleBoard xM rev C. The reason I get this now is because I tried to build the u-boot.bin bootloader myself, I've tried sources from all the repositories below:
      git://git.denx.de/u-boot.git
      git://gitorious.org/beagleboard-default-u-boot/beagle_uboot_revc4.git
      git://gitorious.org/beagleboard-validation/u-boot.git

      am a bit stuck now.

      thanks!

      Delete
  38. for extracting you have asked to use below command
    sudo tar -xvj -C /media/Angstrom -f [YOUR-DOWNLOAD-FILE].tar.bz2
    but we are getting tar.gz so what command we have to use in place of above one?

    Regards

    ReplyDelete
    Replies
    1. i think this will work
      sudo tar -zxv -C /media/Angstrom -f random-84b9fe76-image-beagleboard.tar.gz

      Delete
  39. Hi,

    I'm built a custom Linux kernel 3.2.2. I generated a uImage and am trying to figure out how to install the rootfs on the sd card... like your notes above, all the examples I found were using some pre-build files. Just uncompress *rootfs.tar.gz to the SD card. But I'm building the kernel by myself how do I install the rootfs contents? I asked the same question here: https://groups.google.com/forum/#!topic/beagleboard/TFNLZb7st_o , still waiting for someone to reply... Thought might try my luck asking you... Thanks in advance.

    ReplyDelete
  40. Hi,
    When I built the image in the Narcissus Web site the mono pka appears with a red cross, Any idea why ?
    thanks

    ReplyDelete
    Replies
    1. Hi, Actually it is not really necessary to do the build you can download the files directly form:

      http://www.angstrom-distribution.org/demo/beagleboard/

      Cheers!

      Delete
  41. Hi,

    After I get all this process done what will be the standard output. Will the board be ready for me to connect video display via HDMI?

    Thanks!

    ReplyDelete
  42. After doing these steps the sd card is no longer recognized by my pc. I have already wasted 2 sd cards , what is happening? Please help me

    ReplyDelete
  43. Hi,

    I followed this guide but I have some problems with booting Angstrom on BB-xm Rev C. I was build my Linux kernel 2.6.32 that I download from kernel.org and I copied uImage to the SD card (on the Angstrom partition, boot folder). When I powered up my BB it stops booting on "Uncompressing Linux... done, booting kernel.". I was build kernel with "make -j5 ARCH=arm CROSS_COMPILE=arm-angstrom-linux-gnueabi- uImage". Leds behind Ethernet port (green and yellow) doesn't light up while leds beside SD card continuously light.

    Does anyone have any suggestion? Where I'm wrong?

    Thanks!

    Regards,
    Vladimir

    ReplyDelete
  44. I followed the instructions above and everything works great... except that it only boots with the command line and I never see a GUI. Any idea why that is?

    ReplyDelete
  45. Hey there,

    I guess when extracting the tar, it should be xzvf instead of xjvf as it is not a bzip2 file, but a gz. That is what narcissus creates for the time being.

    ReplyDelete
  46. Hello Trey,
    The tutorial is great though I want to compile the u-boot and kernel on my own and not use pre-built. Do you know how?
    I've followed this instructions: http://eewiki.net/display/linuxonarm/BeagleBoard
    and know have Debian FS on the Beagle board XM, It doesn't matter to me witch FS to use, I just want to use Qt and I saw you have a great tutorial about that with Angsrom FS (http://treyweaver.blogspot.co.il/2010/10/setting-up-qt-development-environment.html)...
    So, I need (if you have) either a tutorial for compiling the u-boot and kernel for Angtron use (maybe I can use the ones I've already compiled for Debian) or a tutorial about Qt for Debian FS...

    Thank You!!
    Aline

    ReplyDelete
  47. hi,

    my bb does not see sd card. sd card leds are off(d6 and d7) normally it works but now i haven't boot from sd card. any suggestions?

    ReplyDelete
  48. Hi,

    I first got stuck at uncompressing the kernel, and adding mmcroot to uEnv.txt solved that. However, now I'm stuck at the loading of the network. Getting Alignment trap messages as well.

    Any clue ?

    ReplyDelete
  49. Hello,

    There is uImage in the rootfs that I downloaded from narcissus, I mean the kernel is loading from /Angstrom/boot/uImage and not /boot/uImage where I've copied it according to the tutorial,
    Also, there is no u-boot.bin but u-boot.img, what are the differences?

    And, can anyone tell me what are the parameters that are supposed to be in uEnv?..

    Thanks!

    ReplyDelete
  50. To install angstrom to beagle board xm do I need to connect it to PC via serial port or ethernet port?
    Do I need to supply 5v power?
    Do I need to connect mini usb cable?
    Please let me know all the initial connectivity required for beagle board xm to install angstram?

    ReplyDelete
  51. God bless you brother. most useful tutorial ever seen. thank you

    ReplyDelete
  52. My Narcissus file did not include an MLO . And is it u-boot.bin? or u-boot.img (which is what is on the Angstrom file archives where I went to get that MLO?)

    Still pretty dang confusing!!

    ReplyDelete
  53. can't log in it asks for username and password I have tried root and repsectivly not working also tried ctrl ALT F1 not working

    ReplyDelete
    Replies
    1. There is no password, just hit enter whenever the password is required.

      Delete
  54. I followed the tutorial, but when booting for the first time i get the following error :
    Timeout reached while wating for return value
    *uld not receive return value from daemon process. [fail]
    Error, do this: mount -t proc none /proc
    cupsd: Cannot run as a setuid program!
    cups: unable to start scheduler.
    INIT: Id "S" respawning too fast: disabled for 5 minutes
    INIT: Id "1" respawning too fast: disabled for 5 minutes
    INIT: no more processes left in this runlevel
    INIT: Id "1" respawning too fast: disabled for 5 minutes
    INIT: Id "S" respawning too fast: disabled for 5 minutes
    INIT: Id "S" respawning too fast: disabled for 5 minutes
    INIT: Id "1" respawning too fast: disabled for 5 minutes
    INITId "S" respawning too fast: disabled for 5 minutes
    INIT: Id "1" respawning too fast: disabled for 5 minutes
    INIT: Id "1" respawning too fast: disabled for 5 minutes
    INIT: Id "S" respawning too fast: disabled for 5 minutes
    It's been 2 days now and i can't figure out why is this happening :/
    Any help would be highly appreciated :)

    ReplyDelete
  55. i have followed the same steps as mentioned . In my media the partion is names as boot1 instead of boot i have done the same procedure but when i put my sd card on beagleboard-xm it only shows logo on the screen and then black screen comes. what is the issue can any one plzzz help..

    ReplyDelete
  56. Lucky Club Casino Site - Get Lucky Club Casino Review and Ratings
    Lucky Club Casino is a new online casino that was launched in 2015. luckyclub.live It is a good company but unfortunately its website and site is slow. This is a serious mistake.

    ReplyDelete