Difference between revisions of "Atmel STK500 on Linux"

From Klaus' wiki
Jump to: navigation, search
Line 96: Line 96:
Continue from the section ''Creating your first AVR project'' [http://interactive-matter.eu/how-to/developing-software-for-the-atmel-avr-with-avr-eclipse-avr-gcc-avrdude/ here].
Continue from the section ''Creating your first AVR project'' [http://interactive-matter.eu/how-to/developing-software-for-the-atmel-avr-with-avr-eclipse-avr-gcc-avrdude/ here].
'''Note:''' For some, by me yet unknown, reason, the Debug configuration does not build a .hex file. Consequently use the Release configuration.
Note: In order to use the Debug configuration in the project properties check the '''Generate HEX file for flash memory'''.
[[Image:AVRDude3.png|600 px]]

Revision as of 12:03, 23 January 2013

In order to develop on the STK500 beginners board on a Fedora (in this case 17) follow these instructions.


Inspired by [this] link.

Install Eclipse CDT in its latest version. Remember to choose the 32 or 64 bit edition that suits your OS. Place it in a separate directory in order to keep it clean of all other plugins you are using.

Start eclipse and in the Help menu select Install new software. In the Work with enter http://avr-eclipse.sourceforge.net/updatesite/ and press enter. Select the AVR plugin and install it. Takes a while, be patient.


Using yum install support for the AVR devices,

$ yum install avrdude avr-gcc* avrice avr-binutils avr-gdb avra avrdude uisp

Attach your USB2serial converter (assuming that there is no serial port on your brand new laptop).

To detect which tty the port is assigned to issue:

$ ll /dev/ttyU*

typical output are

$ ll /dev/ttyU*
crw-rw----. 1 root dialout 188, 0 Jan 21 11:22 /dev/ttyUSB0

Because of the default access rights an ordinary user cannot access the port. There are two solutions to this. Change the access rights issuing:

$ chmod 666 /dev/ttyUSB0

if you are root - otherwise prepend with a sudo.

This have to be done everytime you connect the USB2serial converter.

The other option is to become a member of the dialout group. This is a permanent solution.

$  usermod -a -G dialout <your-loginname>

Now connect the serial cable to the RS232 CTRL connector on the STK500 board. Attach power. Remember do it like this in the future; the STK board can be very sensitive to connecting and disconnecting cables while powered.

Issue this command to test the connection to the board (only the first line is the command, the rest is the output):

$ avrdude -c stk500 -p m32 -P /dev/ttyUSB0
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e9502
avrdude: safemode: Fuses OK
avrdude done.  Thank you.

Configuring Eclipse

Next thing is to configure Eclipse to work with avrdude and the rest of the utils.

First open the Window->Preferences dialogue.

Select and expand the AVR entry.


The AVRDude configuration dialogue

Click Add and select Atmel STK500v2, name the configuration and enter in the Override default port (-P) field /dev/ttyUSB0, if this was the port you found a little while ago.


The STK500 configuration has been selected

Click OK and Apply when back in the main Preferences dialogue.

Now click on the Path entry. BE PATIENT. It may take many, many minutes if not hours, but let it run until the dialogue shows up. Ensure that the Disable search for system paths at startup is checked. You can at any time adjust the paths if needed.


The Path configuration dialogue

Now Eclipse is ready for programming.

Continue from the section Creating your first AVR project here.

Note: In order to use the Debug configuration in the project properties check the Generate HEX file for flash memory.