Trying to get Angstrom going on Beagle Board

264 views
Skip to first unread message

rober...@apostrophe.co.uk

unread,
Sep 8, 2008, 7:45:17 PM9/8/08
to Beagle Board
I'm hoping someone can tell me what salient point I am missing with
trying to get Angstrom going on my Beagle Board. I've spend all day
trying to get it going, so thought I'd post this before bedtime in the
hope there'll be someone telling me what an idiot I've been in the
morning! ;-)

I have downloaded the files from here:

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

I have followed the instructions for dual formatting an SD card here
(4G, not 2G, just in case that's relevant):

http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat

I untarred

file:///home/robertw/Data/Linux/Beagleboard/Angstrom-Beagleboard-demo-image-glibc-ipk-2008.1-test-20080823-beagleboard.rootfs.tar.bz2

And put that on the ext3 partition of the SD card.

On the FAT partition I put:

mlo
u-boot.bin
uImage

I then insert the DS card, boot into uBoot while holding USER switch
down and issue the following commands (there is no Beagleboard logo in
this version of uBoot as there is from the presinstalled NAND flash
version):

(Instructions from here)

http://code.google.com/p/beagleboard/wiki/BootingBeagleBoard

mmcinit
fatload mmc 0 0x80300000 uImage

I then tried two possibilities:

First:

setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p1
rootfstype=ext2 rw rootdelay=1 nohz=off

bootm 0x80300000

This gives me kernel panic and says:

No filesystem could mount root, tried: ext2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-
block(179,1)

I do get a beagleboard.org logo

Them if I reboot, and for the setenv this time put the line from the
readme file:

setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/
mmcblk0p2 rootdelay=2 rootfstype=ext3 video=omapfb:vram:2M,vram:4M

bootm 0x80300000

This time I get at the end:

Freeing init memory: 176K
Kernel panic - not syncing: No init found. Try passing init= option
to kernel.

I saw a post where someone had said they had "finally" got Angstrom
going and someone was expressing alarm that it had been hard. I must
say, if I had not had some embedded Linux experience elsewhere I would
have been *totally* lost rather than simply struggling like mad to get
this far. (That sounds awfully ungrateful for all the work that has
already been put in by other people and I don't wish it to sound like
that.) I'm probably missing something salient, but I just cannot see
at all, so really hope someone can point me to the bit that I can't
see for looking!

Getting to this point had taken from 10am this morning to midnight
with the odd break, so it's definitely not a straightforward thing. If
I can get this going I'll write up a newb's guide to getting it all
loaded up.

Most grateful for any help going it going! :~)

Rob




Jason Kridner

unread,
Sep 10, 2008, 8:40:22 AM9/10/08
to Beagle Board
See below for what I believe is your mistaken step....

