Smart Packet Radio Firmware
Firmware for the Smart Packet Radio
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Programming the Smart Packet Radio

Programming in Windows

Required tools:-

Modifying the Code

  1. Open up the SmartPacketRadio.cproj file in Atmel Studio 6.
  2. Modify the code of the firmware accordingly. If any new files have been added, be sure to update the makefile included in the project.
  3. Once modified, go to Build > Rebuild Solution.
  4. Fix any errors stated and ensure that the .hex file is successfully generated.
Note
At some point, the project may start to exceed the memory capacity of the Smart Packet Radio. To squeeze some extra code into the project, go to Project > SmartPacketRadio Properties > Toolchain tab > Optimization then select the Optimization Level to be "Optimize for size".

Uploading the code

  1. Generate the .hex file in Atmel Studio 6 as instructed above.
  2. Plug in the Smart Packet Radio and depress the Reset push button follow by the HWB then release in the same order. This places the microcontroller into DFU mode and allows it to be programmed via USB. NOTE: No fuses on the microcontroller can be changed via USB.
  3. Launch the FLIP application.
  4. From the toolbar “Device -> Select” and choose AT90USB1286 from the list.
  5. In the FLIP application, load in the .hex file in File > Load hex file. The generated .hex file should be in SmartPacketRadio/Debug
  6. Select the “Open communications medium” button and click USB. Then click “Open”. If this doesn’t work reset the device and repeat from step 1.
  7. Ensure "Erase", "Program" and "Verify" are checked and click "Run". Once done, click "Start Application" with the Reset checkbox ticked.

Programming in Linux

Required packages:-

  • gcc-avr
  • binutils-avr
  • avr-libc
  • dfu-programmer

Here are the steps for programming the microcontroller of the Smart Packet Radio. To demonstrate the process, we will use a short C program. The program, when runs, makes the LED1 of the Smart Packet Radio to blink at 1 Hz.

  1. Install the required tools
    sudo apt-get install gcc-avr binutils-avr avr-libc dfu-programmer
    
  2. Copy the Makefile and spr_mcu_minimal_test.c into a working directory.
  3. cd to this working directory and make. You should now have spr_mcu_minimal_test.hex created.
  4. Get the board into flashing mode: press RST, hold RST and press HWB, release RST, release HWB. Only the two power LEDs should be alight now.
  5. Erase the node:
    sudo dfu-programmer at90usb1286 erase
    
  6. Flash the node:
    sudo dfu-programmer at90usb1286 flash spr_mcu_minimal_test.hex
    
  7. Reset the node:
    sudo dfu-programmer at90usb1286 reset
    
  8. Press the RST button on the board to start running the freshly loaded firmware