[etherlab-users] Cross Compile for ARM

Andreas Stewering-Bone Andreas.Stewering-Bone at gmx.de
Fri Jul 5 08:49:56 CEST 2013


Hello,

In my setup I build a complete kernel for the beaglebone board. Attached 
you find a script to compile the kernel and modules, install it on a 
MM-card, compile the master, install the modules an userland.

Please try.

#get Linaro Compiler
# wget 
https://launchpad.net/linaro-toolchain-binaries/trunk/2013.03/+download/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux.tar.bz2
#get Beagleboard stuff
#git clone https://github.com/beagleboard/kernel.git

# RT-Preempt Kernel and patches in branch 3.8-rt

#define local git repo to prefend getting huge vannilla git repo twice
# EXTERNAL_TREE = /path

#patch KERNEL
#cd kernel
#./patch.sh

#get Beaglebone pm firmware
#wget  
http://arago-project.org/git/projects/?p=am33x-cm3.git;a=tree;f=bin/am335x-pm-firmware.bin 
-o kernel/firmware/am335x-pm-firmware.bin

#set Cross pre-cmd
PRECROSS=arm-linux-gnueabihf-
MYARCH=arm

#extend path
export 
PATH=$PATH:/home/ab/Download/beaglebone/cross/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/bin

#optional get config
#cp ../configs/beaglebone .config
#oldconfig
make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS oldconfig
#menuconfig
make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS menuconfig
#build kernel modules
make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS zImage modules dtbs -j2

#copy
#cp arch/arm/boot/uImage /TARGET/boot/uImage
#cp arch/arm/boot/dts/am335x-bone.dtb /TARGET/boot/

#install modules
# make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS INSTALL_MOD_PATH=/TARGET 
modules_install


#adapt uEnv.txt
#devtree=/boot/am335x-bone.dtb
#dtboot=run mmcargs; ext2load mmc ${mmcdev}:2 ${loadaddr} ${bootfile} ; 
ext2load mmc ${mmcdev}:2 ${fdtaddr} ${devtree} ; bootm ${loadaddr} - 
${fdtaddr}
#uenvcmd=run dtboot
#optargs=consoleblank=0




#connect
#picocom -f n -p n -b 115200 -i -r -l /dev/ttyUSB1


#compile ethercat master
#./configure --disable-8139too --enable-generic 
--with-linux-dir=/home/ab/Download/beaglebone/kernel/kernel 
CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ 
CPP=arm-linux-gnueabihf-cpp --host=arm

#compile userspace
#make


#compile modules
#make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS modules

#install modules
# make ARCH=$MYARCH CROSS_COMPILE=$PRECROSS INSTALL_MOD_PATH=/TARGET 
modules_install
#install ethercat userland
# make install DESTDIR=/TARGET/opt/etherlab
>
>
> _______________________________________________
> etherlab-users mailing list
> etherlab-users at etherlab.org
> http://lists.etherlab.org/mailman/listinfo/etherlab-users
>    

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20130705/901a1240/attachment-0004.htm>


More information about the Etherlab-users mailing list