ATmel Studio 4 Problem (looking for elf file?)

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

TL;DR Version:

 

I ran a basic program and I'm getting the following error:

avr-objcopy: 'TestProject.elf': No such file

 

I thought AVR Studio 4 worked with hex files, not elf files . . . did I miss a really basic configuration setting that's triggering this error?

 

Full Version (including what I've already tried):

 

I realize how incredibly dated this request is . . . but I have a super simple timer/GPIO application I was putting together for a friend so I thought I'd "quickly" throw something together.  I had an old STK500 and an ATmega8515 lying around, downloaded the latest version of AVR Studio (7, I believe) to find there is no support for an STK500 (makes sense, it's super old).  After trying a few different versions with similar problems, I just loaded AVR Studio 4 (as simple as it gets and what I originally used with an STK500) and decided to jump back in on this basic application.  I kept getting errors about an elf file . . . which was odd because I thought the default output in AVR Studio 4 was .hex, not .elf. 

 

I loaded an old project that I had working years ago, same problem.  Went to the newbie thread, followed the instructions to create a new project and just the move base level bit manipulation and I'm still getting the same error:

 

avr-objcopy: 'TestProject.elf': No such file

 

The code I'm trying to run is:

 

#include <avr/io.h>

int main(void)
{
  // Set Port B pins as all outputs
  DDRB = 0xff;

  // Set all Port B pins as HIGH
  PORTB = 0xff;

  return 1;
}

 

 

The full log is shown below:

 

rm -rf TestProject.o  TestProject.elf dep/* TestProject.hex TestProject.eep TestProject.lss TestProject.map
Build succeeded with 0 Warnings...
mmcu=atmega16a -Wall -gdwarf-2 -Os -std=gnu99 -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -MD -MP -MT TestProject.o -MF dep/TestProject.o.d  -c  ../TestProject.c
/usr/bin/sh: -Wall: command not found
make: [TestProject.o] Error 127 (ignored)
mmcu=atmega16a -Wl,-Map=TestProject.map TestProject.o     -o TestProject.elf
/usr/bin/sh: -Wl,-Map=TestProject.map: command not found
make: [TestProject.elf] Error 127 (ignored)
avr-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature  TestProject.elf TestProject.hex
avr-objcopy: 'TestProject.elf': No such file
make: *** [TestProject.hex] Error 1
Build failed with 1 errors and 0 warnings...

I'm not even sure someone's able to help with this, considering how old it is but if anyone can provide some insight on how to get this stupid error to go away so I can build a project, I'd greatly appreciate it!  I'm guessing it's some sort of configuration thing but I would've assumed the install itself would have set things up correctly by default.  I actually thought I'd be spending more time going through code and less time going through the setup process . . . heh.  Oh well. 

 

Thanks in advance!

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

AS7 supports STK500. Add it via Tools Menu. You must tell it the COM port..
.
AS4 supports C projects. And supports subsequent programming with the STK500.
.
Neither IDE appreciates you inventing your own build statements. Yes, you can do it but you need to know what you are doing.
.
Just study the Makefile that AS4 or AS7 generate for your project. Any home-brew that you want to invent should follow a similar strategy.
.
David.

Last Edited: Fri. Mar 23, 2018 - 08:00 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cradleinflames wrote:
I thought AVR Studio 4 worked with hex files, not elf files

The tools generate an ELF file, which is converted to HEX.

 

objcopy is the utility which does the conversion - so, clearly, this will fail if the ELF file was not generated ...

 

EDIT

 

Something like this

Image result for gcc build process

http://www.bogotobogo.com/cplusplus/embeddedSystemsProgramming_gnu_toolchain_ARM_cross_compiler.php

 

EDIT 2

 

Found a better diagram:

http://awawa.hariko.com/eclipse_...

 

EDIT 3

 

clawson uses that diagram here: https://www.avrfreaks.net/commen...

 

#GccToolchainFlow

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Fri. Mar 23, 2018 - 08:11 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You know when we were reviewing the stickies and someone suggested to unsticky a post I made at the top of the Studio forum about how to "fix" AS4.19 + WinAVR? Seems I made the right decision not to unsticky it. The first post is showing the classic signs of it not "seeing" the toolchain.

 

EDIT: this post... https://www.avrfreaks.net/forum/...

 

EDIT2: forgot to say that AS4.19 *will* automatically see "Atmel Toolchain for Windows" (I was convinced at the time it was a deliberate move to wean people off WinAVR!). The fact is that this is almost 10 years later and Atmel Toolchain for Windows *is* the better option now.

 

Oh and never:

return 1;

from an embedded micro program!!

Last Edited: Fri. Mar 23, 2018 - 09:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
someone suggested

 

Who would do a thing like that ... ?

 

blush

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

AS7 supports STK500. Add it via Tools Menu. You must tell it the COM port..
.
AS4 supports C projects. And supports subsequent programming with the STK500.
.
Neither IDE appreciates you inventing your own build statements. Yes, you can do it but you need to know what you are doing.
.
Just study the Makefile that AS4 or AS7 generate for your project. Any home-brew that you want to invent should follow a similar strategy.
.
David.

 

Yeah, definitely wasn't intending on telling it how to build the file . . . looks like it was an issue with AVR Studio 4.19.  As far as AS7 supporting it, sounds like I should move to AS7 rather than AS4, if it'll support the STK500.  Thanks for the information!

 

clawson wrote:

You know when we were reviewing the stickies and someone suggested to unsticky a post I made at the top of the Studio forum about how to "fix" AS4.19 + WinAVR? Seems I made the right decision not to unsticky it. The first post is showing the classic signs of it not "seeing" the toolchain.

 

EDIT: this post... https://www.avrfreaks.net/forum/...

 

EDIT2: forgot to say that AS4.19 *will* automatically see "Atmel Toolchain for Windows" (I was convinced at the time it was a deliberate move to wean people off WinAVR!). The fact is that this is almost 10 years later and Atmel Toolchain for Windows *is* the better option now.

 

Oh and never:

return 1;

from an embedded micro program!!

 

Heh, the funny thing is I thought I had downloaded 4.18 because I read about the issues with 4.19 but clearly, I didn't.  Should've recognized the issue earlier.  It's funny, I haven't been in this forum for years but it's good to see some of the same names around here. 

 

Clawson and David, I think you've both been here helping me since I got started with microcontrollers!  A little embarassing that my first issue coming back is something as simple as this (ESPECIALLY with it being stickied at the top . . . heh).  Thanks again for your help!

 

And thanks to everyone else who took the time to respond!  Now I can jump back in to the actual programming!  Have a good day/night, everyone!