Root/prod/doc/setup.hmac

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

Archive Download this file



interactive