Menu

New to AVR

2007-03-16
2013-05-28
  • benjaminzsj

    benjaminzsj - 2007-03-16

    Just started AVR programming, I use AVR studio in Windows but unfortunately my main OS is Ubuntu, so firstly thanks for your work!
    Now I have a problem compiling in Kontrollerlab. I have already in system binutil-avr, gcc-avr, avrdude and some others I can't name, but the code I run w/o a problem in AVR studio seems fail to compile. Below is the beginning of the code:
    .include "m64def.inc"
    .def a=r16    ;define a to be register r16
    .def b=r17
    .def c=r18
    .def d=r19
    .def e=r20
    main:        ;main is a label
    ...

    And here is the error message:
    avr-gcc -mmcu=atmega64 -g -O0 -c lab01.S -o lab01.o
    lab01.S:20:24: warning: no newline at end of file
    /tmp/ccdrpNnE.s: Assembler messages:
    /tmp/ccdrpNnE.s:11: Can't open m64def.inc for reading: No such file of directory
    lab01.S:2: Error: unknown pseudo-op: `.def'
    lab01.S:3: Error: unknown pseudo-op: `.def'
    lab01.S:4: Error: unknown pseudo-op: `.def'
    ...

    I guess I forgot to configure the environment and in fact I don't know how, hope you can guide me through this. Thanks.

     
    • Mario Boikov

      Mario Boikov - 2007-03-17

      Maybe it's a avr studio thing with the include files for asm. I haven't used asm myself since I only use C but I can't find any m64def.inc file on my system.

      Try put the inc files (and all the files which are included by that file) in the project and see if it solves the problem.

      /Mario

       
    • Martin Strasser

      Martin Strasser - 2007-03-18

      Hi!

      I don't know why there is a difference too, but try this:

      * Write an architecture definition on top like this: .arch atmega64
      * Change the .def a=b by #define a b
      * Write #include instead of .include
      * Completely remove the .include "m64def.inc" line

      Maybe this helps.

      regards,
      Martin

       

Log in to post a comment.