Complilation Errors IDE 2.0

Hi

I've just downloaded and installed IDE 2.0. I've opened one of my sketches that compiles fine with IDE 1.8.19 but will not compile with IDE 2.0

I've tried multiple known working sketches but non of them will compile with IDE 2.0

The error i get is

'C:\Users\Bowling' is not recognized as an internal or external command,
operable program or batch file.

exit status 1

Compilation error: exit status 1

1 Like

Please post an example sketch that does not compile in IDE 2.0

Do you have a folder named C:\Users\Bowling on your PC and, if so, what does it contain ?

All my sketches are in C:\Users\Bowling tough\Desktop\Projects

This sketch will not compile in IDE 2.0

// Include this #define statement for production version with duty cycle adjust input
// Comment out this #define statement for test version without duty cycle adjust input

#define ENABLE_ADJUST



/*
  CONFIGURATION
*/

// ATtiny85 pins
const uint8_t SENSOR_PIN = A2;  // physical pin 3 } {USE THESE TWO PINS AS
const uint8_t ADJUST_PIN = A3;  // physical pin 2 } {I COULD NOT GET A0 TO WORK
const uint8_t PWM_PIN = 0;      // physical pin 5

const uint8_t DUTY_ADJUST_LIMIT = 30;



/*
  DEFINITIONS
*/

uint8_t getDutyOut(uint16_t analogIn)
{
  float dutyOut = 488.0 + 0.6 * (analogIn - 1039.0);
  if (dutyOut < 1.0)
  {
    return 1;
  }
  else if (dutyOut > 255.0)
  {
    return 255;
  }
  else
  {
    return (uint8_t)dutyOut;
  }
}

int8_t getDutyAdjust(uint16_t analogIn)
{
  float x = DUTY_ADJUST_LIMIT * ((int16_t)analogIn - 512) / 512.0;
  return (int8_t)x;
}



/*
  MAIN PROGRAM
*/

void setup()
{


}

void loop()
{

  uint16_t sensorIn = analogRead(SENSOR_PIN);
  sensorIn = analogRead(SENSOR_PIN);
  uint16_t adjustIn = analogRead(ADJUST_PIN);
  adjustIn = analogRead(ADJUST_PIN);

  uint8_t dutyOut = getDutyOut(sensorIn);
  int8_t dutyAdjust = 0;
#ifdef ENABLE_ADJUST
  dutyAdjust = getDutyAdjust(adjustIn);
#endif
  int16_t dutyFinal = dutyOut + dutyAdjust;
  if (dutyFinal < 1)
  {
    dutyFinal = 1;
  }
  else if (dutyFinal > 255)
  {
    dutyFinal = 255;
  }
  analogWrite(PWM_PIN, (uint8_t)dutyFinal);


}

Hi @ullisees. I'm going to ask you to post some additional information that might help us to identify the problem.

:exclamation: NOTE: These instructions will not solve the problem. They are only intended to possibly gather some more information about the problem, which might provide a clue that leads to a solution.

Please do this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the box next to "Show verbose output during: ☐ compilation".
  3. Click the OK button.
  4. Select Sketch > Verify/Compile from the Arduino IDE menus.
  5. Wait for the compilation to fail.
  6. You will see a "Compilation error: ..." notification at the bottom right corner of the Arduino IDE window. Click the COPY ERROR MESSAGES button on that notification.
  7. Open a forum reply here by clicking the Reply button.
  8. Click the </> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  9. Press Ctrl+V.
    This will paste the compilation output into the code block.
  10. Move the cursor outside of the code tags before you add any additional text to your reply.
  11. Click the Reply button to post the output.

In case the output is longer than the forum software will allow to be added to a post, you can instead save it to a .txt file and then attach that file to a reply here:

  1. Open any text editor program.
  2. Paste the copied output into the text editor.
  3. Save the file in .txt format.
  4. Open a forum reply here by clicking the Reply button.
  5. Click the "Upload" icon (image) on the post composer toolbar:
    image
  6. Select the .txt file you saved.
  7. Click the Open button.
  8. Click the Reply button to publish the post.

Alternatively, instead of using the "Upload" icon on the post composer toolbar as described in steps (5) - (7) above, you can simply drag and drop the .txt file onto the post composer field to attach it.

1 Like

Here is the error message.

