PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : Datei Compilieren



A-asuro
26.01.2008, 19:24
Hallo

Wollte mal Fragen wie ich jetzt z.b die Datei

RechteckDemo compiliere.
Habe schon alle Programme die man dafür braucht installiert.


Wenns geht schritt für schritt.



Danke schonmal

Steinigtmich
26.01.2008, 19:31
Maus in Hand nehmen, im Programmers Notepad aufs Menü "Tools" klicken, dann auf "[WinAVR] Make All".

A-asuro
26.01.2008, 19:37
dann auf "[WinAVR] Make All".


das steht bei mir nicht!

radbruch
26.01.2008, 19:44
Hallo

Im asuro-Manual Kapitel "8.1.3. Beispielprogramme" (ab S. 39) steht ab "Im Programmeditor einen Menüeintrag zum Compilieren einrichten" wie man den Compiler einbindet.

Gruß

mic

A-asuro
26.01.2008, 19:46
habe ich gemacht .. also das mit test .....

soll ich das für jede datei einzeln machen =?

Oder kann man mit test alle compilieren?

radbruch
26.01.2008, 19:50
Hier geht es erstmal darum, die Tools "make" und "clean" im Notepad einzubauen. Wenn du das hast, must du jedes Programm (.c-Datei) einzeln kompilieren und auf den asuro laden.

A-asuro
26.01.2008, 19:55
also ich öffne die datei rechteckdemo.c gehe auf "make" dann kommt da am ende der datei 0 Fehler bla bla bla und wenn ich wieder auf open gehe ... sehe ich keine hex datei ..

pinsel120866
26.01.2008, 19:58
Am sinnvollsten wäre es die Orginal - Bedienungsanleitung genau durchzulesen und gleich am PC umzusetzen.

Du kannst dann den Ordner "FirstTry" immer wieder verwenden, musst aber immer die Datei "test.c" anpassen.

A-asuro
26.01.2008, 20:12
was meinste mit anpassen ...

pinsel120866
26.01.2008, 20:16
Damit meine ich dass du z.B. den Inhalt der Rechteckdemo.c in die test.c reinkopierst und an deinen Asuro anpasst, wenn nötig.

A-asuro
26.01.2008, 21:01
ok gemacht ... drauf geflashed und wenn ihn jetzt anmache kommt leuchtet nur die Statusled grün und es bewegt sich nichts

sloti
26.01.2008, 21:32
Dann haste ein leeres Programm geflasht.

A-asuro
26.01.2008, 21:52
Stimmt was beim programm net, wenn sowas kommt :

http://www.nowload.net/bild.php/1415,aaaajpgJ15K7.jpg


VOn 24 steht ja da ...

sind das die zeilen?

radbruch
26.01.2008, 22:26
Das sind Blöcke, entsprechen aber den Zeilen in der Hex-Datei.

Schau dir mal dir Daten (Größe/Datum/Uhrzeit) von der c:\ASURO_src\FirstTry\test.c an. Und dann kompiliere nochmal. Ändern sich die Daten?

A-asuro
26.01.2008, 23:26
gemacht ... nun kommen aber bei kompilieren 2 Fehler