On Sep 8, 6:45 pm, robert.w...@apostrophe.co.uk wrote:
> I'm hoping someone can tell me what salient point I am missing with
> trying to get Angstrom going on my Beagle Board. I've spend all day
> trying to get it going, so thought I'd post this before bedtime in the
> hope there'll be someone telling me what an idiot I've been in the
> morning! ;-)
>
> I have downloaded the files from here:
>
> http://www.angstrom-distribution.org/demo/beagleboard/
>
> I have followed the instructions for dual formatting an SD card here
> (4G, not 2G, just in case that's relevant):
>
> http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat
>
> I untarred
>
> file:///home/robertw/Data/Linux/Beagleboard/Angstrom-Beagleboard-demo-image-glibc-ipk-2008.1-test-20080823-beagleboard.rootfs.tar.bz2
>
> And put that on the ext3 partition of the SD card.

I assume that you 'untarred' the file onto the ext3 partition, not
just copied the file. You need to do that as root as many of the
files must have root ownership.

>
> On the FAT partition I put:
>
> mlo
> u-boot.bin
> uImage
>
> I then insert the DS card, boot into uBoot while holding USER switch
> down and issue the following commands (there is no Beagleboard logo in
> this version of uBoot as there is from the presinstalled NAND flash
> version):
>
> (Instructions from here)
>
> http://code.google.com/p/beagleboard/wiki/BootingBeagleBoard
>
> mmcinit
> fatload mmc 0 0x80300000 uImage
>
> I then tried two possibilities:
>
> First:
>
> setenv bootargs console=ttyS2,115200n8 noinitrd root=/dev/mmcblk0p1 rootfstype=ext2 rw rootdelay=1 nohz=off

Note that you are pointing to the first partition that you formatted
as FAT here as your root file system (mmcblk0p1), instead of the
second partition that you formatted as ext3 (mmcblk0p2). That's
probably not what you intend if you have a dual-partition card.

>
> bootm 0x80300000
>
> This gives me kernel panic and says:
>
> No filesystem could mount root, tried:  ext2
> Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-
> block(179,1)

FAT partitions don't work well for the Linux root file system.

>
> I do get a beagleboard.org logo
>
> Them if I reboot, and for the setenv  this time put the line from the
> readme file:
>
> setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/mmcblk0p2 rootdelay=2 rootfstype=ext3 video=omapfb:vram:2M,vram:4M
>
> bootm 0x80300000

This is better. I note that you left off the closing quote ('), but
you likely corrected that in what you actually did or you would not
have likely gotten to the prompt again.

>
> This time I get at the end:
>
> Freeing init memory: 176K
> Kernel panic - not syncing: No init found.  Try passing init= option
> to kernel.

I'm guessing here that you did *not* untar the root file system, which
would explain why the 'init' program would not be found on the root
file system. Here's an example how to un-tar:

sudo tar xvjf /home/robertw/Data/Linux/Beagleboard/Angstrom-
Beagleboard-demo-image-glibc-ipk-2008.1-test-20080823-
beagleboard.rootfs.tar.bz2 -C <mounted second partition on SD card>

>
> I saw  a post where someone had said they had "finally" got Angstrom
> going and someone was expressing alarm that it had been hard. I must
> say, if I had not had some embedded Linux experience elsewhere I would
> have been *totally* lost rather than simply struggling like mad to get
> this far. (That sounds  awfully ungrateful for all the work that has
> already been put in by other people and I don't wish it to sound like
> that.) I'm probably missing something salient, but I just cannot see
> at all, so really hope someone can point me to the bit that I can't
> see for looking!
>
> Getting to this point had taken from 10am this morning to midnight
> with the odd break, so it's definitely not a straightforward thing. If
> I can get this going I'll write up a newb's guide to getting it all
> loaded up.

It is indeed a very complex task, but many people have sufficient
Linux background that they find it quite easy. Doing a complete write-
up is also a complex task as there are many potential gaps in
knowledge to what is required. The approach I'm taking is to see
where people have problems and to amend the documentation based upon
places where people actually get stuck. Even with this we have a bit
of "information overload".

John Beetem

unread,
Sep 10, 2008, 4:48:09 PM9/10/08
to Beagle Board
Rob,

I think it's important to untar rootfs directly to the SD card. Do
not untar on a PC and then copy the untarred file system to the SD
card. rootfs contains many symbolic links which untar OK but may not
copy properly.

Here's what's worked for me on Kubuntu Linux:

1. cd <root of SD card>

2. sudo tar -xvf <full path name of rootfs.tar on PC>

John

doug....@gmail.com

unread,
Sep 10, 2008, 7:19:54 PM9/10/08
to Beagle Board
Rob,
You could have most of it right but your setenv is wrong since I can
see your "root=" section is specifying the FAT partition instead of
the ext3 partition which is what you untar-ed to.

FWIW, here is a complete list of what was done, using data from those
links you stated. Make sure you did each step in order and you should
get to booting.

1) partition the SD card
partition 1 = 3M Fat32 LBA( type c )
partition 2 = remaining ext3( default )
2) format the SD card
sudo mkfs.msdos -F 32 /dev/mmcblk0p1 -n LABEL
sudo mkfs.ext3 /dev/mmcblk0p2
3) Mount the partitions
sudo mkdir /media/disk-1; sudo mount /dev/mmcblk0p1 /media/disk-1
sudo mkdir /media/disk-2; sudo mount /dev/mmcblk0p2 /media/disk-2
4) Copy the files to partition 1 and MLO must be copied first
cd ~/BeagleBoard/Demos/Angstrom
sudo cp MLO /media/disk-1
sudo cp u-boot.bin /media/disk-1
sudo cp uImage /media/disk-1
5) Extract the root filesystem to partition 2
sudo tar -C /media/disk-2 -xjf Angstrom-Beagleboard-demo-image-glibc-
ipk-2008.1-test-20080823-beagleboard.rootfs.tar.bz2
6) Cleanup - Flush any disk cache bufferes and umount SD
sudo sync; sudo umount /media/disk-*
7) Connect RS232
run minicom at 115200,8,n,1
8) Boot BeagleBoard with the SD installed by entering this in the
minicom terminal window
NOTE: from Angstrom README.txt I ran:
setenv bootargs 'console=ttyS2,115200n8 console=tty0 root=/dev/
mmcblk0p2 rootdelay=2 rootfstype=ext3 video=omapfb:vram:2M,vram:4M'
setenv bootcmd 'mmcinit;fatload mmc 0 0x80300000
uImage;fatload mmc 0 0x81600000;bootm 0x80300000';
run bootcmd

