Skip to content

Software

Aaron Mueller edited this page Jun 9, 2011 · 7 revisions

To get the device working, the microcontroller needs a bootloader and a firmware. Both have to compile first on a PC and flash onto the microcontroller with a programmer. The prerequirements for the following steps are:

  • A host system to build the bootloader and the firmware. You don't need them if you use the precompiled versions. To build the latest code, a Unix or OSX system with the proper tools is prefered. You need the avr-gcc to compile the source and avrdude to transfer the binary to the microcontroller.
  • A programmer to transfer the bootloader and the firmware to the device and set some fuse bits. All sorts of programmers works here. Iy you don't have one, look at this list. Good programmers are the AVRDragon, STK500 or the USBProg. All programmers are multi purpose programmers to use with all kinds of (AVR) microcontrollers.
  • If your computer doesn't have a serial RS232 interface, you need a serial to USB adapter to connect to the HackStick from your computer.

Set up the software

The first step is to make sure to have installed all needed software packages and tools to build the firmware and the bootloader and finally to flash the microcontroller from within your computer. If you are using Ubuntu, install the following packages.

apt-get install avrdude
apt-get install gcc-avr binutils-avr avr-libc

Connect the programmer to the microcontroller

There are several programmers to use. If you want to use a **AVR ISP 2 ** (mk2)compatible programmer, you can use a simple breadboard and some wires to blash the device. Take a look into the data sheet and connect your programmer. Don't forget to plug in a 5V supply and an external quartz crystal with two 27p capacitors (After setting the fuses to work with the external quartz, the microcontroller does nothing if you don't connect it to an external clock).

Compile and flash the Bootloader

Compile and flash the Firmware

Set the fuses

Work with the interactive console

Clone this wiki locally