Using board 'attinyx5' from platform in folder: C:\Users\Bowling tough\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.3.1
Using core 'tiny' from platform in folder: C:\Users\Bowling tough\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.3.1
Detecting libraries used...
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\cores\\tiny" "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\variants\\tinyX5" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\sketch\\Gauge_04_Production.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\cores\\tiny" "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\variants\\tinyX5" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\sketch\\Gauge_04_Production.ino.cpp" -o "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=attiny85 -DF_CPU=1000000L -DARDUINO=10607 -DARDUINO_AVR_ATTINYX5 -DARDUINO_ARCH_AVR -DNEOPIXELPORT=PORTB "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\cores\\tiny" "-IC:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\ATTinyCore\\hardware\\avr\\1.3.1\\variants\\tinyX5" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\sketch\\Gauge_04_Production.ino.cpp" -o "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\sketch\\Gauge_04_Production.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core: C:\Users\Bowling tough\AppData\Local\Temp\arduino-core-cache\core_0853469cae13366aed56b02de9d34fd2.a
Linking everything together...
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.elf" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D\\sketch\\Gauge_04_Production.ino.cpp.o" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/..\\arduino-core-cache\\core_0853469cae13366aed56b02de9d34fd2.a" "-LC:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D" -lm
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.elf" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.eep"
"C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.elf" "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.hex"
cmd /C "C:\\Users\\Bowling tough\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objdump" --disassemble --source --line-numbers --demangle --section=.text "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.elf" > "C:\\Users\\Bowling tough\\AppData\\Local\\Temp\\arduino-sketch-C4B20AB9ED6E433021D0B50C0BA9762D/Gauge_04_Production.ino.lst"
'C:\Users\Bowling' is not recognized as an internal or external command,
operable program or batch file.

exit status 1

Compilation error: exit status 1

OK, this is a known bug in ATTinyCore. I was actually discussing with DrAzzy/SpenceKonde only a few days ago:

https://github.com/MCUdude/MegaCoreX/pull/159#issuecomment-1263839384

The fix should be available in the next release of ATTinyCore, but you can go ahead and apply it yourself right away. I'll provide instructions:

  1. Open the file at this path in any text editor:
    C:\Users\Bowling tough\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\platform.txt
    
    :exclamation: If looking for it with your file browser or command line, note that the C:\Users\Bowling tough\AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  2. Change line 83 from this:
    recipe.hooks.savehex.presavehex.1.pattern.windows=cmd /C "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
    
    to this:
    recipe.hooks.savehex.presavehex.1.pattern.windows=cmd /C echo. && "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
    
  3. Save the file.
  4. If the Arduino IDE is running, select File > Quit from the Arduino IDE menus.
  5. Start the Arduino IDE.
    β“˜ It is necessary to restart the Arduino IDE in order to make it recognize the change you made to platform.txt.

Now try compiling again. The error should no longer occur.


Please let me know if you have any questions of problems while following those instructions.

1 Like

I have had a look through that file and can't find that line anywhere.

This is what is under savehex

## Save hex
recipe.hooks.savehex.presavehex.1.pattern.windows="{runtime.platform.path}/delete_merged_output.bat" {build.export_merged_output} "{build.path}\{build.project_name}.with_bootloader.hex"
recipe.hooks.savehex.presavehex.2.pattern.windows=cmd /C copy "{build.path}\{build.project_name}.lst" "{sketch_path}"
recipe.hooks.savehex.presavehex.1.pattern.linux=chmod +x "{runtime.platform.path}/delete_merged_output.sh"
recipe.hooks.savehex.presavehex.2.pattern.linux="{runtime.platform.path}/delete_merged_output.sh" {build.export_merged_output} "{build.path}/{build.project_name}.with_bootloader.hex"
recipe.hooks.savehex.presavehex.3.pattern.linux=cp "{build.path}/{build.project_name}.lst" "{sketch_path}"
recipe.hooks.savehex.presavehex.1.pattern.macosx=chmod +x "{runtime.platform.path}/delete_merged_output.sh"
recipe.hooks.savehex.presavehex.2.pattern.macosx="{runtime.platform.path}/delete_merged_output.sh" {build.export_merged_output} "{build.path}/{build.project_name}.with_bootloader.hex"
recipe.hooks.savehex.presavehex.3.pattern.linux=cp "{build.path}/{build.project_name}.lst" "{sketch_path}"

I apologize for the confusion. I wrote the instructions based on the contents of the files on my computer, but I see now I have a newer version (1.5.2) of ATTinyCore installed than you have (1.3.1).