siehe hier

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
C:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr4\crtm8.o(.in it9+0x0): undefined reference to `main'
make: *** [test.elf] Error 1

> Process Exit Code: 2

sloti
26.01.2008, 23:51
Hast du überhaupt Winavr installiert?

A-asuro
27.01.2008, 00:01
da stand was von unzip .. hab ich gemacht aber danach ist nichts mehr gekommen

damaltor
27.01.2008, 00:45
A-asuro: was hast du geändert seit du das letzte mal ein programm geflasht hast? beim screenshot oben geht ja scheinbar alles...

A-asuro
27.01.2008, 01:30
Heute bin ich mit dem Asuro fertig geworden !
Das Testprogramm war schon drauf !

Dann habe ich halt diesen Programm draufgespielt "RechteckDemo" und als ich ihn ausprobieren wollte hat nur die grüne statuslampe geleuchtet!!

Als ich das Programm nochmal kompilieren woltle, zeigt er mir 2 Fehler an ! Was ich oben gepostet habe.

damaltor
27.01.2008, 01:41
bitte poste mal den programmcode. nutze dazu den code-button!

A-asuro
27.01.2008, 01:42
hab jetzt mal probiert ein anderes programmm zu compilieren geht auch net..

kommt immer dieser error

vor her ging es ja noch

A-asuro
27.01.2008, 01:43
/************************************************** *****************************
*
* File Name: RechteckDemo.c
* Project : Demo
*
* Description: This file contains RechteckDemo
*
* Ver. Date Author Comments
* ------- ---------- -------------- ------------------------------
* 1.00 14.08.2003 Jan Grewe build
* 2.00 22.10.2003 Jan Grewe angepasst auf asuro.c Ver.2.10
*
* Copyright (c) 2003 DLR Robotics & Mechatronics
************************************************** ***************************/
/************************************************** *************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* any later version. *
************************************************** *************************/
#include "asuro.h"

#define LEFT 0
#define RIGHT 1
#define LINE 0
#define EDGE 1

SIGNAL (SIG_ADC)
{
static unsigned char tmp[2],flag[2],toggle;
static unsigned char state = LINE, posFlag[2] = {FALSE,FALSE};
static unsigned char pos[2] = {0,0};
static unsigned char rightSpeed = 200, leftSpeed = 200;

tmp[toggle]= ADCH;

if (toggle) ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_RIGHT;
else ADMUX = (1 <<ADLAR) | (1 <<REFS0) | WHEEL_LEFT;

if ( (tmp[toggle] < 128) && (flag[toggle] == TRUE)) {
pos[toggle] ++;
flag[toggle] = FALSE;
}
if ( (tmp[toggle] > 128) && (flag[toggle] == FALSE)) {
pos[toggle] ++;
flag[toggle] = TRUE;
}
toggle ^= 1;

if (state == LINE) {
if (pos[LEFT] > 100) {
leftSpeed = 0;
pos[LEFT] = 0;
posFlag[LEFT] = TRUE;
}
if (pos[RIGHT] > 100) {
rightSpeed = 0;
pos[RIGHT] = 0;
posFlag[RIGHT] = TRUE;
}
if (posFlag[RIGHT] == TRUE && posFlag[LEFT] == TRUE) {
state = EDGE;
leftSpeed = 180;
}
}
if (state == EDGE) {
if (pos[LEFT] > 50) {
leftSpeed = 0;
pos[LEFT] = 0;
posFlag[LEFT] = posFlag[RIGHT] = FALSE;
state = LINE;
leftSpeed = rightSpeed = 200;
}
}
MotorSpeed(leftSpeed,rightSpeed);
}


void RechteckDemo(void)
{
Init();
cli();
MotorSpeed(200,200);
DDRC &= ~ ((1<<PC0) | (1<<PC1)); // Input => no break LED
ODOMETRIE_LED_ON;
ADCSRA = (1<<ADEN) | (1<<ADFR) | (1<<ADIE) | (1<<ADSC) | (1<<ADPS0) | (1<<ADPS1) | (1<<ADPS2); // clk/128
ADMUX = (1<<ADLAR) | (1<<REFS0) | WHEEL_LEFT; // AVCC reference with external capacitor
sei();
for(;;);
}

damaltor
27.01.2008, 03:31
das ist ja auch kein vollständiges programm....

vielleicht solltest du, anstatt fragmente aus dem netz zu laden, mal selbst ein kleines testprogramm schreiben?

A-asuro
27.01.2008, 10:37
Ich hab noch keine Ahung von C....
Dieses Programm habe ich von der CD.


Wo kann ich ein vollständiges Programm runterladen ?

p_mork
27.01.2008, 11:05
C:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr4\crtm8.o(.in it9+0x0): undefined reference to `main'

Das kommt daher, dass die main-Funktion in Deinem Programm fehlt. Jedes C-Programm muss aber eine haben. Mach mal aus 'void RechteckDemo(void)' ein 'int main()', dann sollte es klappen.

MfG Mark

A-asuro
27.01.2008, 11:17
C:\WinAVR\bin\..\lib\gcc-lib\avr\3.3.1\..\..\..\..\avr\lib\avr4\crtm8.o(.in it9+0x0): undefined reference to `main'

Das kommt daher, dass die main-Funktion in Deinem Programm fehlt. Jedes C-Programm muss aber eine haben. Mach mal aus 'void RechteckDemo(void)' ein 'int main()', dann sollte es klappen.

MfG Mark

habs gemacht .... trotzdem dieser Fehler

damaltor
27.01.2008, 14:18
hast du gespeichert vor dem kompilieren?

lies mal in der anleitung nach wie man programme schreibt, und fang an selbst etwas zu entwickeln.

A-asuro
27.01.2008, 14:28
ach danke .. ich hatte nicht gespeichert ^^ jetzt geht alles