PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Erstes eigenes Programm



Nix_Blicker
02.09.2008, 20:10
Hallo!
Ich hab heute mal versucht ein kleines eigenes Programm zu schreiben, nur leider finde ich die Syntax von C etwas ungewohnt...
Hier ist laut Compiler der Wurm drin:



#include "asuro.h"

int main(void)
{

Init();

MotorDir(FWD, FWD);
MotorSpeed(120, 120);
StatusLED(GREEN);
while (PollSwitch()==0) {SerWrite("Alles OK!\n", 10)}
MotorSpeed(0, 0);
StatusLED(RED);


while(1);
return 0;
}


Der Fehler ist angeblich in der "while" Zeile.
Bitte helft mir! ;)
Danke!
Mfg

the_Ghost666
02.09.2008, 22:42
Da fehlt wohl ein Semikolon.


#include "asuro.h"

int main(void)
{

Init();

MotorDir(FWD, FWD);
MotorSpeed(120, 120);
StatusLED(GREEN);
while (PollSwitch()==0)
{
SerWrite("Alles OK!\n", 10);
}
MotorSpeed(0, 0);
StatusLED(RED);


while(1);
return 0;
}

Versuchs mal so

Ferdinand
03.09.2008, 00:03
Hi

Kann mir jemand hierbei helfen ich blick nicht durch was ich falsch mache


#include <asuro.h>
int main(void)
{
unsigned int data[2];
Init();
FrontLED(ON);
MotorDir(FWD,FWD);
while (1)
{
LineData(data);
if (data[0] > data[1])
{
MotorSpeed(200,150);
}
else
{
MotorSpeed(150,200);
}
}
return 0;
}

Danke !

hai1991
03.09.2008, 07:26
hallo ferdinand

könntest du dein problem vl etwas genauer beschreiben!
was funktioniert denn nicht?
- kommen errors oder warnungen beim kompilieren? dann bitte posten
- fährt er nicht wie du willst? dann genaue beschreibung
- oder hast du andere probleme?

wenn du nur den code postest und uns keinen tipp gibst wo wir zu suchen anfangen sollen, ist das für uns nicht so leicht

thx und

the_Ghost666
03.09.2008, 09:27
Vor allem, wenn die Syntax (zumindest mir) nicht so geläufig ist. Ist es für Linedata der richtige Datentyp? schonmal mit LineData(&daten) probiert (also Übergabe der Adresse)?

radbruch
03.09.2008, 09:39
Wenn sich die Lib im selben Verzeichniss wie das Programm befindet muss es so heisen:

#include "asuro.h"

Ferdinand
03.09.2008, 12:45
Ich benutze Asuroflash

Das ist der Ferhler report

Asuro Flash (Alias Eierlegendewollmilchsau) V1.4.6.56 (c) O.O. Müller 2008
User has admin rights.
Processor branding Genuine Intel(R) CPU T2500 @ 2.00GHz, OS WINXP
Hello Administrator on DONALD, have fun :)

>Session Environment Variables:
AF_AVRDIR=C:\WinAVR
AF_PROJECT=Project1
AF_SOURCE_FILES=
AF_ASM_SRC_FILES=
AF_PRGDIR=C:\Programme\AsuroFlash
AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
AF_ASURO_LIB_PATH=%AllUsersProfile%\asuro_lib\lib
>Ready.
>Session Environment Variables:
AF_AVRDIR=C:\WinAVR
AF_PROJECT=test1
AF_SOURCE_FILES=test1.c
AF_ASM_SRC_FILES=
AF_PRGDIR=C:\Programme\AsuroFlash
AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
AF_ASURO_LIB_PATH=%AllUsersProfile%\asuro_lib\lib
File test1.c saved.
>Default make_all.cmd file created.
>Default makefile created.
Make
C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash>C:\WinAVR\utils\bin\make.exe all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include test1.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test1.d; \
[ -s test1.d ] || rm -f test1.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include test1.c -o test1.o
test1.c:1:19: asuro.h: No such file or directory
test1.c: In function `main':
test1.c:5: warning: implicit declaration of function `Init'
test1.c:6: warning: implicit declaration of function `FrontLED'
test1.c:6: error: `ON' undeclared (first use in this function)
test1.c:6: error: (Each undeclared identifier is reported only once
test1.c:6: error: for each function it appears in.)
test1.c:7: warning: implicit declaration of function `MotorDir'
test1.c:7: error: `FWD' undeclared (first use in this function)
test1.c:10: warning: implicit declaration of function `LineData'
test1.c:13: warning: implicit declaration of function `MotorSpeed'
make.exe: *** [test1.o] Error 1

