| Author |
Message |
|
|
Posted: Sep 05, 2006 - 06:59 PM |
|


Joined: Mar 01, 2001
Posts: 4953
Location: Rocky Mountains
|
|
|
|
|
|
|
Posted: Sep 05, 2006 - 09:03 PM |
|


Joined: Dec 20, 2002
Posts: 7276
Location: Dresden, Germany
|
|
|
|
|
|
|
Posted: Sep 05, 2006 - 09:48 PM |
|


Joined: Mar 01, 2001
Posts: 4953
Location: Rocky Mountains
|
|
| I've updated the master toolchain list to add the links (that Joerg gave above) to the avr-libc, avrdude, and avarice bug lists. I've also added a list of GDB bugs for the AVR target. |
|
|
| |
|
|
|
|
|
Posted: Jun 24, 2012 - 01:11 PM |
|

Joined: Jun 23, 2012
Posts: 2
|
|
This is my first foray into AVR micros. I gave up attempting to use AS6; too many hang-ups. I'm now rebuilding an old ATmega8a system using command-line avr-gcc, avr-as and avr-ld. Learning as I go, I've had to convert the original source directives from IAR to AVR-Gnu.
Presently, I'm stuck trying to generate a viable hex file from C and Assembly objects. Please anyone who's used avr-ld (or GNU ld), I could use your help. Post or send me sample linker scripts, if you have them.
Thanks |
|
|
| |
|
|
|
|
|
Posted: Jun 24, 2012 - 03:00 PM |
|


Joined: Mar 27, 2002
Posts: 18549
Location: Lund, Sweden
|
|
|
Quote:
This is my first foray into AVR micros. I gave up attempting to use AS6; too many hang-ups.
This is the second post where you claim this with no details.
I'm not saying that AS6 is without faults, but if you told us about them they might be resolved.
One way to get all the linker scripts would be to install the WinAVR package. Then you would also get the MFile utility, which has a template makefile where you can deduce what commands are needed to generate a valid Inte Hex file.
Personally, I've never actually invoked avr-ld literally, but have always relied on letting the compiler driver do this (i.e. avr-gcc).
In the MFile utility tempate makefile the link stage rule is
Code:
%.elf: $(OBJ)
@echo
@echo $(MSG_LINKING) $@
$(CC) $(ALL_CFLAGS) $^ --output $@ $(LDFLAGS)
which might look like mumbo-jumbo, but essentially it does
Code:
avr-gcc <compiler_flags> <a_list_of_all_object_files> --output <name_of_ELF_output_file> <linker_flags>
Since the compiler flags will include the -mmcu flag the linker knows which linker script to pull. (I've never needed to tinker with an AVR linker script either).
The Hex file is produced by the avr-objcopy utility (using the ELF file as input). |
|
|
| |
|
|
|
|
|
Posted: Jun 25, 2012 - 09:58 AM |
|


Joined: Jul 18, 2005
Posts: 62292
Location: (using avr-gcc in) Finchingfield, Essex, England
|
|
Totally agree that you should use Mfile but if you don't want to download the whole of WinAVR get the .zip or tar.gz from here:
http://www.sax.de/~joerg/mfile/
You need tcl/tk to run it. To get a prebuilt copy for Windows go to http://www.tcl.tk/software/tcltk/8.0.html while for Linux use something like "apt-get install tcl" (Ubuntu).
In fact even without tcl/tk you can simply take the makefile_template file that is included and hand edit it for your own project (the Mfile utility just makes this editing a bit simpler using menu selections). |
_________________
|
| |
|
|
|
|
|