ESP32-C3 SuperMini config

After literally days of trying every suggested fix, I am unable to get a simple blink program to compile of PlatformIO.
Please point me to a solution. The program works fine on the Arduino IDE. I can use the ESP32 DOIT devkit v1 on PlatformIO. Where is my disconnect?

[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
monitor_speed = 115200
monitor_port =  COM9
build_flags=
  -DARDUINO_USB_MODE=1
  -DARDUINO_USB_CDC_ON_BOOT=1
#include <Arduino.h>

const int LED_PIN = 8; // Define the GPIO for the LED on SuperMini

void setup()
{
  Serial.begin(115200);            // Start serial communication at 115200 baud rate
  Serial.println("Hello, ESP32!"); // Print message to serial monitor
  pinMode(LED_PIN, OUTPUT);        // Set LED_PIN as output
}

void loop()
{
  Serial.println("loop()");
  digitalWrite(LED_PIN, HIGH); // Turn LED on
  delay(1000);                 // Wait 1 second
  digitalWrite(LED_PIN, LOW);  // Turn LED off
  delay(1000);                 // Wait 1 second
}
Verbose mode can be enabled via `-v, --verbose` option
NameError: name 'config' is not defined:
  File "C:\Users\KarlB\.platformio\penv\Lib\site-packages\platformio\builder\main.py", line 173:
    env.SConscript("$BUILD_SCRIPT")
  File "C:\Users\KarlB\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 620:
    return _SConscript(self.fs, *files, **subst_kw)
  File "C:\Users\KarlB\.platformio\packages\tool-scons\scons-local-4.8.1\SCons\Script\SConscript.py", line 280:
    exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
  File "C:\Users\KarlB\.platformio\platforms\espressif32@src-6702293b941d3896da49241577f9b2cc\builder\main.py", line 313:
    if not check_lib_archive_exists():
  File "C:\Users\KarlB\.platformio\platforms\espressif32@src-6702293b941d3896da49241577f9b2cc\builder\main.py", line 306:
    for section in config.sections():
========================== [FAILED] Took 1.42 seconds =======

Delete that folder, and every C:\Users\KarlB\.platformio\platforms\espressif32* folder. Delete the .pio folder of the project.

Upload the firmware again.

Thank you for your quick response with an effective solution. I knew it was going to work even before compiling it - there were no squiggles under Arduino.h!

Just out of curiosity, were both folder deletions necessary?

It just looked to me like espressif32@src-6702293b941d3896da49241577f9b2cc was some kind of unstable git version of some espressif platform that might have been downloaded in the past, so deleting those folders will cause PlatformIO o grab the latest stable version of the official espressif32 platform, which I exprect to work.

I wouldn’t expect that. I’d expect it to grab a two year old Arduino library and an eight year old compiler.

Slightly less cynically, why do so many of these posts end up with “rm -fr ~/platformio” (or deltree or however it’s spelled) anyway? Has anyone ever really investigated why these worktrees are self-destructing with the frequency they are?

1 Like

The issue of needing delete folder .platformi will be gone with the next pioarduino Arduino release. It will be needed one more time and hopefully never again after this step.Or use the develop branch. There is the change already done. I do not use most parts of the Platformio Installer, use a own or better said the slightly modified espressif espidf installer. Mostly nothing is installed from Platformio Registry anymore. All needed tools and toolchains are downloaded from Github repos release section. No more gatekeeper Platformio vendor lock in.

1 Like