-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
255 lines (223 loc) · 15.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html><html lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Jhnphm's Blag">
<meta name="author" content="John Pham">
<title>Soldering Fumes | Soldering Fumes</title>
<link href="assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
<link rel="canonical" href="http://jhnphm.github.io/index.html">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
</head>
<body class="home blog">
<div id="wrap" style="width:850px">
<div id="container" style="width:560px">
<div class="postbox">
<h1><a href="posts/porting-xbh.html">Thesis: Porting XBH</a></h1>
<div class="meta" style="background-color: rgb(234, 234, 234); ">
<span class="authordate">
Posted: <time class="published" datetime="2014-02-26T22:54:12+00:00">2014-02-26 22:54</time>
</span>
<br>
<span class="tags">Tags:
<a class="tag" href="categories/thesis.html"><span>thesis</span></a>
<a class="tag" href="categories/xbh.html"><span>xbh</span></a>
<a class="tag" href="categories/xbx.html"><span>xbx</span></a>
</span>
</div>
<div><p>As mentioned in a previous <a class="reference external" href="http://jhnphm.wordpress.com/2013/04/18/thesis/">post</a>, the goal of my thesis is to extend the XBX
project to cover power and energy measurements. In order to do this, the
eXternal Benchmarking Harness (XBH) needs to be replaced with something that can
provide frequent sampling and sufficient storage in order to measure current and
voltage in order to compute power and energy usage, and record mins and maxes.</p>
<p>The original XBH was based off of a home automation platform using an <a class="reference external" href="http://www.atmel.com/devices/ATMEGA644.aspx">ATMega644</a> ,
which was deemed insufficiently powerful. We originally intended on replacing it
with a Raspberry Pi, but unfortunately it was deemed rather unsuitable for real-time
measurement purposes despite its power, as only Linux variants are supported,
bare-metal programming is difficult, and external ADCs would have to be added.
We decided to relegate the Pi to simply a networking interface for the <a class="reference external" href="posts/www.ti.com/ww/en/launchpad/launchpads-tivac.html">Tiva-C</a>
board from TI, which can easily run bare-metal code and has a builtin ADC.</p>
<p>The Tiva-C half of the XBH will be responsible for triggering the start of the
measurement via a GPIO pin, measuring voltage and current while operating, and
sensing completion of the benchmark via GPIO pin. It will record data and
attach a timestamp and send the data over USB to the Raspberry Pi.
Pre-processing data to reduce what has to be uploaded over USB may be done on
the Tiva-C</p>
<p>The Raspberry Pi will be responsible for receiving commands via SSH or a web
interface and telling the ARM when to start. It is also responsible for
downloading code to and programming the eXternal Benchmarking Device (XBD).</p>
<p>Currently the task is to get USB IO between a PC and the stellaris working.</p></div>
</div>
<div class="postbox">
<h1><a href="posts/tivac-toolchain.html">Thesis: Tiva-C Toolchain</a></h1>
<div class="meta" style="background-color: rgb(234, 234, 234); ">
<span class="authordate">
Posted: <time class="published" datetime="2014-02-08T15:32:54+00:00">2014-02-08 15:32</time>
</span>
<br>
<span class="tags">Tags:
<a class="tag" href="categories/thesis.html"><span>thesis</span></a>
<a class="tag" href="categories/tiva-c.html"><span>tiva-c</span></a>
<a class="tag" href="categories/arm.html"><span>arm</span></a>
<a class="tag" href="categories/xtools.html"><span>xtools</span></a>
<a class="tag" href="categories/xbh.html"><span>xbh</span></a>
</span>
</div>
<div><p>So I've not been working consistently on my thesis as I should. As
previously mentioned on my old <a class="reference external" href="http://jhnphm.wordpress.com/">blog</a>, I was considering running
everything directly off the Raspberry Pi and using Xenomai as the
real-time OS in order to keep the jitter low.</p>
<p>After some discussions with my professor, we decided that it would
drastically simplify things if the realtime measurement part was
assigned to a microcontroller, which also has ADCs which the Pi doesn't
have. This essentially relegates the Pi to being a NIC and a data
storage device. There are ethernet interfaces for microcontrollers,
however they tend to cost almost as much as the Pi itself.</p>
<p>We are looking at using the <a class="reference external" href="posts/www.ti.com/ww/en/launchpad/launchpads-tivac.html">Tiva-C</a> series microcontroller from Texas
Instruments which has the ability to do 2 megasamples per second, and
runs at 80MHz, for the low cost of 12$. What we actually have on hand is
the LM4F120XL which is essentially the same thing before the series was
rebranded, but without PWM and USB OTG.</p>
<p>The ADCs on the microcontroller require buffering due to the rather low
2.5kOhm impedence. This will be addressed later. In the meantime, we
intend to use the i2c ADCs already on hand.</p>
<p>In order to build the toolchain, I downloaded the latest version of
<a class="reference external" href="http://crosstool-ng.org/">crosstool-ng</a> and built it from source, using a <a class="reference external" href="http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/65137.aspx">post</a> by Todd Elliot
on the TI forums as a guide. However, it doesn't seem necessary to
install OpenOCD from source on Ubuntu 13.10 for the LM4F120XL, and the
sample config recommended isn't optimal for the microcontroller (doesn't
use the hardware floating point). I've posted my configuration on
<a class="reference external" href="https://github.com/jhnphm/tiva-c_xtools">github</a>.</p>
<p>One also needs to download <a class="reference external" href="https://focus-webapps.ti.com/licreg/docs/swlicexportcontrol.tsp?form_type=2&prod_no=SW-EK-LM4F232-2.0.1.11577.exe&ref_url=http://software-dl.ti.com/tiva-c/SW-TM4C/latest/&form_id=154910">TivaWare</a> from Texas Instruments. Once
downloaded it can be unzipped on Linux without running the windows
executable. Run <tt class="docutils literal">make clean</tt> on the extracted directory,
<tt class="docutils literal">patch <span class="pre">-Np1</span> < hard_fp.patch</tt>, then run <tt class="docutils literal">make</tt>. The patch can be
found in my repository above. My configuration enables the hard float
ABI while TivaWare is set to default to soft float.</p>
<p>To start the on-chip-debugger to program the board, ensure that the
permissions to /dev/ttyAC* are correct. then run
<tt class="docutils literal">openocd <span class="pre">-f</span> <span class="pre">/usr/share/openocd/scripts/board/ek-lm4f120xl.cfg</span></tt> for the
LM4F120XL, or
<tt class="docutils literal">openocd <span class="pre">-f</span> <span class="pre">/usr/share/openocd/scripts/board/ek-tm4c123gxl.cfg</span></tt> for
the TivaC. <tt class="docutils literal"><span class="pre">ek-tm4c123gxl.cfg</span></tt> will have to be obtained from
<a class="reference external" href="https://gitorious.org/openocd/openocd/commit/24099b4c144f1c6d1244b8b4d98c0fd69c9ff2fc">gitorious</a> and placed in <tt class="docutils literal">/usr/share/openocd/scripts/board</tt>. The
above assumes OpenOCD was installed from a package manager.</p>
<p>As an example, to program, run
<tt class="docutils literal"><span class="pre">arm-stellaris-eabi-gdb</span> <span class="pre">tivaware/examples/boards/ek-tm4c123gxl/qs-rgb/gcc/qs-rgb.axf</span></tt></p>
<p>Below is an example session:</p>
<pre class="code text literal-block">
GNU gdb (crosstool-NG 1.19.0) 7.6-2013.05
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_unknown-linux-gnu
--target=arm-stellaris-eabi".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from
/home/john/Downloads/tivaware/examples/boards/ek-tm4c123gxl/qs-rgb/gcc/qs-rgb.axf...done.
(gdb) target remote :3333
Remote debugging using :3333
0x000002d4 in ButtonsPoll ()
(gdb) monitor reset halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000ba4 msp: 0x20000910
(gdb) load
Loading section .text, size 0x2664 lma 0x0
Loading section .data, size 0x50 lma 0x2664
Start address 0xba4, load size 9908
Transfer rate: 12 KB/sec, 4954 bytes/write.
(gdb)
(gdb) monitor reset init
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000ba4 msp: 0x20000910
(gdb) c
</pre></div>
</div>
<div class="postbox">
<h1><a href="posts/openwrt-ipv6-tunnel-with-verizon-fios.html">OpenWRT IPv6 Tunnel with Verizon FIOS</a></h1>
<div class="meta" style="background-color: rgb(234, 234, 234); ">
<span class="authordate">
Posted: <time class="published" datetime="2014-02-08T13:50:52+00:00">2014-02-08 13:50</time>
</span>
<br>
<span class="tags">Tags:
<a class="tag" href="categories/ipv6.html"><span>ipv6</span></a>
<a class="tag" href="categories/openwrt.html"><span>openwrt</span></a>
<a class="tag" href="categories/verizon.html"><span>verizon</span></a>
<a class="tag" href="categories/slaac.html"><span>slaac</span></a>
<a class="tag" href="categories/dhcpv6.html"><span>dhcpv6</span></a>
</span>
</div>
<div><p>So I installed OpenWRT last week on a router a friend loaned me.
Verizon's router isn't particularly bad for what it does (specifically
the Rev I Actiontec), but it really lacks customizability, and IPv6
tunneling support to correct Verizon's deficiencies.</p>
<p>I was able to acquire an ASUS RT-N16 last weekend and install OpenWRT on
it. The <a class="reference external" href="http://openwrt.razvi.ro/">unofficial builds</a> linked from the <a class="reference external" href="http://wiki.openwrt.org/toh/asus/rt-n16">wiki</a> didn't work for me,
and the wiki probably hasn't been updated for the latest available
build, so I found the <a class="reference external" href="http://downloads.openwrt.org/snapshots/trunk/brcm47xx/openwrt-brcm47xx-squashfs.trx">snapshot build</a> for bcrm47xx and installed it
via TFTP. The web interface (<a class="reference external" href="http://luci.subsignal.org/trac">LUCI</a>) was installed and enabled.</p>
<p>Since I'm using Verizon, using FIOs TV, and wanted the ASUS as the
primary router in order to use it as an IPV6 tunnel endpoint , I
attempted to set up double bridging (Option 5) as described in this
<a class="reference external" href="posts/www.dslreports.com/faq/16077">DSLReports posting</a>.</p>
<p>Unfortunately the MI424WR Rev I is incompatible with this configuration.
I attempted to use Option 2, but the double NAT breaks Steam. Finally I
configured a static route on the Actiontec to the ASUS router's subnet
and disabled NAT and the IPv4 firewall on the ASUS router. This still
breaks UPnP and NAT is still being done on the Verizon router, but it's
something I can live with. The Rev I of the Verizon router isn't
terrible hardware-wise, it's just incompatible with custom firmware
while retaining <a class="reference external" href="https://en.wikipedia.org/wiki/Multimedia_over_Coax_Alliance">MoCA</a> support for the TV.</p>
<p>I signed up for a Hurricane Electric (HE) <a class="reference external" href="https://www.tunnelbroker.net/">tunnel</a> and configured a
tunnel. IRC does not work until one takes the <a class="reference external" href="https://ipv6.he.net/certification/">IPv6 test</a> to reach Sage
level. As a bonus, they give you a T-shirt. In order to get this to
work, IP protocol 41 had to be forwarded to the ASUS router as described
by <a class="reference external" href="http://bill-owens.blogspot.com/2011/11/hurricane-electric-ipv6-tunnel-through.html">Bill Owens</a></p>
<p>As IPv6 addresses can be long and difficult to remember, I wanted to
enable DDNS for local computers in the network, which requires DHCPv6.
By default this is enabled in OpenWRT, and also sets a <a class="reference external" href="https://en.wikipedia.org/wiki/Unique_local_address">Unique Local
Address</a> for the interface. Both the ULA addresses and the global
addresses from HE were assigned via DHCPv6. This would otherwise be
fine, however NetworkManager on Linux will only pick up one of the
assigned addresses, whichever gets sent last. To fix this, the ULA
address had to be cleared from the router configuration so that only the
GUA was assigned.</p>
<p>Android does not support DHCPv6 but will still work w/ <a class="reference external" href="https://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_.28SLAAC.29">SLAAC</a>. This
means that stateful+stateless (on the LuCI web interface for the network
interface) must be enabled.</p>
<p>Ultimately the configuration I used will result in four addresses being
assigned to each device (3 in the case of Android). These are the global
address assigned by DHCPv6, the global SLAAC address generated from the
MAC address, the global <a class="reference external" href="https://en.wikipedia.org/wiki/IPv6#Privacy">IPv6 privacy extensions</a> for SLAAC, and the
device's automatically generated link-local address.</p></div>
</div>
</div>
<div id="sidebar">
<!--Sidebar content-->
<h1 id="blog-title">
<a href="http://jhnphm.github.io/" title="Soldering Fumes">Soldering Fumes</a>
</h1>
<ul class="unstyled">
<li>
</li><li><a href="archive.html">Archives</a>
</li><li><a href="categories/index.html">Tags</a>
</li><li><a href="rss.xml">RSS</a>
</li><li>
</li></ul>
</div>
<div id="footer">
Contents © 2014 <a href="mailto:[email protected]">John Pham</a> - Powered by <a href="http://getnikola.com" rel="nofollow">Nikola</a>
</div>
</div>
<script src="assets/js/all-nocdn.js" type="text/javascript"></script>
<script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script>
</body>
</html>