kein objektfile mit avr-c++

OP #703594
Lesenswert?

Hallo,

sitze hier vor einem "qfix-Robotic-Kit" mit einem atmel-controller.
Leider schlägt aus irgendeinem Grund das kompilieren der Testdatei fehl.

1
kerberos@debian:~/crash-bobby/software/ledTest$ avr-c++ -O2 --mmcu=atmega32
2
-I ../include -o ledtest.elf ledTest.cc
3

4
cc1plus: error: unrecognized command line option "-fmmcu=atmega32"

Lasse ich testhalber den Schalter "--mmcu" weg, dann gibts jede Menge
Probleme mit undefinierten Konstanten oder Variablen.

1
kerberos@debian:~/crash-bobby/software/ledTest$ avr-c++ -O2 -I ../include -o ledtest.elf ledTest.cc
2
In file included from ../include/qfix.h:12,
3
                 from ../include/qfixBobbyBoard.h:12,
4
                 from ledTest.cc:1:
5
/usr/local/avr/lib/gcc/avr/3.4.2/../../../../avr/include/avr/io.h:254:6: warning: #warning "device type not defined"
6
In file included from ledTest.cc:1:
7
../include/qfixBobbyBoard.h: In function `void SIG_OVERFLOW0()':
8
../include/qfixBobbyBoard.h:131: error: `PORTC' undeclared (first use this function)
9
../include/qfixBobbyBoard.h:131: error: (Each undeclared identifier is reported only once for each function it appears in.)../include/qfixBobbyBoard.h: In function `void initTimer()':
10
../include/qfixBobbyBoard.h:147: error: `TCCR0' undeclared (first use this function)
11
../include/qfixBobbyBoard.h:148: error: `TIMSK' undeclared (first use this function)
12
../include/qfixBobbyBoard.h: In constructor `BobbyBoard::BobbyBoard()':
13
../include/qfixBobbyBoard.h:157: error: `DDRA' undeclared (first use this function)
14
../include/qfixBobbyBoard.h:158: error: `PORTA' undeclared (first use this function)
15
../include/qfixBobbyBoard.h:159: error: `ADCSRA' undeclared (first use this function)
16
../include/qfixBobbyBoard.h:164: error: `DDRB' undeclared (first use this function)
17
../include/qfixBobbyBoard.h:165: error: `PORTB' undeclared (first use this function)
18
../include/qfixBobbyBoard.h:169: error: `DDRC' undeclared (first use this function)
19
../include/qfixBobbyBoard.h:170: error: `PORTC' undeclared (first use this function)
20
../include/qfixBobbyBoard.h:173: error: `DDRD' undeclared (first use this function)
21
../include/qfixBobbyBoard.h:174: error: `PORTD' undeclared (first use this function)
22
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::ledOn(int)':
23
../include/qfixBobbyBoard.h:183: error: `PORTB' undeclared (first use this function)
24
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::ledOff(int)':
25
../include/qfixBobbyBoard.h:190: error: `PORTB' undeclared (first use this function)
26
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::ledsOff()':
27
../include/qfixBobbyBoard.h:195: error: `PORTB' undeclared (first use this function)
28
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::powerOn(int)':
29
../include/qfixBobbyBoard.h:208: error: `PORTD' undeclared (first use this function)
30
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::powerOff(int)':
31
../include/qfixBobbyBoard.h:215: error: `PORTD' undeclared (first use this function)
32
../include/qfixBobbyBoard.h: In member function `bool BobbyBoard::button(int)':
33
../include/qfixBobbyBoard.h:228: error: `PINA' undeclared (first use this function)
34
../include/qfixBobbyBoard.h: In member function `void BobbyBoard::motor(int, int)':
35
../include/qfixBobbyBoard.h:248: error: `PORTC' undeclared (first use this function)
36
../include/qfixBobbyBoard.h: In member function `int BobbyBoard::analog(int)':
37
../include/qfixBobbyBoard.h:299: error: `ADMUX' undeclared (first use this function)
38
../include/qfixBobbyBoard.h:300: error: `ADLAR' undeclared (first use this function)
39
../include/qfixBobbyBoard.h:301: error: `ADCSRA' undeclared (first use this function)
40
../include/qfixBobbyBoard.h:301: error: `ADSC' undeclared (first use this function)
41
../include/qfixBobbyBoard.h:303: error: `ADCH' undeclared (first use this function)
42
../include/qfixBobbyBoard.h: In member function `bool BobbyBoard::digital(int)':
43
../include/qfixBobbyBoard.h:312: error: `PINB' undeclared (first use this function)


Hängt das Problem mit den undefinierten Konstanten oder Variablen nun
irgendwie mit dem Schalter "--mmcu" zusammen oder sind diese einfach 
nicht definiert?

Wie kann ich das Problem lösen?

MfG
#703605
Lesenswert?

> /usr/local/avr/lib/gcc/avr/3.4.2/../../../../avr/include/avr/io.h:254:6:
> warning: #warning "device type not defined"

Das ist der Schlüssel. Wenn du dem Compiler nicht sagen willst, für 
welchen Controllertyp er Code erzeugen soll, dann verweigert er die 
Zusammenarbeit... würde ich auch machen ;-)
OP #703612
Lesenswert?

Ja klingt logisch!

Was passt ihm dann nicht an :
1
kerberos@debian:~/crash-bobby/software/ledTest$ avr-c++ -O2 --mmcu=atmega32
2
-I ../include -o ledtest.elf ledTest.cc
3

4
cc1plus: error: unrecognized command line option "-fmmcu=atmega32"

avr-c++ kennt diese Option nicht!! Hab ich mich irgendwie vertippt, wie 
lautet es korrekt? Diese Angaben stammen von Datenblatt des Herstellers!
Es sollte so eigentlich funktionieren....

MfG

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren