Version 57 (modified by agr, 7 months ago)

--

Quick Start Guide

The current version of the source will not be publicaly available until the beta-release milestone is complete.


Installing the Toolchain

You can install the toolchain for either:

Once you have installed the toolchain from the above link, you can download the latest release snapshot of the source from our Downloads page.

To use the micaZ you will need to install uisp for the MIB510 or MIB520. See micaZ-quick-start page for instructions.


Checking out the Source

Users can checkout a development copy of the code from subversion by typing:

svn checkout svn://nanork.org/srv/svn/repos/nano-RK

or go to our releases page for code snapshots.


Testing the board

Once everything is installed, try compiling and downloading a project.

  • Change Directories to the project you want to compile
    cd nano-RK/projects/examples/basic_task
    
  • Set the platform type in the makefile
    # Platform name  cc2420DK, firefly, micaZ
    PLATFORM = firefly2
    
  • Compile the code
    make clean
    make
    
  • You can also set the NODE_ADDR #define that will be passed to your C code. If no value is provided, it defaults to 0.
    make clean
    make NODE_ADDR=5
    
  • You should see something like this if it compiles correctly:
    Size after:
    main.elf  :
    section     size      addr
    .data        194   8388864
    .text      13918         0
    .bss         992   8389058
    .stab      36204         0
    .stabstr   15067         0
    Total      66375
    
    
    
    Errors: none
    Platform: firefly2
    -------- end --------
    
  • Connect Programming Board
    • For first time users go to our connecting-firefly-programmer page for correct cable orientations
    • Turn on the programming board and make sure the power led lights
    • In linux type "dmesg", you should see something like this:
      usb 2-2: new full speed USB device using uhci_hcd and address 3
      usb 2-2: new device found, idVendor=0403, idProduct=6010
      usb 2-2: new device strings: Mfr=1, Product=2, SerialNumber=0
      usb 2-2: Product: Dual RS232
      usb 2-2: Manufacturer: FTDI
      usb 2-2: configuration #1 chosen from 1 choice
      ftdi_sio 2-2:1.0: FTDI USB Serial Device converter detected
      drivers/usb/serial/ftdi_sio.c: Detected FT2232C
      usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB0
      ftdi_sio 2-2:1.1: FTDI USB Serial Device converter detected
      drivers/usb/serial/ftdi_sio.c: Detected FT2232C
      usb 2-2: FTDI USB Serial Device converter now attached to ttyUSB1
      
    • This shows that two serial ports have been started at /dev/ttyUSB0 and /dev/ttyUSB1
      • The lower numbered port (/dev/ttyUSB0) is for debug messages
      • The higher numbered port (/dev/ttyUSB1) is for the downloader
    • In windows, check in the device manager to see if the programming board loaded as two COM ports
      • The lower numbered port (COM1) is for debug messages
      • The higher numbered port (COM2) is for the downloader
      • These port numbers will likely be different on different computers
  • Set FireFly (version 2.2) Node Fuses
    • If this is the first time you have programmed a FireFly node, make sure the fuses are set correctly. Once the fuses are set, they should remain programmed unless there is a downloading problem later. The following avrdude commands set the FireFly fuses using the FireFly debugger (replace /dev/ttyUSB1 with the correct com port if different). Note that the -F forces the download for the atmega1281 using the atmega128 as the device code since many versions of avrdude will not recognize the atmega1281.
      avrdude -b115200 -F -p atmega128 -P /dev/ttyUSB1  -c avr910 -V -U lfuse:w:0xE6:m -v
      avrdude -b115200 -F -p atmega128 -P /dev/ttyUSB1  -c avr910 -V -U hfuse:w:0xD9:m -v
      avrdude -b115200 -F -p atmega128 -P /dev/ttyUSB1  -c avr910 -V -U efuse:w:0xFF:m -v
      
  • Download the code
    make program
    
  • You should see something like this if the code downloads correctly:
    avrdude: Device signature = 0x1e9702
    avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed         
    To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file "main.hex"
    avrdude: input file main.hex auto detected as Intel Hex
    avrdude: writing flash (14108 bytes):
    
    Writing | ################################################## | 100% 7.07s
    
    
    
    avrdude: 14108 bytes of flash written
    
    avrdude: safemode: Fuses OK
    
    avrdude done.  Thank you.
    
  • Open up a terminal program like Minicom (see Minicom page for help)
  • Configure the program for:
    • /dev/ttyUSB0 as the port path
    • Set the baudrate to 115200 8N1 with no Hardware / Software Flow Control
  • You should see something like this:
    My node's address is 5
    Task1 PID=1
    Task1 cnt=0
    Task1 cnt=1
    Task2 cnt=1
    Task3 cnt=1
    Task1 cnt=2
    Task4 cnt=1
    ...