ExitCode 2
>Ready.


ich vermute mal das er irgendwelche dataien nicht finden kann?

radbruch
03.09.2008, 13:11
test1.c:1:19: asuro.h: No such file or directory
asuro.h wird nicht gefunden weil es zwischen <> steht und deshalb im AVR-Suchpfad gesucht wird.

Ferdinand
03.09.2008, 14:18
das kanns auch nicht sein den das gerüst war ja schon von ASUROflasch for gegeben ich habs getestet und das kam rauss.


Asuro Flash (Alias Eierlegendewollmilchsau) V1.4.6.56 (c) O.O. Müller 2008
User has admin rights.
Processor branding Genuine Intel(R) CPU T2500 @ 2.00GHz, OS WINXP
Hello Administrator on DONALD, have fun :)

>Session Environment Variables:
AF_AVRDIR=C:\WinAVR
AF_PROJECT=Project1
AF_SOURCE_FILES=
AF_ASM_SRC_FILES=
AF_PRGDIR=C:\Programme\AsuroFlash
AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
AF_ASURO_LIB_PATH=%AllUsersProfile%\asuro_lib\lib
>Ready.
>Session Environment Variables:
AF_AVRDIR=C:\WinAVR
AF_PROJECT=Project1
AF_SOURCE_FILES=test1.c
AF_ASM_SRC_FILES=
AF_PRGDIR=C:\Programme\AsuroFlash
AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
AF_ASURO_LIB_PATH=%AllUsersProfile%\asuro_lib\lib
File test1.c saved.
>Default make_all.cmd file created.
>Default makefile created.
Make
C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash>C:\WinAVR\utils\bin\make.exe all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include test1.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test1.d; \
[ -s test1.d ] || rm -f test1.d
test1.c:1:19: asuro.h: No such file or directory
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include test1.c -o test1.o
test1.c:1:19: asuro.h: No such file or directory
test1.c: In function `main':
test1.c:5: warning: implicit declaration of function `Init'
test1.c:6: warning: implicit declaration of function `FrontLED'
test1.c:6: error: `ON' undeclared (first use in this function)
test1.c:6: error: (Each undeclared identifier is reported only once
test1.c:6: error: for each function it appears in.)
test1.c:7: warning: implicit declaration of function `MotorDir'
test1.c:7: error: `FWD' undeclared (first use in this function)
test1.c:10: warning: implicit declaration of function `LineData'
test1.c:13: warning: implicit declaration of function `MotorSpeed'
C:\WinAVR\utils\bin\make.exe: *** [test1.o] Error 1

ExitCode 2
>Ready.


ich glaube das er die dataien von asurolib nicht findet nur weiss ich nicht wo ich die hin tuhen soll.

thx

Osser
03.09.2008, 14:56
Hi Ferdinand,

der AVR Pfad muss im Config Dialog richtig eingestellt sein (siehe bildchen).
http://www.img-share.com/image/987.jpeg
(config dialog)


Stay tuned,

O.



PS. Hab das dialogbildchen aus 'nem anderen Thread benutzt, deshalb musst Du bitte die frei definierbaren Variablen ignorieren.

Ferdinand
03.09.2008, 15:50
ok

