Assembler and AVR-GCC?

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

When i try to build my files from AVR studio on windows, on my linux laptop (with kontrollerlab and avr-gcc) i get strange errors like:

testprojekt.s:0: Warning: end of file not at the end of a line; new line inserted
testprojekt.s:1: Can't open m8def.inc for reading: No such file or directory
testprojekt.s:3: Error: constant value required

Error 0 goes away if I make a new empty line at the end of the code.
Error 1... Well i though this file would be part of avr-gcc, but i can't seem to find it anywhere on my harddrive!?
Error 3, is this because of error 1? I don't really get it if not!

Any input appreciated, and yes i'm new to linux.

Brian

- Brian

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

OK, so you have to add an EOL at the end of the file and that fixes Error 0. Then do it.

m8def should be one of the studio files. It may be well buried but I've always found it there. The standard install appears to be

Atmel\AVR Tools\AVRAssembler\AppNotes\

and

Atmel\AVR Tools\AVRAssembler2\AppNotes\

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

Okay, so i need to copy the files from my windows computer?
(I don't have any folders like that, at least note ones i could find)

That's fine by me, but since i'm away for the holidays only with my laptop along with me i can't do that, i was hoping i could get to fiddle a little with my mega8 while i had some free time...

Brian

- Brian

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

do you want a copy of m8def? I can send one if you give me an e-mail address that accepts attachments.

Jim
wagnerj@proaxis.com

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

That'd be great, thanks! I just send an email to you.

Brian

- Brian

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

Okay i got the file, thanks Jim!
However it didn't help! Now i get a whole bunch of error messages, several hundred actually!

    ... M8DEF.INC:722: Error: expected comma after "SPIaddr"
    M8DEF.INC:723: Error: expected comma after "URXCaddr"
    M8DEF.INC:724: Error: expected comma after "UDREaddr"
    M8DEF.INC:725: Error: expected comma after "UTXCaddr"
    M8DEF.INC:726: Error: expected comma after "ADCCaddr"
    M8DEF.INC:727: Error: expected comma after "ERDYaddr"
    M8DEF.INC:728: Error: expected comma after "ACIaddr"
    M8DEF.INC:729: Error: expected comma after "TWIaddr"
    M8DEF.INC:730: Error: expected comma after "SPMRaddr"
    M8DEF.INC:732: Error: expected comma after "INT_VECTORS_SIZE"
    testprojekt.s:3: Error: constant value required

Brian

- Brian

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

Look for SPIaddr in M8DEF and see how the statement is written. Then look at the gcc statement format. I have not had any such problem with gcc. Are you explicitly including m8def.inc?

If so, read the avrlibc document and try io.h instead. Most of the gcc incude files are built to automatically select the appropriate params for your specific processor (I think that has to be called out in the make file in the MCU_TARGET statement).

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

This is the entirely wrong approach. m8def.inc is the include file meant
for the Atmel assembler. The GNU assembler (as part of AVR-GCC) uses a
different syntax, and you should use #include there. Please
read the avr-libc documentation for more explanations.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Thanks for your replies both of you. It turns out I made .include instead of #include but I still get:

    testprojekt.s:3: Error: Constant value required
No matter if i use the avr/io.h or the m8def.inc... :(
Btw. the code that causes the error 3 is:

	out	DDRD,R16

Brian

- Brian

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

Umm shouldn't that file be named tekprojekt.S and not tekprojekt.s ??

Cliff