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 9c64024af55259eb27fe2d86aa8e26257c996342 created 7 years 4 months ago. By Stefan Schmidt, atusb/Makefile: add missing atusb back layer to upload target | |
---|---|
1 | Requires a very recent toolchain, because ATmega32U2 is relatively new. |
2 | |
3 | - Building: |
4 | |
5 | make |
6 | |
7 | - Uploading the firmware to a Ben (for flashing with the atusb-pgm cable): |
8 | |
9 | make HOST=<hostname> upload |
10 | |
11 | Example: |
12 | |
13 | make HOST=ben upload |
14 | |
15 | HOST defaults to "jlime". |
16 | |
17 | - Flashing the boot loader: |
18 | |
19 | Prerequisite: avrdude on the Ben. |
20 | |
21 | Disconnect the atusb board from USB. Insert the atusb-pgm connector into |
22 | the Ben. Place the atusb-pgm adapter on the exposed contact pads of the |
23 | atusb board and push it down. Then run |
24 | |
25 | make prog |
26 | |
27 | This takes about 30 seconds. If the programming fails with an error |
28 | message like "Yikes! Invalid device signature.", verify that the |
29 | atusb-pgm board is properly connected and placed, then try again. |
30 | |
31 | - Uploading the application: |
32 | |
33 | Prerequisite: dfu-util installed on the PC. |
34 | |
35 | Insert atusb into the PC, then run |
36 | |
37 | make dfu |
38 | |
39 | Note: since the boot loader resets the USB bus after timing out, |
40 | this operation can fail with a message like "No DFU capable USB device |
41 | found". Just retry, and it will eventually get through. |
42 | |
43 | -------------------------- |
44 | |
45 | Making the toolchain: |
46 | |
47 | # patches according to |
48 | # http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=789527 |
49 | |
50 | # some gcc prerequisites |
51 | |
52 | apt-get remove avr-libc gcc-avr binutils-avr |
53 | apt-get install libmpfr-dev libmpc-dev |
54 | |
55 | # binutils |
56 | |
57 | wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2 |
58 | tar xfj binutils-2.21.tar.bz2 |
59 | cd binutils-2.21 |
60 | ./configure --target=avr --disable-nls |
61 | make |
62 | make install |
63 | |
64 | # gcc |
65 | |
66 | wget http://ftpmirror.gnu.org/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2 |
67 | wget -O gcc_452_avr.patch http://gcc.gnu.org/bugzilla/attachment.cgi?id=23050 |
68 | tar xfj gcc-4.5.2.tar.bz2 |
69 | cd gcc-4.5.2 |
70 | patch -p1 -s <../gcc_452_avr.patch |
71 | mkdir obj-avr |
72 | cd obj-avr |
73 | ../configure --target=avr --enable-languages=c \ |
74 | --disable-nls --disable-libssp --with-dwarf2 |
75 | make |
76 | make install |
77 | |
78 | wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2 |
79 | tar xfj avr-libc-1.7.1.tar.bz2 |
80 | cd avr-libc-1.7.1 |
81 | ./bootstrap # the automake at the end takes a while |
82 | ./configure --build=`./config.guess` --host=avr |
83 | make |
84 | make install |
85 |