Extra notes:
a) if you enter "saveenv" before running the "run bootcmd" command,
you will save the two long lines into NAND and all you'll need to to
next time is run the "run bootcmd" to boot.
b) Add "; boot" to the end of the "setenv bootargs" line, run
"saveenv" and you will get an auto booting system.

If you don't have Linux on your PC, you can use something like the
Knoppix liveCD to do all off this. I think minicom is part of the
Knoppix LiveCD. If not, ask and I'll help you get that running.

Doug

rober...@apostrophe.co.uk

unread,
Sep 11, 2008, 12:10:00 PM9/11/08
to Beagle Board
Chaps,

Many thanks for your kind help. The one thing I hadn't done was untar
the distribution directly on to the flash card. I had, indeed,
untarred it onto my HDD and then copied it across.

This hasn't helped though and I'm still getting similar errors. I am
wonding whether my SD card is a bit dodgy, so will try the one from mt
camera! It's shewing some file system errors just before kernel panic
- I have posted below.

Since I had posted the original mail, I had gone over my bootargs and
notieced things like ext3 rather than ext2 as the filesystem and
changed those. I should have noticed things like that before; I am
guilty someomtes of spending too long a period of things like this
when walking away and clearing your head is often the most sensible
thing to do!

Just for completeness' sake, I'm a long time Linux desktop/laptop user
running Mandriva and have done a *little* embedded Linux, so these
concepts aren't completely alien to me. Things like changing the card
to /dev/sddX rather than /dev/mmcbblkX or /dev/sdcX were not too
taxing. I had already carried the instructions Doug posted almost
exactly apart from the fact that it would never have occurred to me to
untar directly to the ext3 partition on the flash card.

Thanks again, I'll try a different flashcard now and here is the tail
end of my kernel boot messages:

Cheers,

Rob

---------------------------------------------------------------------------------
<4>mmc0: card lacks mandatory switch function, performance might
suffer.
mmc0: card lacks mandatory switch function, performance might suffer.
<4>mmc0: host does not support reading read-only switch. assuming
write-enable.
mmc0: host does not support reading read-only switch. assuming write-
enable.
<6>mmcblk0: mmc0:0008 SD 4096000KiB
mmcblk0: mmc0:0008 SD 4096000KiB
<6> mmcblk0: mmcblk0: p1 p1 p2 p2

<6>kjournald starting. Commit interval 5 seconds
kjournald starting. Commit interval 5 seconds
<4>EXT3-fs warning: mounting fs with errors, running e2fsck is
recommended
EXT3-fs warning: mounting fs with errors, running e2fsck is
recommended
<6>EXT3 FS on mmcblk0p2, EXT3 FS on mmcblk0p2, internal journal
internal journal
<6>EXT3-fs: mounted filesystem with ordered data mode.
EXT3-fs: mounted filesystem with ordered data mode.
VFS: Mounted root (ext3 filesystem).
VFS: Mounted root (ext3 filesystem).
<6>Freeing init memory: 132K
Freeing init memory: 132K
<4>Warning: unable to open an initial console.
Warning: unable to open an initial console.
<0>Kernel panic - not syncing: No init found. Try passing init=

rober...@apostrophe.co.uk

unread,
Sep 11, 2008, 2:41:49 PM9/11/08
to Beagle Board
Turns out it was (at least partly) the card itself. I tried the one
from my camera and it just worked. :-/

That's not to say the issue about untarring directly to SD card wasn't
equally as important.

Now to work out how the hell to connect an OTG USB connector to a
hub!

Thanks again for all your help. :~)

Steve Franks

unread,
Sep 11, 2008, 6:28:10 PM9/11/08
to beagl...@googlegroups.com
> Now to work out how the hell to connect an OTG USB connector to a
> hub!

http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=H2956-ND

I haven't got mine yet, but it appears to be the right thing.

Steve

Jason Kridner

unread,
Sep 11, 2008, 6:41:04 PM9/11/08
to Beagle Board
On Sep 11, 5:28 pm, "Steve Franks" <stevefra...@ieee.org> wrote:
> > Now to work out how the hell to connect an OTG USB connector to a
> > hub!
>
> http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=H295...
>
> I haven't got mine yet, but it appears to be the right thing.
>

That'll work fine as long as you have a USB hub with a mini-B port on
it. If it has a standard-B port, then you'll need a mini-B to
standard-B adapter. That might be easier to find than the mini-A to
standard-A adapter I've been recommending:

