https://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_3.2&feed=atom&action=historyEBC Exercise 08 Installing Development Tools 3.2 - Revision history2024-03-29T04:48:09ZRevision history for this page on the wikiMediaWiki 1.31.0https://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_3.2&diff=280562&oldid=prevYoder: Added 3.2 icon2013-08-19T17:18:41Z<p>Added 3.2 icon</p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 17:18, 19 August 2013</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l2" >Line 2:</td>
<td colspan="2" class="diff-lineno">Line 2:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{YoderHead}}</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>{{YoderHead}}</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([http://projects.gnome.org/gedit/ gedit]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle.  Later, when we start compiling the kernel [http://www.kernel.org/] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.</div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins class="diffchange diffchange-inline">{{EBC3.2}}</ins>Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([http://projects.gnome.org/gedit/ gedit]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle.  Later, when we start compiling the kernel [http://www.kernel.org/] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.</div></td></tr>
<!-- diff cache key elinux:diff::1.12:old-260696:rev-280562 -->
</table>Yoderhttps://elinux.org/index.php?title=EBC_Exercise_08_Installing_Development_Tools_3.2&diff=260696&oldid=prevYoder: Moved to ECE497Fall20122013-06-03T17:10:42Z<p>Moved to ECE497Fall2012</p>
<p><b>New page</b></p><div>[[Category:ECE497Fall2012]]<br />
{{YoderHead}}<br />
<br />
Early in the class most of the exercises we will do will all run on the BeagleBoard. You'll be able to edit ([http://projects.gnome.org/gedit/ gedit]), compile ([http://gcc.gnu.org/ gcc]) and run all on the Beagle. Later, when we start compiling the kernel [http://www.kernel.org/] or the boot loader, ([http://www.denx.de/wiki/U-Boot U-boot]) you will need to cross compile on a Linux machine and copy the results to the Beagle.<br />
<br />
The purpose of this exercise is to install all the tools needed for compiling on your host so they will be ready when you need them.<br />
<br />
Instructions for building Ångström are given [http://www.angstrom-distribution.org/building-angstrom here]; however there are a few changes you have to make. Here's what I did.<br />
<br />
'''Tip:''' Run this exercise using a wired connection if you can. The Ubuntu wireless driver can be finicky, and if it stops working you'll have to restart some of this.<br />
<br />
== The 3.2 Kernel ==<br />
{{EBC3.2}}These instructions have been tested for the 3.2.25 kernel.<br />
<br />
=== download ===<br />
These are notes are based on [https://github.com/beagleboard/kernel/blob/6682025752d0b807119c1e363a0b1b9bfe2ab453/README.md Beagleboard kernel git site].<br />
<br />
First download the tools needed to compile the kernel. This took about 25 seconds.<br />
host$ '''sudo apt-get install -y git lzop gcc-arm-linux-gnueabi uboot-mkimage'''<br />
<br />
Next download the tools to get the kernel and the patches needed to make it run on the beagle. (2.5 seconds)<br />
host$ '''cd ~/BeagleBoard'''<br />
host$ '''git clone git://github.com/beagleboard/kernel.git'''<br />
host$ '''cd kernel'''<br />
host$ '''git checkout 6a7c4284a16fed3dae87f4aef78b59c902e4da84 -b beaglebone-3.2'''<br />
<br />
Next download the kernel and the patches. Before running '''./patch/sh''', take a look at it. Can you figure out what it's doing? Also look at '''patch_script.sh''', it's where the details are. The downloading/patching process takes some 39 minutes.<br />
host$ '''less patch.sh patch_script.sh'''<br />
host$ '''./patch.sh'''<br />
host$ '''cp patches/beaglebone/defconfig kernel/arch/arm/configs/beaglebone_defconfig<br />
host$ '''wget http://arago-project.org/git/projects/?p=am33x-cm3.git\;a=blob_plain\;f=bin/am335x-pm-firmware.bin\;hb=HEAD -O kernel/firmware/am335x-pm-firmware.bin'''<br />
host$ '''md5sum kernel/firmware/am335x-pm-firmware.bin''' <br />
17d6a4c24d3cb720aa9ed4522cb891fc kernel/firmware/am335x-pm-firmware.bin<br />
<br />
=== compile ===<br />
Once patched you are ready to compile the kernel. The first time takes a while. Mine tool 4 minutes, but I was running on 8 cores. Set the '''-j''X'' ''' to match the number of cores you have. '''uImage''' is the kernel!<br />
host$ '''cd kernel'''<br />
host$ '''make beaglebone_defconfig'''<br />
<br />
Now that you know it's working, let's compile it. First set the paths to find the cross-compiles. Put the following in a file, call it ~/.oe/'''crossCompile.sh'''.<br />
<br />
export ARCH=arm<br />
export CROSS_COMPILE=arm-linux-gnueabi-<br />
Do the above once<br />
<br />
Now ''source'' the file.<br />
host$ '''source ~/.oe/crossCompileEnv.sh'''<br />
Do the above once per terminal session.<br />
<br />
host$ '''make -j9'''<br />
host$ '''make uImage'''<br />
Do the above every time you recompile the kernel<br />
<br />
You also need all the kernel modules. Here we create a directory to install them in. (a few seconds)<br />
host$ '''mkdir ../rootfs'''<br />
host$ '''make INSTALL_MOD_PATH=../rootfs modules_install'''<br />
<br />
=== install ===<br />
Copy the kernel and the modules to the Beagle. (a minute or so)<br />
host$ '''cd ..'''<br />
host$ '''scp kernel/arch/arm/boot/uImage root@beagle:/boot/uImage-3.2.25+<br />
host$ '''cd rootfs'''<br />
host$ '''find -H -depth | cpio -o -H crc | ssh root@beagle 'cd /; cpio -id' '''<br />
<br />
Now log into the beagle and move some things around.<br />
host$ '''ssh root@beagle<br />
<br />
This will copy the kernel to the ext4 partition.<br />
beagle$ '''cd /boot'''<br />
beagle$ '''rm uImage'''<br />
beagle$ '''ln -s uImage-3.2.25+ uImage'''<br />
<br />
This will copy to the FAT partition.<br />
beagle$ '''mkdir /media/mmcblk0p1'''<br />
beagle$ '''mount /dev/mmcblk0p1 /media/mmcblk0p1'''<br />
beagle$ '''cp /boot/uImage-3.2.25+ /media/uImage'''<br />
<br />
=== reboot ===<br />
Make sure screen is running on your host so you can see the shutdown and boot processes.<br />
host$ '''screen /dev/ttyUSB1 115200'''<br />
<br />
If you get an error try changing making yourself the owner of /dev/ttyUSB1.<br />
host$ '''sudo chown ''yoder:yoder'' /dev/ttyUSB1'''<br />
host$ '''screen /dev/ttyUSB1 115200'''<br />
<br />
Then restart you beagle<br />
beagle$ '''shutdown -r now'''<br />
<br />
If all goes well you will boot into your new kernel.<br />
beagle$ '''uname -a'''<br />
Linux beaglebone 3.2.25+ #1 Fri Oct 19 11:05:28 EDT 2012 armv7l GNU/Linux<br />
<br />
== DAS U-boot ==<br />
These instructions came from [http://www.eewiki.net/display/linuxonarm/Home eewiki].<br />
<br />
=== download ===<br />
While we're at it, let's get the boot loader we'll be using. It takes some 3 minutes.<br />
<br />
host$ '''cd ~/BeagleBoard'''<br />
host$ '''git clone git://git.denx.de/u-boot.git'''<br />
host$ '''cd u-boot/'''<br />
host$ '''git checkout v2012.10-rc2 -b tmp'''<br />
<br />
=== compile ===<br />
Now configure and build. The first time takes some 4 minutes. After that it's only 5 seconds or so. (Replace '''am335x_evm_config''' with '''omap3_beagle_config''' if you are compiling for the xM.)<br />
host$ '''make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- am335x_evm_config'''<br />
host$ '''make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-'''<br />
<br />
=== install ===<br />
<br />
host$ '''scp u-boot.img root@beagle:.'''<br />
beagle$ '''mkdir /media/mmcblk0p1'''<br />
beagle$ '''mount /dev/mmcblk0p1 /media/mmcblk0p1'''<br />
beagle$ '''cd /media/mmcblk0p1'''<br />
beagle$ '''mv u-boot.img u-boot.img.orig''' # Save the working u-boot<br />
beagle$ '''cp ~/u-boot.img u-boot.img.new'''<br />
beagle$ '''cp u-boot.img.new u-boot.img'''<br />
Once installed you are ready for u-boot work.<br />
<br />
{{YoderFoot}}</div>Yoder