Cannot generate new project in 4.3.2a1

I am trying to create a new ESP32 project using ESP-IDF framework. The following error occurs.
I have tried to make a project using arduino framework and it works.
/Jens

------------------- ERROR -------------------

PIO Core Call Error: The current working directory C:\Users\jjk\CloudStation\PlatformIO\WorkSpace\MainGateway will be used for the project.


The next files/directories have been created in C:\Users\jjk\CloudStation\PlatformIO\WorkSpace\MainGateway
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File


Error: Processing esp32dev (platform: espressif32; board: esp32dev; framework: espidf)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 1.12.0 > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-espidf 3.40000.200303 (4.0.0) 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - tool-idf 1.0.1 
 - tool-mconf 1.4060000.20190628 (406.0.0) 
 - tool-ninja 1.9.0 
 - toolchain-esp32ulp 1.22851.190618 (2.28.51) 
 - toolchain-xtensa32 2.80200.200226 (8.2.0)
Reading CMake configuration…
TypeError: environment can only contain strings:
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\main.py", line 156:
 env.SConscript("$BUILD_SCRIPT")
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\SConscript.py", line 541:
 return _SConscript(self.fs, *files, **subst_kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\SConscript.py", line 250:
 exec file in call_stack[-1].globals
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\main.py", line 210:
 target_elf = env.BuildProgram()
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Environment.py", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 61:
 env.ProcessProgramDeps()
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Environment.py", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 118:
 env.BuildFrameworks(env.get("PIOFRAMEWORK"))
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Environment.py", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py", line 330:
 SConscript(env.GetFrameworkScript(f), exports="env")
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\SConscript.py", line 604:
 return method(*args, **kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\SConscript.py", line 541:
 return _SConscript(self.fs, *files, **subst_kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\SConscript.py", line 250:
 exec file in call_stack[-1].globals
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\espidf.py", line 768:
 else [],
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\espidf.py", line 174:
 run_cmake(src_dir, build_dir, extra_args)
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\espidf.py", line 551:
 run_tool(cmd)
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\espidf.py", line 506:
 result = exec_command(cmd, env=idf_env)
 File "c:\users\jjk\.platformio\penv\lib\site-packages\platformio\proc.py", line 116:
 p = subprocess.Popen(*args, **kwargs)
 File "C:\Users\jjk\.platformio\python27\Lib\subprocess.py", line 390:
 errread, errwrite)
 File "C:\Users\jjk\.platformio\python27\Lib\subprocess.py", line 640:
 startupinfo)
 [FAILED] Took 1.59 seconds

What’s your full platformio.ini?

Its autogenerated when you click on New Project:

; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; Redirecting...

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = espidf

Same issue,
Any body can help?

If you have the latest core version (pio upgrade --dev) and have also tried using the upstream version of the ESP32 core (docs) and it still doesn’t work, report an issue to GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO where @valeros can have a detailed look.

What is the Python version installed in your system? I suspect this issue might be caused by unicode symbols in PATH variable and only occurs with Python 2.

Hi all,

I finally got it working, The Phyton version was to old. I vent into Windows apps and un-installed all Phyton versions (two in my case). Deleted PlatformIO, and then reinstalled PlatformIO, bingo it worked, sort of:

It seems that the new compiler is a bit more restrictive, or helpfull, it discovered some sprintf(x, “%s”, stg). The Compiler could see that the size of stg could overflow x.

An other thing is I need to change some parameters in stdconfig. I had some struggle to run
“pio run -t menuconfig”, it seems its necessary to use latest platformio and not the stable version. Perhaps someone can verify that.