tag:blogger.com,1999:blog-30461097709545772572024-02-19T06:57:50.284-08:00Embedded ProjectsMicrocontrollers, robots, radios, and more!Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-3046109770954577257.post-67444226286955869082018-02-28T20:50:00.000-08:002018-02-28T20:50:58.748-08:00Building a Linux Powered Multi-copter from Scratch<h4>
Introduction</h4>
I purchased my first quadcopter about 6 years ago, back in the heyday of MultiWii. I flew it a few times, crashed it a few times, and it was fun for a little while, but my model lacked GPS, WiFi, and stabilized video, so it ended up sitting on a basement shelf for a few years.<br />
<br />
Fast forward to fall 2017, where two things came together. One, I was able to get my hands on an Intel Aero RTF. This is a very powerful computing package on "wings." And two, the Beaglebone Blue came to my attention. It didn't take me long to come up a burning question...."I wonder if I can get the Beaglebone to do most of the stuff the Aero does?"<br />
<br />
Let's find out!<br />
<br />
Here is my syllabus for the next few blog posts. I'll try to match my normal development progression: get something working and then tweak it for performance.<br />
<br />
<ol>
<li>Component Details</li>
<li>Initial Board Bring-up</li>
<li>Flight Control Software</li>
<li>Ground Tests</li>
<li>Mavlink Improvements</li>
<li>Boot Time Improvements</li>
</ol>
<br />
Stay tuned for Component Details...coming up after a short break.Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com0tag:blogger.com,1999:blog-3046109770954577257.post-5262264054055376142018-02-28T20:21:00.000-08:002018-02-28T20:51:42.096-08:00Howto: Bluetooth GN/NAP on Beaglebone<span style="background-color: red;">This is an old article that I never published, but I'm making it available now, "as-is". Some of the instructions may be outdated, but I hope you find it helpful.</span><br />
<br />
Recently I had the need to create a more secure wireless network connection. Bluetooth NAP came up as a viable solution, for a number of reasons:<br />
<br />
<ul>
<li>Short Range</li>
<li>Fewer Sniffing/Hacking/War-driving tools</li>
<li>Mobile device support (Android/IOS)</li>
</ul>
I'll detail some of the configuration challenges and pairing procedures to get it up and running.<br />
<br />
<ul>
</ul>
<h4>
Prerequisites</h4>
<ul>
<li>Linux beaglebone 3.8.13-bone50 #1 SMP Tue May 13 13:24:52 UTC 2014 armv7l GNU/Linux</li>
<li>Bluetooth USB Dongle: GBU521 (http://www.iogear.com/product/GBU521/)</li>
<li>Powered USB Hub (IO Gear Bluetooth adapter will not work when directly plugged into Beaglebone)</li>
</ul>
<br />
<ul>
</ul>
<h4>
Get Bluetooth up and running</h4>
Update servers/folders/file names:<br />
<pre>sudo apt-get update</pre>
<br />
Bring installed packages up-to-date:<br />
<pre>sudo apt-get upgrade</pre>
<br />
Install necessary packages:<br />
<pre>sudo apt-get install bluez bluez-tools bridge-utils</pre>
<br />
Ensure Bluetooth is up and running by listing loaded Kernel modules:<br />
debian@beaglebone:~$ lsmod<br />
<pre>Module Size Used by
rfcomm 26769 10
bnep 8909 2
g_multi 50407 2
libcomposite 15028 1 g_multi
btusb 10339 0
bluetooth 159258 24 bnep,btusb,rfcomm
rfkill 16672 2 bluetooth
mt7601Usta 641118 0
</pre>
<br />
<h4>
Verify Bluetooth Stack</h4>
See if device is up via bluez:<br />
<pre>debian@beaglebone:~$ hciconfig -a
hci0: Type: BR/EDR Bus: USB
BD Address: 00:02:72:CC:B8:47 ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:1351 acl:0 sco:0 events:60 errors:0
TX bytes:1333 acl:0 sco:0 commands:60 errors:0
Features: 0xbf 0xfe 0xcf 0xfe 0xdb 0xff 0x7b 0x87
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH SNIFF
Link mode: SLAVE ACCEPT
Name: 'beaglebone-0'
Class: 0x420100
Service Classes: Networking, Telephony
Device Class: Computer, Uncategorized
HCI Version: 4.0 (0x6) Revision: 0x1000
LMP Version: 4.0 (0x6) Subversion: 0x220e
Manufacturer: Broadcom Corporation (15)</pre>
<h4>
</h4>
<h4>
<br />Pair Beaglebone and Device</h4>
<span style="color: yellow;">NOTE: Make sure you have a discoverable Bluetooth device turned on now... </span><br />
<br />
Test scanning:<br />
<pre>debian@beaglebone:~$ hcitool scan
Scanning ...
60:A4:4C:00:00:00 CGM Nexus 7</pre>
<br />
Configure local Bluetooth settings:
<br />
<pre>debian@beaglebone:~$ bluez-test-adapter name honeypot
debian@beaglebone:~$ bluez-test-adapter pairable on
debian@beaglebone:~$ bluez-test-adapter discoverable on
debian@beaglebone:~$ bluez-test-adapter discoverabletimeout 30</pre>
<br />
<span style="color: yellow;">NOTE: After setting discoverable to on, you must scan for the beaglebone before the timeout. If you took too long, simple set discoverable to on again.</span><br />
<br />
Pair the beaglebone to the other device<br />
<pre>debian@beaglebone:~$ bluez-simple-agent
Agent registered
RequestConfirmation (/org/bluez/15561/hci0/dev_60_A4_4C_B7_C0_A2, 945453)
Confirm passkey (yes/no): yes
Press CTRL-C to quit simple agent....</pre>
<br />
Add the other device to the trusted list<br />
<pre>debian@beaglebone:~$ bluez-test-device trusted 60:A4:4C:B7:C0:A2 yes</pre>
<br />
At this point the devices are paired, but no services are running on the Beaglebone.<br />
<br />
<h4>
Configure Services</h4>
Add NAP service to Beaglebone by editing bluez-nap-server:<br />
<pre>debian@beaglebone:~$ sudo nano /usr/local/bin/bluez-nap-server
#!/usr/bin/python
import sys
import time
import dbus
from optparse import OptionParser, make_option
bus = dbus.SystemBus()
manager = dbus.Interface(bus.get_object("org.bluez", "/"), "org.bluez.Manager")
option_list = [
make_option("-i", "--device", action="store", type="string", dest="dev_id"),
]
parser = OptionParser(option_list=option_list)
(options, args) = parser.parse_args()
if options.dev_id:
adapter_path = manager.FindAdapter(options.dev_id)
else:
adapter_path = manager.DefaultAdapter()
server = dbus.Interface(bus.get_object("org.bluez", adapter_path), "org.bluez.NetworkServer")
service = "nap"
if (len(args) < 1):
bridge = "tether"
else:
bridge = args[0]
server.Register(service, bridge)
print "Server for %s registered for %s" % (service, bridge)
while True:
time.sleep(1000)</pre>
<br />
Make it an executable file:<br />
<pre>debian@beaglebone:~$ sudo chmod a+x /usr/local/bin/bluez-nap-server</pre>
<br />
Start it at boot by creating/editing a service file:<br />
<pre>debian@beaglebone:~$ sudo nano /etc/systemd/system/bluez-nap.service
[Unit]
Description=Bluetooth NAP Server
After=syslog.target
[Service]
Type=simple
ExecStart=/usr/local/bin/bluez-nap-server br0
WorkingDirectory=/home/debian
[Install]
WantedBy=multi-user.target</pre>
<pre></pre>
<br />
Enable the service:<br />
<pre>debian@beaglebone:~$ sudo systemctl enable bluez-nap.service</pre>
<br />
Enable DHCP by modifying udhcpd config file:<br />
<pre>debian@beaglebone:~$ sudo nano /etc/udhcpd.conf
start 169.254.7.2
end 169.254.7.2
interface br0
max_leases 1
option subnet 255.255.255.252</pre>
<br />
Create Bluetooth Bridge interface (add to end of interface file, after usb0 definition):<br />
<pre>debian@beaglebone:~$ sudo nano /etc/network/interfaces
# Bluetooth NAP interface
auto br0
iface br0 inet static
address 169.254.7.1
netmask 255.255.255.0
bridge_ports none
bridge_fd 5
bridge_stp no</pre>
<br />
Reset and restart services
<br />
<pre>debian@beaglebone:~$ sudo systemctl restart networking.service
debian@beaglebone:~$ sudo systemctl restart udhcpd.service
debian@beaglebone:~$ sudo systemctl restart bluez-nap.service</pre>
<br />
<h4>
References</h4>
<ul>
<li>http://notes.pitfall.org/ip-over-bluetooth-to-a-raspberry-pi.html</li>
<li>http://www.hkepc.com/forum/viewthread.php?tid=1710030</li>
<li>http://forum.doozan.com/read.php?2,2698</li>
<li>https://viaforensics.com/articles-presentations/bluetooth-packet-capture-android.html</li>
<li>https://bbs.archlinux.org/viewtopic.php?pid=1129449</li>
<li>http://www.linux.com/learn/tutorials/346552-personal-area-networking-with-bluetooth</li>
<li>https://github.com/Douglas6/pinaple</li>
<li>http://www.raspberrypi.org/forums/viewtopic.php?t=36889&p=479992h</li>
</ul>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com0tag:blogger.com,1999:blog-3046109770954577257.post-37561731704336135452015-01-19T14:14:00.001-08:002015-01-19T14:14:26.971-08:00Howto: Build Octal Beaglebone Black Cluster<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqFnPjgUMlE4S83Bxgonc0gUcD8q-OmYxIrjq6UFOyjl60W108fPPhX_6FvMckTwaXeiai0BLk0Y5RyM2sOjJjkvj1J5PyDKfRj5pIKCJYXJHI_abhKfQw1uiLgv4e4Z-b9ZKmRwXNJEuw/s1600/IMG_20141203_131244.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqFnPjgUMlE4S83Bxgonc0gUcD8q-OmYxIrjq6UFOyjl60W108fPPhX_6FvMckTwaXeiai0BLk0Y5RyM2sOjJjkvj1J5PyDKfRj5pIKCJYXJHI_abhKfQw1uiLgv4e4Z-b9ZKmRwXNJEuw/s320/IMG_20141203_131244.jpg" height="240" width="320" /></a>Compiling Qt is getting old. While my applications are not that big, I find myself building Qt from source more often that I would like. I have cross compiled Qt on an x86 Ubuntu machine, but getting the configuration script to properly detect all of the modules is time consuming.<br />
<br />
My first idea was to get a few Beaglebones so that I could be building multiple versions at any given time. This worked well, but it still took 20+ hours to get a testable output. If only there was a way to get these Beaglebones to help each other out......ah, but there is!
<br />
<br />
Enter distcc. Distcc is nice in that it is simply a wrapper around your existing build commands. This means it is easy to setup and use. Distcc works by inserting itself between the make script and the compiler (gcc or g++), which it accomplishes through the standard CC and CXX command line options available through make. By redirecting gcc and g++ commands through distcc, you can get a parallel build across machines using the normal make -j option.<br />
<br />
<h2>
Overview</h2>
<ul>
<li>Configure hardware</li>
<li>Install image</li>
<li>Install packages</li>
<li>Configure Main build client</li>
<li>Configure compile hosts</li>
<li>Run</li>
<br />
</ul>
<br />
<h2>
Hardware</h2>
<ul>
<li>8 Beaglebone Blacks (2 Rev. A6A, 1 Rev. B, 3 Rev. C, 2 Element 14 Rev. C)</li>
<li>16 port Ethernet Switch (N-tron 516TX)</li>
<li>50 Watt 5V DC Power Supply (Omron or Astrodyne)</li>
<li>DHCP Server (Asus RT-N56U)</li>
</ul>
There is nothing special about the hardware. As you can see, I used a wide variety of Beaglebone versions from two suppliers. The support structure is made of 20 mm extruded aluminum and an acrylic sheet:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLSzafZ77Uhhx9ohMIlR9ivTxQBHzV6FLrGNjyzFIX7WiBKU_inzOtcuVVBJdQAkLFt0sx3E5TzvWW_epAuT382Wjq1AUu0co6FuAOyUtL4u8u6bNrj79qJp8QcqkADq6zTnFTAgJfmUVd/s1600/IMG_20141203_131314.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLSzafZ77Uhhx9ohMIlR9ivTxQBHzV6FLrGNjyzFIX7WiBKU_inzOtcuVVBJdQAkLFt0sx3E5TzvWW_epAuT382Wjq1AUu0co6FuAOyUtL4u8u6bNrj79qJp8QcqkADq6zTnFTAgJfmUVd/s1600/IMG_20141203_131314.jpg" height="240" width="320" /></a></div>
<br />
<br />
<br />
<h2>
Software Installation</h2>
Use the default operating system image or download a Debian console eMMC flasher such as <a href="https://rcn-ee.net/deb/flasher/wheezy/BBB-eMMC-flasher-debian-7.7-console-armhf-2014-10-29-2gb.img.xz">BBB-eMMC-flasher-debian-7.7-console-armhf-2014-10-29-2gb.img.xz</a> found at the <a href="http://elinux.org/BeagleBoardDebian#Demo_Image">elinux.org</a> site.<br />
<br />
Add the required tools:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
>sudo apt-get install distcc distcc-pump g++ make</div>
</pre>
<br />
<br />
<h2>
Compile Hosts Configuration</h2>
Choose one Beaglebone to set aside as the main build client. Ideally this would be the Beaglebone with the most memory (RAM and filesystem). The other seven "workers" will be referred to as compile hosts. In order to simplify the calling of distcc on the main build client, we need to give our workers hostnames. Run the following three commands on each of them:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> sudo nano /etc/hostname<br />
> sudo nano /etc/hosts<br />
> sudo hostname boris
</div>
</pre><br /><br />
In the 'hostname' and 'hosts' files, replace the default hostname (usually "beaglebone") with the desired hostname, which in the example above would be "boris". <br/><br />
A reboot will force an update to the hostname, but before we do that, we need to tell distcc to start a service at boot and to allow local network traffic. Edit the first few lines of the /etc/default/distcc config file:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> sudo nano /etc/default/distcc
</div>
</pre>
to look something like this:<pre>
# Defaults for distcc initscript
# sourced by /etc/init.d/distcc
#
# should distcc be started on boot?
#
# STARTDISTCC="true"
STARTDISTCC="true"
#
# Which networks/hosts should be allowed to connect to the daemon?
# You can list multiple hosts/networks separated by spaces.
# Networks have to be in CIDR notation, f.e. 192.168.1.0/24
# Hosts are represented by a single IP Adress
#
# ALLOWEDNETS="127.0.0.1"
ALLOWEDNETS="192.168.0.0/24"
</pre><br /><br />
Reboot to commit the changes.
<br />
<br />
<h2>
Main Build Client Configuration</h2>
Like we set up on the workers, we need to give the master a hostname. Two of the commands are identical:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> sudo nano /etc/hostname<br />
> sudo hostname pluto
</div>
</pre><br />
but we need to add the workers, in addition to the master hostname, to the hosts file:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> sudo nano /etc/hosts<br />
</div>
</pre><br />
Which, if your master unit is named "pluto", will look something like this:
<pre>
127.0.0.1 localhost
127.0.1.1 pluto
192.168.0.106 droopy
192.168.0.71 astro
192.168.0.232 dogbert
192.168.0.9 scooby
192.168.0.100 underdog
192.168.0.139 snoopy
192.168.0.180 goofy
192.168.0.41 peabody
192.168.0.20 brian
</pre>
<br />
That's it! We are now ready to run distcc.
<br /><br />
<h2>
Run distcc</h2>
Before we run distcc, we need to setup a couple of environment variables.<br /><br />
The first variable is handy if you are having trouble talking to workers, or would like more feedback from distcc:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> export DISTCC_VERBOSE=1
</div>
</pre>
<br />
I found the extra output helpful in diagnosing issues. <br/><br/>
The following command is necessary any time the list of client names changes. The order is important, but really only matters if you include the master in the worker list. Due to the limited resources on the Beaglebone, I chose not to allow normal building on the master.
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> export DISTCC_POTENTIAL_HOSTS='astro dogbert snoopy underdog droopy scooby goofy peabody brian'
</div>
</pre>
<br />
We can now call distcc, but instead of calling it directly, we are going to use the distcc-pump tool. Distcc-pump parses the "DISTCC_POTENTIAL_HOSTS" variable and automatically configures and starts the appropriate distcc services.<br /><br />
Most of the websites that show examples for distcc show something like this:<br/>
<pre>
distcc-pump make -j12 CC="distcc"
</pre>
which works, but when compiling large projects that are written in both C and C++, like Qt, that command only compiles SOME of the code on the cluster. Needless to say, this is bad and the master Beaglebone dies a quick death due to memory loss.<br/><br />
The workaround took me a while to figure out, but is really simple. Because distcc is smart enough to figure out which compiler to use, call this line instead:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="margin: 0px; padding: 0px;">
> distcc-pump make -j12 CC=distcc CXX=distcc
</div>
</pre>
<br /><br />
Now that you have a working compiler, you can play around with the -j12 parameter to get the best results. Many distcc examples claim that this parameter could be very large, but that does not work for compiling a large project like Qt. The main choke point is the amount of RAM and the huge memory requirements for the include server.
<br /><br />
<h2>
Building Qt and Optimizations</h2>
Like I alluded to earlier, I did manage to compile Qt on the cluster, but it wasn't "clean". After a half hour of compiling, the master Beaglebone runs out of memory. It's not that big of a deal, because you can just run the distcc-pump command again, but I wanted to see if I could help it out.<br /><br />
To do this, I created 1 Gb of swap space on a micro SD card. This helped, but only extended the build time to an hour before the memory was full and the Beaglebone started spending most of it's time paging memory.<br /><br />
The ultimate solution was to use a master with more memory. I chose a Wandboard i.MX6 paired with a SATA HD, which worked well.<br /><br />
Here are the resultant compile times for various configurations:<br/>
<pre>
Single Beaglebone ~19-20 hours
Beaglebone Master + 7 Beaglebone Workers ~5-6 hours
Beaglebone Master + 9 Beaglebone Workers ~5 hours
Wandboard Master + 8 Beaglebones <4 hours
</pre>
<br />
<h2>
References</h2>
<br />
<ul>
<li><a href="http://www.manpagez.com/man/1/distcc/">http://www.manpagez.com/man/1/distcc/</a></li>
<li><a href="http://radekp.github.io/qtmoko/api/buildsystem/over-configure-options-qt-1.html">http://radekp.github.io/qtmoko/api/buildsystem/over-configure-options-qt-1.html</a></li>
</ul>Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com2tag:blogger.com,1999:blog-3046109770954577257.post-16916286271936050692014-11-14T08:21:00.000-08:002014-11-14T08:21:45.893-08:00Qt 5.3.2 Beaglebone Binaries<h2>
Overview</h2>If you saw my <a href="http://armsdr.blogspot.com/2014/03/qt-521-beaglebone-binaries.html">Qt 5.2 Binaries post</a>, this will look very familiar....<br />
<br />
<h2>Prerequisites</h2>
For this build, I wanted to try to enable support for everything. I got close, but didn't want to put forth the extra effort for the packages that were not obvious to install. You can mix and match the following installs, depending on your needs.
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo apt-get install libicu-dev<br />
> sudo apt-get install libcups2-dev<br />
> sudo apt-get install libudev-dev<br />
> sudo apt-get install libmtdev-dev<br />
> sudo apt-get install libegl1-mesa-dev<br />
> sudo apt-get install libopenvg1-mesa-dev<br />
</div>
</div>
</pre><br />
KMS seems to be already installed (libdrm-dev), but the configuration script cannot find it. Also, some more research is needed before GLX can be enabled. The <a href="https://packages.debian.org/search?searchon=names&keywords=glx">Debian package search tool</a> is an awesome resource for finding files in packages.<br /><br />
<h2>
Configuration</h2>
Here is the command line I used to generate the make files:<br>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> ./configure -v -opensource -confirm-license -prefix /usr/local/qt-5.3.2 -qt-xcb<br />
</div>
</div>
</pre><br /><span style="font-family: Courier New, Courier, monospace;"></span>
The cross compile feature changed slightly from 5.2, but 5.3 detects the local environment fairly well, so you no longer need to pass "-device" into the configuration script.<br /><br />
The Qt configuration script takes about 20 minutes to run on a rev. C Beaglebone Black. It first builds a native version of qmake, which takes about 15 minutes, then it tests for available modules.<br /><br />
Here is the configuration summary:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Courier New', Courier, monospace; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
Configure summary<br />
<br />
Build type: linux-g++ (arm, CPU features:)<br />
Platform notes:<br />
<br />
- Also available for Linux: linux-kcc linux-icc linux-cxx<br />
<br />
qmake vars .......... styles += mac fusion windows QT_LIBS_DBUS = -ldbus-1 QT_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include QT_HOST_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_GLIB = -pthread -lgthread-2.0 -lrt -lglib-2.0 QT_CFLAGS_QGTKSTYLE = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 QT_LIBS_QGTKSTYLE = -lgobject-2.0 -lglib-2.0 QT_CFLAGS_QGTK2 = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/arm-linux-gnueabihf/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 QT_LIBS_QGTK2 = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 QT_CFLAGS_PULSEAUDIO = -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_PULSEAUDIO = -lpulse-mainloop-glib -lpulse -lglib-2.0 QMAKE_CFLAGS_FONTCONFIG = -I/usr/include/freetype2 QMAKE_LIBS_FONTCONFIG = -lfontconfig -lfreetype QMAKE_INCDIR_LIBUDEV = QMAKE_LIBS_LIBUDEV = -ludev QMAKE_X11_PREFIX = /usr QMAKE_XKB_CONFIG_ROOT = /usr/share/X11/xkb QMAKE_INCDIR_EGL = /usr/include/libdrm QMAKE_LIBS_EGL = -lEGL QMAKE_CFLAGS_EGL = QMAKE_CFLAGS_XCB = QMAKE_LIBS_XCB = -lxcb QMAKE_CFLAGS_DIRECTFB = -D_REENTRANT -I/usr/include/directfb QMAKE_LIBS_DIRECTFB = -ldirectfb -lfusion -ldirect -lpthread sql-drivers = sql-plugins = sqlite <br />qmake switches .........<br />
<br />
Build options:<br />
Configuration .......... accessibility accessibility-atspi-bridge alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cups dbus directfb egl egl_x11 eglfs evdev eventfd fontconfig full-config getaddrinfo getifaddrs glib gtk2 gtkstyle iconv icu inotify ipv6ifname large-config largefile libudev linuxfb medium-config minimal-config mremap mtdev nis no-harfbuzz opengl openssl openvg pcre png posix_fallocate precompile_header pulseaudio qpa qpa reduce_exports release rpath shared small-config system-freetype system-jpeg system-png system-zlib xcb xcb-plugin xcb-qt xcb-sm xcb-xlib xinput2 xkbcommon-qt xlib xrender<br />
Build parts ............ libs tools examples<br />
Mode ................... release<br />
Using C++11 ............ yes<br />
Using PCH .............. yes<br />
Target compiler supports:<br />
iWMMXt/Neon .......... no/auto<br />
<br />
Qt modules and options:<br />
Qt D-Bus ............... yes (loading dbus-1 at runtime)<br />
Qt Concurrent .......... yes<br />
Qt GUI ................. yes<br />
Qt Widgets ............. yes<br />
Large File ............. yes<br />
QML debugging .......... yes<br />
Use system proxies ..... no<br />
<br />
Support enabled for:<br />
Accessibility .......... yes<br />
ALSA ................... yes<br />
CUPS ................... yes<br />
Evdev .................. yes<br />
FontConfig ............. yes<br />
FreeType ............... yes (system library)<br />
Glib ................... yes<br />
GTK theme .............. yes<br />
HarfBuzz ............... no<br />
Iconv .................. yes<br />
ICU .................... yes<br />
Image formats:<br />
GIF .................. yes (plugin, using bundled copy)<br />
JPEG ................. yes (plugin, using system library)<br />
PNG .................. yes (in QtGui, using system library)<br />
journald ............... no<br />
mtdev .................. yes (system library)<br />
Networking:<br />
getaddrinfo .......... yes<br />
getifaddrs ........... yes<br />
IPv6 ifname .......... yes<br />
OpenSSL .............. yes (loading libraries at run-time)<br />
NIS .................... yes<br />
OpenGL / OpenVG:<br />
EGL .................. yes<br />
OpenGL ............... desktop<br />
OpenVG ............... yes-auto<br />
PCRE ................... yes (bundled copy)<br />
pkg-config ............. yes<br />
PulseAudio ............. yes<br />
QPA backends:<br />
DirectFB ............. yes<br />
EGLFS ................ yes<br />
KMS .................. no<br />
LinuxFB .............. yes<br />
XCB .................. yes (bundled copy)<br />
EGL on X ........... yes<br />
GLX ................ no<br />
MIT-SHM ............ yes<br />
Xcb-Xlib ........... yes<br />
Xcursor ............ yes (loaded at runtime)<br />
Xfixes ............. yes (loaded at runtime)<br />
Xi ................. no<br />
Xi2 ................ yes<br />
Xinerama ........... yes (loaded at runtime)<br />
Xrandr ............. yes (loaded at runtime)<br />
Xrender ............ yes<br />
XKB ................ yes<br />
XShape ............. yes<br />
XSync .............. yes<br />
XVideo ............. yes<br />
Session management ..... yes<br />
SQL drivers:<br />
DB2 .................. no<br />
InterBase ............ no<br />
MySQL ................ no<br />
OCI .................. no<br />
ODBC ................. no<br />
PostgreSQL ........... no<br />
SQLite 2 ............. no<br />
SQLite ............... yes (plugin, using bundled copy)<br />
TDS .................. no<br />
udev ................... yes<br />
xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)<br />
zlib ................... yes (system library)<br />
<br />
NOTE: libxkbcommon and libxkbcommon-x11 0.4.1 or higher not found on the system, will use
the bundled version from 3rd party directory.<br />
NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.
Configure with '-qreal float' to create a build that is binary compatible with 5.1.<br />
Info: creating super cache file /media/sda2/qt5.3.2/bbb_all/.qmake.super<br />
<br />
Qt is now configured for building. Just run 'make'.<br />
Once everything is built, you must run 'make install'.<br />
Qt will be installed into /usr/local/qt-5.3.2<br />
<br />
Prior to reconfiguration, make sure you remove any leftovers from<br />
the previous build.<br />
<br />
</div>
</div>
</pre><br />
<br />
Before calling make, ensure that you have enough free space. The qt source folder starts at 920 Mb and will grow to 1.9 Gb during the compile (building only the libs requires 1.5 Gb and building libs and tools only requires 1.7 Gb). An additional 180 Mb is needed if a 'make install' is performed. I did a shadow build on a USB Flash drive (run /path/to/configure from an empty folder), as I was cutting it close on the internal eMMC. It took the BBB 12 hours to compile the libs only, 16 hours to compile the libs and tools, and 21 hours to compile libs, tools, and examples.<br /><br />
For convenience, I've included three zipped archives of the binaries for this build. The unlabeled build contains libs, tools, and examples. The others should be self explanatory. Once expanded, the libs package uses 94 Mb, the libs and tools package uses 104 Mb, and the full package uses 180 Mb<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">MD5SUM:<br />
6dc968164bc532bea18b550f46660c3d <a href="https://drive.google.com/file/d/0B1B3pSjj6X4uVlduTWtCenVTenc/view?usp=sharing" target="_blank"><span style="color: #444444;">qt-5.3.2-no-examples.tar.xz</span></a>(22 Mb)<br />
ae7f9b7c8d0134e7c253500a64a9b9d7 <a href="https://drive.google.com/file/d/0B1B3pSjj6X4uMDdvQkhacDA3ZGM/view?usp=sharing" target="_blank"><span style="color: #444444;">qt-5.3.2-libs.tar.xz</span></a> (18 Mb)<br />
a735f85d028e1627fbfd031c58434ea5 <a href="https://drive.google.com/file/d/0B1B3pSjj6X4uclhobnpSSmZ1NlU/view?usp=sharing" target="_blank"><span style="color: #444444;">qt-5.3.2.tar.xz</span></a> (40 Mb)</span><br />
<br />
Extract to /usr/local ('tar -xf file.tar.xz'), as the tarball contains the qt-5.3.2 folder in it.<br />Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com4tag:blogger.com,1999:blog-3046109770954577257.post-64542326142497879132014-11-11T11:10:00.002-08:002014-11-11T11:24:41.643-08:00Beaglebone Debian Read Only Filesystem<h2>
Overview</h2>
To save the eMMC and to allow for faster bootup/shutdowns, I wanted to mount the root partition as read-only. I spent many days researching and trying to find out what areas of the filesystem needed to have write permissions. It seemed like I was going in circles. Unionfs, aufs, mount -bind, overlayfs, tmpfs.....so many options and so many modules that didn't exist in the default BBB Debian kernel. I finally got so fed up that I decided to just start hacking away at the fstab.
<br /><br />
<h2>
Details</h2>
It turns out that the basic read-only filesystem is fairly easy to create, as everything that needs to be configured is contained in /etc/fstab. We need to change the root mount to read-only and add a couple of temporary file systems to handle logs and such.
Let's start with an ordinary fstab created by the eMMC flasher script:
<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
# /etc/fstab: static file system information.<br />
#<br />
# Auto generated by: beaglebone-black-eMMC-flasher.sh<br />
#<br />
UUID=716e1ca7-bc61-4958-8c0d-665e48102cfd / ext4 ro,noatime,errors=remount-ro 0 1<br />
UUID=0DFE-E81B /boot/uboot auto defaults 0 0<br />
debugfs /sys/kernel/debug debugfs defaults 0 0<br />
</div>
</div>
</pre><br />
We could then use the following sed command to add the "ro" tag to the root mount line and save it to a temporary fstab file:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo sed s:ext4\ \ noatime:ext4\ \ ro,noatime: /etc/fstab_ro
</div>
</div>
</pre><br />
Next we need to append some tmpfs declarations to our temporary fstab file:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo nano /etc/fstab_ro
</div>
</div>
</pre><br />
and put the following lines at the end:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
tmpfs /tmp tmpfs nodev,nosuid,size=32M 0 0<br />
tmpfs /srv tmpfs nodev,size=512K 0 0<br />
tmpfs /var/log tmpfs defaults,noatime,size=1M 0 0<br />
tmpfs /var/tmp tmpfs defaults,noatime,size=512K 0 0<br />
tmpfs /var/run tmpfs defaults,noatime,size=512K 0 0<br />
</div>
</div>
</pre><br />
Replace the real /etc/fstab with your temporary file:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo cp /etc/fstab /etc/fstab.orig<br />
> sudo mv /etc/fstab_ro /etc/fstab<br />
</div>
</div>
</pre><br />
Reboot and you're done!<br /><br />
You may have to experiment with different size limits, depending on your logging needs, but the sizes above should get you started.
<br /><br />
<h2>
Alternate Method</h2>
Systemd does the actually mounting, by parsing the fstab. The order in which the mounts are created is not guaranteed. If you need to create mounts in a particular order you need to create a systemd .mount unit for each mount:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo nano /etc/systemd/system/my.mount
</div>
</div>
</pre><br /><br />
with content similar to the following:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
[Unit]<br />
Description=Runtime Directory<br />
Before=local-fs.target<br />
<br />
[Mount]<br />
What=/mine<br />
Where=/tmp/myfs<br />
Type=bind<br />
Options=bind<br />
</div>
</div>
</pre><br />
<h2>
Remount RW</h2>
If you need to modify the filesystem, you can remount it rw, for a while, with the following command:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo mount -o remount,rw /
</div>
</div>
</pre><br />
To return to read-only mode, either reboot or run this command:
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo mount -o remount,ro /
</div>
</div>
</pre><br />
<h2>
References</h2>
<a href="https://groups.google.com/forum/#!topic/beagleboard/9J2r8xn3-Os" target="_blank">https://groups.google.com/forum/#!topic/beagleboard/9J2r8xn3-Os</a><br />
<a href="http://adis.ca/tag/beaglebone/" target="_blank">http://adis.ca/tag/beaglebone/</a><br />
<a href="http://unix.stackexchange.com/questions/27449/mount-a-filesystem-read-only-and-redirect-writes-to-ram" target="_blank">http://unix.stackexchange.com/questions/27449/mount-a-filesystem-read-only-and-redirect-writes-to-ram</a><br />
<a href="https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash" target="_blank">https://help.ubuntu.com/community/aufsRootFileSystemOnUsbFlash</a><br />
<a href="http://unix.stackexchange.com/questions/81959/how-to-mount-aufs-file-system-on-boot-in-archlinux" target="_blank">http://unix.stackexchange.com/questions/81959/how-to-mount-aufs-file-system-on-boot-in-archlinux</a><br />
<a href="http://www.thegeekstuff.com/2013/05/linux-aufs/" target="_blank">http://www.thegeekstuff.com/2013/05/linux-aufs/</a><br />
<a href="https://wiki.debian.org/ReadonlyRoot" target="_blank">https://wiki.debian.org/ReadonlyRoot</a><br />
<a href="https://code.google.com/p/rootaufs/wiki/HowToUse" target="_blank">https://code.google.com/p/rootaufs/wiki/HowToUse</a><br />Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com2tag:blogger.com,1999:blog-3046109770954577257.post-39848213315848971782014-04-09T08:09:00.002-07:002014-04-09T08:09:34.771-07:00TFTP and NFS Debian on Beaglebone Black<h2>
Overview</h2>
Back when I was working with kernel 3.2 and the TI Linux SDK, I had the Beaglebone booting to a NFS. I thought it would be nice to do that again, because it is very convenient for development purposes.<br />
<br />
<h2>
Downloads</h2>
Get this if you don't already have a micro SD card with an image on it:<br />
Debian eMMC Flasher (can also be used as a live system): <a href="http://debian.beagleboard.org/images/BBB-eMMC-flasher-debian-7.4-2014-03-27-2gb.img.xz" target="_blank">Official Image</a>, <a href="http://rcn-ee.net/deb/testing/" target="_blank">Other Versions</a><br />
<br />
<br />
<h2>
Background</h2>
I will break up the configuration into three parts:<br />
<div>
<ul>
<li>TFTP</li>
<li>NFS</li>
<li>Local bootstrap</li>
</ul>
</div>
<br />
<a name='more'></a><br />
<br />
<h2>
TFTP</h2>
TFTP is a popular method of booting IP phones, routers, and net boot capable PCs. It provides a simple way to download files to clients. TFTP requires a server to be running somewhere on the network, though. This can be a Linux system or your fancy home router (DD-WRT, tomato, or other custom firmware).<br />
<br />
TFTP is easy to install on an Ubuntu host:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo apt-get install xinetd tftpd tftp</div>
</div>
</pre>
<br />
Unlike most installs, this does not create a default configuration. So you have to create the following:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<span style="font-family: Lucida Grande, Arial, Helvetica, sans-serif;">> sudo </span><span style="font-family: Arial, Helvetica, sans-serif;">nano </span><span style="font-family: Lucida Grande, Arial, Helvetica, sans-serif;">/etc/xinetd.d/tftp</span></div>
</div>
</pre>
<br />
and enter the following into the file:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
service tftp<br />
{<br />
protocol = udp<br />
port = 69<br />
socket_type = dgram<br />
wait = yes<br />
user = nobody<br />
server = /usr/sbin/in.tftpd<br />
server_args = /tftpboot<br />
disable = no<br />
}</div>
</div>
</pre>
<br />
This will configure the service to reside on port 69 and serve files from the root folder /tftpboot. Since /tftpboot doesn't exist, let's create this folder now, populate it with boot binaries, set permissions, and restart the service:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo mkdir /tftpboot<br />
> sudo chmod -R 777 /tftpboot<br />
> sudo chown -R nobody /tftpboot<br />
> sudo /etc/init.d/xinetd restart<br />
<div>
</div>
</div>
</div>
</pre>
<br />
<br />
<h2>
NFS</h2>
NFS stands for network file system. It has been around a while (the 80's) and is easy to setup on an existing Linux host.<br />
<br />
First we have to install the NFS server on our host:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo apt-get install nfs-kernel-server</div>
</div>
</pre>
<br />
Next we need to populate a root filesystem. You could use the image-builder scripts from Robert C Nelson, but those require lots of harddrive space and time. A faster way is to copy an already generated image. I chose to use a micro SD card with the eMMC image because I had one laying around.<br />
<ol>
<li>Use a card reader to mount the SD card in the Ubuntu host.</li>
<li>Copy the root file system to a host folder and copy boot files to our TFTP folder:</li>
</ol>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo cp -a /media/eMMC-Flasher/* /home/programmer/bbb_nfs_root<br />
> sudo cp /media/BEAGLE_BONE/initrd.img /tftpboot<br />
> sudo cp /media/BEAGLE_BONE/zImage /tftpboot<br />
> sudo cp /media/BEAGLE_BONE/dtbs/am335x-boneblack.dtb /tftpboot</div>
</div>
</pre>
<br />
You may have to change the am335x-boneblack.dtb file to match your system, for example a BBW. Browse the dtbs folder for options.<br />
<br />
Once you have a full rootfs folder, you now need to tell the server where to look by modifying the /etc/exports file:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
> sudo nano /etc/exports</div>
</div>
</pre>
<br />
Add this line (modify the path to point to your rootfs):<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<span style="font-size: xx-small;">/home/programmer/bbb_nfs_root *(rw,nohide,insecure,no_subtree_check,async,no_root_squash)
</span></div>
</div>
</pre>
<br />
<span style="background-color: yellow;"><span style="color: #444444;">NOTE: Ensure that there is a space between rootfs and *, but no space between * and (rw,nohi.....</span></span><br />
<br />
Save and exit, and then restart the NFS server, so our folder will get served up:<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<span style="color: #444444;">> sudo /etc/init.d/nfs-kernel-server restart</span></div>
</div>
</pre>
<br />
<br />
<h2>
Local Bootstrap</h2>
Now that the server is configured, we need to tell the Beaglebone to boot from the network.<br />
<br />
First, a little background on the Beaglebone filesystem. The AM335x can get its initial image from a number of sources. The Beaglebone White used a uSD card, while the Beaglebone Black can use a uSD card or the on-board eMMC. Either way, the partitioning is the same: one small FAT boot partition and an EXT root partition that fills up the rest of the space.<br />
<br />
The Beaglebone Linux images use Das uBoot as their bootloader (versus LILO or GRUB found on typical desktop systems). uBoot takes care of initializing low level hardware and provides filesystem drivers to aide in booting the main operating system. On the Beaglebones, uBoot can be run interactively, through the console serial port, or it can be scripted through a file called uEnv.txt. So, in order to boot a NFS, all we need to do is create a specially crafted uEnv.txt file.<br />
<br />
The easiest way to modify the uEnv.txt file is to use a USB connection to a host PC. Any host will work, as we only need to modify the files that mount automatically as a mass storage device. For this to work, though, you need to have an initial image booting the Beaglebone. Any image (Angstrom/Debian/etc) will work, as long as it uses uBoot and uEnv.txt.<br />
<br />
I highly recommend using a micro SD card image until you get the uEnv.txt settings nailed down. It is much easier to use a card reader, to modify the files on a host, than it is to try to get the Beaglebone booting again (it needs to boot in order to start the mass storage driver). If you still insist on using the eMMC, you should be familiar with the serial console, because you are going to need it.<br />
<br />
After several failed attempts, here is my golden uEnv.txt file. Change the IP addresses and rootpath to match your configuration. I could not get DHCP to work, so I assigned ipaddr to be outside of the range of my DHCP server. This IP is only used for the TFTP process and once the operating system is up and running, it will reinitialize the Ethernet and get a DHCP address.<br />
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<span style="color: #444444; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">serverip=192.168.1.100</span><br />
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">ipaddr=192.168.1.55</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">rootpath=/home/programmer/bbb_nfs_root</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<br />
<span style="color: #444444;"># Choose one...</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">#mmcORtftp=load mmc ${mmcdev}:${mmcpart}</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">mmcORtftp=tftp</span></div><br />
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;"># Original Configs</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">loadaddr=0x80300000</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">initrd_addr=0x81600000</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">fdtaddr=0x815f0000</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">initrd_high=0xffffffff</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">fdt_high=0xffffffff</span></div><br />
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">systemd=quiet init=/lib/systemd/systemd</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">mmcrootfstype=ext4 rootwait fixrtc</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">console=ttyO0,115200n8</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">kernel_file=zImage</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">initrd_file=initrd.img</span></div><br />
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">loadkernel=${mmcORtftp} ${loadaddr} ${kernel_file}</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">loadinitrd=${mmcORtftp} ${initrd_addr} ${initrd_file}; setenv initrd_size \ ${filesize}</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">loadfdt=${mmcORtftp} ${fdtaddr} ${fdtfile}</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">loadfiles=run loadkernel; run loadinitrd; run loadfdt</span></div><br />
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">mmcargs=setenv bootargs console=${console} root=/dev/nfs \ nfsroot=${serverip}:${rootpath},nolock ${systemd}</span></div>
<div style="font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="color: #444444;">uenvcmd=run loadfiles; run mmcargs; bootz ${loadaddr} \ ${initrd_addr}:${initrd_size} ${fdtaddr}</span></div>
</div>
</div>
</pre>
<br />
Enjoy testing new Kernels, unzipping large files with the host processor, and taking advantage of the massive storage capacity of your host hard drive :)<br />
<br />
<br />
Sources:<br />
<a href="http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot" target="_blank">http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot</a><br />
<a href="http://processors.wiki.ti.com/index.php/Alternate_Boot_Methods_for_OMAP-L137/DA830#Mounting_Root_File_System" target="_blank">http://processors.wiki.ti.com/index.php/Alternate_Boot_Methods_for_OMAP-L137/DA830#Mounting_Root_File_System</a><br />
<a href="http://askubuntu.com/questions/201505/how-do-i-install-and-run-a-tftp-server" target="_blank">http://askubuntu.com/questions/201505/how-do-i-install-and-run-a-tftp-server</a>Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com2tag:blogger.com,1999:blog-3046109770954577257.post-90754318996375479992014-03-10T11:19:00.000-07:002014-03-10T20:04:12.840-07:00Qt 5.2.1 Beaglebone Binaries<h2>
Overview</h2>So, how did I create these binaries....well I thought it would be fun to see how long it would take the Beaglebone to compile Qt. Here is a brief description of my setup.<br>
<br>
I powered the Beaglebone with a 5v power supply and booted a Debian rootfs using TFTP and NFS (a future post will explain how to configure this) so I could utilize the large HD of my Linux host. After compiling and installing Qt, the total root filesystem usage is around 3 Gb. The actual compile took about 21 hours, which includes compiling all examples and plugins.<br>
<br>
<h2>
Configuration</h2>
I created a simple shell script to modify the Qt source, with the Beaglebone configuration, and run the Qt configuration script:<br>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">#!/bin/sh</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">
</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;"># Create beaglebone hard float configuration file</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">cd qt-everywhere-opensource-src-5.2.1/qtbase/mkspecs/devices/</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">cp -r linux-beagleboard-g++ linux-beaglebone-g++</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">sed 's/softfp/hard/' <linux-beagleboard-g++/qmake.conf >linux-beaglebone-g++/qmake.conf</span><br>
<span style="color: #444444; font-family: Courier New, Courier, monospace;">
</span></div>
<span style="color: #444444; font-family: Courier New, Courier, monospace;">
</span>
<span style="color: #444444; font-family: Courier New, Courier, monospace;"># Run configuration</span><br>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">cd ../../../</span></div>
<div style="line-height: normal;">
<span style="color: #444444; font-family: Courier New, Courier, monospace;">./configure -v -opensource -confirm-license -prefix /usr/local/qt-5.2 -no-largefile -no-accessibility -qt-zlib -no-gif -qt-libpng -qt-libjpeg -no-nis -no-cups -device linux-beaglebone-g++</span></div>
<div style="color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px;">
</div>
</div>
</div>
</pre>
<br>
<br>
This produced the following summary:<br>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Configure summary</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Build type: linux-g++ (arm, CPU features:)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Platform notes:</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> - Also available for Linux: linux-kcc linux-icc linux-cxx</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">qmake vars .......... styles += mac fusion windows DEFINES += QT_NO_MTDEV QT_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/arm-linux-gnueabihf/dbus-1.0/include QT_LIBS_DBUS = -ldbus-1 QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_GLIB = -pthread -lgthread-2.0 -lrt -lglib-2.0 QT_CFLAGS_PULSEAUDIO = -D_REENTRANT -I/usr/include/glib-2.0 -I/usr/lib/arm-linux-gnueabihf/glib-2.0/include QT_LIBS_PULSEAUDIO = -lpulse-mainloop-glib -lpulse -lglib-2.0 DEFINES += QT_NO_LIBUDEV QMAKE_CFLAGS_XCB = QMAKE_LIBS_XCB = -lxcb QMAKE_CFLAGS_DIRECTFB = -D_REENTRANT -I/usr/include/directfb QMAKE_LIBS_DIRECTFB = -ldirectfb -lfusion -ldirect -lpthread sql-drivers = sql-plugins = sqlite qmake switches ......... </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Build options:</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Configuration .......... alsa audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent dbus directfb evdev eventfd full-config getaddrinfo getifaddrs glib iconv inotify ipv6ifname large-config linuxfb medium-config minimal-config mremap neon no-gif no-harfbuzz opengl openssl pcre png posix_fallocate precompile_header pulseaudio qpa qpa reduce_exports reduce_relocations release rpath shared small-config system-freetype xcb xcb-qt xkbcommon-qt xlib zlib </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Build parts ............ libs tools examples</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Mode ................... release</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Using C++11 ............ yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Using PCH .............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Target compiler supports:</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> iWMMXt/Neon .......... no/yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Qt modules and options:</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Qt D-Bus ............... yes (loading dbus-1 at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Qt Concurrent .......... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Qt GUI ................. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Qt Widgets ............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> JavaScriptCore JIT ..... yes (To be decided by JavaScriptCore)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> QML debugging .......... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Use system proxies ..... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Support enabled for:</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Accessibility .......... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> ALSA ................... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> CUPS ................... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> FontConfig ............. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> FreeType ............... system</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Iconv .................. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> ICU .................... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Image formats: </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> GIF .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> JPEG ................. yes (plugin, using bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> PNG .................. yes (in QtGui, using bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Glib ................... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> GTK theme .............. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Large File ............. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> mtdev .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Networking: </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> getaddrinfo .......... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> getifaddrs ........... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> IPv6 ifname .......... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> OpenSSL .............. yes (loading libraries at run-time)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> NIS .................... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> OpenGL ................. desktop</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> OpenVG ................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> PCRE ................... yes (bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> pkg-config ............. yes </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> PulseAudio ............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> QPA backends: </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> DirectFB ............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> EGLFS ................ no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> KMS .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> LinuxFB .............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> XCB .................. yes (bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> MIT-SHM ............ yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xcb-Xlib ........... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xcursor ............ yes (loaded at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xfixes ............. yes (loaded at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xi ................. yes (loaded at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xi2 ................ no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xinerama ........... yes (loaded at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xrandr ............. yes (loaded at runtime)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Xrender ............ no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> XKB ................ yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> XShape ............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> XSync .............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> XVideo ............. yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> Session management ..... yes</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> SQL drivers: </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> DB2 .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> InterBase ............ no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> MySQL ................ no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> OCI .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> ODBC ................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> PostgreSQL ........... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> SQLite 2 ............. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> SQLite ............... yes (plugin, using bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> TDS .................. no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> udev ................... no</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> xkbcommon .............. yes (bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;"> zlib ................... yes (bundled copy)</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">
</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">NOTE: libxkbcommon 0.2.0 (or higher) not found on the system, will use </span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">the bundled version from 3rd party directory.</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">NOTE: Qt is using double for qreal on this system. This is binary incompatible against Qt 5.1.</span></div>
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
<span style="font-family: Courier New, Courier, monospace;">Configure with '-qreal float' to create a build that is binary compatible with 5.1.</span></div>
</div>
</div>
</pre>
<br>
If you've tried cross compiling Qt, from my other posts, you will notice a lot more modules are enabled in this build.<div><br>
I've tested a few examples and they all work, but I have not tested everything (haven't been able to test touch screen stuff yet). The examples default to using X11, if you want to use the linuxfb, add '-platform linuxfb' to the command line options. For example:<br>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
<div style="margin: 0px;">
<div style="color: black; font-family: 'Times New Roman'; font-size: medium; line-height: normal;">
> analogclock -platform linuxfb</div>
</div>
</div>
</pre>
<br>
Here are two versions of binaries, one that includes examples (78 Mb) and one that does not (36 Mb).<br>
<br>
<span style="font-family: Courier New, Courier, monospace;">MD5SUM:</span><br>
<span style="font-family: Courier New, Courier, monospace;">9395fc70f576e58b68df7d732a002abb <a href="https://drive.google.com/file/d/0B1B3pSjj6X4uRTM1RkpCT0RpMms/edit?usp=sharing" target="_blank"><span style="color: #444444;">qt-5.2-no-examples.tgz</span></a></span><br>
<span style="font-family: Courier New, Courier, monospace;">f698f038166c4b2f65cec40056e23db2 <a href="https://drive.google.com/file/d/0B1B3pSjj6X4uR3pEZGN3UEY2N3c/edit?usp=sharing" target="_blank"><span style="color: #444444;">qt-5.2.tgz</span></a></span><br>
<div>
<br></div>
Extract to /usr/local, as the tarball contains the qt-5.2 folder in it.</div><div><br></div><div>If you want to try your hand at compiling applications on the Beaglebone, these packages have a native qmake included. Don't forget to add /usr/local/qt-5.2/bin to your path.</div><div><br></div><div>Have fun!</div><div><br></div>Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com13tag:blogger.com,1999:blog-3046109770954577257.post-42867331957847777472014-03-04T13:58:00.001-08:002014-03-05T18:37:43.011-08:00Why Qt Development was stalled....<div dir="ltr">
I finally finished my digital I/O cape! It only took about two and a half hours to hand solder all of the components. It is fully tested and ready to go.</div>
<div dir="ltr">
<br /></div>
<div dir="ltr">
It has an isolated DC to DC converter, 16 optically isolated digital inputs and 16 optically isolated digital outputs, a 4 wire RS-422 port, and an optically isolated 2 wire RS-485 port.</div>
<div dir="ltr">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPjvzykNfzYgptJ-0m6HWa1u9YMFRT1O_E9w_BDYT9Np6hVU9tBOfKLEOKAP1601r6UxHGIhhvBPZcshvhZYyU2svOJ41AkRyLgN0wNr2qRfKcxPqwafB1ZJQEQfh-gQaqEKcw5YQvaA4b/s1600/_20140304_154734.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"> <img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPjvzykNfzYgptJ-0m6HWa1u9YMFRT1O_E9w_BDYT9Np6hVU9tBOfKLEOKAP1601r6UxHGIhhvBPZcshvhZYyU2svOJ41AkRyLgN0wNr2qRfKcxPqwafB1ZJQEQfh-gQaqEKcw5YQvaA4b/s640/_20140304_154734.JPG" height="372" width="400" /> </a> </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div dir="ltr">
I have released the Eagle 6.5 project files, for my older v1.0 board (v2.0 is in the photo), on GitHub: <a href="https://github.com/compeoree/bb-dio-cape">https://github.com/compeoree/bb-dio-cape</a>.<br />
<br /></div>
<div dir="ltr">
Now back to Qt 5.....</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com0tag:blogger.com,1999:blog-3046109770954577257.post-48360768141272424992014-01-26T21:10:00.001-08:002014-01-26T21:11:36.205-08:00element14 BB-View and the Debian Beta<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
This is a post I made at the element14 Community pages:</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
I thought some other might like to know how to get the BB-View working under the latest Debian beta images.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Unfortunately, you are going to have to recompile the Kernel. The video works fine without a recompile (the red/blue swap is easy to fix), but the touchscreen control connections are not the same as the standard TI 4-wire interface. I tried to patch the ti_am335x_tsc.c file, so the changes would be limited to a dts recompile, but I haven't been able to get that working yet (I'm pretty sure it is a state machine / bit assignment issue). But anyway, here are the steps that you need to perform.....</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<h3 style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 20px; margin: 0px; padding: 0px;">
<strong>Overview</strong></h3>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
1) Download the necessary files</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
a) Robert Nelson's handy tools for compiling the Beaglebone kernel</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
b) BB-View source for Angstrom</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
2) Build the default kernel</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
3) Patch the Kernel and perform a fast recompile</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
4) Copy the new kernel to the Beaglebone</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
5) Edit the xorg.conf file to correct the Red/Blue color swap</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
6) Revel in the 4 days you just saved <img ___jive_emoticon_name="happy" class="jive_macro jive_emote" data-mce-src="/community/6.0.3.0/images/emoticons/happy.png" src="http://www.element14.com/community/6.0.3.0/images/emoticons/happy.png" jivemacro="emoticon" style="border: 0px; height: 16px; width: 16px;" /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<h3 style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 20px; margin: 0px; padding: 0px;">
<strong>Let's Get Started</strong></h3>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
I am using Ubuntu 12.04 LTS 64 bit running in a VirtualBox VM to compile the kernel:</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Make a new folder called bb-view, this is where our build will happen.</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> mkdir bb-view</div>
<div style="padding: 0px;">
> cd bb-view</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Install git, if you haven't already:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> apt-get install git</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Clone Robert Nelson's linux-dev project locally. Be prepared for a large download (~100 Mb for the cross-compiler and ~700 Mb for the kernel source).</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> git clone https://github.com/RobertCNelson/linux-dev.git</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Change into the new linux-dev folder and select branch/tag that matches the Debian version.</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> cd linux-dev</div>
<div style="padding: 0px;">
> git checkout 3.8.13-bone37 -b tmp</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now we need to build the base image, so our cape drivers folder gets populated. The script will tell you if you need to do or install anything else. </div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> ./build_kernel.sh</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br type="_moz" /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Come back in an hour or so.....(You might want to download the Angstrom source from <a href="http://www.element14.com/community/community/knode/single-board_computers/next-gen_beaglebone#downloadsoftware" style="color: #2989c5; text-decoration: none;">element14</a><span style="font-size: 10pt; line-height: 1.5em;"> now)</span></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<h3 style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 20px; margin: 0px; padding: 0px;">
<strong>Patching the Kernel</strong></h3>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Extract two files from the Angstrom source:</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> unzip angstrom-source.zip</div>
<div style="padding: 0px;">
> tar -zxf bb-black-kernel-3.8.13-bb-view.tar.bz2</div>
<div style="padding: 0px;">
> cp ./kernel/kernel/drivers/input/touchscreen/ti_am335x_tsc.c ~/bb-view/linux-dev/KERNEL/drivers/input/touchscreen/</div>
<div style="padding: 0px;">
> cp ./kernel/kernel/firmware/capes/BB-VIEW-LCD7-01-00A0.dts ~/bb-view/linux-dev/KERNEL/firmware/capes/</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now we need to let the compiler know that we want to add the firmware to the build:</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> nano ~/bb-view/linux-dev/KERNEL/firmware/Makefile</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Add the following line somewhere near line 192 (CTRL-C will display current cursor position):</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
BB-VIEW-LCD7-01-00A0.dtbo \</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Don't forget the trailing backslash....it is important. Now save and exit by doing CTRL-O, Enter, CTRL-X.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Change back to the linux-dev root folder:</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> cd ~/bb-view/linux-dev</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now issue the kernel rebuild command, this won't take very long at all:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> ./tools/rebuild.sh</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<h3 style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 20px; margin: 0px; padding: 0px;">
Copy Kernel to BBB</h3>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<em>The following instructions assume that you already have the Debian beta installed and booted up on the BBB.</em></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
The easiest way is to copy the files over the network, via the 'scp' command:</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> scp ~/bb-view/linux-dev/deploy/3.8.13-bone37.zImage debian@192.168.7.2:/home/debian</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Replace debian (both instances) with the username you are running on the BBB and 192.168.7.2 with the IP address of the BBB.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now log into the BBB and copy the kernel image to the boot partition:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> ssh debian@192.168.7.2</div>
<div style="padding: 0px;">
bbb> sudo cp <span data-mce-style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif;">3.8.13-bone37.zImage</span> /boot/uboot/zImage</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
We need to do one more thing before the LCD will work. Since the cape doesn't have an EEPROM, we need to black-list the HDMI drivers and force-load the BB-VIEW drivers in the boot command file:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
bbb> sudo nano /boot/uboot/uEnv.txt</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Find the "optargs" line and edit it to be:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN capemgr.enable_partno=BB-VIEW-LCD7-01</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Notice that the preceding "#" has been removed. You don't want to disable BB-BONE-EMMC-2G, or you won't be able to boot from eMMC.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now save and exit by doing CTRL-O, Enter, CTRL-X.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Reboot the BBB and the LCD should now work....except the blue and red are reversed.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<h3 style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 16px; line-height: 20px; margin: 0px; padding: 0px;">
Fixing Red/Blue Color Swap</h3>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
This is due to errata in the TI AM335x processor when switching between 16 and 24 bit video modes. To fix this, we must first find the name of our screen:</div>
<pre _modifiedtitle="true" class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
> ssh debian@192.168.7.2</div>
<div style="padding: 0px;">
bbb> cat /var/log/Xorg.0.log | grep screen</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Mine was "Builtin Default fbdev Screen 0"</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Now we edit our X configuration file:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
bbb> sudo nano /usr/share/X11/xorg.conf.d/10-evdev.conf</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
<br /></div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
and add a "Screen" section at the end of the file:</div>
<pre class="jive_text_macro jive_macro_quote" jivemacro="quote" style="background-color: white; background-image: url(http://www.element14.com/community/6.0.3.0/images/quote-background-1.gif); background-repeat: repeat repeat; border-color: rgb(238, 238, 238) rgb(238, 238, 238) rgb(238, 238, 238) rgb(204, 204, 204); border-style: solid; border-width: 1px 1px 1px 2px; color: #575757; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 20px; margin: 1em 2em 0.5em; padding: 10px 10px 10px 1em; white-space: normal; width: auto;"><div style="padding: 0px;">
Section "Screen"</div>
<div style="padding: 0px;">
Identifier "Builtin Default fbdev Screen 0"</div>
<div style="padding: 0px;">
Monitor "Configured Monitor"</div>
<div style="padding: 0px;">
Device "Configured Video Device"</div>
<div style="padding: 0px;">
DefaultDepth 24</div>
<div style="padding: 0px;">
EndSection</div>
</pre>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Save and exit by doing CTRL-O, Enter, CTRL-X.</div>
<div style="color: #575757; font-family: arial, helvetica, sans-serif; font-size: 13px; line-height: 20px; padding: 0px;">
Reboot and enjoy!</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com1tag:blogger.com,1999:blog-3046109770954577257.post-49527142305875636912014-01-16T09:08:00.000-08:002014-01-20T08:07:42.967-08:00Bare Metal Qt 5.2 on BeagleBone Black Ubuntu - Part 3<h2>
Overview</h2>
<div>
With Qt 5.2 working on the BeagleBone Black, created in <a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black.html" target="_blank">Part 1</a> and <a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_10.html" target="_blank">Part 2</a>, now it is time to compile a "Hello World" application. Assumptions:</div>
<div>
<ul>
<li>You are using an Ubuntu x64 host for creating Qt applications</li>
<li>You have a Linaro toolchain located under /usr/local/linaro</li>
<li>You have a BeagleBone connect to your host PC via a LAN</li>
</ul>
</div>
<div>
<h2>
Downloads</h2>
No need to compile our own Qt Creator, just download it:<br />
<ul>
<li>Qt Creator 3.0.0 Installer: <a href="http://download.qt-project.org/official_releases/qtcreator/3.0/3.0.0/qt-creator-opensource-linux-x86_64-3.0.0.run">Direct Link</a>, <a href="http://qt-project.org/downloads" target="_blank">Others</a></li>
</ul>
<br />
<h2>
Video Tutorials</h2>
</div>
<div>
Derek Molloy has three excellent videos about Qt on the BeagleBone. I suggest you start with these, as it will make following these instructions easier.</div>
<div>
<ul>
<li>Part 1: <a href="http://www.youtube.com/watch?feature=player_embedded&v=yXTJC-_rlMY" target="_blank">BeagleBone LCDs and Qt</a></li>
<li>Part 2: <a href="http://www.youtube.com/watch?feature=player_detailpage&v=kP7uvOu9hoQ" target="_blank">Using Qt Creator</a></li>
<li>Part 3: <a href="http://www.youtube.com/watch?feature=player_embedded&v=yNvOyY9zK1o" target="_blank">A fully featured application</a></li>
</ul>
<div>
<br /></div>
<h2>
Setup Toolchain Environment</h2>
<div>
Open Qt Creator</div>
</div>
<div>
Go to Tools -> Options</div>
<div>
<br /></div>
<div>
<b><u>Add a new Device</u></b></div>
<div>
Click on "Devices" from the list on the left</div>
<div>
Click the "Add..." button on the upper right</div>
<div>
Select Generic Linux Device</div>
<div>
Click "Start Wizard" button</div>
<div>
Enter "BBB - Ubuntu" for the name</div>
<div>
Enter IP, and user information.</div>
<div>
Click "Next" button</div>
<div>
Click "Finish" button</div>
<div>
Verify that the test connection was successful</div>
<div>
<br /></div>
<div>
<b><u>Add a new Compiler</u></b></div>
<div>
<div>
Click on the "Build & Run" item from the list on the left</div>
<div>
Click on the "Compilers" tab</div>
<div>
Click the "Add" drop down list button and select GCC</div>
<div>
Change the name to "Linaro GCC"</div>
<div>
Click the "Browse..." button next to the "Compiler path" field</div>
<div>
Enter "/usr/local/linaro/bin/" into the filename field and click "Open"</div>
<div>
Select "arm-linux-gnueabihf-g++" and click "Open" again</div>
<div>
Click the "Apply" button</div>
</div>
<div>
<br /></div>
<div>
<b><u>Add a new Debugger</u></b></div>
<div>
<div>
Click on the "Debuggers" tab</div>
<div>
Click the "Add" button</div>
<div>
Enter "Linaro GDB" for the name</div>
<div>
Click the "Browse..." button next to the Path field</div>
<div>
Select "arm-linux-gnueabihf-gdb" and click "Open"</div>
<div>
Click the "Apply" button</div>
</div>
<div>
<br /></div>
<div>
<b><u>Add a new Qt Version</u></b></div>
<div>
Click on the "Qt Versions" tab</div>
<div>
Click the "Add..." button</div>
<div>
Navigate to "/usr/local/qt-5.2/bin/qmake"</div>
<div>
Click the "Open" button</div>
<div>
Click the "Apply" button</div>
<div>
<br /></div>
<div>
<b><u>Add a new Kit</u></b></div>
<div>
Click on the "Kits" tab</div>
<div>
Click the "Add" button</div>
<div>
Change name to "BBB Kit"</div>
<div>
Ensure that the device type is "Generic Linux Device"</div>
<div>
Ensure that the device is "BBB - Ubuntu"</div>
<div>
Select the "Linaro GCC" compiler from the Compiler drop down list button</div>
<div>
Select the "Linaro GDB" debugger from the Debugger drop down list button</div>
<div>
Select the "Qt 5.2.0 (qt-5.2)" version from the "Qt Version" drop down list button</div>
<div>
Click the "Ok" button</div>
<div>
<br /></div>
<h2>
Create a New Console Project</h2>
<div>
Under the Welcome page, Click the "New Project" button</div>
<div>
Select "Applications" from the list on the left</div>
<div>
Select "Qt Console Application"</div>
<div>
Click the "Next" button</div>
<div>
Enter "HelloWorld" in the name field</div>
<div>
Change the target directory, if you like</div>
<div>
Click on the "Next" button</div>
<div>
Review the details and then click on the "Next" button</div>
<div>
Click on the "Finish" button</div>
<div>
<br /></div>
<div>
<h2>
Modify Auto-Generated Project</h2>
</div>
<div>
Edit main.cpp to look like this:<br />
<br /></div>
<pre>#include <QCoreApplication>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{<div>
QCoreApplication a(argc, argv);</div>
<div>
cout << "Hello World!" << endl;</div>
<div>
return a.exec();<br />
}</div>
</pre>
<br />
This will build locally, but we want it to auto deploy to the BeagleBone. That's coming up next...<br />
<br />
<h2>
Create Deploy Configuration</h2>
Add the following three lines to HelloWorld.pro after the "TARGET=HelloWorld" line<br />
<br />
<pre> target.files = HelloWorld
target.path = /home/ubuntu
INSTALLS += target</pre>
<br />
That's it, now Qt Creator will automatically deploy the files before a debug or run.<br />
<br />
<br />
<h2>
Install GDB Server</h2>
This is required in order to debug from Qt Creator running on our host PC. This only needs to be done once. Issue this command on the Beaglebone:<br />
<br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;">> sudo apt-get install gdbserver</span></span><br />
<br />
Now you can press the Debug icon (looks like a play arrow) in Qt Creator and it will automatically scp the binary to the BeagleBone and start a remote GDB server session.<br />
<br />
<h2>
Create a GUI Project</h2>
<div>
Under the Welcome page, Click the "New Project" button</div>
<div>
Select "Applications" from the list on the left</div>
<div>
Select "Qt Gui Application"<br />
<br />
<span style="background-color: yellow; color: #444444;"><b><strike>Note: This option may not show up. If Qt Creator does not see the Qt 5.2 build as supporting GUI applications, you can choose "Qt Widgets Application", but this may give different results. The other option is to install a distro version of Qt and make Qt Creator aware of it. This will make the Gui option visible in the project creation section.</strike> Nevermind, this is a difference between Qt Creator 2.8 and 3.0. The source generated, for either option, is identical.</b></span><br />
<br /></div>
<div>
Click the "Next" button</div>
<div>
Enter "HelloWorldGUI" in the name field</div>
<div>
Change the target directory, if you like</div>
<div>
Click on the "Next" button</div>
<div>
Review the details and then click on the "Next" button</div>
<div>
Click on the "Finish" button</div>
<div>
<br /></div>
<div>
<h2>
Modify Auto-Generated Project</h2>
</div>
<div>
Perform the same .pro file changes, as the console project, to deploy the project to the Beaglebone.</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com25tag:blogger.com,1999:blog-3046109770954577257.post-5311047371394372962014-01-10T09:42:00.001-08:002014-03-10T11:24:13.197-07:00Bare Metal Qt 5.2 on BeagleBone Black Ubuntu - Part 2<h2>
Overview</h2>
<div>
<span style="background-color: yellow;"><span style="color: #444444; font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">For the impatient, I now have a precompiled tar of Qt 5.2.1 (for installation on a Beaglebone), see <a href="http://armsdr.blogspot.com/2014/03/qt-521-beaglebone-binaries.html">my blog post</a> for more info...</span></span><br />
<br />
Now that we have our development environment setup from <a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black.html" target="_blank">Part 1</a>, I will now guide you through the steps to compile Qt 5.2. This guide assumes the following:</div>
<div>
<ul>
<li>That Ubuntu host machine is up-to-date</li>
<li>The host machine has the necessary utilities installed</li>
<li>Contains a folder, in the home directory, with the Qt source</li>
<li>The toolchain is installed under /usr/local/, which, for this guide, is in the linaro directory.</li>
</ul>
</div>
<div>
<h2>
Downloads</h2>
Download these files, if you still need to flash Ubuntu onto the BeagleBone Black:<br />
<ul>
<li>BeagleBone Ubuntu Saucy: <a href="https://rcn-ee.net/deb/rootfs/saucy/ubuntu-13.10-console-armhf-2013-12-17.tar.xz">Direct Link</a>, <a href="http://elinux.org/BeagleBoardUbuntu#Saucy_13.10" target="_blank">Others</a>, <a href="http://www.armhf.com/index.php/boards/beaglebone-black/" target="_blank">Alternate Site</a></li>
</ul>
<h2>
Create Device Configuration</h2>
<div>
Before we can call the Qt configuration script, we need to create a device configuration file so Qt knows how to generate the proper makefiles. Let's start by diving deeper into the Qt source folders.</div>
<div>
<br /></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cd </span></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cd qt-everywhere-opensource-src-5.2.0/qtbase/mkspecs/devices </span></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> ls </span></div>
<div>
<br /></div>
<div>
The directory list will reveal 17 devices that we can target with Qt, of which, one of those is linux-beagleboard-g++. Let's make a copy of that device directory and then modify the qmake.conf file for our toolchain.</div>
<div>
<br /></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cp -r linux-beagleboard-g++ linux-beaglebone-g++ </span></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> nano linux-beaglebone-g++/qmake.conf </span></div>
<div>
<br /></div>
<div>
We'll start by modifying the comment (line 2) to reflect this new file's target hardware, because good comments are important :)</div>
<blockquote class="tr_bq">
# qmake configuration for the <span style="background-color: yellow; color: #666666;">BeagleBone </span>and <span style="background-color: yellow; color: #666666;">BeagleBone Black</span> boards</blockquote>
Next we need to change the compiler flags. The Linaro toolchain uses hardfloat so we need to change the "-mfloat-abi=softfp" option to "-mfloat-abi=hard" on line 29.<br />
<blockquote class="tr_bq">
COMPILER_FLAGS = -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=<span style="background-color: yellow; color: #666666;">hard</span></blockquote>
Save your changes and exit nano: CTRL-O, Enter, CTRL-X.<br />
<br />
<h2>
Create Platform Configuration</h2>
<div>
We need to create one more configuration before we call the Qt configuration script. Similar to a device configuration, we need to point to our platform compiler. In this case, I use the same linaro toolchain compiler. (I tried running the make without a -xplatform defined, because I thought it was not necessary....wrong!) </div>
<div>
<br /></div>
<div>
Let's start by making a copy of an existing configuration file:</div>
<div>
<br /></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cd </span></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cd qt-everywhere-opensource-src-5.2.0/qtbase/mkspecs </span></div>
<div>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cp -r linux-arm-gnueabi-g++ linux-linaro-gnueabihf-g++ </span></div>
<div>
<br /></div>
<div>
Now let's modify the qmake.conf file:</div>
<div>
<br /></div>
<div>
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> nano linux-linaro-gnueabihf-g++/qmake.conf </span></div>
<div>
<br /></div>
<div>
Comments first (line 2):</div>
<blockquote class="tr_bq">
# qmake configuration for building <span style="background-color: yellow; color: #666666;">with Linaro hardfloat toolchain.</span></blockquote>
Next we need to modify all 8 lines of compiler paths to point to our Linaro toolchain. We can do this two ways:<br />
<br />
<ul>
<li>By using the -device-options CROSS_COMPILE tag</li>
<li>By entering the full path</li>
</ul>
I chose the first option because I just copied the device configuration file, removed unused parts based on the linux-arm-gnueabi-g++ file (opengl, calls to device_config, etc), and modified the paths (changed ../../ to ../) to common headers. But I would recommend using the full path method because the configuration script may not enforce a "-device-option" tag for a "-xplatform" tag like it does for a "-device" tag.<br />
<br />
So lets add the full path to qmake.conf. Change each line from this:<br />
<blockquote class="tr_bq">
QMAKE_* = arm-linux-gnueabi-*</blockquote>
to<br />
<blockquote class="tr_bq">
QMAKE_* = /usr/local/linaro/bin/arm-linux-gnueabihf-* </blockquote>
In other words, leave the suffixes (gcc/g++/ar/objcopy/nm/strip) and options (cqs/-P) unchanged. As an example, the QMAKE_AR line (line 20) would become:<br />
<blockquote class="tr_bq">
QMAKE_AR = /usr/local/linaro/bin/arm-linux-gnueabihf-ar cqs</blockquote>
Once you have modified all 8 lines, save your changes and exit nano: CTRL-O, Enter, CTRL-X.<br />
<br />
<h2>
Configure Qt</h2>
Now we are ready to configure Qt. This is a relatively painless operation, but took me a while to discover which command line options were required. A lot of the options that were available in Qt 4 are no longer valid in Qt 5. We can ask the configuration script what options are available, but first we need to change our working directory to the build folder:<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> cd </span><br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> cd qt-5.2-host </span><br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> ../qt-everywhere-opensource-src-5.2.0/configure --help </span><br />
<span style="background-color: white; font-family: 'Courier New', Courier, monospace;"><br /></span>
This outputs several pages of information, which you can study later; while you are waiting for Qt to compile. But for now, let's run configure with these parameters:<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> ../qt-everywhere-opensource-src-5.2.0/configure \ </span><br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;"> -v \ </span><br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;"> -opensource \ </span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -confirm-license \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -prefix /usr/local/qt-5.2 \ </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -no-largefile \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -no-accessibility \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -qt-zlib \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -no-gif \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -qt-libpng \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: Courier New, Courier, monospace;"> -qt-libjpeg \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -no-nis \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -no-cups \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> </span><span style="color: white; font-family: Courier New, Courier, monospace;">-xplatform linux-linaro-gnueabihf-g++ \</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: Courier New, Courier, monospace;"> -device</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;">linux-beaglebone-g++</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> \ </span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;"> -device-option CROSS_COMPILE=/usr/local/linaro</span><span style="color: white; font-family: 'Courier New', Courier, monospace;">/bin/arm-linux-g</span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;">n</span><span style="color: white; font-family: 'Courier New', Courier, monospace;">ueabihf- </span></span><br />
<br />
Here is a brief description of each option<br />
<br />
<b>-v </b> verbose output, which is helpful for problem solving<br />
<b>-opensource</b> build Qt as the opensource version<br />
<b>-confirm-license</b> automatically say "yes" to the LGPL license terms<br />
<b>-prefix </b> the destination folder for binaries when a 'make' is performed<br />
<b>-no-largefile </b>no 4Gb file support<br />
<b> -no-accessibility</b> don't include accessibility, to save space?<br />
<b> -qt-zlib </b> use the Qt version of zlib (instead of system)<br />
<b> -no-gif </b> no GIF support<br />
<b>-qt-libpng</b> use the Qt version of libpng (instead of system)<br />
<b>-qt-libjpeg</b> use the Qt version of libjpeg (instead of system)<br />
<b>-no-nis</b> no Network Information Service support<br />
<b>-no-cups</b> no print support<br />
<b>-xplatform</b> defines which qmake.conf file to use for building libraries/plugins/examples<br />
<b>-device </b> defines which qmake.conf file, in the device folder, to use for building<br />
<b> -device-option</b> this is required, when -device is used, to point to the cross compiler binary<br />
<br />
The reasoning behind why I chose these options is simple: these were the only options that worked from the <a href="http://qt-project.org/wiki/Building_Qt_for_Embedded_Linux" target="_blank">Building Qt for Embedded Linux</a> web page., which is written for Qt 4.8.<br />
<br />
<b style="background-color: yellow;"><span style="color: #444444;">Note: This is a work in progress, and as such the mouse, touchscreen, and GUI elements are not fully functional. Console applications seem to be working fine.</span></b><br />
<h2>
Building Qt</h2>
The configure script has compiled a host version of qmake, automatically detected what modules are available to build, determined what compiler optimizations are available, and has created makefiles in the source folders. So now what? Well, that's easy, the configure script prints it out when it finishes:<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> make -j3 </span><br />
<br />
The -j3 option tells the compiler how many jobs (aka threads) to run simultaneously. Your number of CPU cores minus one is a good number for a virtual machine host. Number of cores plus one is a good number for native hosts. <br />
<br />
My host PC has an Intel i7-3540M quad-core processor and 8 Gb of RAM. I created the VM with four cores and assigned 3 Gb of RAM. It finished the compile in about 20 to 30 minutes.</div>
<div>
<br />
<h2>
Tasks While Waiting</h2>
Since it is going to take a while, let's setup the BeagleBone Black with our embedded Ubuntu image. Follow the instructions on <a href="http://elinux.org/BeagleBoardUbuntu#Saucy_13.10">this</a> site to create a card and update the BBB eMMC. It should only take a few minutes.<br />
<br />
Once you have a working Ubuntu on the BBB, we need to remove an old version of Qt, 5.0.2<br />
<span style="background-color: white;"><br /></span>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> sudo apt-get remove libqt5core5 </span><br />
<br />
This will clear up the /usr/lib/arm-linux-gnueabihf folder of the old Qt libraries.<br />
<br />
We need a way to transfer files to the BeagleBone. This can be via SD or USB, but I prefer connecting it to my LAN and using 'scp'. You can find the IP address of the BeagleBone by issuing the following command:<br />
<br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> ifconfig </span><br />
<br />
Under the eth0 adapter listing (or wlan0 if using WiFi) you will find the "inet addr" field. Write this down, or remember it, as this is what you use for the host name with the scp command:<br />
<br />
> scp source_file username@host:remote_path<br />
<br />
But that will have to wait until the build is done....</div>
<div>
<br />
<h2>
Post Build</h2>
When the build is done, Qt is ready to be installed. The following command will create the directory, specified by the -prefix target when you ran the configuration script, and fill it with binaries.<br />
<br />
<span style="background-color: #999999; color: white;"><span style="font-family: Courier New, Courier, monospace;">> make install </span></span><br />
<br />
Now let's go explore the installation....<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> cd /usr/local/qt-5.2 </span><br />
<br />
Under this directory you will find eight more folders, of which a few are of interest:<br />
<br />
<ul>
<li>bin - host binary of qmake, and other utilities</li>
<li>examples - target binaries for testing our build</li>
<li>lib - .so libraries for our target</li>
<li>plugins - our platform gui drivers</li>
</ul>
<br />
<br />
<h2>
Copy Binaries to BeagleBone</h2>
My preferred method is to use 'scp' to copy the files over the LAN to the BeagleBone. The following commands will copy the entire Qt folder to your BeagleBone home folder:<br />
<br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> cd /usr/local </span><br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> scp -r qt-5.2 ubuntu@192.168.7.2:/home/ubuntu/qt-5.2 </span><br />
<br />
Replace 'ubuntu' with the user account that you use on the BeagleBone. Replace '192.168.7.2' with the IP address of your BeagleBone. It will take a couple minutes, depending on your network speed. You can reduce the size, by about 1/3, if you only transfer the four folders: examples, lib, plugins, and qml.<br />
<br />
The Qt libraries are now on the BeagleBone, but they are in the wrong directory. So, now we need to log into the BeagleBone, either via 'ssh' or through the console, and move them to the proper location:<br />
<br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">bbb> sudo mv /home/ubuntu/qt-5.2 /usr/local </span><br />
<br />
<h2>
Test Installation</h2>
Everything should be good to go, so let's run a couple examples to verify it. First let's try a console application:<br />
<br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">bbb> /usr/local/qt-5.2/examples/network/dnslookup www.google.com </span><br />
<br />
Now for a GUI application. I recommend calling this from a ssh session, because a local session will take over the screen and you will not be able to get it back until you reboot the BeagleBone.<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">bbb> /usr/local/qt-5.2/examples/gui/analogclock/analogclock </span><br />
<br />
Hmm, it doesn't work! Well, our device configuration, that we copied, sets the GUI to default to 'eglfs'. We don't have this plugin, because we didn't configure OpenGL support. So, to get around this, we need to explicitly define the platform. Add this to the previous command:<br />
<br />
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;"> -platform linuxfb </span><br />
<br />
Congratulations, you now have a working Qt 5.2 on your BeagleBone Black!<br />
<br />
<h2>
Conclusion</h2>
<a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_16.html" target="_blank">Part 3</a> shows how to configure Qt Creator for application development.<br />
<br />
<h2>
Sources</h2>
Here are some web pages that I used for inspiration.<br />
<br />
<ul>
<li><a href="http://qt-project.org/doc/qt-5/configure-options.html">http://qt-project.org/doc/qt-5/configure-options.html</a></li>
<li><a href="http://qt-project.org/doc/qt-4.8/qt-embedded-crosscompiling.html">http://qt-project.org/doc/qt-4.8/qt-embedded-crosscompiling.html</a></li>
<li><a href="http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/">http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/</a></li>
<li><a href="http://qt-project.org/wiki/Building_Qt_for_Embedded_Linux">http://qt-project.org/wiki/Building_Qt_for_Embedded_Linux</a></li>
<li><a href="https://groups.google.com/forum/#!topic/beagleboard/doI41xkIvks">https://groups.google.com/forum/#!topic/beagleboard/doI41xkIvks</a></li>
</ul>
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com22tag:blogger.com,1999:blog-3046109770954577257.post-62414138902695479582014-01-09T14:21:00.000-08:002014-01-10T14:20:26.308-08:00Bare Metal Qt 5.2 on BeagleBone Black Ubuntu - Part 1<h2>
Overview</h2>
<div>
This part will guide you through the steps to create a working cross compile platform for the Beaglebone. I will try to keep it generic enough that you could use any toolchain and target distro, but this is my target:</div>
<div>
<ul>
<li>BeagleBone Black Rev A6</li>
<li>Saucy Ubuntu 13.10 with Kernel 3.8.13-bone32 (12/13/2013) installed to eMMC</li>
<li>CircuitCo LCD7 Rev A3</li>
</ul>
<div>
See <a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_10.html" target="_blank">Part 2</a> for configuring and building Qt. </div>
</div>
<div>
<br /></div>
<h2>
Downloads</h2>
Download these files while you read the instructions below...<br />
<br />
<ul>
<li>Virtual Box 4.3.6: <a href="http://download.virtualbox.org/virtualbox/4.3.6/VirtualBox-4.3.6-91406-Win.exe">Windows Host</a>, <a href="https://www.virtualbox.org/wiki/Downloads" target="_blank">Others</a></li>
<li>Ubuntu x64 12.04 LTS: <a href="http://www.mirrorservice.org/sites/releases.ubuntu.com//precise/ubuntu-12.04.3-desktop-amd64.iso">Direct Link</a>, <a href="http://www.ubuntu.com/download/desktop" target="_blank">Others</a></li>
<li>Linaro Toochain GCC 4.8 (04/17/2013): <a href="https://launchpad.net/linaro-toolchain-binaries/trunk/2013.04/+download/gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux.tar.xz">Direct Link</a>, <a href="https://launchpad.net/linaro-toolchain-binaries/+milestone/2013.04" target="_blank">Others</a></li>
<li>Qt 5.2.0 Source: <a href="http://download.qt-project.org/official_releases/qt/5.2/5.2.0/single/qt-everywhere-opensource-src-5.2.0.tar.gz">Direct Link</a>, <a href="http://qt-project.org/downloads" target="_blank">Others</a></li>
<li>TI Graphics SDK (for OpenGL ES2.0 support): <i>to be covered later</i></li>
</ul>
<br />
<h2>
Setup Generic Virtual Machine</h2>
<div>
Follow these instructions to create and setup a vanilla Ubuntu VM. If you already have a VM or are going to use your host Ubuntu install, proceed to the "Install Compiler Prerequisites" section.</div>
<div>
<ol>
<li>Install Virtual Box</li>
<li>Create a new Virtual Machine</li>
<ol>
<li>Enter a name, such as "Ubuntu Qt Builder"</li>
<li>Change Type to "Linux", if it hasn't automatically done so.</li>
<li>Change Version to "Ubuntu (64 bit)"</li>
<li>Specify memory size, at least 1.5 Gb for better compiling performance.</li>
<li>Create a new virtual hard drive (ignore size recommendation for now)</li>
<li>Select VDI</li>
<li>Select Dynamically allocated</li>
<li>Set size to at least 40 Gb (it's dynamic, so why limit yourself)</li>
<li>Once the virtual machine is created, change the advanced settings</li>
<ol>
<li>Click the Settings button and then select "System" from the list on the left</li>
<li>Click the "Processor" tab and change the Processors to something greater than 1</li>
<li>Select "Display" from the list on the left</li>
<li>Max out the video memory</li>
<li>Select "Storage" from the list on the left</li>
<li>Click on the empty CD drive under the Storage Tree</li>
<li>Under the attributes section, click the CD symbol and select "Choose a Virtual CD/DVD disk file"</li>
<li>Point it to your Ubuntu ISO.</li>
<li>Adjust other virtual machine settings as desired.</li>
</ol>
</ol>
<li>Start the virtual machine and perform the Ubuntu Install</li>
<li>After the install completes, reboot the virtual machine. Don't forget to hit enter to "eject" the boot CD when it prompts.</li>
<li>Let it install the 200+ updates</li>
<li>After another reboot, install Guest Additions by clicking on the Devices menu of the running VM, and then selecting "Install Guest Additions..." (You may have to do this again after Ubuntu installs future updates)</li>
</ol>
<div>
<br /></div>
</div>
<h2>
Install Compiler Prerequisites</h2>
<div>
Since we are running a 64 bit host OS, we need to install the 32 bit libraries to run some of the build tools. We also need the Linaro headers. Follow these instructions to install both of these required packages</div>
<div>
<ol>
<li>Open a new Terminal or xterm window</li>
<li>Type the following to install the Linaro headers and 32 bit compatibility libraries</li>
</ol>
<span style="background-color: #999999; color: white; font-family: Courier New, Courier, monospace;">> sudo apt-get install lsb <br />> sudo apt-get install ia32-libs </span><br />
<h2>
Extract Qt Source</h2>
Perform this step to expand the source tarball into your home directory. It will reside under the tarball directory of "qt-everywhere-opensource-src-5.2.0". This can be done in a new terminal window, while the prerequisites are being installed.</div>
<div>
<br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;">></span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;">cd </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;">></span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span><span style="color: white; font-family: 'Courier New', Courier, monospace;">tar -zxf qt-everywhere-opensource-src-5.2.0.tar.gz </span></span><br />
<br />
Now we create a couple of folders for our shadow builds. This helps keep the main source folder clean of configuration files and binaries.<br />
<br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> mkdir qt-5.2-host </span><br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> mkdir qt-5.2-target </span><br />
<br />
<br />
<h2>
Extract Linaro Toolchain</h2>
I chose to use the Linaro toolchain because it came highly recommended and the Ubuntu cross compile chain does not include a g++ binary, which will be required to compile Qt.<br />
<br />
Issue these commands to extract the Linaro toolchain, change the directory name, and move it to a global location:<br />
<br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;">> tar -Jxf </span><span style="color: white; font-family: Courier New, Courier, monospace;">gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_li nux.tar.xz</span><span style="color: white; font-family: 'Courier New', Courier, monospace;"> </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;">> mv </span><span style="color: white; font-family: 'Courier New', Courier, monospace;">gcc-linaro-arm-linux-gnueabihf-4.8-2013.04-20130417_linux \ </span></span><br />
<span style="background-color: #999999;"><span style="color: white; font-family: 'Courier New', Courier, monospace;"> linaro </span></span><br />
<span style="background-color: #999999; color: white; font-family: 'Courier New', Courier, monospace;">> sudo mv linaro /usr/local </span><br />
<span style="color: white; font-family: Courier New, Courier, monospace;"> </span><br />
<br />
<h2>
Conclusion</h2>
You should now have a working Ubuntu virtual machine that is:<br />
<br />
<ul>
<li>Up-to-date</li>
<li>Has necessary host utilities installed</li>
<li>Contains a folder, in the home directory, with the Qt source</li>
<li>Has the Linaro toolchain installed under /usr/local/linaro</li>
</ul>
<br />
<br />
Continue on to <a href="http://armsdr.blogspot.com/2014/01/bare-metal-qt-52-on-beaglebone-black_10.html" target="_blank">Part 2</a> for the configuration and building of Qt.</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com12tag:blogger.com,1999:blog-3046109770954577257.post-49806292357676795542013-04-29T22:22:00.000-07:002013-04-29T22:22:44.997-07:00BeagleBone Black arrived today!I received my BeagleBone Black today!<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8rqThrDUi-K-6CtXGQICn-Ukw72l7q_VEDKaR8NSqCLElspVIji0YobmGGV8xkGb6Y046J0JzNFXCcyKHeZnRF4Ge6z2XW88HJBe3pgUH8yQ_MCWq5R6JM9PYaEf-UKL4hdRNsGKvyhK/s1600/DSCF0012.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="Cheap camera shot" border="0" height="196" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjE8rqThrDUi-K-6CtXGQICn-Ukw72l7q_VEDKaR8NSqCLElspVIji0YobmGGV8xkGb6Y046J0JzNFXCcyKHeZnRF4Ge6z2XW88HJBe3pgUH8yQ_MCWq5R6JM9PYaEf-UKL4hdRNsGKvyhK/s400/DSCF0012.JPG" title="Does this aspect ratio look off to you?" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The kernel date for the image on the eMMC matched the latest build date, so I did not try to flash a whole new image. I did, however, run 'opkg update' and 'opkg upgrade', which had quite a list of packages. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
I then started on getting an EDIMax (EW-7811Un) USB WiFi adapter working. I plugged it in and checked 'dmesg'. The kernel module was complaining that it could not load a binary firmware file. So a little searching on the internet, and a couple of false starts later, I found a working binary at:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://mirrors.arizona.edu/raspbmc/downloads/bin/lib/wifi/rtlwifi/">http://mirrors.arizona.edu/raspbmc/downloads/bin/lib/wifi/rtlwifi/rtl8192cufw.bin</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
so I copied it to the /lib/firmware/rtlwifi folder.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The next step was to add my wireless router settings to the wpa_supplicant.conf file. I did this by entering the following command:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<span style="font-family: Courier New, Courier, monospace;"># wpa_passphrase mywireless_ssid "secretpassphrase" >> /etc/wpa_supplicant.conf</span><br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The adapter associates with the access point after a system reboot and/or removing and reinserting the adapter. Success! Well, not quite. By default, access point association does not imply getting a dhcp lease.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
So this is where it goes all wrong....I decided to run 'opkg upgrade' before finishing this step, however, some way through the downloads, it could not fetch any more packages. The update still seemed to be doing the configurations, so I thought it would just allow me to run upgrade again. Nope, when it got to the end it complained about bonescript.socket not listening and other bonescript post processing errors. I tried to run 'opkg upgrade' a couple more times, but nothing changed. I decided to reboot to reset the network. Doh! Now, on boot, it shows LED D2 for a couple seconds, then D2, D3, and D4 all light up and stay on. Time to reflash eMMC......tomorrow.</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com0tag:blogger.com,1999:blog-3046109770954577257.post-81632248661084647832013-04-28T21:14:00.000-07:002013-04-28T21:14:18.127-07:00ArchLinux on BeagleBone and Linux 3.8I've discovered the joys of embedded programming with the new Linux kernel 3.8. It is bleeding edge and not for the faint of heart. The way that I/O works has been totally changed, so anything that relied on the /sys/kernel/debug/omap_mux/ folder is broken.<br />
<br />
This has to do with switching over to Device Tree Overlays for processor configurations. The README.md file at <a href="https://github.com/jadonk/validation-scripts/tree/master/test-capemgr">https://github.com/jadonk/validation-scripts/tree/master/test-capemgr</a> has a good explanation, but that doesn't make it any easier to get it up and running.<br />
<br />
I've cloned the validation-scripts repository from https://github.com/jadonk/validation-scripts.git. I tried to run do_pinctrl_test.sh from test-capemgr folder, but it needs dtc. No problem, right, we'll just install it....wrong! The current version of dtc in ALARM is not patched to support the -@ option (see <a href="https://patchwork.kernel.org/patch/1934471/">https://patchwork.kernel.org/patch/1934471/</a>), so you get a "dtc: invalid option -- '@'" error message.<br />
<br />
I'm not as hardcore as the guys at <a href="http://hipstercircuits.com/adding-beaglebone-cape-support-to-a-kernel-with-device-tree-in-ubuntu/">http://hipstercircuits.com/adding-beaglebone-cape-support-to-a-kernel-with-device-tree-in-ubuntu/</a> so I am calling it a night. I will look into how to get a patched version of dtc, but if it involves too much, I can see myself jumping ship and reverting to an older kernel.<br />
<br />
FYI: Here are a couple of issues that I ran into, when trying to install ArchLinux, and how to fix them:<br />
<br />
I followed the instructions at <a href="http://archlinuxarm.org/platforms/armv7/beaglebone">http://archlinuxarm.org/platforms/armv7/beaglebone</a> for configuring and setting up the SD card. When I followed the links provided though, I ran into 2 issues:<br />
<br />
<ol>
<li>I could get a u-boot command prompt, but it could not load the kernel image from the SD card. This was solved by copying /boot/uImage to the DOS partition.</li>
<li>After looking for upgrades ('pacman -Syu'), the kernel update gave a warning that my u-boot was probably out of date. After a reboot, sure enough the "image is wrong type" error message appeared in u-boot. I corrected this by downloading and installing http://os.archlinuxarm.org/os/omap/BeagleBone-bootloader.tar.gz </li>
</ol>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com2tag:blogger.com,1999:blog-3046109770954577257.post-58583161281705870272013-04-26T14:52:00.001-07:002013-04-26T14:52:14.152-07:00LiFePO4 Battery Pack for Yaesu FT-857DI am playing around with the idea of using LiFePO4 batteries for my Yaesu FT-857D. Since I have access to some pretty cool software, I thought I would model up my radio and try some simple permutations.<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKm4xXoje3w_rGvpCudgOSB4kiWhyphenhyphenFc8V8faikcSLjpv54sG5lGK70AP22SBD6wydM-2kiLV4Kl-0nj-LHhqJzAqr8CsqRg2yKCH0UxsiHdCXsJF-cdNfkB9Xsx8Py9Z6vHNnU4lTmuLT2/s1600/flood_pack.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKm4xXoje3w_rGvpCudgOSB4kiWhyphenhyphenFc8V8faikcSLjpv54sG5lGK70AP22SBD6wydM-2kiLV4Kl-0nj-LHhqJzAqr8CsqRg2yKCH0UxsiHdCXsJF-cdNfkB9Xsx8Py9Z6vHNnU4lTmuLT2/s400/flood_pack.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Large Prismatic type, 20 Ah</td></tr>
</tbody></table>
<br />
This image above shows the large plastic case style. These cost around <a href="http://www.batteryspace.com/LiFePO4-Prismatic-Module-3.2V-20-Ah-10C-Rate-64-wh.aspx" target="_blank">$35</a> each and have an energy density of around 85.33Wh/kg.<br />
<br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisQoPDSLyS0yDy66sJL7Mvbdn7Trcx0fGm2PJ6W6dy8aC0iiE9-RHkQOBj-oDNZXccmVISzxEaF3PLkgpgRhB5Y5qiXrISNDLiTZlQLWsiQB8ZGzPF19fh08DvZi91wNMdCt1l_BgZUdGe/s1600/poly_pack.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisQoPDSLyS0yDy66sJL7Mvbdn7Trcx0fGm2PJ6W6dy8aC0iiE9-RHkQOBj-oDNZXccmVISzxEaF3PLkgpgRhB5Y5qiXrISNDLiTZlQLWsiQB8ZGzPF19fh08DvZi91wNMdCt1l_BgZUdGe/s400/poly_pack.jpg" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Polymer Type, 20 Ah</td></tr>
</tbody></table>
<br /><div>
The image above shows the foil packed polymer style cells. These cost around <a href="http://www.batteryspace.com/High-Power-LFP-Polymer-Cell-3.2V-20Ah-100122200-2C-64Wh-40A-rate.aspx" target="_blank">$60</a> each and have an energy density of around 125 Wh/Kg.</div>
<div>
<br /></div>
<div>
The typical discharge rate is the same for both types, 20 amps, but the peak discharge (<10 seconds) is much higher for the prismatic style (200 amps) vs the polymer style (40 amps).</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com0tag:blogger.com,1999:blog-3046109770954577257.post-23841822952408868472013-04-25T20:44:00.001-07:002013-04-26T07:24:30.754-07:00Convert Cheap 9 LED flashlight to PIC Controlled High Brightness LEDs<h2>
<span style="font-size: x-large;">
Why?</span></h2>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvWrRELQFsxsTpO5RL7ybsKpcBHKviH89HPJc2lDZ8MCMC1p0MEwjJIMHhz9v8a8vvOVyZHgj5PS4kTTdJ35bhqbyNnr1t6JCztl-ZFzWod-dD_Nn3ihKsiQ-Y56ILBuYlJu0LH4xgfIi6/s1600/Packaged.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img alt="Flashlight in the package" border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvWrRELQFsxsTpO5RL7ybsKpcBHKviH89HPJc2lDZ8MCMC1p0MEwjJIMHhz9v8a8vvOVyZHgj5PS4kTTdJ35bhqbyNnr1t6JCztl-ZFzWod-dD_Nn3ihKsiQ-Y56ILBuYlJu0LH4xgfIi6/s320/Packaged.jpg" title="Cheap Flashlight" width="171" /></a>A while back I needed a high power light for my mountain bike. I couldn't justify purchasing one, as they were between $100 and $500 at the time, so I decided to make my own.<br />
<br />
I was initially going to fabricate the whole thing out of aluminum tube stock and a lathe, but that was going to require a lot of time and borrowed resources (I don't own a lathe :). So I started to look for suitable candidates that were 'close' to my design dimensions.<br />
<br />
I ultimately chose a cheap, Chinese, nine LED flashlight that runs on three AAA batteries. Here is one that was purchased for around $1.50 (2 for $3) from <a href="http://www.harborfreight.com/" target="_blank"><span style="color: white;">Harbor Freight</span></a>.<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h2>
<span style="font-size: x-large;">
Let's open it up, shall we....</span></h2>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8O4560RR2R43gYcKgrXqLzaEtQlU3qwo_1Hty6adk16gl_FbueVGCttGD3F8-FkodISAN1NSa4Oo68eWPuFi3LR2uvwYTdYyhvPxsu6gmw2b5cgUBBzvv3DnutTJA35Gu1DZgFBpEl2iz/s1600/Switch_Removed.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Three parts so far..." border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8O4560RR2R43gYcKgrXqLzaEtQlU3qwo_1Hty6adk16gl_FbueVGCttGD3F8-FkodISAN1NSa4Oo68eWPuFi3LR2uvwYTdYyhvPxsu6gmw2b5cgUBBzvv3DnutTJA35Gu1DZgFBpEl2iz/s320/Switch_Removed.jpg" title="Battery pack removed" width="276" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Removing the battery compartment.<br />
Nothing warranty voiding here...</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj16LTJXv8HkTbhbJxKdwHCdtNbcKfIki7UWO7AigVKltwJUZ6TcD0Yx0UKIJAB00DlTljQZEpph1LmZF_9tRyDiBNCKzzhmBrktjZhNY-hQHO1vJtYMRfai_4w3Q89VdgZPF9pv78Es0nc/s1600/Removing_LED.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img alt="Trying for four more parts..." border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj16LTJXv8HkTbhbJxKdwHCdtNbcKfIki7UWO7AigVKltwJUZ6TcD0Yx0UKIJAB00DlTljQZEpph1LmZF_9tRyDiBNCKzzhmBrktjZhNY-hQHO1vJtYMRfai_4w3Q89VdgZPF9pv78Es0nc/s200/Removing_LED.jpg" title="Who needs a spanner wrench" width="177" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Removing the LED board with pliers.<br />
That was easy....</td></tr>
</tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9YpDtCDJjf7ZKl0F6yt7-Z707azyNgrYlhqrDJQAru6eR8sXo1zu_X1h5j0OKkn98_Poirnx_wlebc9_HXvZ6nPii5BAR2WbI6e2-COutolei6g5EUpKqGgX6Xdv_sEsMevzAcoy261XJ/s1600/LED_Parts.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Ah, the smell of aluminum and plastic...." border="0" height="181" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9YpDtCDJjf7ZKl0F6yt7-Z707azyNgrYlhqrDJQAru6eR8sXo1zu_X1h5j0OKkn98_Poirnx_wlebc9_HXvZ6nPii5BAR2WbI6e2-COutolei6g5EUpKqGgX6Xdv_sEsMevzAcoy261XJ/s200/LED_Parts.jpg" title="Cheap plastic and hastily machined aluminum" width="200" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">The LED assembly, not much to it.</td></tr>
</tbody></table>
<br />
<h2>
<span style="font-size: x-large;">
Time to upgrade!</span></h2>
<h3>
The Switch</h3>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxXxcMnVmd2B6pK1URFH1nHwWLJUkId_CTs9hFiZ5_6LvAxSRBvuOMZGQYm_IAa7xw0oqW_cDaf2CAICcbQmJGEeKBd3-4eTJK7mWcuM3h2dIEjZ9Zl-Ry2enej8B5yYFQO9VQhR6x1SWu/s1600/Switch_Upgrade.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="A big green button" border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxXxcMnVmd2B6pK1URFH1nHwWLJUkId_CTs9hFiZ5_6LvAxSRBvuOMZGQYm_IAa7xw0oqW_cDaf2CAICcbQmJGEeKBd3-4eTJK7mWcuM3h2dIEjZ9Zl-Ry2enej8B5yYFQO9VQhR6x1SWu/s320/Switch_Upgrade.jpg" title="Pay no attention to the number of wires you see" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">I had to open up the hole a wee bit to get the new switch to fit.<br />
Like a glove..</td></tr>
</tbody></table>
<div>
The first thing to go was the power switch. The original switch was turn on, turn off, but I thought a momentary button would be so much cooler and I also convinced myself that a button that cost more than the flashlight would be a longer lasting solution. Little did I know how many tens of thousands of switches and buttons there were at Mouser. I chose a nice bright green silicone one, for moisture reasons.</div>
<br />
<br />
<br />
<br />
<br />
<br />
<h3>
The Processor</h3>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ6SYiE6GBzFDqvD72fMT2NzbmAegYagzqIDFOK2_O2APkir3BOdn4tecn9n2xT47pVgQsKuGekyZoUHZlrX_KuAA5_PvP6PbT5HCgrWcq_fxJJ398mw48yJCDpjMKV-HThvZ7pMHQCSg/s1600/The_Brains.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Now I know why they switched to surface mount components...." border="0" height="288" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbJ6SYiE6GBzFDqvD72fMT2NzbmAegYagzqIDFOK2_O2APkir3BOdn4tecn9n2xT47pVgQsKuGekyZoUHZlrX_KuAA5_PvP6PbT5HCgrWcq_fxJJ398mw48yJCDpjMKV-HThvZ7pMHQCSg/s320/The_Brains.jpg" title="Yes the assembly fits through the switch hole in the back" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Microchip PIC12F683 installed</td></tr>
</tbody></table>
<div>
Space is kinda tight in the case, so I decided to solder a PCB straight to the pins of the switch. Since the PIC chip only has 8 pins, I didn't have to create a lot of traces or add any discrete components.</div>
<div>
<br /></div>
<div>
For those not familiar with the Microchip PIC processor family, you are missing out. This particular unit has up to 6 I/O pins (on an 8 pin device!), goodbye my faithful 555. The clock is internal and the reset line can be made an input, but I chose to leave that alone to simplify programming and debugging. Another neat feature is onboard EEPROM that is writable from the running program. I use this to store the current brightness, in case power is lost momentarily. More on that later.</div>
<div>
<br />
<br />
<br /></div>
<h3>
</h3>
<h3>
The LED Module</h3>
<div>
These high brightness LEDs come with a price, they must have a good heatsink. So what better way to sink some heat than to add more aluminum. Technically copper would be better, but aluminum is lighter and I had some laying around.</div>
<div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTfZfQOjb9DRbqipZH5n1YMsund-1yYZPVPpc_00d9UOaNl6oR_Ipozz4-FFeHb6Hb4PhM4O6RCqiD6Rs7tGfn7H3nRIti2icYVSimg8Ra-kfA_ooAKXGHefF9zMIJ1M46OwJuCztGWuDr/s1600/IMG_20110805_190256.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="The motion stopping speed of my Nexus One camera" border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTfZfQOjb9DRbqipZH5n1YMsund-1yYZPVPpc_00d9UOaNl6oR_Ipozz4-FFeHb6Hb4PhM4O6RCqiD6Rs7tGfn7H3nRIti2icYVSimg8Ra-kfA_ooAKXGHefF9zMIJ1M46OwJuCztGWuDr/s320/IMG_20110805_190256.jpg" title="Let the chips fly!" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">A friend has a machine shop in his garage :)</td></tr>
</tbody></table>
</div>
<div>
None of the scraps of aluminum I had would fit, without some minor machining. Once we had the right size heatsink (approximately 1" of material to be pressed into the case), we prepared the flashlight case by removing the paint, from the inside, with a Dremel tool. The LED mounting face height is a little more dimensionally critical, so it involved some trial and error fitting of the whole assembly. Once we were satisfied with the dimensions, the heatsink was permanently pressed into the case.<br />
<br /></div>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: left; float: left; margin-bottom: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbqt4Kzo19YPNPt7A93GtB6cwIXmQM-hd-CvgOuImxmspr8KQzhXaaAv3Se_2-rQBPVoLIkGEn-y9p5BqJNH8x7zGEH7fmLV-Nfatf-dzcbktJ_vsUllwGJjmxpRe2DgGchYWIsQrwVa9u/s1600/Surface_Prep.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="The smell of burning paint.....yum." border="0" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbqt4Kzo19YPNPt7A93GtB6cwIXmQM-hd-CvgOuImxmspr8KQzhXaaAv3Se_2-rQBPVoLIkGEn-y9p5BqJNH8x7zGEH7fmLV-Nfatf-dzcbktJ_vsUllwGJjmxpRe2DgGchYWIsQrwVa9u/s320/Surface_Prep.jpg" title="Dremel to the rescue!" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Removing the paint from the inside of the case.</td></tr>
</tbody></table>
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="clear: right; float: right; margin-bottom: 1em; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisonO7sAYl2zpe1IWr-iDDjHWcEzuDfCoaASKNTffETtRBRO9XRgW1zAd68Q818QRz69dIbVQXTEnQDMqC_l_pIEW70URXIrqCXjnMuvZLUoTLVJo40HIcLCcFqMjb1prQkWMrfl4zkxnH/s1600/LED_Closeup.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img alt="Getting closer...." border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisonO7sAYl2zpe1IWr-iDDjHWcEzuDfCoaASKNTffETtRBRO9XRgW1zAd68Q818QRz69dIbVQXTEnQDMqC_l_pIEW70URXIrqCXjnMuvZLUoTLVJo40HIcLCcFqMjb1prQkWMrfl4zkxnH/s200/LED_Closeup.jpg" title="Shiny new aluminum" width="185" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Ignore the LED module for now ;)</td></tr>
</tbody></table>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<h2>
<span style="font-size: x-large;">
Stay tuned for more!</span></h2>
<div>
Look for the exciting conclusion soon....<br />
<br />
<br />
<br />
<br />
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
Anonymoushttp://www.blogger.com/profile/03414974093909807958noreply@blogger.com1