Ich habe den path zu AsuroLib geendert und jetst kommt das


>Ready.
>Session Environment Variables:
AF_AVRDIR=C:\WinAVR-20080610
AF_PROJECT=Project1
AF_SOURCE_FILES=test1.c
AF_ASM_SRC_FILES=
AF_PRGDIR=C:\Programme\AsuroFlash
AF_PRJDIR=C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash
AF_LIB_PATH=C:\AsuroFlash\AsuroLib-v280rc1\lib
File test1.c saved.
>Default make_all.cmd file created.
>Default makefile created.
Make
C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash>C:\WinAVR-20080610\utils\bin\make all
set -e; avr-gcc -MM -mmcu=atmega8 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test1.d; \
[ -s test1.d ] || rm -f test1.d
-------- begin --------
avr-gcc --version
avr-gcc (WinAVR 20080610) 4.3.0
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.lst -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.c -o test1.o
avr-gcc -mmcu=atmega8 -DF_CPU=8000000UL -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test1.o -IC:\Programme\AsuroFlash\include -IC:\AsuroFlash\AsuroLib-v280rc1\lib\inc test1.o --output Project1.elf -Wl,-Map=Project1.map,--cref -IC:\Programme\AsuroFlash\lib -LC:\AsuroFlash\AsuroLib-v280rc1\lib -lm -lasuro
test1.o: In function `main':
C:\Dokumente und Einstellungen\All Users\Anwendungsdaten\AsuroFlash/test1.c:5: undefined reference to `Init'
make: *** [Project1.elf] Error 1


ExitCode 2


was muss ich jetst machen ?

thx

Ferdinand
03.09.2008, 23:05
ich bekomme kein *.hex






#include "asuro.h"

init();

int main(void){

unsigned int data[2];

//init();


FrontLED(ON);

MotorDir(FWD,FWD);


while (1)

{

LineData(data);

if (data[0] > data[1])

{

MotorSpeed(200,150);

}

else

{

MotorSpeed(150,200) ;

}


}

return 0;
}


> "C:\ASURO_src\FirstTry\Test-all.bat"

C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c:5: warning: type defaults to `int' in declaration of `init'
test.c:5: warning: function declaration isn't a prototype
test.c:5: warning: data definition has no type or storage class
test.c:45:2: warning: no newline at end of file
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex test.elf test.eep
avr-objdump -h -S test.elf > test.lss
Size after:
test.elf :
section size addr
.text 1552 0
.data 0 8388704
.bss 1 8388704
.noinit 0 8388705
.eeprom 0 8454144
.stab 3204 0
.stabstr 1763 0
Total 6520


Errors: none
-------- end --------

> Process Exit Code: 0
> Time Taken: 00:00


thx

radbruch
03.09.2008, 23:18
Hallo

Warum schreibst du das Init() außerhalb von main()? Das wird natürlich angemotzt:

test.c:5: warning: type defaults to `int' in declaration of `init'
test.c:5: warning: function declaration isn't a prototype
test.c:5: warning: data definition has no type or storage class
test.c:45:2: warning: no newline at end of file
...und nach dem letzten } fehlt angeblich noch ein [Enter]

Warum kein .hex erzeugt wird weiß ich auch nicht. Vielleicht mal ein "clean all" ausführen...

Gruß

mic

Ferdinand
03.09.2008, 23:36
hi

das kommt dabei raus



#include "asuro.h"


int main(void){

unsigned int data[2];

init();


FrontLED(ON);

MotorDir(FWD,FWD);


while (1)

{

LineData(data);

if (data[0] > data[1])

{

MotorSpeed(200,150);

}

else

{

MotorSpeed(150,200) ;

}


}

return 0;
}



> "C:\ASURO_src\FirstTry\Test-all.bat"

C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function `main':
test.c:10: warning: implicit declaration of function `init'
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
test.o(.text+0x8): In function `main':
C:\ASURO_src\FirstTry/test.c:10: undefined reference to `init'
make: *** [test.elf] Error 1

