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