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 cec05a0f5ea2fb4ff5637d418c7f5dae196abda8 created 6 years 9 months ago. By Werner Almesberger, atusb/atusb.pro: we don't use power.lib anymore | |
|---|---|
| 1 | 1. Obtain u-boot's mkimage |
| 2 | |
| 3 | wget ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2 |
| 4 | tar xfj u-boot-2009.11.tar.bz2 |
| 5 | cd u-boot-2009.11 |
| 6 | touch include/config.{h,mk} |
| 7 | make SUBDIRS=tools BIN_FILES-y=mkimage tools |
| 8 | cp tools/mkimage /usr/local/bin |
| 9 | cd .. |
| 10 | |
| 11 | 2. Build the kernel |
| 12 | |
| 13 | git clone git://projects.qi-hardware.com/qi-kernel.git |
| 14 | cd qi-kernel |
| 15 | git checkout ben-wpan |
| 16 | cp ../ben-wpan-config-2.6.38 .config |
| 17 | patch -p1 -s < ../qi_lb60-NAND-add-data-partition.patch |
| 18 | OWRT make ARCH=mips CROSS_COMPILE=mipsel-openwrt-linux- vmlinux.bin |
| 19 | Jlime make ARCH=mips CROSS_COMPILE=mipsel-linux- vmlinux.bin |
| 20 | gzip -9 -f arch/mips/boot/vmlinux.bin |
| 21 | OWRT mkimage -A mips -O linux -T kernel -a 0x80010000 \ |
| 22 | -C gzip -e 0x`mipsel-openwrt-linux-nm vmlinux | \ |
| 23 | grep " kernel_entry" | cut -f1 -d ' '` \ |
| 24 | -n 'Ben NanoNote Linux Kernel' \ |
| 25 | -d arch/mips/boot/vmlinux.bin.gz uImage |
| 26 | Jlime mkimage -A mips -O linux -T kernel -a 0x80010000 \ |
| 27 | -C gzip -e 0x`mipsel-linux-nm vmlinux | \ |
| 28 | grep " kernel_entry" | cut -f1 -d ' '` \ |
| 29 | -n 'Ben NanoNote Linux Kernel' \ |
| 30 | -d arch/mips/boot/vmlinux.bin.gz uImage |
| 31 | cd .. |
| 32 | |
| 33 | 3. Install the kernel |
| 34 | |
| 35 | Using u-boot without reflash: |
| 36 | |
| 37 | - set up TCP/IP networking with the Ben |
| 38 | - copy uImage to Ben /boot/uImage |
| 39 | - hold F4 when poweron |
| 40 | |
| 41 | Using usbboot: |
| 42 | |
| 43 | - remove battery and USB |
| 44 | - wait 15 seconds |
| 45 | - press the "U" key on the Ben |
| 46 | - insert USB while keeping "U" pressed |
| 47 | - release the "U" key |
| 48 | - on the host, run |
| 49 | usbboot -c "boot;nprog 1024 qi-kernel/uImage 0 0 -n" |
| 50 | - disconnect USB |
| 51 | - wait 15 seconds |
| 52 | - connect USB again |
| 53 | |
| 54 | Using nandwrite: |
| 55 | |
| 56 | - set up TCP/IP networking with the Ben |
| 57 | - get the Ben's IPv4 address: |
| 58 | NN=`ifconfig usb0 | |
| 59 | sed '/.*inet addr:\([^ ]*\).*/{s//\1/;s/100$/101/;s/200$/202/;p;};d'` |
| 60 | # should be NN=192.168.254.101 for OpenWRT, |
| 61 | # NN=192.168.1.202 for Jlime |
| 62 | - copy the kernel: |
| 63 | scp qi-kernel/uImage $NN: |
| 64 | - flash the kernel, clean up, and reboot: |
| 65 | ssh $NN 'PATH=$PATH:/usr/sbin; |
| 66 | flash_eraseall /dev/mtd1 && nandwrite -p /dev/mtd1 uImage && |
| 67 | rm -f uImage && sync && sleep 1 && sync && sleep 1 && |
| 68 | /sbin/reboot -f' |
| 69 | - press ^C to return to the shell |
| 70 | |
| 71 | 4. Set up the user space on the Ben |
| 72 | |
| 73 | - connect to the Ben |
| 74 | ssh $NN |
| 75 | - run the following commands: |
| 76 | OWRT opkg update |
| 77 | OWRT opkg install ip |
| 78 | OWRT opkg install ldconfig |
| 79 | OWRT opkg install libnl-1 |
| 80 | OWRT opkg install lowpan-tools |
| 81 | OWRT opkg install dirtpan |
| 82 | mkdir -p /usr/local/var/run |
| 83 | exit |
| 84 | |
| 85 | 5. Build libnl-1 for cross-development and install the run-time library |
| 86 | |
| 87 | wget http://www.infradead.org/~tgr/libnl/files/libnl-1.1.tar.gz |
| 88 | tar xfz libnl-1.1.tar.gz |
| 89 | cd libnl-1.1 |
| 90 | Jlime patch -p1 -s <../libnl-1.1-limits.patch |
| 91 | Jlime inc=`mipsel-linux-cpp -v </dev/null 2>&1 | grep usr/include | tr -d \ ` |
| 92 | Jlime ./configure --prefix=${inc%/include} --host=mipsel-linux |
| 93 | make |
| 94 | make install |
| 95 | |
| 96 | scp lib/libnl.so.1.1 $NN:/usr/lib |
| 97 | ssh $NN /sbin/ldconfig |
| 98 | cd .. |
| 99 | |
| 100 | 6. Build the user space tools of the linux-zigbee project |
| 101 | |
| 102 | git clone git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee/linux-zigbee |
| 103 | cd linux-zigbee |
| 104 | JLime ./autogen.sh --host=mipsel-linux |
| 105 | make |
| 106 | |
| 107 | scp src/iz src/izcoordinator src/izchat $NN:/usr/sbin/ |
| 108 | cd .. |
| 109 | |
| 110 | 7. Build dirtpan, a crude IPv4-over-IEEE 802.15.4 tunnel |
| 111 | |
| 112 | git clone git://projects.qi-hardware.com/ben-wpan.git |
| 113 | |
| 114 | # If compiling dirtpan.c fails due a missing ieee802145.h header, |
| 115 | # copy it over from lowpan-tools: |
| 116 | |
| 117 | cp lowpan-tools-0.2.2/include/ieee802154.h tools/dirtpan/ |
| 118 | |
| 119 | cd ben-wpan/tools |
| 120 | JLime make TARGET=ben_jlime |
| 121 | JLime make -C dirtpan TARGET=ben_jlime |
| 122 | scp dirtpan/dirtpan $NN:/usr/sbin |
| 123 | |
