AVRStudio: Makefile, CDEFS, *** No rule to make target

OP #492339
Lesenswert?

Hi!

Habe einen ATmega162.
Versuche mit der Fleury-Bibliothek Code für die USART zu schreiben.
Beim "Build"-Versuch wird folgender Fehler angezeigt:

#error
"size of UART_RX_BUFFER_SIZE + UART_TX_BUFFER_SIZE larger than size of 
SRAM"

Die Ursache ist der folgende Code aus der Datei uart.h:
1
/** Size of the circular receive buffer, must be power of 2 */
2
#ifndef UART_RX_BUFFER_SIZE
3
#define UART_RX_BUFFER_SIZE 32
4
#endif
5
/** Size of the circular transmit buffer, must be power of 2 */
6
#ifndef UART_TX_BUFFER_SIZE
7
#define UART_TX_BUFFER_SIZE 32
8
#endif
9

10
/* test if the size of the circular buffers fits into SRAM */
11
#if ( (UART_RX_BUFFER_SIZE+UART_TX_BUFFER_SIZE) >= (RAMEND-0x60 ) )
12
#error "size of UART_RX_BUFFER_SIZE + UART_TX_BUFFER_SIZE larger than size of SRAM"
13
#endif

Dazu gibt es dann diesen Hinweis am Anfang der Header-Datei:

*
*  The UART_RX_BUFFER_SIZE and UART_TX_BUFFER_SIZE constants define
*  the size of the circular buffers in bytes. Note that these constants 
*  must be a power of 2.
*  You may need to adapt this constants to your target and your
*  application by adding
*  CDEFS += -DUART_RX_BUFFER_SIZE=nn -DUART_RX_BUFFER_SIZE=nn
*  to your Makefile.
*

Habe dann im AVRStudio in der Menüleiste unter "Build" das "Export 
Makefile" aufgerufen und im Projektverzeichnis gespeichert, dann unter 
"Project" -> "Configuration Options" "Use External Makefile" die 
Checkbox markiert und das exportierte Makefile angegeben und 
anschliessend CDEFS += -DUART_RX_BUFFER_SIZE=32 -DUART_RX_BUFFER_SIZE=32 
im Makefile eingetragen.

Leider kommt jetzt, mit oder ohne den Eintrag von "CDEFS += 
-DUART_RX_BUFFER_SIZE=32 -DUART_RX_BUFFER_SIZE=32", beim Ausführen von 
"Build" die folgende Meldung:

make: *** No rule to make target `../gt_ctrl.c', needed by `gt_ctrl.o'. 
Stop.

Habe das Makefile im Anhang eingefügt.

Liegt das Makefile evtl. in einem falschen Verzeichnis, oder ist der 
Eintrag an der falschen Stelle?

Gruss Markus
Angehängte Dateien:
Gast #492368
Lesenswert?

make: *** No rule to make target `../gt_ctrl.c', needed by `gt_ctrl.o'.

Das makefile muss ins Verzeichnis "default" (wenn du keine andere 
Konfiguration angelegt hast), und auch von dort aufgerufen werden.

Im übrigen brauchst du nicht den Weg über ein externes makefile zu 
gehen, wenn du compiler-directiven hinzufügen willst. Unter 
"Projektoptionen" lassen sich die auch direkt angeben. (Unbedingt button 
"ADD" benutzen).
Oder du packst die defines einfach mit ins header-file.

 "UART_RX_BUFFER_SIZE+UART_TX_BUFFER_SIZE) >= (RAMEND-0x60 )
Lt. avt-libc doku kommt RAMEND aus io.h. Schau doch mal dort, bzw im 
entsprechenden MCU-spezifischen file, wie RAMEND definert ist. Das 
sollte eigentlich größer als 64 sein :-)

Oliver
#2341526
Lesenswert?

Grüße an alle,

ich hatte das gleiche Problem und hab die Einträge in die makefile 
gemacht.

Nun kommt der Kram:

make: *** No rule to make target `../Test_senden.c', needed by 
`Test_senden.o'.  Stop.

Was kann ich tun damit das wieder funktioniert?

Danke

MBauer

P.S. Ja ich habe alles was oben steht schon versucht :( bin total 
frustriert!

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