AVR2070: Route Under MAC (RUM) with IPv6 and 6LoWPAN Features • A FREE 802.15.4 networking solution - Multi-hop Route Under MAC (RUM) - All A
10 AVR2070 8240B-AVR-06/09 3.3 Build Sizes This section shows various build sizes using different compile flags described from Table 3-1. Table 3-2
AVR2070 118240B-AVR-06/09 4 AT91SAM7X-EK RUM Quickstart The Atmel RUM protocol is integrated to run on the AT91SAM7X-EK board which contains an AT91
12 AVR2070 8240B-AVR-06/09 4.1.1 uTasker Patches Since uTasker is a licensed RTOS, only a binary image has been provided for demonstration purposes.
AVR2070 138240B-AVR-06/09 This project should now include the original uTasker OS, SP4, and RUM patch files. A test compile can now be tried using t
14 AVR2070 8240B-AVR-06/09 TRX Pin SAM7X MCU Pin Port Port Function SCK 50 PA22 SPI1_SPCK SEL 49 PA21 SPI1_NPCS0 IRQ 80 PA30 IRQ0 CLKM 70 PB24 TI
AVR2070 158240B-AVR-06/09 the source code and precompiled code have USB disabled. Due to limitations on the SAM7X board, if a reset is necessary, th
16 AVR2070 8240B-AVR-06/09 Note: The SAM-ICETM JTAG adapter does not work for Linux based systems running the Rowley Crossworks IDE. 4.6 Loading the
AVR2070 178240B-AVR-06/09 Figure 4-6-2 SAM-BA File Selection Once the image has been selected in the “Send File Name” field, connect the SAM-ICE JT
18 AVR2070 8240B-AVR-06/09 Once the webpages are transferred, the default IP address of 192.168.1.125 must be entered into the selected internet brow
AVR2070 198240B-AVR-06/09 Figure 4-7-2 Simple Webserver Network Table 4.8 SD File Handling The maximum size of SD card is 2 GB. The card should be
2 AVR2070 8240B-AVR-06/09 2 Stack Architecture Route Under Mac (RUM) is a small 802.15.4 protocol developed by Atmel. This protocol routes packets at
20 AVR2070 8240B-AVR-06/09 5 Running the RUM Demo Now that all the platforms have been properly configured with RUM, operating the RUM demo without I
AVR2070 218240B-AVR-06/09 Table 5-1 ARM Telnet Menu Commands ASCII Command Description a (lowercase) IP Address. This is the current IPv4 address
22 AVR2070 8240B-AVR-06/09 Table 5-2 AVR Serial Menu Commands ASCII Command Description T Touch. Ping or send a Reading (asks for ‘p’ or ‘r’ &
AVR2070 238240B-AVR-06/09 6 Running the IPv6 Demo This demo requires the AT91SAM7X-EK to be used as the PAN Coordinator, due to the Ethernet interfa
24 AVR2070 8240B-AVR-06/09 If an IP address for the Ethernet side is not seen, this means an IPv6 router was discovered on the network. However the r
AVR2070 258240B-AVR-06/09 6.3 Using the 6LoWPAN / IPv6 Code on End Nodes The 6LoWPAN / IPv6 API is documented using the Doxygen documentation system
26 AVR2070 8240B-AVR-06/09 The IPSO demo has two parts to it. The first part is an interactive control to allow polling of the sensor and configurati
AVR2070 278240B-AVR-06/09 A<enter> A0 A1<enter> A<enter> A1 HTL<enter> H50T22.5L50 A0A<enter> A0 This also demonstrat
28 AVR2070 8240B-AVR-06/09 When setting an IP address, the full IP address must be specified with all zeros present. If the address is short any byte
AVR2070 298240B-AVR-06/09 By passing the messages over an IPv6 link, it does not matter if the sensors communicate directly with the coordinator or
AVR2070 38240B-AVR-06/09 2.1 Overview of RUM A RUM network is constructed around a coordinator. The coordinator is the only node that keeps any stat
30 AVR2070 8240B-AVR-06/09 6.7 Sleeping Nodes A node that spends much its time asleep is good for battery life, but makes IP connectivity harder. If
AVR2070 318240B-AVR-06/09 Appendix A - Route Under MAC (RUM) Protocol A.1 Overview This appendix outlines the scheme used by RUM for implementing a
32 AVR2070 8240B-AVR-06/09 8. Some pre-deployment configuration can be used to determine whether a given node should or can join a given network. T
AVR2070 338240B-AVR-06/09 Figure A-4-2 Direct Association Message Sequence End/Router Node Pan Coord NodeAssociation RequestAssociation Response The
34 AVR2070 8240B-AVR-06/09 Figure A-4-3 In-Direct Association Message Sequence End/Router Node Pan Coord NodeAssociation Request DirectAssociation Re
AVR2070 358240B-AVR-06/09 • If neither of the above conditions apply, then send the packet to the last routed address used for sending (which was s
36 AVR2070 8240B-AVR-06/09 • The destination node must be more than two hops away from the coordinator. For one or two hops, there is no ambiguity
AVR2070 378240B-AVR-06/09 Figure A-5-1 Example Network Commissioning Diagram CR9 R8R1 R3R2 E3E1E2SA: 0x0000(always)SA: 0x0003SA: 0x0002SA: 0x0004SA:
38 AVR2070 8240B-AVR-06/09 Table A-5-1. Beacon request and beacon frames E1 FCF – beacon req 0x0803 Seq 01 Broadcast PAN ID 0xffff Broadcast short a
AVR2070 398240B-AVR-06/09 C sends association response. Table A-5-7. Associaton response (direct) C FCF – assoc rsp 0x8C63 Seq 03 PID 0x1234 E1 MAC
4 AVR2070 8240B-AVR-06/09 2.3 Supported Hardware Platforms The RUM software distributed with this application note can run on a variety of platforms.
40 AVR2070 8240B-AVR-06/09 Table A-5-11. Association response (direct) R1 FCF – assoc rsp 0x8C63 Seq 03 PID 0x1234 R2 MAC addr 0x5555444433332222 R1
AVR2070 418240B-AVR-06/09 A.6 Routing packets There is a special packet used to create a route for a packet leaving the coordinator toward any route
42 AVR2070 8240B-AVR-06/09 Table A-6-3. End node E2 to Coordinator C via Router R2 E2 FCF – Data 0x8861 Seq 34 PID 0x1234 R2 SA 0x0006 E2 SA 0x0007Fi
AVR2070 438240B-AVR-06/09 Appendix B - Firmware API Overview This appendix discusses how the RUM firmware is implemented, what Application Programm
44 AVR2070 8240B-AVR-06/09 If a frame was received by the radio, it is transferred from the transceiver into a receive buffer in the host processor.
AVR2070 458240B-AVR-06/09 Figure B-2 appInit overview
46 AVR2070 8240B-AVR-06/09 Figure B-3 macTask overview
AVR2070 478240B-AVR-06/09 Figure B-4 macDataIndication overview
48 AVR2070 8240B-AVR-06/09 RoutingStartAm I coordinator?CoordSend routing packet if necessaryResend packet to first router in chainIs dest a child of
AVR2070 498240B-AVR-06/09 Figure B-6 Radio ISR overview
AVR2070 58240B-AVR-06/09 2.3.3 Raven USB This is the USB stick that comes with the ATAVRRZRAVEN kit. This board has an AT90USB1287 microcontroller,
50 AVR2070 8240B-AVR-06/09 The flowchart shown in Figure B-5 shows how the RUM protocol routes packets. Most of this processing occurs in the macRou
AVR2070 518240B-AVR-06/09 For more detailed examples of association and sending sensor data, see MAC function calls and Sensor application function
52 AVR2070 8240B-AVR-06/09 B.3 6LoWPAN API This group of functions is used to send a UDP packet to a node either on the wireless network (‘iplocal’)
AVR2070 538240B-AVR-06/09 Figure B-7 AVR 6LoWPAN DataIndication
54 AVR2070 8240B-AVR-06/09 Figure B-8 ARM 6LoWPAN DataIndication sixlowpan_DataIndication()StartEndCall 6LoWPAN Layer to uncompress packet to bufferC
AVR2070 558240B-AVR-06/09 and the RF231 and RF212 radios can be configured for rising or falling edge via the IRQ_POLARITY register value. In additi
56 AVR2070 8240B-AVR-06/09 #ifndef __AVR_ATmega1281__ #error "Incorrect MCU for Platform! Check Makefile" #endif // Set this to
AVR2070 578240B-AVR-06/09 # define HAL_INIT_ADC() DIDR0 |= (1 << ADPIN), \ ADMUX = 0xC0 | ADPIN, ADCSRA = 0x84 # define HAL_STOP
58 AVR2070 8240B-AVR-06/09 control) and press the enter key. A simple terminal menu should be printed, and the ASCII 'd' character should
AVR2070 598240B-AVR-06/09 Appendix C - IPv6 / 6LoWPAN Background Using IPv6 and 6LowPAN will be easier if an understanding of the underlying techno
6 AVR2070 8240B-AVR-06/09 3 AVR RUM Quickstart In order to operate the RUM demo application, make sure one of the platforms described in this documen
60 AVR2070 8240B-AVR-06/09 Any leading zeros can be dropped, writing addresses like: 2001:DB8:0:0:8:800:200C:417A Finally a number of zeros in the
AVR2070 618240B-AVR-06/09 Figure C-4-1 IPv6 Router Discovery C.4.3 Node Auto-configuration On power-up a node uses these packets to acquire an addr
62 AVR2070 8240B-AVR-06/09 10. Node is now on the network. It can be seen how IPv6 simplifies auto-configuration of network addresses. Nodes no longe
AVR2070 638240B-AVR-06/09 Traffic Class and Flow Label encoding A message will be properly parsed by end-nodes regardless if traffic class and flow
64 AVR2070 8240B-AVR-06/09 Compared to normal IPv6 networks, there are some differences to how a node acquires its IPv6 address. A typical startup se
AVR2070 658240B-AVR-06/09 Appendix D - AT91SAM7X-EK Development Tools uTasker can be compiled in a number of different environments: IARTM, Rowley
66 AVR2070 8240B-AVR-06/09 Figure D-1-3 uTasker and RUM Integrated Folder Structure D.2 Rowley Crossworks IDE Rowley Crossworks is a cross platform
AVR2070 678240B-AVR-06/09 5. Load J-Link .dll for debugging a. Target -> Connect Segger J-Link b. Should see “DLL WARNING” c. Select Tools -&
68 AVR2070 8240B-AVR-06/09 folder structuring has been properly followed; the Rowley project file should build as expected. Figure D-2-2 Rowley IDE
AVR2070 698240B-AVR-06/09 Figure D-2-3 Rowley Project Properties Then click on the ellipsis button to bring up the Preprocessor Definitions window
AVR2070 78240B-AVR-06/09 Figure 3-1 AVR Studio RUM Project Options Figure 3-2 AVR Studio RUM Compile Flags
70 AVR2070 8240B-AVR-06/09 Note: Sometimes the SAM7X will retain old FLASH values such as IP addresses. This can be a valuable feature during code re
AVR2070 718240B-AVR-06/09 Figure D-3-1 Eclipse Workspace Selection In this example they are stored in the f:\eclipse_projects directory. With that
72 AVR2070 8240B-AVR-06/09 Finally the RUM project can be imported. This is done by going to the “File -> Import” menu. Select the type as “Existi
AVR2070 738240B-AVR-06/09 Point the root directory to the RUM source code. It should automatically find the project, and optionally one can check th
74 AVR2070 8240B-AVR-06/09 Change the “compiler invocation command” to point to the YAGARTO installation. In this example it is located at C:\Progra
AVR2070 758240B-AVR-06/09 Next open the “Settings” pane under “C/C++ Build”. Select the “GNU Elf Parser” checkbox, then point both the addr2line an
76 AVR2070 8240B-AVR-06/09 Figure D-3-8 Eclipse Debug Plugin Press “Add Site” and add the site http://opensource.zylin.com/zylincdt and press OK. No
AVR2070 778240B-AVR-06/09 D.3.5 Programming the FLASH First programming the FLASH memory with SAM-PROG will be covered. With the SAM-ICE connected,
78 AVR2070 8240B-AVR-06/09 Figure D-3-11 Segger J-Link Connection Screen Next Eclipse needs to be set up to work with the GDB Server. To do this cli
AVR2070 798240B-AVR-06/09 A new window will pop up, and select the “Zylin Embedded debug (Native)” category, and hit the new button. Set the name, a
8 AVR2070 8240B-AVR-06/09 For command line operation using avr-gcc, options should be passed on the command line as define (-D) options, such as: avr
80 AVR2070 8240B-AVR-06/09 monitor endian little # Set JTAG speed to 30 kHz monitor speed 30 # Reset the radio to get to a known state. monitor res
AVR2070 818240B-AVR-06/09 this tutorial the external SAM-PROG tool is used instead. The flash breakpoints feature removes the limit of two hardware
82 AVR2070 8240B-AVR-06/09 Figure D-3-16 Debugging Tools The “Variables” section contains all local variables for the current function. To add a glo
AVR2070 838240B-AVR-06/09 Figure D-3-20 Debug Terminate/Disconnect Option Once debugging is finished, the process can begin again. After re-compili
84 AVR2070 8240B-AVR-06/09 Appendix E - Third-Party Reference Designs / Platforms This section describes various reference designs that can be purch
AVR2070 858240B-AVR-06/09 Figure E-1-1 AT91SAM7X-EK Standard Board Figure E-1-2 REB and REX_ARM adaptor Figure E-1-3 AT91SAM7X-EK with REB/REX_A
86 AVR2070 8240B-AVR-06/09 E.2 RCB212 This platform is a version of RCB (Radio Control Board) from Atmel, designed specifically for the AT86RF212 rad
AVR2070 878240B-AVR-06/09 E.5 DSK001 This platform is a small circular PCB containing an RF230 or RF231 radio transceiver, an ATmega48/88/168/328 fa
88 AVR2070 8240B-AVR-06/09 Glossary 6LoWPAN - A scheme to compress and fragment IPv6 packets for transmission over an 802.15.4 wireless network. See
AVR2070 898240B-AVR-06/09 Multi-hop - A network that can relay packets over several wireless nodes to a destination. RUM has multi-hop capability,
AVR2070 98240B-AVR-06/09 Option Name Possible values Meaning IPV6LOWPAN 0 1 Compiles in 6LoWPAN functionality, which gives each node in the networ
90 AVR2070 8240B-AVR-06/09 Table of Contents Features...
AVR2070 918240B-AVR-06/09 6.4.1 Commands on Port 61616... 26 6.4
92 AVR2070 8240B-AVR-06/09 C.5.1 Draft-ietf-6lowpan-hc01....... 6
8240B-AVR-06/09 Disclaimer Headquarters International Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USA Tel: 1(408) 441-0311 Fax: 1(
Comments to this Manuals