IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
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 | |
29 | Before performing production tests, various pieces of software |
30 | need to be installed on Ben and PC, and configuration settings may |
31 | have to be adjusted. The following sections describe the installation |
32 | and configuration process. |
33 | |
34 | |
35 | <!-- ====================================================================== --> |
36 | |
37 | |
38 | <SECTION ref="pcsw" title="PC software installation"> |
39 | |
40 | For a DUT and reference device role, the <B>ben-wpan</B> utilities |
41 | and the test scripts have to be installed on the PC. For flashing the |
42 | <B>atusb</B> application |
43 | firmware, also <B>dfu-util</B> and the firmware binary are required. |
44 | <P> |
45 | The instructions below assume that a complete development environment |
46 | is already present on the PC. If any prerequisitres are not met, |
47 | compilation will fail, and you'll have to install the corresponding |
48 | package and try again. |
49 | |
50 | |
51 | <!-- ---------------------------------------------------------------------- --> |
52 | |
53 | |
54 | <SUBSECTION title="Install ben-wpan tools"> |
55 | |
56 | To build the ben-wpan tools and install them under |
57 | <SAMP>/usr/local/</SAMP> on the local machine, |
58 | run the following commands: |
59 | <PRE> |
60 | git clone git://projects.qi-hardware.com/ben-wpan.git |
61 | git clone git://projects.qi-hardware.com/f32xbase.git |
62 | cd ben-wpan/tools |
63 | make |
64 | make install |
65 | </PRE> |
66 | <P> |
67 | A different directory prefix can be chosen by overriding the |
68 | <B>INSTALL_PREFIX</B> variable, e.g., |
69 | <PRE> |
70 | make INSTALL_PREFIX=/usr install |
71 | </PRE> |
72 | <P> |
73 | Note that the test scripts expect <SAMP>${INSTALL_PREFIX}/bin</SAMP> |
74 | to be in <B>PATH</B>. |
75 | |
76 | |
77 | <!-- ---------------------------------------------------------------------- --> |
78 | |
79 | |
80 | <SUBSECTION title="Install test scripts"> |
81 | |
82 | The 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 |
84 | this directory. Therefore, all that's necessary is to check out the |
85 | repository, 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 |
95 | commands: |
96 | |
97 | <PRE> |
98 | git clone git://git.openezx.org/dfu-util.git |
99 | cd dfu-util |
100 | ./autogen.sh |
101 | ./configure |
102 | make |
103 | make install |
104 | </PRE> |
105 | |
106 | Note that some Linux distributions already provide a pre-compiled |
107 | version of <B>dfu-util</B>, which could be used instead of building |
108 | it from source. |
109 | |
110 | |
111 | <!-- ---------------------------------------------------------------------- --> |
112 | |
113 | |
114 | <SUBSECTION title="Install firmware binary"> |
115 | |
116 | The binary of the application running on <B>atusb</B> is transferred from |
117 | the PC. To download a pre-compiled version, use this command: |
118 | |
119 | <PRE> |
120 | wget -O atusb.bin \ |
121 | http://downloads.qi-hardware.com/people/werner/wpan/bindist/atusb-de72af351f661b538add81cbc9965278a2f8c40c.bin |
122 | </PRE> |
123 | |
124 | Instructions 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 | |
133 | To simplify accessing the Ben via TCP/IP, its IP address should be |
134 | registered in the hosts file on the PC. If the Ben is running OpenWrt, |
135 | use the following command: |
136 | <PRE> |
137 | echo 192.168.254.101 ben >>/etc/hosts |
138 | </PRE> |
139 | <P> |
140 | If the Ben is running Jlime, the address would be as follows: |
141 | <PRE> |
142 | echo 192.168.1.202 ben >>/etc/hosts |
143 | </PRE> |
144 | <P> |
145 | If using the same PC with Bens running OpenWrt and Jlime, one may choose |
146 | different host names depending on the distribution, and adapt the commands |
147 | used in the production and testing process accordingly. For example, |
148 | <PRE> |
149 | echo 192.168.254.101 ben >>/etc/hosts |
150 | echo 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 | |
167 | For a DUT and reference device role, the <B>ben-wpan</B> utilities |
168 | have to be installed on a Ben. For flashing the <B>atusb</B> boot |
169 | loader, also <B>avrdude</B> and the boot loader binary are needed. |
170 | <P> |
171 | The instructions below apply for OpenWrt and Jlime. For building |
172 | things from source, a cross-compilation toolchain has to be installed |
173 | on the PC. |
174 | |
175 | |
176 | <!-- ---------------------------------------------------------------------- --> |
177 | |
178 | |
179 | <SUBSECTION title="Password-less remote access"> |
180 | |
181 | To enable password-less remote access from the PC, set up network |
182 | access to the Ben and run the following command: |
183 | <PRE> |
184 | ssh 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 | |
193 | To build and install the <B>ben-wpan</B> tools on the Ben, first set |
194 | up networking between the PC and the Ben. If you have not yet checked |
195 | out the project's repository, run these commands: |
196 | |
197 | <PRE> |
198 | git clone git://projects.qi-hardware.com/ben-wpan.git |
199 | git clone git://projects.qi-hardware.com/f32xbase.git |
200 | cd ben-wpan/tools |
201 | </PRE> |
202 | |
203 | If you have already checked out the repository, <B>cd</B> to |
204 | <SAMP>ben-wpan/tools/</SAMP> and run |
205 | |
206 | <PRE> |
207 | make clean |
208 | </PRE> |
209 | |
210 | Next, if on OpenWrt, compile the tools with |
211 | <PRE> |
212 | make TARGET=ben_openwrt |
213 | </PRE> |
214 | |
215 | If on Jlime, use |
216 | <PRE> |
217 | make TARGET=ben_jlime |
218 | </PRE> |
219 | |
220 | Finally, upload the tools to the Ben and install them under |
221 | <SAMP>/usr/bin/</SAMP> with |
222 | |
223 | <PRE> |
224 | make HOST=ben install |
225 | </PRE> |
226 | |
227 | Where <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 | |
235 | The <B>atusb</B> boot loader is flashed using <B>avrdude</B>. A pre-compiled |
236 | static binary (suitable for OpenWrt and Jlime) can be installed by running |
237 | the following two command on the Ben: |
238 | |
239 | <PRE> |
240 | wget http://downloads.qi-hardware.com/people/werner/wpan/bindist/avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz |
241 | tar -xz -C / -f avrdude-5.10-de72af351f661b538add81cbc9965278a2f8c40c.tar.gz |
242 | </PRE> |
243 | |
244 | Instructions 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 | |
254 | The binary of the boot loader running on <B>atusb</B> is transferred from |
255 | the Ben. To download a pre-compiled version, use this command: |
256 | |
257 | <PRE> |
258 | wget -O boot.hex \ |
259 | http://downloads.qi-hardware.com/people/werner/wpan/bindist/boot-de72af351f661b538add81cbc9965278a2f8c40c.hex |
260 | </PRE> |
261 | |
262 | Instructions 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 | |
271 | The configuration setting described in this section are lost on each |
272 | reset or reboot and either need to be entered again. Alternatively, |
273 | a setup script running at boot time can be written. |
274 | |
275 | |
276 | <!-- ---------------------------------------------------------------------- --> |
277 | |
278 | |
279 | <SUBSECTION title="Enable network access"> |
280 | |
281 | Once the Ben has booted and started USB networking, the interface |
282 | on the PC side is configured as follows: |
283 | <PRE> |
284 | ifconfig usb0 192.168.254.100 up |
285 | </PRE> |
286 | <P> |
287 | These are the settings for OpenWrt, assuming the network device is |
288 | called "usb0". If using Jlime, the command would be as follows: |
289 | <PRE> |
290 | ifconfig usb0 192.168.1.200 up |
291 | </PRE> |
292 | |
293 | |
294 | <!-- ---------------------------------------------------------------------- --> |
295 | |
296 | |
297 | <SUBSECTION title="Silence other 8:10 card users"> |
298 | |
299 | Before running any of the ben-wpan utilities, other users of the 8:10 |
300 | card slot have to be disabled. In a Ben running the regular OpenWrt or |
301 | Jlime distribution, the only such user that is automatically started |
302 | is the MMC kernel driver. The following command disables it: |
303 | <PRE> |
304 | echo jz4740-mmc.0 >/sys/bus/platform/drivers/jz4740-mmc/unbind |
305 | </PRE> |
306 | <P> |
307 | If a WPAN-enabled kernel has been installed, the AT86RF230 driver takes |
308 | the place of the MMC driver. To disable it, run |
309 | <PRE> |
310 | echo spi2.0 >/sys/bus/spi/drivers/at86rf230/unbind |
311 | </PRE> |
312 | |
313 | |
314 | <!-- ---------------------------------------------------------------------- --> |
315 | |
316 | |
317 | <SUBSECTION title="Start atrf-proxy"> |
318 | |
319 | On the Ben, launch the proxy daemon. We pass the option -b to background it: |
320 | <PRE> |
321 | atrf-proxy -b |
322 | </PRE> |
323 | |
324 | |
325 | <!-- ====================================================================== --> |
326 | |
327 | |
328 | <SECTION ref="profiles" title="Test profiles"> |
329 | |
330 | Some of the functional tests measure characteristics that are strongly |
331 | influenced by the test setup. It is therefore not possible to provide |
332 | universally applicable reference values, but they have to be measured |
333 | in the actual test environment. |
334 | |
335 | |
336 | <!-- ---------------------------------------------------------------------- --> |
337 | |
338 | |
339 | <SUBSECTION title="Clock count (atben only)"> |
340 | |
341 | Insert a known to be good <B>atben</B> board and run the following |
342 | command directly on the Ben to record the reference value for the |
343 | clock count with an accuracy of about +/−20 ppm: |
344 | <PRE> |
345 | atrf-xtal 1000 >ben.xtal |
346 | </PRE> |
347 | <P> |
348 | This takes about 5 seconds. |
349 | <P> |
350 | Note that the result depends on the tolerance of the crystal in the Ben |
351 | and is also affected by temperature. Good accuracy can therefore |
352 | only be obtained if this measurement is performed individually on each |
353 | Ben, 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 |