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.

------------------- 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
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)
 - 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\", line 156:
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\", line 541:
 return _SConscript(self.fs, *files, **subst_kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\", line 250:
 exec file in call_stack[-1].globals
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\", line 210:
 target_elf = env.BuildProgram()
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 61:
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 118:
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\", line 224:
 return self.method(*nargs, **kwargs)
 File "C:\Users\jjk\.platformio\penv\lib\site-packages\platformio\builder\tools\", line 330:
 SConscript(env.GetFrameworkScript(f), exports="env")
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\", line 604:
 return method(*args, **kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\", line 541:
 return _SConscript(self.fs, *files, **subst_kw)
 File "C:\Users\jjk\.platformio\packages\tool-scons\script\…\engine\SCons\Script\", line 250:
 exec file in call_stack[-1].globals
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\", line 768:
 else [],
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\", line 174:
 run_cmake(src_dir, build_dir, extra_args)
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\", line 551:
 File "C:\Users\jjk\.platformio\platforms\espressif32\builder\frameworks\", line 506:
 result = exec_command(cmd, env=idf_env)
 File "c:\users\jjk\.platformio\penv\lib\site-packages\platformio\", line 116:
 p = subprocess.Popen(*args, **kwargs)
 File "C:\Users\jjk\.platformio\python27\Lib\", line 390:
 errread, errwrite)
 File "C:\Users\jjk\.platformio\python27\Lib\", line 640:
 [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...

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.