Difference between revisions of "Atmel STK500 on Linux"

From Klaus' wiki
Jump to: navigation, search
Line 44: Line 44:
 
The other option is to become a member of the ''dialout'' group. This is a permanent solution.
 
The other option is to become a member of the ''dialout'' group. This is a permanent solution.
  
<source lang="bash>
+
<source lang="bash">
 
$  usermod -a -G dialout <your-loginname>
 
$  usermod -a -G dialout <your-loginname>
 
</source>
 
</source>
Line 67: Line 67:
  
 
===Configuring Eclipse===
 
===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.
 +
 +
[[Image:AVRDude.png|600px]]½½½½½½
 +
 +
'''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.
 +
 +
[[Image:AVRDude1.png|600px]]
 +
 +
'''The STK500 configuration has been selected'''
 +
 +
Click '''OK''' and '''Apply''' when back in the main Preferences dialogue.

Revision as of 11:45, 21 January 2013

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

Eclipse

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.

Bin-utils

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.

AVRDude.png½½½½½½

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.

AVRDude1.png

The STK500 configuration has been selected

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