Cross compiling linux for BBB

141 views
Skip to first unread message

Carl-Fredrik Sundström

unread,
Jan 2, 2014, 12:15:50 AM1/2/14
to beagl...@googlegroups.com


I want to get started in kernel development for the BBB and I can't find where to start, I have done work before developing Linux drivers for network interface cards and TV tuner cards. Is there a document that describes how to setup a cross compilation environment for lets say an ubuntu workstation or any other mainstream distribution and step by step how to build a bin file for flashing ?

I have looked at and can't find something like that



According to thread linked below the BBB will be going towards debian, is there a tutorial on how to cross compile debian ?


For me this is the number one stumbling block, I haven't tried compiling just a kernel on the beagle itself, I assume thats not how you do it?





John Syne

unread,
Jan 2, 2014, 1:20:53 AM1/2/14
to beagl...@googlegroups.com

From: Carl-Fredrik Sundström <audi...@gmail.com>
Reply-To: <beagl...@googlegroups.com>
Date: Wednesday, January 1, 2014 at 9:15 PM
To: <beagl...@googlegroups.com>
Subject: [beagleboard] Cross compiling linux for BBB
host> sudo apt-get install arm-linux-gnueabihf-gcc
# if you use make, you want to setup these env variables
host> export CROSS_COMPILE=arm-linux-gnueabihf-
host> export ARCH=arm
# To compile
host> arm-linux-gnueabihf-gcc test.c –o test
# Copy file to BBB, set execute permission and run.

Regards,
John





--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Charles Steinkuehler

unread,
Jan 2, 2014, 8:42:29 AM1/2/14
to beagl...@googlegroups.com
On 1/1/2014 11:15 PM, Carl-Fredrik Sundstr�m wrote:
>
>
> I want to get started in kernel development for the BBB and I can't find
> where to start, I have done work before developing Linux drivers for
> network interface cards and TV tuner cards. Is there a document that
> describes how to setup a cross compilation environment for lets say an
> ubuntu workstation or any other mainstream distribution and step by step
> how to build a bin file for flashing ?
>
> I have looked at and can't find something like that

In part, that's because it's not really necessary to build a bin file
for flashing. The BBB is much more like a desktop system than a
'traditional' embedded Linux board, and unless you're playing with the
uBoot loader, you don't really have to invoke any black magic or secret
sauce.

For kernel development, you can just drop a new kernel onto the FAT boot
partition and load it. You can cross-build the kernel as usual, or if
you're not familiar with the process just grab RCN's linux-dev github
and it will do everything for you (including downloading a known-good
cross-compiler tool chain if you don't already have one installed).

To avoid pulling out too much hair while testing new kernels, I
recommend you obtain a serial port cable for the BBB, which lets you
interact with the uBoot loader and see all the boot messages. Both can
be critical in figuring out why your shiny new kernel doesn't boot and
in recovering from this state.

Also, I find it easier to play with kernels when network booting or
booting from the SD card. With both of these options you can easily
recover a non-booting system...if you mess up the kernel in the on-board
eMMC flash, it can be difficult to recover from. If you're using an SD
card, you can just pop it into another system to fix the problem, and
with network booting, you don't even have to do that, you can just swap
kernel files around and reboot in seconds.

--
Charles Steinkuehler
cha...@steinkuehler.net

Carl-Fredrik Sundström

unread,
Jan 2, 2014, 8:57:11 AM1/2/14
to beagl...@googlegroups.com


So its the hard float tool chain that I need to use, for userland programs its the emulated float version thats used at least for the angstrom version I am playing with.

Thats looks a lot easier than I thought.

Thanks

cmicali

unread,
Jan 2, 2014, 9:29:29 AM1/2/14
to beagl...@googlegroups.com
I posted some notes on that here:  http://bonenotes.tumblr.com/  under "Cross-compiling the BeagleBone 3.8 Kernel"

Daniel Metcalf

unread,
Jan 2, 2014, 1:46:27 PM1/2/14
to beagl...@googlegroups.com
Chris,

This is exactly what I have been looking for! Nicely done!
Everywhere else I have seen general steps but no actual procedures. This is great for a beginner like myself.


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Dan Metcalf -- KB3UUN

cmicali

unread,
Jan 2, 2014, 7:08:10 PM1/2/14
to beagl...@googlegroups.com
Great - I'm glad someone has found it useful :)

dlewin555

unread,
Jan 5, 2014, 12:15:49 PM1/5/14
to beagl...@googlegroups.com
I do too .Disapointed by the recent events from Angstrom side I think it's
a good way and alternative to buildroot.

PS : in the build_kernel.sh you use a
"make -j 8"
assuming the user will have 4 cpu which is not allways the case. Maybe something like 
cat /proc/cpuinfo | awk '/^processor/{print $3}' | tail -1

would help to retrieve CPU cores to x2 to be more generic.

Anyway very interesting notes.

Chris Micali

unread,
Jan 5, 2014, 5:45:48 PM1/5/14
to beagl...@googlegroups.com
Yeah good point - my machine is 4core/ht but that should change depending on what your machine is!

One thing I should update also on the wifi - i switched from the crap realtek chipset to an atheros-based TP-LINK adaptor, and things are MUCH much better.
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/NGMLXOaMvQY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages