[TUT] [SOFT] Setting Up AVRStudio to use GCC

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I got tired of flipping back and forth between Programmer's Notepad and AVR Studio, I wrote a short tutorial on how to use WinAVR from within AVR Studio. Feedback appreciated. Hopefully I haven't duplicated anybody else's efforts...

Aaron

Attachment(s): 

Last Edited: Wed. Mar 22, 2006 - 12:31 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just a small point but step 5 starts "Open AVR Studio" but it's already open because you just entered that C code into blinky.c using it.

It may also be an idea to include a pointer to the "official" GCC plugin help too - while you are editing a GCC project in Studio then "AVR GCC Plug-in Help" is on the main help menu - otherwise you need to procced to Help-"AVR tools User Guide"-"AVR Studio"-"Project"-"AVR GCC Project"

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the feedback. I revised the file above.

Aaron

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When using Studio and WinAVR, I always have issues with the libraries when setting up support for float printf and float math.
I can't remember what it was that always gave me trouble but it has to do with exactly which libaries (some of the names are similar) to use and the order in which you add them??

JChristoff
Illinois

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well an Mfile generated Makefile does:

# Minimalistic printf version
PRINTF_LIB_MIN = -Wl,-u,vfprintf -lprintf_min

# Floating point printf version (requires MATH_LIB = -lm below)
PRINTF_LIB_FLOAT = -Wl,-u,vfprintf -lprintf_flt

# If this is left blank, then it will use the Standard printf version.
PRINTF_LIB = 
#PRINTF_LIB = $(PRINTF_LIB_MIN)
#PRINTF_LIB = $(PRINTF_LIB_FLOAT)


# Minimalistic scanf version
SCANF_LIB_MIN = -Wl,-u,vfscanf -lscanf_min

# Floating point + %[ scanf version (requires MATH_LIB = -lm below)
SCANF_LIB_FLOAT = -Wl,-u,vfscanf -lscanf_flt

# If this is left blank, then it will use the Standard scanf version.
SCANF_LIB = 
#SCANF_LIB = $(SCANF_LIB_MIN)
#SCANF_LIB = $(SCANF_LIB_FLOAT)

MATH_LIB = -lm

LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)

while in Studio you just have Project-Config options-libraries which presents a list of:

libm.a
libprintf_flt.a
libprintf_min.a
libscanf_flt.a
libscanf_min.a

So it would seem that you'd want to add (if necessary) one of libprintf_flt.a or libprintf_min.a then (if necessary) one of libscanf_flt.a or libscanf_min.a and then (if necessary) libm.a

Though I wouldn't have thought the order mattered but probably best to do what an Mfile would have done to be sure!

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I can't seem to open your tutorial. It seems to be in PHP and not in PDF. Is there a way to please post it here or upload the file as PDF. I am trying to set-up AVR Studio but when I try to build and run my file it keeps giving me an error message:

Loaded plugin AVR LCD Visualizer
Loaded plugin STK500
Loaded plugin AVR GCC
Loaded partfile: C:\Program Files\Atmel\AVR Tools\PartDescriptionFiles\ATmega16.xml
gcc plug-in: Error: Object file not found on expected location C:\Documents and Settings\Desktop\Project\studio projects\myRoom\ATMEGAMe\myRoom.elf

What do I do?!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

rename it from index.php to tut.pdf

Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow - thanks for that tutorial! At first I was quite overwhelmed with integrating all of the third part aps; I'm happy to see that I can stick with just 'Studio for learning.

I don't have an emulator just yet(ie JTAG ICE) but I presume you can do source-level debugging also?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PS - IE insisted on downloading the link as a PHP file also: try Firefox(worked for me).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear,

WinAVR_AVRStudio_Tutorial.pdf is not opening..Can anybody sent the file to dollar_124@yahoo.com..

Kudrot

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
rename it from index.php to tut.pdf

Just rename it with tutorial.pdf, it will open