Root/prod/doc/setup.hmac

Source at commit 3e37af63ca3032ee0aba9657e3c6326e956968f5 created 8 years 2 months ago.
By Werner Almesberger, prod/doc/setup.hmac: changed boot.hex and atusb.bin to the ce16a16 versions
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 ben-wpan tools
41and the test scripts have to be installed on the PC. For flashing the
42<B>atusb</B> application
43firmware, also dfu-util and the firmware binary are required.
44<P>
45The instructions below assume that a complete development environment
46is already present on the PC, including SDL, SDL_gfx, and GSL.
47If any prerequisites are not met,
48compilation will fail, and you'll have to install the corresponding
49package and try again.
50
51
52<!-- ---------------------------------------------------------------------- -->
53
54
55<SUBSECTION title="Install ben-wpan tools">
56
57To build the ben-wpan tools and install them under
58<SAMP>/usr/local/</SAMP> on the local machine,
59run the following commands:
60<PRE>
61git clone git://projects.qi-hardware.com/ben-wpan.git
62cd ben-wpan/tools
63make
64make install
65</PRE>
66<P>
67A different directory prefix can be chosen by overriding the
68<SAMP>INSTALL_PREFIX</SAMP> 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 <SAMP>PATH</SAMP>.
75
76
77<!-- ---------------------------------------------------------------------- -->
78
79
80<SUBSECTION title="Install test scripts">
81
82The test scripts are in the directory <SAMP>prod/</SAMP> of the
83ben-wpan 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
93dfu-util is used to transfer the application firmware to
94<B>atusb</B> boards. To build dfu-util 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 dfu-util, which could be used instead of building
108it from source.
109
110
111<!-- ---------------------------------------------------------------------- -->
112
113
114<SUBSECTION title="Install and run NTP">
115
116The clock frequency test for <B>atusb</B> measures the clock frequency
117relative to the PC clock. Many PC clocks are highly inaccurate, which
118would render the result of the measurement meaningless. To improve the
119quality of the reference clock, it should be disciplined by NTP.
120<P>
121If NTP is not available, it may be necessary to increase the test's
122tolerance by changing the variable <SAMP>CLOCK_DRIFT_PPM</SAMP> in
123the script <SAMP>atusb</SAMP>.
124
125
126<!-- ---------------------------------------------------------------------- -->
127
128
129<SUBSECTION title="Install firmware binary">
130
131The binary of the application running on <B>atusb</B> is transferred from
132the PC. To download a pre-compiled version, use this command:
133
134<PRE>
135wget -O atusb.bin \
136     http://downloads.qi-hardware.com/people/werner/wpan/bindist/atusb-ce16a16.bin
137</PRE>
138
139Instructions for building the binary from sources are
140<A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw/README">here</A>.
141
142
143<!-- ---------------------------------------------------------------------- -->
144
145
146<SUBSECTION title="Register Ben host name">
147
148To simplify accessing the Ben via TCP/IP, its IP address should be
149registered in the <SAMP>/etc/hosts</SAMP> file on the PC. If the Ben is
150running OpenWrt, use the following command:
151<PRE>
152echo 192.168.254.101 ben >>/etc/hosts
153</PRE>
154<P>
155If the Ben is running Jlime, the address would be as follows:
156<PRE>
157echo 192.168.1.202 ben >>/etc/hosts
158</PRE>
159<P>
160If using the same PC with Bens running OpenWrt and Jlime, one may choose
161different host names depending on the distribution, and adapt the commands
162used in the production and testing process accordingly. For example,
163<PRE>
164echo 192.168.254.101 ben >>/etc/hosts
165echo 192.168.1.202 jlime >>/etc/hosts
166</PRE>
167
168
169<!-- ---------------------------------------------------------------------- -->
170
171
172<SUBSECTION title="Customize test scripts">
173
174If using <SAMP>prod/Makefile</SAMP> to run the production test process,
175the names of the drivers for DUT and reference device are defined
176through variables at the beginning of the Makefile. In particular,
177if the host name or IP address under which the Ben is reached differs from
178"ben", the value of <SAMP>ATBEN_DUT</SAMP> and <SAMP>ATUSB_REF</SAMP>
179will have be changed accordingly.
180<P>
181The Makefile also contains the variable <SAMP>SPECTRUM_MARGIN</SAMP> that
182defines how many dB of tolerance should be allowed below and above the
183reference signal strength. The default is to allow a margin of 5 dB in
184either direction.
185<P>
186The scripts <SAMP>atusb</SAMP> and <SAMP>atusb-flash</SAMP> also contain
187configuration variables. If the names of the files containing the
188<B>atusb</B> firmware binaries are not <SAMP>boot.hex</SAMP> and
189<SAMP>atusb.bin</SAMP>, <SAMP>atusb-flash</SAMP> needs to be adapted.
190
191
192<!-- ====================================================================== -->
193
194
195<SECTION ref="bensw" title="Ben software installation">
196
197For a DUT and reference device role, the ben-wpan utilities
198have to be installed on a Ben. For flashing the <B>atusb</B> boot
199loader, also avrdude and the boot loader binary are needed.
200<P>
201The instructions below apply for OpenWrt and Jlime. For building
202things from source, a cross-compilation toolchain has to be installed
203on the PC.
204
205
206<!-- ---------------------------------------------------------------------- -->
207
208
209<SUBSECTION title="Password-less remote access">
210
211To enable password-less remote access from the PC, set up network
212access to the Ben and run the following command:
213<PRE>
214ssh ben 'cat >>/etc/dropbear/authorized_keys' <~/.ssh/id_rsa.pub
215</PRE>
216
217
218<!-- ---------------------------------------------------------------------- -->
219
220
221<SUBSECTION title="Install ben-wpan tools">
222
223To build and install the ben-wpan tools on the Ben, first set
224up networking between the PC and the Ben. If you have not yet checked
225out the project's repository, run these commands:
226
227<PRE>
228git clone git://projects.qi-hardware.com/ben-wpan.git
229cd ben-wpan/tools
230</PRE>
231
232If you have already checked out the repository, <SAMP>cd</SAMP> to
233<SAMP>ben-wpan/tools/</SAMP> and run
234
235<PRE>
236make clean
237</PRE>
238
239Next, if on OpenWrt, compile the tools with
240<PRE>
241make TARGET=ben_openwrt
242</PRE>
243
244If on Jlime, use
245<PRE>
246make TARGET=ben_jlime
247</PRE>
248
249Finally, upload the tools to the Ben and install them under
250<SAMP>/usr/bin/</SAMP> with
251
252<PRE>
253make HOST=ben upload
254</PRE>
255
256Where <SAMP>ben</SAMP> is the host name or IP address assigned to the Ben.
257
258
259<!-- ---------------------------------------------------------------------- -->
260
261
262<SUBSECTION title="Install avrdude">
263
264The <B>atusb</B> boot loader is flashed using avrdude. A pre-compiled
265static binary (suitable for OpenWrt and Jlime) can be installed by running
266the following two commands on the Ben:
267
268<PRE>
269wget http://downloads.qi-hardware.com/people/werner/wpan/bindist/avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
270tar -xz -C / -f avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz
271</PRE>
272
273Instructions for building avrdude from sources are
274<A href="http://projects.qi-hardware.com/index.php/p/ben-blinkenlights/source/tree/master/avrdude/README
275">here</A>.
276
277
278<!-- ---------------------------------------------------------------------- -->
279
280
281<SUBSECTION title="Install boot-loader binary">
282
283The binary of the boot loader running on <B>atusb</B> is transferred from
284the Ben. To download a pre-compiled version, use this command:
285
286<PRE>
287wget -O boot.hex \
288   http://downloads.qi-hardware.com/people/werner/wpan/bindist/boot-ce16a16.hex
289</PRE>
290
291Instructions for building the binary from sources are
292<A href="http://projects.qi-hardware.com/index.php/p/ben-wpan/source/tree/master/atusb/fw/README">here</A>.
293
294
295<!-- ====================================================================== -->
296
297
298<SECTION ref="bensys" title="Ben system setup">
299
300The configuration settings described in this section are lost on each
301reset or reboot and need to be entered again. Alternatively,
302a setup script running at boot time can be written.
303
304
305<!-- ---------------------------------------------------------------------- -->
306
307
308<SUBSECTION title="Enable network access">
309
310Once the Ben has booted and started USB networking, the interface
311on the PC side is configured as follows:
312<PRE>
313ifconfig usb0 192.168.254.100 up
314</PRE>
315<P>
316These are the settings for OpenWrt, assuming the network device is
317called "usb0". If using Jlime, the command would be as follows:
318<PRE>
319ifconfig usb0 192.168.1.200 up
320</PRE>
321
322
323<!-- ---------------------------------------------------------------------- -->
324
325
326<SUBSECTION title="Silence other 8:10 card users">
327
328Before running any of the ben-wpan utilities, other users of the 8:10
329card slot have to be disabled. In a Ben running the regular OpenWrt or
330Jlime distribution, the only such user that is automatically started
331is the MMC kernel driver. The following command disables it:
332<PRE>
333echo jz4740-mmc.0 >/sys/bus/platform/drivers/jz4740-mmc/unbind
334</PRE>
335<P>
336If a WPAN-enabled kernel has been installed, the AT86RF230 driver takes
337the place of the MMC driver. To disable it, run
338<PRE>
339echo spi2.0 >/sys/bus/spi/drivers/at86rf230/unbind
340</PRE>
341Note that the above command only has the desired effect if used
342before running any of the user-space tools. If the kernel driver and
343the user-space tools have already clashed over access to the board, the
344driver will not unbind and a reboot is needed.
345
346
347<!-- ---------------------------------------------------------------------- -->
348
349
350<SUBSECTION title="Start atrf-proxy">
351
352On the Ben, launch the proxy daemon. We pass the option -b to background it:
353<PRE>
354atrf-proxy -b
355</PRE>
356
357
358<!-- ====================================================================== -->
359
360
361<SECTION ref="profiles" title="Test profiles">
362
363Some of the functional tests measure characteristics that are strongly
364influenced by the test setup. It is therefore not possible to provide
365universally applicable reference values, but they have to be measured
366in the actual test environment.
367
368
369<!-- ---------------------------------------------------------------------- -->
370
371
372<SUBSECTION title="Clock count (atben only)">
373
374Insert a known to be good <B>atben</B> board and run the following
375command directly on the Ben to record the reference value for the
376clock count with an accuracy of roughly +/&minus;20 ppm:
377
378<PRE>
379atrf-xtal 1000 >ben.xtal
380</PRE>
381<P>
382This takes about 5 seconds.
383<P>
384Note that the result depends on the tolerance of the crystal in the Ben
385and is also affected by temperature. Good accuracy can therefore
386only be obtained if this measurement is performed individually on each
387Ben, and if a stable temperature is maintained.
388
389
390<!-- ---------------------------------------------------------------------- -->
391
392
393<SUBSECTION title="Signal strength">
394
395The signal strength of a DUT is assessed by comparing it with
396measurements previously obtained in the same setup, with a known to
397be good device taking the role of the DUT. It is therefore necessary
398to establish a reference profile each time the test environment changes,
399e.g., when changing location or when using a different reference device.
400<P>
401The physical arrangement of the devices should have the characteristics
402described in <A href="test.html#atben">the test section</A>. The orientation
403of the devices should be chosen such that the overall signal strength is
404near its maximum, that the spectrum is relatively "flat", and that small
405changes in the orientation only produce small variations in the measured
406signal strength.
407<P>
408To generate the profiles for <B>atben</B> and <B>atusb</B>, simply run
409<PRE>
410make spectrum
411</PRE>
412Then place the devices appropriately and press <B>D</B>
413to use the displayed spectrum as the reference. Multiple spectra
414can be merged into the reference, e.g., if unavoidable environmental
415variations cause
416significant changes. Spectra included in the reference are shown in blue.
417<P>
418After a obtaining the reference spectrum, press <B>Q</B> to exit. The
419Makefile will then record the signal strength limits for an <B>atben</B>
420DUT in the file <SAMP>ben.profile</SAMP> and proceed with the reverse
421measurement, i.e., with <B>atusb</B> acting as the DUT.
422
423
424<END author="Werner Almesberger" date="<GEN_DATE>">
425</BODY>
426</HTML>
427

Archive Download this file



interactive