IntroductionThe µracoli team recently got one of the new RaspBee modules from dresden elektronik (DE) for evaluation. The RaspBee is a addon module for the popular Raspberry Pi computer and is equipped with an Atmega256RFR2. Due to its huge amount of RAM and FLASH and the integrated transceiver, this MCU is a smart choice for building ZigBee or IEEE 802.15.4 gateways.
The very popular Raspberry Pi needs probably no extra introduction. The credit card size ARM computer runs Linux (e.g. Raspbian) and it has USB and Ethernet interfaces, which makes it perfect for DIY projects.
Esentially the RaspBee consists of a radio module deRFmega256-23M12, is equipped with a ceramic chip antenna, the footprint for an U.FL coaxial connector, two LEDs and a (not populated) JTAG connector. The 12 pin header connects the RaspBee with the Raspberry Pi over the expansion connector. This connector provides power supply and serial port as well as one digital GPIO and the Reset pin.
The RaspBee is preprogrammed with a proprietary serial bootloader. For this bootloader, DE provides the tool GCFFlasher. It runs on the Raspberry Pi and provides a convenient and safe way to upgrade RaspBees firmware.
Caution: If you want to programm the RaspBee via the JTAG interface, the original DE bootloader firmware will be destroyed and because the flash protect fuses are set, there is no way to do backup in advance. The bootloader firmware makes the difference between the basic version (capable to handle 5 ZigBee nodes) and premium version (handles up to 200 ZigBee nodes). However upgrading the firmware with GCFFlasher is safe. You can always restore the firmware image from the DE download page.
Basic SetupBefore you can run your own firmware on the Raspberry Pi / RaspBee hardware, some prerequisite steps are required. For detailed information refer to the RaspBee User Manual.
- Free the serial Port /dev/ttyAMA0 from the getty process.
- Install the tool GCFFlasher on the Raspberry Pi
- Configure ssh access and preferably install your ssh-key. This may ease up the development and test from a regular PC.
Using µracoli Firmware on RaspBeeOn your development PC you will need the latest AVR toolchain that supports Atmega256RFR2. A good choice is either Atmel Studio 6.x on Windows or one of the stand-alone Atmel toolchains for Linux or Windows.
Download the latest µracoli source code package, e.g uracoli-src-0.4.1.zip and unzip it. In order to test the basic development flow, we will use the program xmpl_hif.c on the RaspBee. The following steps describe the installation from a Linux-PC:
# unzip uracoli-src-0.4.1.zip
# cd uracoli-src-0.4.1
# make -C src raspbee
# make -C xmpl -f xmpl_hif.mk raspbee
# avr-objcopy -I ihex -O binary bin/xmpl_hif_raspbee.hex bin/raspbee.bin
# scp bin/raspbee.bin email@example.com:/tmp
# ssh firstname.lastname@example.org sudo ./GCFFlasher /tmp/raspbee.bin
Now open a serial terminal program (e.g. minicom) on the Raspberry Pi and try to communicate with the RaspBee module. The default port settings are /dev/ttyAMA0 38400-8N1. You will see the following output after resetting the RaspBee with the command GCFFlasher -r:
HIF Example : raspbee : 38400 bit/s
Welcome in the world of µracoli!
DUMP : p=0x81d8, size=35
0000 : 57 65 6C 63 6F 6D 65 20 : Welcome :
0008 : 69 6E 20 74 68 65 20 77 : in the w :
0010 : 6F 72 6C 64 20 6F 66 20 : orld of :
0018 : B5 72 61 63 6F 6C 69 21 : .racoli! :
0020 : 0A 0D 00 : ... :