> Process Exit Code: 2
> Time Taken: 00:01


THX

radbruch
04.09.2008, 08:30
C:\ASURO_src\FirstTry/test.c:10: undefined reference to `init'
Die Funktion heißt Init() mit großem I am Anfang. Wir sind nahe dran :)

Ferdinand
04.09.2008, 10:36
OK

Ich hab jetzt alles neu gemacht mit den sahen von der Arexx HP und jetzt geht es.

Du hast recht mit großem I ;-)

Danke!!!


wo find ich den ein besseres Beispiel für die "PollSwitch" tastern.


Mit freundlichen Grüßen Ferdinand.

Felix1988
04.09.2008, 18:58
Hallo
Ich habe auch mal wieder den Asuro rausgekramt :) und habe mal versucht ein programm zu schreiben und zwar dieses hier:
#include "asuro.h"

int main(void)
{
unsigned char Speed;
unsigned int i;


Init();
StatusLED (GREEN);
MotorDir(FWD,FWD);
MotorSpeed(255,255);
while (PollSwitch()==0) {
StatusLED (GREEN);
}
MotorSpeed(0,0);
for (i=0; i<200; i++) {
Sleep(255);}
MotorDir(RWD,RWD);
MotorSpeed(150,150);
for (i=0; i<200; i++) {
Sleep(255);}
MotorDir(RWD,FWD);
MotorSpeed(150,150);
for (i=0; i<200; i++);{
Sleep(255); }


while(1);
return 0;
}

Aber irgendwie zeigt er die fehlermeldung an

set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c: In function `main':
test.c:5: warning: unused variable `Speed'
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex test.elf test.eep
C:\Users\FELIXK~1\AppData\Local\Temp\make27964.sh: /c/WinAVR/bin/avr-objcopy: Invalid argument
make: [test.eep] Error 126 (ignored)
avr-objdump -h -S test.elf > test.lss
C:\Users\FELIXK~1\AppData\Local\Temp\make27965.sh: /c/WinAVR/bin/avr-objdump: Invalid argument
make: *** [test.lss] Error 126

> Process Exit Code: 2

Vielleicht kan mir jemand weiterhelfen! Es muss ja irgendwas mit dem unsigned char Speed zu tun haben.
Wäre nett wenn mit jemand helfen könnte.
Vielen Dank im Vorraus :)
Felix

Ferdinand
04.09.2008, 23:25
Deine Speed Variable wirt nicht gebraucht

komentire das mal aus " unsigned char Speed; " so.: //unsigned char Speed;

by Ferdinand

hai1991
05.09.2008, 07:38
hallo
das mit der nicht benutzten variable dürfte kein problem sein, da es nur eine warnung ist (ein hinweis an den programmierer, da er vl. etwas übersehen haben könnte)
im weiteren verlauf der fehlermeldung treten aber auch noch 2 Error126. ich glaube man sollte herausfinden was es mit diesen auf sich hat. ich kann aber auch nichts genaueres dazu sagen

Felix1988
05.09.2008, 13:16
Also ich habe das Unsigned char Speed jetzt weggelassen und trotzdem kommt immer noch folgende Fehlermeldungen:

C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex test.elf test.eep
C:\Users\FELIXK~1\AppData\Local\Temp\make33804.sh: /c/WinAVR/bin/avr-objcopy: Invalid argument
make: [test.eep] Error 126 (ignored)
avr-objdump -h -S test.elf > test.lss
C:\Users\FELIXK~1\AppData\Local\Temp\make33805.sh: /c/WinAVR/bin/avr-objdump: Invalid argument
make: *** [test.lss] Error 126

> Process Exit Code: 2

Veilleicht hat doch noch jemand eine idee? wäre schön:-)
Vielen dank im Vorraus und an die Leute welche mir schon geholfenhaben!
Felix

radbruch
05.09.2008, 14:58
Hallo Felix

Ich kann dein Programm (mit auskommentiertem Speed) Fehler und warnungsfrei kompilieren. Irgendwas läuft wohl mit deinem Makefile schief:


Mein Make mit KamAVR:

avr-gcc -mmcu=atmega8 -Os -mno-interrupts -funsigned-char -funsigned-bitfields -Wall -Wstrict-prototypes -ggdb -c -DF_CPU=8000000UL -Wa,-acdhlmns=temp.lst temp.c -o temp.o
avr-gcc -mmcu=atmega8 -Os -mno-interrupts -funsigned-char -funsigned-bitfields -Wall -Wstrict-prototypes -ggdb temp.o asuro.o -o test.elf -Wl,-Map=test.map --cref -lm
avr-objcopy -j .text -j .data -O ihex test.elf test.hex
avr-objcopy -j .eeprom --change-section-lma .eeprom=0 -O ihex test.elf test_eeprom.hex
avr-objdump -d -S test.elf > test.lst


Felix Make:

C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
-------- begin --------
avr-gcc --version
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
avr-gcc -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.o test.o asuro.o --output test.elf -Wl,-Map=test.map,--cref -lm
avr-objcopy -O ihex -R .eeprom test.elf test.hex
avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 -O ihex test.elf test.eep
C:\Users\FELIXK~1\AppData\Local\Temp\make33804.sh: /c/WinAVR/bin/avr-objcopy: Invalid argument
make: [test.eep] Error 126 (ignored)
avr-objdump -h -S test.elf > test.lss
C:\Users\FELIXK~1\AppData\Local\Temp\make33805.sh: /c/WinAVR/bin/avr-objdump: Invalid argumentmake: *** [test.lss] Error 126

> Process Exit Code: 2


Was das bedeutet kann ich auch nicht sagen. Mein KamAVR erzeugt seine Makefiles selbstständig.

Gruß

mic

Felix1988
05.09.2008, 15:21
Ich habe mir das Programm auch mal gehiolt nur leider kann ich die Tools make und Clean nicht erstellen bzw einstellen gibt es da einen trick? wenn es so geht könnte mir dann vielleicht mal jemand die hex datei schicken? Falls ich es mit kam avr auch nicht hinkrige?
Wäre sehr nett
Vielen dank im Vorraus
felix

radbruch
05.09.2008, 16:05
Hallo

Bevor du nun zig neue Anläufe mit anderen Programmen machst solltest du nochmals versuchen das mit dem asuro gelieferte winavr/gcc-Paket zum Laufen zu bringen. Zumal zumindest KamAVR auch eine funktionierende Installation von WinAVR benötigt. Also alles wieder löschen und neu installieren. Das ist zwar bitter, aber wenn es dann mal funktioniert brauchst du dich darum nie mehr zu kümmern.

Im Anhang meine KamAVR-Einstellungen für den asuro. Wie gesagt wird aber eine funktionierende WinAVR-Installation vorausgesetzt. [Link: KamAVR (http://store.earthlcd.com/DOWNLOADS-KamAVR-zip-IDE-for-AVR-Microcontrollers)]

Gruß

mic

Felix1988
06.09.2008, 14:50
Hallo Radbruch,
Ich habe gar nicht bei KamAVR diese leiste zum einstellen der Tools beim mir sieht das so aus:



ich habe Ihren tipp alles neu zu installieren probiert aber leider bleibt es beim gleichen wie vorher auch.. Kann das was mit Vista vielleicht in irgendeiner Form zu tun haben?
Falls irgendjemand noch eine Idee hat bitte sagt sie mir ich bin am verzweifeln..
Vielen dank
Felix

radbruch
06.09.2008, 19:56
Hallo

Es gibt scheinbar einige Probleme bei Vista. In der Forumsuche mal nach "asuro AND vista" suchen.

Die Einstellunen in KamAVR sieht man erst nach file->new->new Project.

Gruß

mic