Root/prod/doc/setup.hmac

Source at commit 717f7e77a39d514d6c87fee09c17df2242f0c32a created 12 years 10 months ago.
By Werner Almesberger, prod/doc/setup.hmac: filled the intro sections; added dfu-util installation
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<TITLE>Production and testing: Software setup</TITLE>
4<BODY bgcolor="#ffffff" link="#000000" vlink="#404040">
5
6<INCLUDE file="style.inc">
7
8<PAGE_BAR title="Production and testing">
9  <PAGE_CURR href="setup.html">Software setup</PAGE_CURR>
10  <PAGE_ITEM href="flash.html">Flashing</PAGE_ITEM>
11  <PAGE_ITEM href="test.html">Functional test</PAGE_ITEM>
12  <PAGE_ITEM href="analysis.html">Fault analysis</PAGE_ITEM>
13</PAGE_BAR>
14
15<SECTION_BAR>
16  <SECTION_ITEM href="#intro">Introduction</SECTION_ITEM>
17  <SECTION_ITEM href="#pcsw">PC installation</SECTION_ITEM>
18  <SECTION_ITEM href="#bensw">Ben installation</SECTION_ITEM>
19  <SECTION_ITEM href="#bensys">Ben setup</SECTION_ITEM>
20  <SECTION_ITEM href="#profiles">Test profiles</SECTION_ITEM>
21</SECTION_BAR>
22
23
24<!-- ====================================================================== -->
25
26
27<SECTION ref="intro" title="Introduction">
28
29Before performing production tests, various pieces of software
30need to be installed on Ben and PC, and configuration settings may
31have to be adjusted. The following sections describe the installation
32and configuration process.
33
34
35<!-- ====================================================================== -->
36
37
38<SECTION ref="pcsw" title="PC software installation">
39
40For a DUT and reference device role, the <B>ben-wpan</B> utilities
41and the test scripts have to be installed on the PC. For flashing the
42<B>atusb</B> application
43firmware, also <B>dfu-util</B> and the firmware binary are required.
44<P>
45The instructions below assume that a complete development environment
46is already present on the PC. If any prerequisitres are not met,
47compilation will fail, and you'll have to install the corresponding
48package and try again.
49
50
51<!-- ---------------------------------------------------------------------- -->
52
53
54<SUBSECTION title="Install ben-wpan tools">
55
56To build the ben-wpan tools and install them under
57<SAMP>/usr/local/</SAMP> on the local machine,
58run the following commands:
59<PRE>
60git clone git://projects.qi-hardware.com/ben-wpan.git
61git clone git://projects.qi-hardware.com/f32xbase.git
62cd ben-wpan/tools
63make
64make install
65</PRE>
66<P>
67A different directory prefix can be chosen by overriding the
68<B>INSTALL_PREFIX</B> variable, e.g.,
69<PRE>
70make INSTALL_PREFIX=/usr install
71</PRE>
72<P>
73Note that the test scripts expect <SAMP>${INSTALL_PREFIX}/bin</SAMP>
74to be in <B>PATH</B>.
75
76
77<!-- ---------------------------------------------------------------------- -->
78
79
80<SUBSECTION title="Install test scripts">
81
82The test scripts are in the directory <SAMP>prod/</SAMP> of the
83<B>ben-wpan</B> project. They currently are designed to be run from
84this directory. Therefore, all that's necessary is to check out the
85repository, as shown above.
86
87
88<!-- ---------------------------------------------------------------------- -->
89
90
91<SUBSECTION title="Install dfu-util">
92
93<B>dfu-util</B> is used to transfer the application firmware to
94<B>atusb</B> boards. To build <B>dfu-util</B> from source, run these
95commands:
96
97<PRE>
98git clone git://git.openezx.org/dfu-util.git
99cd dfu-util
100./autogen.sh
101./configure
102make
103make install
104</PRE>
105
106Note that some Linux distributions already provide a pre-compiled
107version of <B>dfu-util</B>, which could be used instead of building
108it from source.
109
110
111<!-- ---------------------------------------------------------------------- -->
112
113
114<SUBSECTION title="Install firmware binary">
115
116The binary of the application running on <B>atusb</B> is transferred from
117the PC. To download a pre-compiled version, use this command:
118
119<PRE>
120wget -O atusb.bin \
121     http://downloads.qi-hardware.com/people/werner/wpan/bindist/atusb-de72af351f661b538add81cbc9965278a2f8c40c.bin
122</PRE>
123
124Instructions for building the binary from sources are
125<A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw/README">here</A>.
126
127
128<!-- ---------------------------------------------------------------------- -->
129
130
131<SUBSECTION title="Register Ben host name">
132
133To simplify accessing the Ben via TCP/IP, its IP address should be
134registered in the hosts file on the PC. If the Ben is running OpenWrt,
135use the following command:
136<PRE>
137echo 192.168.254.101 ben >>/etc/hosts
138</PRE>
139<P>
140If the Ben is running Jlime, the address would be as follows:
141<PRE>
142echo 192.168.1.202 ben >>/etc/hosts
143</PRE>
144<P>
145If using the same PC with Bens running OpenWrt and Jlime, one may choose
146different host names depending on the distribution, and adapt the commands
147used in the production and testing process accordingly. For example,
148<PRE>
149echo 192.168.254.101 ben >>/etc/hosts
150echo 192.168.1.202 jlime >>/etc/hosts
151</PRE>
152
153
154<!-- ---------------------------------------------------------------------- -->
155
156
157<SUBSECTION title="Customize test scripts">
158
159@@@
160
161
162<!-- ====================================================================== -->
163
164
165<SECTION ref="bensw" title="Ben software installation">
166
167For a DUT and reference device role, the <B>ben-wpan</B> utilities
168have to be installed on a Ben. For flashing the <B>atusb</B> boot
169loader, also <B>avrdude</B> and the boot loader binary are needed.
170<P>
171The instructions below apply for OpenWrt and Jlime. For building
172things from source, a cross-compilation toolchain has to be installed
173on the PC.
174
175
176<!-- ---------------------------------------------------------------------- -->
177
178
179<SUBSECTION title="Password-less remote access">
180
181To enable password-less remote access from the PC, set up network
182access to the Ben and run the following command:
183<PRE>
184ssh ben 'cat >>/etc/dropbear/authorized_keys' <~/.ssh/id_rsa.pub
185</PRE>
186
187
188<!-- ---------------------------------------------------------------------- -->
189
190
191<SUBSECTION title="Install ben-wpan tools">
192
193To build and install the <B>ben-wpan</B> tools on the Ben, first set
194up networking between the PC and the Ben. If you have not yet checked
195out the project's repository, run these commands:
196
197<PRE>
198git clone git://projects.qi-hardware.com/ben-wpan.git
199git clone git://projects.qi-hardware.com/f32xbase.git
200cd ben-wpan/tools
201</PRE>
202
203If you have already checked out the repository, <B>cd</B> to
204<SAMP>ben-wpan/tools/</SAMP> and run
205
206<PRE>
207make clean
208</PRE>
209
210Next, if on OpenWrt, compile the tools with
211<PRE>
212make TARGET=ben_openwrt
213</PRE>
214
215If on Jlime, use
216<PRE>
217make TARGET=ben_jlime
218</PRE>
219
220Finally, upload the tools to the Ben and install them under
221<SAMP>/usr/bin/</SAMP> with
222
223<PRE>
224make HOST=ben install
225</PRE>
226
227Where <B>ben</B> is the host name or IP address assigned to the Ben.
228
229
230<!-- ---------------------------------------------------------------------- -->
231
232
233<SUBSECTION title="Install avrdude">
234
235The <B>atusb</B> boot loader is flashed using <B>avrdude</B>. A pre-compiled
236static binary (suitable for OpenWrt and Jlime) can be installed by running
237the following two command on the Ben:
238
239<PRE>
240wget http://downloads.qi-hardware.com/people/werner/wpan/bindist/avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
241tar -xz -C / -f avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
242</PRE>
243
244Instructions for building <B>avrdude</B> from sources are
245<A href="http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/avrdude/README
246">here</A>.
247
248
249<!-- ---------------------------------------------------------------------- -->
250
251
252<SUBSECTION title="Install boot-loader binary">
253
254The binary of the boot loader running on <B>atusb</B> is transferred from
255the Ben. To download a pre-compiled version, use this command:
256
257<PRE>
258wget -O boot.hex \
259   http://downloads.qi-hardware.com/people/werner/wpan/bindist/boot-de72af351f661b538add81cbc9965278a2f8c40c.hex
260</PRE>
261
262Instructions for building the binary from sources are
263<A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw/README">here</A>.
264
265
266<!-- ====================================================================== -->
267
268
269<SECTION ref="bensys" title="Ben system setup">
270
271The configuration setting described in this section are lost on each
272reset or reboot and either need to be entered again. Alternatively,
273a setup script running at boot time can be written.
274
275
276<!-- ---------------------------------------------------------------------- -->
277
278
279<SUBSECTION title="Enable network access">
280
281Once the Ben has booted and started USB networking, the interface
282on the PC side is configured as follows:
283<PRE>
284ifconfig usb0 192.168.254.100 up
285</PRE>
286<P>
287These are the settings for OpenWrt, assuming the network device is
288called "usb0". If using Jlime, the command would be as follows:
289<PRE>
290ifconfig usb0 192.168.1.200 up
291</PRE>
292
293
294<!-- ---------------------------------------------------------------------- -->
295
296
297<SUBSECTION title="Silence other 8:10 card users">
298
299Before running any of the ben-wpan utilities, other users of the 8:10
300card slot have to be disabled. In a Ben running the regular OpenWrt or
301Jlime distribution, the only such user that is automatically started
302is the MMC kernel driver. The following command disables it:
303<PRE>
304echo jz4740-mmc.0 >/sys/bus/platform/drivers/jz4740-mmc/unbind
305</PRE>
306<P>
307If a WPAN-enabled kernel has been installed, the AT86RF230 driver takes
308the place of the MMC driver. To disable it, run
309<PRE>
310echo spi2.0 >/sys/bus/spi/drivers/at86rf230/unbind
311</PRE>
312
313
314<!-- ---------------------------------------------------------------------- -->
315
316
317<SUBSECTION title="Start atrf-proxy">
318
319On the Ben, launch the proxy daemon. We pass the option -b to background it:
320<PRE>
321atrf-proxy -b
322</PRE>
323
324
325<!-- ====================================================================== -->
326
327
328<SECTION ref="profiles" title="Test profiles">
329
330Some of the functional tests measure characteristics that are strongly
331influenced by the test setup. It is therefore not possible to provide
332universally applicable reference values, but they have to be measured
333in the actual test environment.
334
335
336<!-- ---------------------------------------------------------------------- -->
337
338
339<SUBSECTION title="Clock count (atben only)">
340
341Insert a known to be good <B>atben</B> board and run the following
342command directly on the Ben to record the reference value for the
343clock count with an accuracy of about +/&minus;20 ppm:
344<PRE>
345atrf-xtal 1000 >ben.xtal
346</PRE>
347<P>
348This takes about 5 seconds.
349<P>
350Note that the result depends on the tolerance of the crystal in the Ben
351and is also affected by temperature. Good accuracy can therefore
352only be obtained if this measurement is performed individually on each
353Ben, and if a stable temperature is maintained.
354
355
356<!-- ---------------------------------------------------------------------- -->
357
358
359<SUBSECTION title="Signal strength">
360
361@@@
362
363
364<END author="Werner Almesberger" date="<GEN_DATE>">
365</BODY>
366</HTML>
367

Archive Download this file



interactive