"recipe for target ... failed" in sample project

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everyone,

 

recently I bought two ATmega 1284P XPLAINED boards and decided to use Atmel Studio (7.0, downloaded a couple of days ago) for my code.

I created a new AVR GCC Executable project and selected the 1284P board for it. Naturally, to see if everything was okay, I thought I'd build

the project as-is (a "main" function with a "while (1){}" loop).

 

However, upon hitting "Build" (or "Build Solution") I was presented with the following error message:

 

------ Build started: Project: fromVideo, Configuration: Debug AVR ------
Build started.
Project "fromVideo.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "D:\Install\Uni\Atmel\7.0\Vs\Compiler.targets" from project "D:\Studium\SS20\BA\code\fromVideo\fromVideo\fromVideo.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "D:\Install\Uni\Atmel\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path D:\Install\Uni\Atmel\7.0\shellUtils
        D:\Install\Uni\Atmel\7.0\shellUtils\make.exe all --jobs 4 --output-sync
D:\Studium\SS20\BA\code\fromVideo\fromVideo\Debug\Makefile(106,1): error: recipe for target 'fromVideo.elf' failed
        make: *** [fromVideo.elf] Error 1
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "fromVideo.cproj" -- FAILED.
Done building project "fromVideo.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

After some googling, I found that:

  • the skipped "PreBuildEvent" is most probably not the issue,
  • others have had similar problems too, but with the 6.0 version.

 

In particular, this post looked a lot like my problem; however, unlike the OP there, I do not have any helpful output pointing out what

could be broken.

 

I am running Atmel Studio on a Windows 7 machine. Building from the Windows Shell did not help either. I have also tried removing the loop

or the #include<avr/io.h> import.

 

Any help would be appreciated; I can also provide additional input. It is my first time using Atmel Studio, although I had programmed another

microcontroller about an year ago.

 

Best regards.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Suggest you remove AS7 and re-install it in the default location on C drive and see if that helps.

Or upload a zip of your project directory and see if others can duplicate your problem.

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I build, I get:

 

------ Build started: Project: LTX_Serial_Interface, Configuration: Debug AVR ------
Build started.
Project "********************.cppproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\7.0\Vs\Compiler.targets" from project "C:\***********************************************************************************************\********************.cppproj" (target "Build" depends on it):
	Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\7.0\Extensions\Application\AvrGCC.dll".
	Task "RunCompilerTask"
		Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\7.0\shellUtils
		C:\Program Files (x86)\Atmel\Studio\7.0\7.0\shellUtils\make.exe all --jobs 4 --output-sync 
		Building file: .././main.cpp
		Invoking: AVR8/GNU C Compiler : 5.4.0
		"C:\Program Files (x86)\Atmel\Studio\7.0\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-g++.exe" -funsigned-char -funsigned-bitfields -DDEBUG -DF_CPU=3579500UL -D******** -D***************** -D********************  -U********************** -U************* -U**************  -I"C:\Program Files (x86)\Atmel\Studio\7.0\7.0\Packs\Atmel\ATmega_DFP\1.2.209\include"  -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328p -B "C:\Program Files (x86)\Atmel\Studio\7.0\7.0\Packs\Atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328p" -c -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.cpp" 
		Finished building: .././main.cpp
		Building target: ********************.elf
		Invoking: AVR8/GNU Linker : 5.4.0

But OP's output seems to be missing any attempt to actually build any files.

 

Are you sure you have the source file(s) included in the Project?

 

https://www.avrfreaks.net/commen...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

alistavat wrote:
recently I bought two ATmega 1284P XPLAINED boards

Possibly not the best choice, I'm afraid:

 

See: https://www.avrfreaks.net/commen... - and the rest of that thread.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

thank you all for the tips.

 

Suggest you remove AS7 and re-install it in the default location on C drive and see if that helps.

 

I reinstalled AS7 in its default location and also created a new project with the new installation. It did indeed change the output, but the build still fails:

 

------ Build started: Project: AnotherTest, Configuration: Debug AVR ------
Build started.
Project "AnotherTest.cproj" (default targets):
Target "PreBuildEvent" skipped, due to false condition; ('$(PreBuildEvent)'!='') was evaluated as (''!='').
Target "CoreBuild" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\Studium\SS20\BA\code\AnotherTest\AnotherTest\AnotherTest.cproj" (target "Build" depends on it):
    Using "RunCompilerTask" task from assembly "C:\Program Files (x86)\Atmel\Studio\7.0\Extensions\Application\AvrGCC.dll".
    Task "RunCompilerTask"
        Shell Utils Path C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils
        C:\Program Files (x86)\Atmel\Studio\7.0\shellUtils\make.exe all --jobs 4 --output-sync
        Building file: .././main.c
        Invoking: AVR/GNU C Compiler : 5.4.0
        "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe"  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega1284p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega1284p" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c"
        Finished building: .././main.c
D:\Studium\SS20\BA\code\AnotherTest\AnotherTest\Debug\Makefile(106,1): error: recipe for target 'AnotherTest.elf' failed
        make: *** [AnotherTest.elf] Error 1
    Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "AnotherTest.cproj" -- FAILED.
Done building project "AnotherTest.cproj" -- FAILED.

Build FAILED.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

 

... so I am getting the "Finished building: .././main.c" line as @awneil wrote.

 

Regarding the question of @awneil: Yes, my main.c is in the project and appears in the project explorer -- as shown in the image from the comment you linked.

 

I chose this type of boards as it was recommended by the authors of a project I'm hoping to implement.

Last Edited: Sat. Jun 13, 2020 - 01:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just out of interest what does line 106 say?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is @echo Building target: $@ . To put it into perspective,

 

# All Target
all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES)

 

$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
    @echo Building target: $@
    @echo Invoking: AVR/GNU Linker : 5.4.0

 

that is the content of the Makefile around it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A few more lines of context are required.

 

Post all the lines from this target line:

$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)

down to the next line that looks like

target : dependency dependency

 

Or perhaps just post the whole thing if it isn't excessively long.

 

Last Edited: Sat. Jun 13, 2020 - 08:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think that would be

 

$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP)
    @echo Building target: $@
    @echo Invoking: AVR/GNU Linker : 5.4.0
    $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="AnotherTest.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega1284p -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.3.300\gcc\dev\atmega1284p"

    @echo Finished building target: $@
    "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures  "AnotherTest.elf" "AnotherTest.hex"
    "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom  --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0  --no-change-warnings -O ihex "AnotherTest.elf" "AnotherTest.eep" || exit 0
    "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "AnotherTest.elf" > "AnotherTest.lss"
    "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "AnotherTest.elf" "AnotherTest.srec"
    "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "AnotherTest.elf"
   

Since what comes next is just the cleanup with rm -rf.