recipe for target 'GccApplication1.elf' error

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

Hello

I have a problems with my Microchip Studio v.7.0.2542. After debugging I have error  "recipe for target 'GccApplication1.elf' failed". It's my code:

#include <avr/io.h>
#include <avr/pgmspace.h>

int diode_table[8] = {247, 254, 191, 223, 253, 127, 251, 239};
int button_fun(void);
int button = 0;
int output = 0;
int diode = 0;
int binary_mask(void);

int main(void)
{
	PORTC=0xff;
	DDRC = 0xff;
	PORTB = 255;
	while(1) {
		button = button_fun();
		diode = binary_mask();
		output = diode_table[diode];
		PORTC = output;
	}
	return 0;
}

int button_fun(void)
{
	button = PINB;
	return button;
}

int binary_mask(void)
{
	if (button == 254) {
		diode = 7;
	}
	if (button == 253) {
		diode = 6;
	}
	if (button == 251) {
		diode = 5;
	}
	if (button == 247) {
		diode = 4;
	}
	if (button == 239) {
		diode = 3;
	}
	if (button == 223) {
		diode = 2;
	}
	if (button == 191) {
		diode = 1;
	}
	if (button == 127) {
		diode = 0;
	}
	return diode;
}

And this is output:

------ Build started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.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:\mikroklocki\GccApplication1\GccApplication1\GccApplication1.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 8 --output-sync
D:\mikroklocki\GccApplication1\GccApplication1\Debug\Makefile(106,1): error: recipe for target 'GccApplication1.elf' failed
		make: *** [GccApplication1.elf] Error 1
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "GccApplication1.cproj" -- FAILED.
Done building project "GccApplication1.cproj" -- FAILED.

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

 

 

I tried it at computer and board at my Univ (Atmel Studio 6.2) and worked correctly. In my private computer I use a Comodo AV, maybe it' s a problem? My teacher haven't any idea to solve it. 

Thank

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

What does the build log look like if you do a rebuild instead of a build?

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
------ Rebuild All started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.cproj" (Clean target(s)):
Target "Clean" in file "C:\Program Files (x86)\Atmel\Studio\7.0\Vs\Compiler.targets" from project "D:\mikroklocki\GccApplication1\GccApplication1\GccApplication1.cproj" (entry point):
	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 clean 
		rm -rf  main.o   
		rm -rf  main.d   
		rm -rf "GccApplication1.elf" "GccApplication1.a" "GccApplication1.hex" "GccApplication1.lss" "GccApplication1.eep" "GccApplication1.map" "GccApplication1.srec" "GccApplication1.usersignatures"
	Done executing task "RunCompilerTask".
Done building target "Clean" in project "GccApplication1.cproj".
Done building project "GccApplication1.cproj".

Build succeeded.
------ Rebuild All started: Project: GccApplication1, Configuration: Debug AVR ------
Build started.
Project "GccApplication1.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:\mikroklocki\GccApplication1\GccApplication1\GccApplication1.cproj" (target "Build" depends on it):
	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 8 --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.6.364\include"  -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128a" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c" 
		Finished building: .././main.c
D:\mikroklocki\GccApplication1\GccApplication1\Debug\Makefile(106,1): error: recipe for target 'GccApplication1.elf' failed
		make: *** [GccApplication1.elf] Error 1
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "GccApplication1.cproj" -- FAILED.
Done building project "GccApplication1.cproj" -- FAILED.

Build FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

 

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

Joanna987 wrote:

D:\mikroklocki\GccApplication1\GccApplication1\Debug\Makefile(106,1): error: recipe for target 'GccApplication1.elf' failed

What is on line 106 of that Makefile it references ?

 

"recipe for target failed" usually means "the Makefile mentioned a source file but I cannot see/build it". That's odd in AS7 as it usually auto-generates the Makefile each time you build from the list of files listed in the Solution/Project. Could you have ticked the box that says "use external makefile"? If you did then it might be a Makefile that mentions a source not in your code tree. 

 

On the other hand I see that Makefile is apparently located in projname\Debug which suggests this IS a Studio 7 auto-generated Makefile.

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

Joanna987 wrote:

D:\mikroklocki\GccApplication1\GccApplication1\Debug\Makefile(106,1): error: recipe for target 'GccApplication1.elf' failed

Is D:\ by any chance a network attached drive?  AS(any version) has problems with network drives.....

Try putting your project dir on the C:\ drive and see if it works....

 

Jim

 

 

Keys to wealth:

Invest for cash flow, not capital gains!

Wealth is attracted, not chased! 

Income is proportional to how many you serve!

Lets go Brandon!

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

In a .cproj file? No, I didn't match "Use external Makefile". 

In a makefile in line 106 I have  @echo Building target: $@

 

And more (lines 102-114):

# 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
	$(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="GccApplication1.map" -Wl,--start-group -Wl,-lm  -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128a"
	@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  "GccApplication1.elf" "GccApplication1.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 "GccApplication1.elf" "GccApplication1.eep" || exit 0
	"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "GccApplication1.elf" > "GccApplication1.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 "GccApplication1.elf" "GccApplication1.srec"
	"C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "GccApplication1.elf"

 

 

 

@Jim, no, it's local disc, not network

Last Edited: Wed. Nov 24, 2021 - 06:18 PM