http://www.vernier.com/accessories/access.html?usb-mini&template=basic.html

Either way, be sure to use a mini-*A* to connect to the Beagle when
you want it to act as a host (as in connecting it to a hub to talk to
other peripherals). If you connect a mini-B to the Beagle (which it
allows since the Beagle has a mini-AB port), the Beagle will think
that you are trying to use it as a device, rather than a host. In
USB, a host is always required and it must be at the top of the tree
(unlike IEEE-1394/Firewire). Some folks might want to use Beagle as a
device, such as when you connect Beagle to a PC (which would also
supply it with power).

Hope this helps.

Steve Franks

unread,
Sep 11, 2008, 6:51:58 PM9/11/08
to beagl...@googlegroups.com

Is it true that a "mini-A" is a mini-B with 5 wires instead of 4, or
is there something more exotic going on?

Steve

doug....@gmail.com

unread,
Sep 12, 2008, 12:38:37 AM9/12/08
to Beagle Board
Good to hear you got it working. Now, to save you some time, the trick
to what a mini-a is and a mini-b is goes like this. Mini-a has pins 4
and 5 as GND and that is what kicks the OTG port into HOST mode. Every
mini- cable you'll find around the house is a mini-b and the only way
that'll work is to manually ground pin 4 on the back of the OTG
socket.

Also, for less than $20 there's a kit at Fryes with standard A
connectors on both ends of a cable and a bunch of adapters, including
a mini-b. My USB hub has a mini-b socket on it so I need to get a mini-
a -> mini-b cable.

If you try the pin-4 grounding thing, you only need to do it once
booting and can release after the boot up. Also, the two large through
holes next to the SD socket make for good ground clip-able locations.

Doug

Gerald Coley

unread,
Sep 12, 2008, 9:50:48 AM9/12/08
to beagl...@googlegroups.com
Correct. The exotic piece is that the ID pin (pin 5) must be grounded in order for the OTG portt to go into Host mode.
 
Gerald

rober...@apostrophe.co.uk

unread,
Sep 12, 2008, 12:22:32 PM9/12/08
to Beagle Board
Looks like I have got the right sort of Mini A to female A adapter
(got a nice little Belkin adapter kit).

http://www.acsoutlet.com/ME-F3U900-16-Standard.aspx

However, even though when I boot you see +5V on pin one, as soon as I
plug anything in, that 5V on pin one dies and lsusb gives me this
message:

root@beagleboard:~# lsusb
<3>hub 1-0:1.0: over-current change on port 1
hub 1-0:1.0: over-current change on port 1
Bus 001 Device 001: ID 0000:0000

That suggests to me that the port can't supply enough current
(although that's purely an educated guess). I have a strong 5V supply
and I don't think a memory stick should take anywhere near 100mA,
Also, a powered USB hub does the same.

Googling for over-current change on port X gives a few messages about
updating the kernel, but I *think* I have the latest one!

uname -a

Linux beagleboard 2.6.22.18-omap3 #1 Thu Jul 24 15:29:36 IST 2008
armv7l unknown

Is there a later version I'm not aware of that might help? Anyone seen
this before?

rober...@apostrophe.co.uk

unread,
Sep 12, 2008, 12:23:36 PM9/12/08
to Beagle Board
>> If you try the pin-4 grounding thing, you only need to do it once
booting and can release after the boot up. Also, the two large through
holes next to the SD socket make for good ground clip-able locations.
<<

I think one of these is +5V, so need to be careful on that! :~)

John Beetem

unread,
Sep 15, 2008, 12:04:58 PM9/15/08
to Beagle Board
Rob,

I've seen similar problems when I've plugged in a flash drive into my
powered USB hub. In my case, I'm using the same +5V regulated supply
for both the BeagleBoard (via its power jack) and my USB hub (via its
power jack). When I plug in the flash drive I see a 0.3V dip on my
+5V supply for about 2 microseconds on an oscilloscope as my switching
regulator adjusts to the sudden change in +5V current. This is
apparently enough to lose the hub sometimes, which surprises me.
Maybe the dip is greater sometimes.

Evidently the USB standard does not have a spec for "soft start" of
new devices, or else cheap flash drives don't worry about complying
with it. When I get a chance I'm going to try adding some LC
filtering so the hub doesn't affect the beagle board.

If I plug the flash drive in before booting Ångström it's pretty
solid.

John

****************
That suggests to me that the port can't supply enough current
(although that's purely an educated guess). I have a strong 5V supply
and I don't think a memory stick should take anywhere near 100mA,
Also, a powered USB hub does the same.
****************
Reply all
Reply to author
Forward
0 new messages