Forum: Mikrocontroller und Digitale Elektronik avr-eclipse probleme


von Tom (Gast)


Lesenswert?

Hallo Leute,

kurze Frage an die Eclipse-Kenner:

Ich habe mir eclipse 3.7 und das avr-plugin unter windows installiert.

Mein minimalistisches xmega programm (nur clock einstellen) kann ich 
auch compilieren. Allerdings tut eclipse so, als ob es zich Fehler geben 
würde, weil es anscheinend die ganzen Register nicht kennt.

Click ich auf "build", läufts in der console aber durch...

Kann man dagegen was tun?

==================

Code main.c:

#include <avr/io.h>        /* XMega 128A1 */

void Clock_init(void)
{
    OSC_XOSCCTRL = OSC_XOSCSEL_XTAL_16KCLK_gc | OSC_FRQRANGE_12TO16_gc;
    OSC.CTRL |= OSC_XOSCEN_bm;
    while(!(OSC.STATUS & OSC_XOSCRDY_bm));
    CCP = CCP_IOREG_gc;
    CLK.CTRL = CLK_SCLKSEL_XOSC_gc;
}


int  main() {

}


==================

eclipse sagt dazu:

Description  Resource  Path  Location  Type
Field 'CTRL' could not be resolved  main.c  /mgmt-xmega  line 13 
Semantic Error
Field 'CTRL' could not be resolved  main.c  /mgmt-xmega  line 16 
Semantic Error
Field 'STATUS' could not be resolved  main.c  /mgmt-xmega  line 14 
Semantic Error
Symbol 'CCP_IOREG_gc' could not be resolved  main.c  /mgmt-xmega  line 
15  Semantic Error
Symbol 'CCP' could not be resolved  main.c  /mgmt-xmega  line 15 
Semantic Error
Symbol 'CLK_SCLKSEL_XOSC_gc' could not be resolved  main.c  /mgmt-xmega 
line 16  Semantic Error
Symbol 'CLK' could not be resolved  main.c  /mgmt-xmega  line 16 
Semantic Error
Symbol 'OSC_FRQRANGE_12TO16_gc' could not be resolved  main.c 
/mgmt-xmega  line 12  Semantic Error
Symbol 'OSC_XOSCCTRL' could not be resolved  main.c  /mgmt-xmega  line 
12  Semantic Error
Symbol 'OSC_XOSCEN_bm' could not be resolved  main.c  /mgmt-xmega  line 
13  Semantic Error
Symbol 'OSC_XOSCRDY_bm' could not be resolved  main.c  /mgmt-xmega  line 
14  Semantic Error
Symbol 'OSC_XOSCSEL_XTAL_16KCLK_gc' could not be resolved  main.c 
/mgmt-xmega  line 12  Semantic Error
Symbol 'OSC' could not be resolved  main.c  /mgmt-xmega  line 13 
Semantic Error
Symbol 'OSC' could not be resolved  main.c  /mgmt-xmega  line 14 
Semantic Error

==================

Compiler sagt:


**** Build of configuration Release for project mgmt-xmega ****

make all
Building file: ../main.c
Invoking: AVR Compiler
avr-gcc -Wall -Os -fpack-struct -fshort-enums -std=gnu99 -funsigned-char 
-funsigned-bitfields -mmcu=atxmega128a1 -DF_CPU=32000000UL -MMD -MP 
-MF"main.d" -MT"main.d" -c -o "main.o" "../main.c"
Finished building: ../main.c

Building target: mgmt-xmega.elf
Invoking: AVR C Linker
avr-gcc -Wl,-Map,mgmt-xmega.map -mmcu=atxmega128a1 -o "mgmt-xmega.elf" 
./main.o
Finished building target: mgmt-xmega.elf

Invoking: AVR Create Extended Listing
avr-objdump -h -S mgmt-xmega.elf  >"mgmt-xmega.lss"
Finished building: mgmt-xmega.lss

Create Flash image (ihex format)
avr-objcopy -R .eeprom -O ihex mgmt-xmega.elf  "mgmt-xmega.hex"
Finished building: mgmt-xmega.hex

Create eeprom image (ihex format)
avr-objcopy -j .eeprom --no-change-warnings --change-section-lma 
.eeprom=0 -O ihex mgmt-xmega.elf  "mgmt-xmega.eep"
Finished building: mgmt-xmega.eep

Invoking: Print Size
avr-size --format=avr --mcu=atxmega128a1 mgmt-xmega.elf
AVR Memory Usage
----------------
Device: atxmega128a1

Program:     610 bytes (0.4% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


Finished building: sizedummy


**** Build Finished ****



danke!

von hp-freund (Gast)


Lesenswert?

Hast Du ein Makefile Projekt erstellt oder lässt Du eclipse selbst das 
makefile erstellen?
Probier noch mal das funktionierende Projekt als Makefile Projekt zu 
importieren.

von Tom (Gast)


Lesenswert?

hallo,

war ein neues Projekt.

Warum auch immer, notwendig ist:

#include <avr/iox128a1.h>

obwohl die xmega128 konstante defined ist...


nun klappts

von Zeichnungen und Screenshots (Gast)


Lesenswert?

Das, was Eclipse meint und was der Compiler sieht, sind
manchmal 2 Paar Stiefel, besonders bei Makefile-Projekten.

Eclipse bezieht sich auf das, was in den
Projekteinstellungen gesetzt ist (spez. PATHs and Symbols), der Compiler 
sieht, was ihm das Makefile vorgibt.

von Cyblord -. (cyblord)


Lesenswert?

Index -> Rebuild

von Max H. (mmfh)


Lesenswert?

Hallo Leute :)!

Beim Durchforsten des Internets nach einer Lösung für mein Problem bin 
ich auf diesen Beitrag gestoßen.

Ich habe in Eclipse (Version Juno Service Release 1) ein C Projekt 
erstellt und verschiedene (lauffähige!) .c- und .h-Dateien importiert. 
Bei einem Klick auf die Schaltfläche "Build" erhalte ich dieselben 
Fehlermeldungen wie Tom.

Hier wurden bereits ein paar Antworten auf die Problemstellung gegeben. 
Leider kann ich als Neueinsteiger noch nicht viel damit anfangen.

Könnt ihr mir bitte bei der Behebung meines Problems helfen? Ich wäre 
euch sehr dankbar!

Falls ihr noch Zusatzinformationen braucht, gebt mir bitte Bescheid!

Vielen Dank schon mal im Voraus!

Viele Grüße,
Max

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.