Error compiling for board Attiny45/85

I am trying to program an attiny85 with arduino uno. I have connected all 6 pins correctly and a capacitor on reset to gnd. I was able to upload the arduino isp sketch just fine, and was able to burn bootloader to attiny85 with no error showing up with the leds on pin 8 of the arduino. When I try to compile a test sketch to upload to the attiny, I get this error.

Arduino: 1.8.9 (Windows 10), Board: "ATtiny25/45/85, Enabled, CPU, ATtiny85, 8 MHz (internal), EEPROM retained, B.O.D. Disabled, Enabled"

Archiving built core (caching) in: C:\Users\AARON'~1\AppData\Local\Temp\arduino_cache_357583\core\core_ffd381a33916f6ea878f33d327022289.a
Linking everything together...
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.elf" "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248\\sketch\\motor_pwm.ino.cpp.o" "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/core\\core.a" "-LC:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248" -lm
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.elf" "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.eep"
"C:\\Arduino\\hardware\\tools\\avr/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.elf" "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.hex"
cmd /C "C:\\Arduino\\hardware\\tools\\avr/bin/avr-objdump" --disassemble --source --line-numbers --demangle --section=.text "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.elf" > "C:\\Users\\AARON'~1\\AppData\\Local\\Temp\\arduino_build_586248/motor_pwm.ino.lst"
exec: "cmd": executable file not found in %PATH%
Error compiling for board ATtiny25/45/85.

I have tried things that other people used to resolve this issue in other threads. I first thought it was an issue with environmental values, but if that was the case, it should have not wrote to the uno in the first place. I have tried re-installing ide-1.8.9 and running as admin. I am using this attiny core

I could not post the full error message, it was over 9000 characters.

Is you user account on your computer very restricted?

I have admin privileges. I also ran the ide as admin with no difference. I have no anti virus software, just windows defender. Is there any settings that would need to be changed to allow the ide access to cmd? Also, i was able to upload code to my uno just fine, wouldn't having permission issues not let any code be written?

That is strange. What happens if you run cmd from the Windows Start menu?

Do you have a ' in your Windows user name?

Yes, he does: C:\Users\AARON’~1\AppData\Local\Temp\arduino_build_586248/motor_pwm.ino.elf

Though I’m not sure exactly why that’s causing a problem, since the paths in the commands are quoted…

Are you doing “export compiled binary”?

It looks like it’s choking when it tries to generate the assembler listing (a special feature of ATTinyCore) - but this should only be happening when doing “export compiled binary” not for normal compiles…

I get the same error message (exec: "cmd": executable file not found in %PATH%) when I compile, upload, or export compiled binary. I already tried uninstalling and re installing arudino ide on both my hard drives. It is currently on the same drive as my os.

DrAzzy:
It looks like it's choking when it tries to generate the assembler listing (a special feature of ATTinyCore) - but this should only be happening when doing "export compiled binary" not for normal compiles....

You're probably thinking of the other hack that removes the "with_bootloader" .hex file. The disassembly listing is generated on every compilation because it's done via the objcopy.postobjcopy hook.

@doodlebob please tell me what your Windows user name is. If you don't want to share it publicly, send it to me in a private message.

My preliminary test indicates having a ' in your user name does indeed cause problems. However, in my test, the insane user name broke compilation long before it even got to the objcopy.postobjcopy step. I think this is because I also put a space in the test user name. It takes a ridiculously long time for me to create a new user, install the Arduino IDE, and install ATTinyCore on my Windows 10 virtual machine so I don't want to invest any more time on this purely operating on guess work. I need to reproduce your exact environment as closely as possible to be able to test effectively.

I tried uploading the code with my laptop (same version and attiny core), which has the same Microsoft account and username, and I was able to write to the attiny85 and the code ran with no problems. I can use my laptop for now, but would still like to be able to use my desktop, since my laptop is slow.

I’m here ready to investigate any time you feel like providing me with the information I need.

In addition to knowing your user name, I’ll also need the following from your laptop:

  • (In the Arduino IDE) click File > Preferences
  • Check the box next to "Show verbose output during: > compilation
  • Click “OK”
  • Sketch > Verify/Compile
  • After the compilation finishes, click on the black console window at the bottom of the Arduino IDE window.
  • Press Ctrl+A to select all the text.
  • Press Ctrl+C to copy the selected text to the clipboard.
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the compilation output between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the length of the output exceeds the forum’s 9000 character limit, save it in a .txt file and post it here as an attachment. If you click the “Reply” button you’ll see the “Attachments and other options” link.

Here are the upload verbose from laptop and desktop. I will dm you my usernames.

desktop upload.txt (17.6 KB)

laptop upload.txt (9.65 KB)

It found this to be caused by an incorrectly configured Windows PATH environment variable. You must have %SystemRoot%\system32 in your path because that's where cmd is located.

Please try this:

  • Start Windows Control Panel.
  • Navigate to System and Security > System > Advanced system settings.
  • Click the "Advanced" tab.
  • Click the "Environment variables..." button.
  • In the "System Variables" list, double click on "Path".
  • Check whether %SystemRoot%\system32 is one of the items on the list. If not:
  • Click the "New" button.
  • Enter %SystemRoot%\system32 in the text field.
  • Click the "OK" button.
  • Click the "OK" button.

Let me know if that solves the problem.

Thank you so much! Everything works and the code ran just fine. Now I do not have to get out my laptop just to upload code. The variable PATH was mapped to java in my c:/ drive. Im sure Minecraft is to blame for this one.

I'm so glad to hear that fixed it!

I got off on a bit of a wild goose chase with the apostrophe in the path thing. In my test setup I had an apostrophe followed by a space in the user name and it seems that is not supported, even though your user name which doesn't have a space after the apostrophe is supported. So that issue is not relevant to your situation and it is also not specific to ATTinyCore. I have the same error with that account if I try to compile for official Arduino boards like the Uno too.