Error 127, command not found

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

Hi guys,

 

I'm having a problem compiling a project. This is not a new problem, many others have had it but I can't seem to fix it. Here's the output from Atmel Studio

 

------ Build started: Project: Control, Configuration: Debug AVR ------
Build started.
Project "Control.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 "\\**private directory path**" (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 --output-sync 
		/usr/bin/sh: C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe: command not found
		make: *** [main.o] Error 127
		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.2.209\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328pb -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb" -c -std=gnu99 -MD -MP -MF "main.d" -MT"main.d" -MT"main.o"   -o "main.o" ".././main.c" 
\\**private directory path**\Debug\Makefile(88,1): error: recipe for target 'main.o' failed
		make: *** Waiting for unfinished jobs....
		Building file: .././hd44780.c
		Invoking: AVR/GNU C Compiler : 5.4.0
		/usr/bin/sh: C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe: command not found
		make: *** [hd44780.o] Error 127
		"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.2.209\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328pb -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb" -c -std=gnu99 -MD -MP -MF "hd44780.d" -MT"hd44780.d" -MT"hd44780.o"   -o "hd44780.o" ".././hd44780.c" 
\\**private directory path**\Debug\Makefile(81,1): error: recipe for target 'hd44780.o' failed
	Done executing task "RunCompilerTask" -- FAILED.
Done building target "CoreBuild" in project "Control.cproj" -- FAILED.
Done building project "Control.cproj" -- FAILED.

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

Now I did check and C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe is in that directory AND I can compile code from this week without any issues.

 

This has prevented me from updating my older projects. What can I do here?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
/usr/bin/sh: C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe: command not found

The curious thing in that would appear to be the /usr/bin/sh on the front. That's a very "unix"y way of saying things. As AS7 itself is on a Windows machine it sounds a bit like Cygwin / Min-GW/ Msys may be getting involved here ?

 

Do you have some kind of "linux like" thing on your machine and is it possible that it is higher in the PATH than anything AS7 may have provided ?

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

Agree with Cliff.. Sounds like something like cygwin is messing up your path... 

 

 

:: Morten

 

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

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

 

Man, I don't think so, I installed Atom text editor yesterday (https://atom.io/), that was the only thing I installed recently. And then why would it compile code I created yesterday? (edit: actually I can't compile any new code)

Another thing I found was that my colleague could open it on his machine and compile. Then when I open it on my side with will build when I open it but not when I change anything in the code.

 

Here's my path variables:

 

 

Can I get you guys any other information to help me troubleshoot this?

 

In the makefile it highlights

@echo Building file: $<

As the error part.

 

# AVR32/GNU C Compiler
./hd44780.o: .././hd44780.c
	@echo Building file: $<
	@echo Invoking: AVR/GNU C Compiler : 5.4.0
	$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE)  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328pb -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"   -o "$@" "$<"
	@echo Finished building: $<

./main.o: .././main.c
	@echo Building file: $<
	@echo Invoking: AVR/GNU C Compiler : 5.4.0
	$(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE)  -x c -funsigned-char -funsigned-bitfields -DDEBUG  -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\include"  -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=atmega328pb -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.2.209\gcc\dev\atmega328pb" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)"   -o "$@" "$<"
	@echo Finished building: $<

 

Last Edited: Fri. Feb 14, 2020 - 07:06 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

After reinstalling Atmel Studio I can no longer see any tools in the drop down box in Device programming

 

** Oh I forgot you have to go Tools > Add target to get the stk500 available. My mistake.

 

Last Edited: Fri. Feb 14, 2020 - 11:29 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why have you got WinAVR so early on your PATH? (or on your PATH at all?)

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

I'm not sure but after I reinstalled Atmel studio it has gone away.

 

I've found now that I still get the error in the makefile

 

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

Now the highlighted line is:

 

@echo Building target: $@

Instead of building file.

 

But now when I just build it again after the error it works and I can program my boards. At least I can work again but what is going on with this?

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

The implication is that it's probably the wrong make.exe that is being executed I think.

 

Maybe just try starting a Command Prompt and typing "make". If it actually runs make then try "where make.exe" to find out which one is run by deafult.

Last Edited: Fri. Feb 14, 2020 - 11:45 AM