Errors occurred while compiling “partitions.bin” and “esp32.cpp.0”


the code is as follows:

#include <Arduino.h>
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200); 
  pinMode(2, OUTPUT); 
  digitalWrite(2, LOW); 
}

void loop() { 
  // put your main code here, to run repeatedly:
  digitalWrite(2, HIGH); 
  Serial.println("LED: ON");  
  delay(500); 
  digitalWrite(2, LOW); 
  Serial.println("LED: OFF");
  delay(500);
}

“C:\Users\GGG.platformio\penv\Scripts\platformio.exe ‘run’” terminated with exit code: 1.

Hi, I’m a new hand in esp32. I’ve tried Arduino IDE to compile the code, but it also failed.
I have searched in various forums, but I can’t find any solution. (T_T)
Is the compiler crashed ? And what should I do.
Thanks.

A package (framework, compiler) may be corrupted. Try a clean reinstallation:

  1. Close VSCode
  2. Delete C:\Users\<user>\.platformio
  3. Reopen VSCode
  4. Wait for PlatformIO to reinstall itself
  5. Upload again

Thanks for your reply. I try it. But it doesn’t work. :sob:

Open a PIO CLI and execute

pio run -v -j1

What’s the last few lines of this output?

as follows:

- IC:/Users/GGG/platformio/packages/framework-arduinoespressif32/variants/esp32 src/main.cpp
xtensa-esp32-elf-g++@D:\commands\esp32\Test1\.pio\build\esp32dev\tmpessildao.tmp
**[.pio\build\esp32dev\src\main.cpp.o] Error 1
=====[FAILED] took 11.09 seconds======

What if you move the project to the C: drive?

errors still occur as written above.

Check if Antivirus / Windows Defender interferes.

If you’re out of ideas, please file an issue in https://github.com/platformio/platform-espressif32/issues.

OK. Thank you for providing so many ideas.