+ Post New Thread
Results 1 to 8 of 8
  1. #1
    Newbie level 6
    Points: 240, Level: 2

    Join Date
    Mar 2018
    Posts
    11
    Helped
    0 / 0
    Points
    240
    Level
    2

    Eclipse Compiling error with AVR

    Dear All

    I'v used Eclipse to create a simple AVr application for ATMEGA8A, but after compiling the code i got an errors which is generated with any avr application coded by the Eclipse,so pls help to solve these errors

    my code is

    Code C - [expand]
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    #include <avr/io.h>
    int main()
    {
       DDRC |= 1<<PC0;
       while(1)
       {
         PORTC0 ^= 1<<PC0;
       }
    }

    and the errors are

    make: *** [LedOnOff.o] Error 1
    recipe for target 'LedOnOff.o' failed
    and the details for the auto generated make file ,which contain the errors belong to subdir.mk file


    ################################################## ##############################
    # Automatically-generated file. Do not edit!
    ################################################## ##############################

    # Add inputs and outputs from these tool invocations to the build variables
    C_SRCS += \
    ../LedOnOff.c

    OBJS += \
    ./LedOnOff.o

    C_DEPS += \
    ./LedOnOff.d

    # Each subdirectory must supply rules for building sources it contributes
    %.o: ../%.c
    @echo 'Building file: $<' "the error is here"
    @echo 'Invoking: AVR Compiler'
    avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega8a -DF_CPU=16000000UL -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<"
    @echo 'Finished building: $<'
    @echo ' '
    and the toolchain configuration as below

    AVR-GCC C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin

    GNU Make C:\Program Files (x86)\Atmel\Studio\7.0\shellutils

    AVR Header Files C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include

    AVRDude C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
    many thanks

    •   AltAdvertisment

        
       

  2. #2
    Super Moderator
    Points: 28,642, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,527
    Helped
    1081 / 1081
    Points
    28,642
    Level
    41
    Blog Entries
    6

    Re: Eclipse Compiling error with AVR

    Are you compiling only, or are you also trying to download/run/debug this program ? I would bet there are more than one programs attempting to make access to this file at same time, e.g compiler and debugger; just guessing.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   AltAdvertisment

        
       

  3. #3
    Advanced Member level 3
    Points: 6,645, Level: 19
    Achievements:
    7 years registered

    Join Date
    Jul 2010
    Location
    Sweden
    Posts
    857
    Helped
    345 / 345
    Points
    6,645
    Level
    19

    Re: Eclipse Compiling error with AVR

    The "make" utility can't find the source file LedOnOff.c
    As the compile rule is written, that file must be located in the directory above the one where LedOnOff.o will be generated.



    •   AltAdvertisment

        
       

  4. #4
    Newbie level 6
    Points: 240, Level: 2

    Join Date
    Mar 2018
    Posts
    11
    Helped
    0 / 0
    Points
    240
    Level
    2

    Re: Eclipse Compiling error with AVR

    Quote Originally Posted by std_match View Post
    The "make" utility can't find the source file LedOnOff.c
    As the compile rule is written, that file must be located in the directory above the one where LedOnOff.o will be generated.
    Hi my friend
    I put LedOnoff.c in all the folders belong to the project, but i've got the same error



  5. #5
    Newbie level 6
    Points: 240, Level: 2

    Join Date
    Mar 2018
    Posts
    11
    Helped
    0 / 0
    Points
    240
    Level
    2

    Re: Eclipse Compiling error with AVR

    Quote Originally Posted by andre_teprom View Post
    Are you compiling only, or are you also trying to download/run/debug this program ? I would bet there are more than one programs attempting to make access to this file at same time, e.g compiler and debugger; just guessing.
    Hi My friend
    I compiling only a release version without debug ,also enabled avrdude to burn the generated hex file



    •   AltAdvertisment

        
       

  6. #6
    Super Moderator
    Points: 28,642, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,527
    Helped
    1081 / 1081
    Points
    28,642
    Level
    41
    Blog Entries
    6

    Re: Eclipse Compiling error with AVR

    The output from compilation seems too short.
    Try invoking make in verbose mode, it should be something like that:

    Code:
    make V=1
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  7. #7
    Newbie level 6
    Points: 240, Level: 2

    Join Date
    Mar 2018
    Posts
    11
    Helped
    0 / 0
    Points
    240
    Level
    2

    Re: Eclipse Compiling error with AVR

    I've made

    make V=1

    but nothing change, the same errors



  8. #8
    Super Moderator
    Points: 28,642, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,527
    Helped
    1081 / 1081
    Points
    28,642
    Level
    41
    Blog Entries
    6

    Re: Eclipse Compiling error with AVR

    The purpose of this statement is not to elliminate the error itself, but rather to change compilation output to verbose mode, which at first sight could give more details on the error reason.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



--[[ ]]--