Hola Hernando,

avr-gcc con AVRLIB me funciona en fedora-12:

gcc version 4.4.3 20100127 (Red Hat 4.4.3-4) (GCC) 


blueberry> avr-gcc -v

Using built-in specs.
Target: avr
Configured with: ../gcc-4.4.2/configure --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info --target=avr
--enable-languages=c,c++ --disable-nls --disable-libssp
--with-system-zlib --enable-version-specific-runtime-libs
Thread model: single
gcc version 4.4.2 (GCC)
 

Con mis makefiles y al compilar el 'Hello World' de Wiring/avr-gcc

blueberry> make
avr-gcc -c -g -Os -Wall -Wstrict-prototypes -I/home/juanig/avrlib
-Wa,-ahlms=blink.lst -mmcu=atmega128 -I. blink.c -o blink.o
avr-gcc -c -g -Os -Wall -Wstrict-prototypes -I/home/juanig/avrlib
-Wa,-ahlms=/home/juanig/avrlib/timer.lst -mmcu=atmega128
-I. /home/juanig/avrlib/timer.c -o /home/juanig/avrlib/timer.o
In file included from /home/juanig/avrlib/timer.c:20:
/usr/lib/gcc/avr/4.4.2/../../../../avr/include/avr/signal.h:36:2:
warning: #warning "This header file is obsolete.  Use
<avr/interrupt.h>."
avr-gcc  /home/juanig/avrlib/timer.o blink.o   -Wl,-Map=blink.map,--cref
-mmcu=atmega128 -o blink.elf
avr-objcopy   -O ihex    -R .eeprom blink.elf blink.hex
avr-objcopy   -j .eeprom --set-section-flags=.eeprom="alloc,load"
--change-section-lma .eeprom=0 -O ihex   blink.elf blink.eep
avr-objcopy: --change-section-lma .eeprom=0x00000000 never used
avr-size blink.elf
   text    data     bss     dec     hex filename
   2196       0      28    2224     8b0 blink.elf
Errors: none
avr-objdump -S blink.elf > blink.ss 
rm /home/juanig/avrlib/timer.o
blueberry> 


Por si acaso el programita de blink es:


//------------------------------------------------------
//------------------------------------------------------
//   
//  AVRLIB-DEMO
//  For avrlib and Wiring development board.
//  
//
//  File:     blink.c
//  Author:   Juan Reyes    juanig-at-ccrma-stanford_edu
//  Date:     June 18, 2008
//
//  Notes:
//-----------------------------------------------------
//  USING THE WIRING DEVELOPMENT BOARD, BUILT-IN LED
//  IN PIN 48 PORT D SHOULD LIGHT.
//
//-----------------------------------------------------
//  Layout of ports in Wiring board correspond with
//  ATMega128 as follows:
//
//  ATMega128                WIRING
//  =========                ======
//  
//  PORTD                    PORT-0
//  PORTC                    PORT-1
//  PORTA                    PORT-2
//  PORTB                    PORT-3
//  PORTE                    PORT-4
//  PORTF                    PORT-5
//  PORTG                    PORT-6
//-----------------------------------------------------
//  Layout of pins in Wiring board correspond with
//  ATMega128 as follows:
//
//  px0                   WPIN0
//  px1                   WPIN1
//   .                      .
//  px7                   WPIN7
//
//  Where x = {a,b,...,g}
//
//-----------------------------------------------------
//  More information about Wiring board:
//
//  http://wiring.org.co/hardware/index.html
//  
//-----------------------------------------------------
//  Information about functions used here and avrlib:
// 
//  ~/avrlib/examples/basic_io/basiciotest.c
//  
//  
//
//*********************************************************
//   Description:
//   ============
//
//   This program will cause Built-in LED to blink on/off 
//   every 500ms.
//
//*********************************************************


//compiler includes
#include <avr/io.h>
#include <avr/interrupt.h>

//avrlib includes
#include "global.h"
#include "timer.h"


int main(void)
{

        //  outb(register,byte) is a function that writes 
        //  a byte to a register.


        //  The DDRG register sets the direction of Port G.
        //  PORTG is labeled PORT6 on the Wiring Board.
  
        // a '1' makes the corresponding pin an OUTPUT.
        // a '0' makes the corresponding pin an INPUT.
        // Ports can only be set as INPUT or OUTPUT (0x00, 0xff).

        // 0xFF is hexadecimal for binary 11111111.
        // Therefore using ´outb'. all pins of PORTG 
        // are set to OUTPUT as follows:
        //
        outb(DDRG, 0xFF);
        //
        

        // Gnome calculator in Fedora can do bin-to-hex conversion.
    
        // The PORTG register can set the physical pins on port G high
        // or low when those pins are set to be outputs using DDRG. 
        // When pins are set to input, the PORTG register does something
        // else that will be discussed later.
        
        // To turn off the LEDs we want to pull the end connected to 
        // port A high (to 5V) so that there will be no voltage drop
across
        // the LEDs. See the schematic.
        // So we "set" the low 4 bits HIGH (to 5V) of PORTG by writing
1's.
        // Remember 0xF0 is hexadecimal for binary 11110000
        
        outb(PORTG, 0xF0);
        

        // initialize the timer library
        timerInit();

        //loop forever
        while (1) {
          //clear bit PG0 in the PORTG register - turn LED on
          cbi(PORTG,PG0);
          //PORTG = 0xFF;
          // pause for 500ms
          timerPause(500);

          //set bit PG0 in the PORTG register - turn LED off
          sbi(PORTG,PG0);
          // PORTG = 0x00;
          //pause for 500ms
          timerPause(500);
        } 

        return 0;
}

//------------------------------------------------------

_______________________________________________
____ ____ ___  ____ _  _ ___
|__| |__/   /  |___  \/  |__]
|  | |  \  /__ |___ _/\_ |

Arzexp mailing list
[email protected]
http://lists.slow.tk/listinfo.cgi/arzexp-slow.tk

Responder a