Page 2 - Stack Architecture; over; Figure 2-1 RUM Architecture
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 the MAC layer, as opposed to the application or IPv6 layer, which would be a route over scheme. The under comes from the fact that routing is done at ...
Page 3 - constructed; Figure 2-2 RUM Tree Topology Example; Appendix A contains a detailed description of the RUM protocol.; Overview of IPv6 and 6LoWPAN; or IPv6 addressable device
AVR2070 3 8240B-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 state information about the network, so that the other nodes do not have to store any network information. This allows for low cost hardware for both route...
Page 4 - Supported Hardware Platforms
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. The PLATFORM keyword defines several parameters about a board. An example of these parameters is: • Which microcontroller is present on the platform b...
Page 6 - AVR RUM Quickstart; , or that a custom platform has been
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 document has been selected , or that a custom platform has been properly defined in the hal_avr.h file. Also the use of an Atmel JTAGICE mkII or AVRISP progra...
Page 8 - Here is a list of available compile-time flags:; Table 3-1 Compile Time Flags
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-gcc -mmcu=atmega1281 -DF_CPU=8000000UL -DPLATFORM=RAVEN -o radio.o radio.c (etc.) Here is a list of available compile-time flags: Table 3-1 Compile Ti...
Page 10 - Table 3-2 Various Build Sizes for AVR and ARM; Raven
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 Various Build Sizes for AVR and ARM Coordinator Router End Node Raven USB Coordinator IPv6 off DEBUG on Sensor App SLEEP on 25332 bytes FLASH 4811 bytes...
Page 11 - AT91SAM7X-EK RUM Quickstart; RUM
AVR2070 11 8240B-AVR-06/09 4 AT91SAM7X-EK RUM Quickstart The Atmel RUM protocol is integrated to run on the AT91SAM7X-EK board which contains an AT91SAM7X256 microcontroller. Additionally, the IPv6/6LoWPAN layers can be compiled in. Compiling in the IPv6 layer will allow the SAM7X platform to act as...
Page 13 - Figure 4-2-1 Microcontroller to Transceiver Connections; TRX Pin
AVR2070 13 8240B-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 the IDE of choice. Appendix D explains two common IDE’s that can be configured to compile uTasker with RUM support. 4.2 Radio Interface The radio interf...
Page 14 - Serial Interfaces; uTaskerAtmelVirtualCOM.inf
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 TIOB0 SLEEP_TR 13 PA8 PA8 RST 14 PA9 PA9 4.2.2 Firmware The low level driver code is located in two files: hal_arm.c hal_arm.h These files initialize SPI-1 a...
Page 15 - Network Interfaces; The ARM
AVR2070 15 8240B-AVR-06/09 the source code and precompiled code have USB disabled. Due to limitations on the SAM7X board, if a reset is necessary, the USB cable must be removed and any open USB terminal sessions closed and then the board can be reconnected and the USB terminal session restarted. 4.4...
Page 16 - JTAG adapter does not work for Linux based systems; Loading the Program; . Various methods to program the AT91SAM7X-
16 AVR2070 8240B-AVR-06/09 Note: The SAM-ICE TM JTAG adapter does not work for Linux based systems running the Rowley Crossworks IDE . 4.6 Loading the Program In order to load the uTasker RUM demo, the AT91SAM-ICE comes with a SAM-BA ® programmer GUI interface. This needs to be installed on the loca...
Page 17 - Simple Web Interface; folder
AVR2070 17 8240B-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 JTAG unit to the AT91SAM7X-EK development board. Power on the target and press the “Send File” button. The programmer will begin communication with the AT...
Page 19 - Figure 4-7-2 Simple Webserver Network Table; SD File Handling; please refer to the originators for comprehensive details.
AVR2070 19 8240B-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 formatted as FAT32. Note that the SD file handling is rudimentary. Users needing more advanced file handling can adapt the system as source code is avai...
Page 20 - Running the RUM Demo
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 IPv6 is described in this section. It is assumed there is only one PAN Coordinator per network and the PAN Coordinator can be either the AT91SAM7X-EK bo...
Page 21 - Table 5-1 ARM Telnet Menu Commands; ASCII Command
AVR2070 21 8240B-AVR-06/09 Table 5-1 ARM Telnet Menu Commands ASCII Command Description a (lowercase) IP Address. This is the current IPv4 address of the SAM7X. A (uppercase) IPv6 Address. This is the IPv6 address that has been self configured or configured as a result of connecting to a true IPv6 r...
Page 22 - Table 5-2 AVR Serial Menu Commands
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’ & interval time). c Channel. This allows the user to change the operating channel. d Dump. This shows the current content of the radio control registers. i...
Page 23 - Running the IPv6 Demo; . This is set by defining the IPV6LOWPAN macro to ‘1’ at build time; Network Table; Note
AVR2070 23 8240B-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 interface available on the board. The demo is separated into four parts. The first is the ‘ping’ demo which simply verifies IPv6 network connectivity. The nex...
Page 24 - Then try to ping the node:
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 router is NOT advertising a prefix using stateless auto configuration. Router advertisements must either be disabled on the router, or set the router to...
Page 25 - Windows users can find copies of netcat6.exe available online at
AVR2070 25 8240B-AVR-06/09 6.3 Using the 6LoWPAN / IPv6 Code on End Nodes The 6LoWPAN / IPv6 API is documented using the Doxygen documentation system. What follows is an overview of how the example application works, and is not the full API documentation. Refer to Appendix C for the entire API docum...
Page 26 - UDP Ports; Port; Tip; Command Description
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 configuration tasks. The second part is to have the sensor automatically send data to a central server. The wireless sensor node listens on three UDP ports, their...
Page 28 - Sensor App Example
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 bytes, the node will respond “length error”. The 'server address' is the IP address which the node automatically sends readings to. The 'button press addre...
Page 29 - TFTP Bootloading; for both Linux and
AVR2070 29 8240B-AVR-06/09 By passing the messages over an IPv6 link, it does not matter if the sensors communicate directly with the coordinator or with some other computer. As well multiple sensor networks could report to a single coordinator device, even if that coordinator is physically located ...
Page 30 - of a second. For example the following would set
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 a node only wakes up every 5 minutes, attempting to ping the node will either fail or have a very long latency. The 6LoWPAN sleeping system contains an...
Page 32 - A.4 Implementation Details; Figure A-4-1 Channel Scan Message Sequence
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. This configuration is part of the application, not the MAC. 9. Only short (16-bit) 802.15.4 addresses are used in sending data over the network except dur...
Page 33 - Figure A-4-2 Direct Association Message Sequence
AVR2070 33 8240B-AVR-06/09 Figure A-4-2 Direct Association Message Sequence End/Router Node Pan Coord Node Association Request Association Response The node then associates to its parent as illustrated in figure A-4-2 (above): The node sends an Association Request packet to the chosen router (or coo...
Page 35 - When the coordinator starts, it performs the following actions:
AVR2070 35 8240B-AVR-06/09 • If neither of the above conditions apply, then send the packet to the last routed address used for sending (which was stored from a routing frame). 4. If an association response is received with the router's short address as parent, then add the child node to a table of ...
Page 36 - The destination node must be more than two hops away from the; A.5 Examples of network operation
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 in the route, so no routing packet is required. • The last time a packet was sent through the top-most router in a sub-tree, the destination address was ...
Page 38 - A.5.2 Example 2 – Router R1 connects to Coordinator C
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 addr 0xffff 07 (beacon req) 0x07 C FCF – beacon 0x8000 Seq 01 PID 0x1234 Coord SA 0x0000 Superframe 0x40ff ID (6=6LoWPAN) 0x06 Hops 0 E1 selects C based ...
Page 40 - A.5.5 Example 5 – End node E2 connects to network
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 SA 0x0003 MAC 02 R2 SA 0x0006 R2 saves its parent's short address and its own short address. A.5.5 Example 5 – End node E2 connects to network This exa...
Page 43 - Appendix B - Firmware API Overview; B.1 Program Organization; foreground
AVR2070 43 8240B-AVR-06/09 Appendix B - Firmware API Overview This appendix discusses how the RUM firmware is implemented, what Application Programming Interface (API) functions are present, and gives some detail about what functions are called to implement the RUM protocol. The firmware source, ava...
Page 45 - Figure B-2 appInit overview
AVR2070 45 8240B-AVR-06/09 Figure B-2 appInit overview
Page 46 - Figure B-3 macTask overview
46 AVR2070 8240B-AVR-06/09 Figure B-3 macTask overview
Page 47 - Figure B-4 macDataIndication overview
AVR2070 47 8240B-AVR-06/09 Figure B-4 macDataIndication overview
Page 48 - Figure B-5 Frame routing overview
48 AVR2070 8240B-AVR-06/09 Routing Start Am I coordinator? Coord Send routing packet if necessary Resend packet to first router in chain Is dest a child of mine? No Send packet to child (destination) Yes Is this frame from parent? Router Packet is from child – resend to my parent No Yes Is destinati...
Page 49 - Figure B-6 Radio ISR overview
AVR2070 49 8240B-AVR-06/09 Figure B-6 Radio ISR overview
Page 52 - sixlowpan_DataIndication
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’) or somewhere outside the wireless network (‘ipglobal’). The source and destination ports are set, the payload loaded, and finally the UDP packet is sen...
Page 53 - Figure B-7 AVR 6LoWPAN DataIndication
AVR2070 53 8240B-AVR-06/09 Figure B-7 AVR 6LoWPAN DataIndication
Page 54 - Figure B-8 ARM 6LoWPAN DataIndication; B.4 Writing a Custom Application Using RUM; Make sure the hardware is compatible with RUM.
54 AVR2070 8240B-AVR-06/09 Figure B-8 ARM 6LoWPAN DataIndication sixlowpan_DataIndication() Start End Call 6LoWPAN Layer to uncompress packet to buffer Call IPv6 Layer on uncompressed packet B.4 Writing a Custom Application Using RUM RUM is meant to be a base upon which a custom application can be w...
Page 58 - B.4.4 Step 4: Verify that the RUM network is working on the hardware; enabled by setting the DEBUG flag to one,
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 cause a dump of the radio's register set. If these values look reasonable (not all zero's or 0xff's), then the radio is connected properly. If terminal display do...
Page 59 - C.3 6LoWPAN to the Rescue; across; Lo; power; C.4 A Crash Course in IPv6
AVR2070 59 8240B-AVR-06/09 Appendix C - IPv6 / 6LoWPAN Background Using IPv6 and 6LowPAN will be easier if an understanding of the underlying technologies is in place. This section assumes familiarity with the RUM network outlined in Appendix A. C.1 The problem with RF-Only Networks Atmel® provides ...
Page 61 - Node sends a neighbor advertisement, advertising it has address
AVR2070 61 8240B-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 address using stateless auto-configuration. It first auto-configures a link-local address by using the fe80:: prefix followed by an interface identifier des...
Page 62 - baad
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 longer require DHCP to acquire an address. IPv6 does support DHCPv6 (called stateful auto-configuration) should the extra features be required. C.5 6LoWPAN ...
Page 63 - UDP Header compression is supported by this implementation.; C.6 6LoWPAN Compressed Header
AVR2070 63 8240B-AVR-06/09 Traffic Class and Flow Label encoding A message will be properly parsed by end-nodes regardless if traffic class and flow label is compressed or uncompressed. However the value itself is not read, hence to avoid wasting space all messages should have the traffic class and ...
Page 65 - Appendix D - AT91SAM7X-EK Development Tools; uTasker can be compiled in a number of different environments: IAR; Crossworks and Eclipse; (with gcc). The discussion that follows here is based on the; D.1 Folder Structure; . The RUM specific source is located in the; Figure D-1-1 RUM Source and uTasker Support Download
AVR2070 65 8240B-AVR-06/09 Appendix D - AT91SAM7X-EK Development Tools uTasker can be compiled in a number of different environments: IAR TM , Rowley Crossworks and Eclipse TM (with gcc). The discussion that follows here is based on the Rowley Crossworks tool chain and the Eclipse tool chain. D.1 Fo...
Page 66 - Figure D-1-3 uTasker and RUM Integrated Folder Structure; D.2 Rowley Crossworks IDE
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 IDE that is lower cost alternative to other ARM development IDE’s on the market. There are many license models available. Rowley Crossworks and detailed...
Page 67 - \Rowley RUM Project File
AVR2070 67 8240B-AVR-06/09 5. Load J-Link .dll for debugging a. Target -> Connect Segger J-Link b. Should see “DLL WARNING” c. Select Tools -> Targets d. Highlight “Segger J-Link”, right-click and select “Properties” as shown in figure D-3-1. e. Find Properties window in lower right corner, ma...
Page 68 - Not needed for SAM7X
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 The Rowley Crossworks interface looks like the image shown in figure D-2-2. The Rowley compile option flags can be set via the IDE. Click on Project -&g...
Page 70 - Erase
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 reloads to keep static variables. To ensure that the memory is purged, the Erase jumper on the SAM7X board can be connected to ground. Doing so will comp...
Page 71 - Figure D-3-1 Eclipse Workspace Selection; In this example they are stored in the
AVR2070 71 8240B-AVR-06/09 Figure D-3-1 Eclipse Workspace Selection In this example they are stored in the f:\eclipse_projects directory. With that, the Welcome screen will appear: Figure D-3-2 Eclipse Welcome Screen Clicking the “workbench” icon on the far right will then open the workbench view: F...
Page 72 - figure D-3-4 Eclipse Import Selection Screen
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 “Existing Projects into Workspace”, and click next: figure D-3-4 Eclipse Import Selection Screen
Page 73 - Figure D-3-5 Eclipse Import Project Screen; Project Explorer
AVR2070 73 8240B-AVR-06/09 Point the root directory to the RUM source code. It should automatically find the project, and optionally one can check the “Copy projects into workspace” option to copy the source files to a local Eclipse workspace. Figure D-3-5 Eclipse Import Project Screen Upon hitting ...
Page 74 - Figure D-3-6 uTasker Project Properties Compiler Setting
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:\Program Files\yagarto\bin\arm-elf-gcc.exe : Figure D-3-6 uTasker Project Properties Compiler Setting
Page 75 - and; Figure D-3-7 uTasker Project Properties Binary Parser
AVR2070 75 8240B-AVR-06/09 Next open the “Settings” pane under “C/C++ Build”. Select the “GNU Elf Parser” checkbox, then point both the addr2line and c++filt command to point to the YAGARTO commands. In this case this was C:\Program Files\yagarto\bin\arm-elf- addr2line.exe and C:\Program Files\yagar...
Page 77 - . Ensure the “None” and
AVR2070 77 8240B-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, open the SAM-PROG program. Point to the file at Applications\UTaskerV1.3\GNU_SAM7X\uTaskerV1.3.bin . Ensure the “None” and “Auto-mode” checkbox are che...
Page 79 - Clear the line that says “GDB command file”:
AVR2070 79 8240B-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, and then set the project by hitting the “Browse” button and selecting the project. Assuming the project has successfully been built, pressing the “Searc...
Page 80 - Note the following lines are commented out:
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 reset 8 monitor sleep 10 # # Disable the watchdog and setup the PLL # # WDT_MR, disable watchdog monitor writeu32 0xFFFFFD44 = 0x00008000 # CKGR_MOR #monito...
Page 81 - Figure D-3-15 Eclipse Debug Perspective
AVR2070 81 8240B-AVR-06/09 this tutorial the external SAM-PROG tool is used instead. The flash breakpoints feature removes the limit of two hardware breakpoints. Figure D-3-14 Eclipse GDB Server - Commands Now hit the “Debug” button, and Eclipse should ask to open the debug perspective. With this op...
Page 84 - Table E-1 Signal Connections
84 AVR2070 8240B-AVR-06/09 Appendix E - Third-Party Reference Designs / Platforms This section describes various reference designs that can be purchased from distributors like Dresden Elektronik ( www.dresden-elektronik.de ) and TRT Technology ( www.trttech.com ). These platforms are supported withi...
Page 86 - 00 development board.
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 radio (in the 900 MHz band). Because this board operates in a different band from the RCB230 and RCB231 boards, RUM expects an RF212 radio on this platfor...
Page 87 - E.6 Compile Time Settings; Table E-2 Compile Time Options; RCB and REB based platforms:
AVR2070 87 8240B-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 family microcontroller, a temperature sensor, and a three axis accelerometer. This board is available from TRT Technology ( www.trttech.com ), along with...
Page 88 - Glossary
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 RFC-4944 online for details. Association - The method by which a new node joins the network. After association, a node is part of the network and can c...
Page 90 - Table of Contents
90 AVR2070 8240B-AVR-06/09 Table of Contents Features ............................................................................................... 1 1 Introduction ...................................................................................... 1 2 Stack Architecture ..........................
Page 93 - Disclaimer; Headquarters
8240B-AVR-06/09 Disclaimer Headquarters International Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USA Tel: 1(408) 441-0311 Fax: 1(408) 487-2600 Atmel Asia Unit 1-5 & 16, 19/F BEA Tower, Millennium City 5418 Kwun Tong Road Kwun Tong, Kowloon Hong Kong Tel: (852) 2245-6100 Fax: (852)...