I'll provide the instructions over again, except this time written for ATTinyCore version 1.3.1:

  1. Open the file at this path in any text editor:
    C:\Users\Bowling tough\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.3.1\platform.txt
    
    :exclamation: If looking for it with your file browser or command line, note that the C:\Users\Bowling tough\AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  2. Change line 77 from this:
    recipe.hooks.objcopy.postobjcopy.1.pattern.windows=cmd /C "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
    
    to this:
    recipe.hooks.objcopy.postobjcopy.1.pattern.windows=cmd /C echo. && "{compiler.path}{compiler.objdump.cmd}" {compiler.objdump.flags} "{build.path}/{build.project_name}.elf" > "{build.path}/{build.project_name}.lst"
    
  3. Save the file.
  4. If the Arduino IDE is running, select File > Quit from the Arduino IDE menus.
  5. Start the Arduino IDE.
    β“˜ It is necessary to restart the Arduino IDE in order to make it recognize the change you made to platform.txt.

Now try compiling again. The error should no longer occur.


Please let me know if you have any questions of problems while following those instructions.

Excellent. All working now thank you.

Where can i get version 1.5.2 from for the ATTinyCore

You are welcome. I'm glad it is working now.

You can use the Arduino IDE Boards Manager to update ATTinyCore. I'll provide instructions:

  1. Select File > Preferences from the Arduino IDE menus.
  2. If it is not already there, enter the following URL into the "Additional Boards Manager URLs" field:
    http://drazzy.com/package_drazzy.com_index.json
    
    :exclamation: If there are already Boards Manager URLs in the field, separate them with commas.
  3. Click the OK button.
  4. You will now see a "Downloading index: package_drazzy.com_index.json" notification at the bottom right corner of the IDE window. Wait for that notification to close.
  5. Select Tools > Board > Boards Manager from the Arduino IDE menus to open the "Boards Manager" view in the left side panel.
  6. Scroll down through the list of boards platforms until you see the "ATTinyCore by Spence Konde" entry. Hover the mouse pointer over that entry.
  7. You will now see an "INSTALL" button appear at the bottom of the entry. Click the button.
  8. This will start an update to the latest version of ATTinyCore. The progress of the update will be shown in a notification at the bottom right corner of the Arduino IDE window. Wait for the installation to finish.

The update will remove the bug fix you applied to the platform.txt file. So you will need to repeat that fix. This time around, the first set of instructions I provided will actually be appropriate:

Version 1.5.2 installed with bug fix done and all working

1 Like

Hello, I have a similar problem, but using version 2.0.0 of ATTinyCore with version 2.0.1 of Arduino IDE. I selected the board "ATtiny85 w/Micronucleus (Digispark)" because I'm using a board compatible with this version.

The final message that appears is:

Failed uploading: cannot execute upload tool: exec: "{runtime.tools.micronucleus.path}/micronucleus": file does not exist

I can imagine the reason for the problem (it's not finding the "Micronucleus.exe" file), but I don't know how I can configure the "Plataform.txt" file to work correctly.
I installed ATTinyCore and Micronucleus by synchronizing the GitHub pages in the "hardware" folder under the Arduino folder and ATTinyCore is recognized normally.

Can you help me with this?

You are correct. The problem is this tool is not part of the ATTinyCore repository. It is an external toolchain dependency. Those are automagically installed when you install the ATTinyCore boards platform via the Arduino Boards Manager, but I see you did a manual installation of the platform, which means the tool was not installed.

Do you have a specific reason for installing ATTinyCore this way? I ask because the recommended installation technique for normal usage of ATTinyCore is Boards Manager. The manual installation you did is intended only for those who are doing development work on the ATTinyCore codebase or providing beta testing.

So the easiest solution would be to remove the manual installation and reinstall the platform using Boards Manager.

But if you do want to continue to use the development version of ATTinyCore, I can definitely provide you with the instructions to get Micronucleus installed. In order for me to do that, I will need some additional information from you: What is the exact folder name under the hardware folder where you have installed ATTinyCore?

Thanks a lot for the help. I went back to version 1.5.2 and, although I'm still struggling with some things, I've made some progress.
Despite having more than 35 years of experience in IT (analysis and programming) this is the first time I venture to program processors directly, not only ATtiny85 but also 328p, ESP32, etc. and I'm finding it fascinating.
If I find more problems that I can't solve, I'll bother you again.
Thank you one more time.

You are welcome. I'm glad you have been able to make progress.

Welcome to the wonderful world of embedded systems! It is definitely some fascinating stuff.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.