How do I switch to sdkconfig.h for the desired configuration?

My platformio.ini:

; 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
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = main
include_dir = main/include
description = Radiola-ESP32
default_envs = 
	; wrover_debug
	S2_debug

[env]
platform = https://github.com/platformio/platform-espressif32.git
framework = espidf
monitor_speed = 115200
;upload_speed = 1152000 576000 921600
;upload_speed = 576000
monitor_filters = direct
board_build.partitions = partitions.csv
extra_scripts = 
	pre:pre_extra_script.py
	extra_script.py

[common]
build_flags = 
	-DCONFIG_RELEASE
	-D LV_CONF_INCLUDE_SIMPLE

[env:wrover_release]
board = esp-wrover-kit
build_type = release
build_flags =
	-DCONFIG_SPIRAM_CACHE_WORKAROUND
	-D FILENAME=Radiola-2_release
	${common.build_flags}

[env:wrover_debug]
board = esp-wrover-kit
build_type = debug
monitor_filters = esp32_exception_decoder
build_flags =
	-DCONFIG_SPIRAM_CACHE_WORKAROUND
	-D FILENAME=Radiola-2_debug
	${common.build_flags}
	-UCONFIG_RELEASE

[env:S2_release]
board = esp32-s2-saola-1
build_type = release
build_flags = 
	-D FILENAME=Radiola-S2_release
	${common.build_flags}

[env:S2_debug]
board = esp32-s2-saola-1
build_type = debug
monitor_filters = esp32_exception_decoder
build_flags = 
	-D FILENAME=Radiola-S2_debug
	${common.build_flags}
	-UCONFIG_RELEASE

The project tasks look like this:
2021-10-25_11-07-25

How can I switch to the sdkconfig.h of the project I need to correctly display the code in the VScode editor and the correct operation of other functions, for example, the monitor, without recompiling the entire project?


Now I am switching sdkconfig.h by selecting the desired configuration in the [platformio] section.

default_envs = 
	; wrover_debug
	S2_debug

or

default_envs = 
	wrover_debug
	; S2_debug

This leads to a complete recompilation of the project, which is very tiring because of the long wait.
Am I missing something and doing it all wrong?
Any help is appreciated!

This is the correct way, PlatformIO will load the sdkconfig.<environment> file as the base sdkconfig from which the header files etc. are generated. You can open in issue at Issues · platformio/platform-espressif32 · GitHub for the performance issue.

1 Like

I would love to, but I am currently problems in a project with ESP32 at the level of framework libraries (I solve this problem with the developers of the esp-idf framework) and very little free time.
And by the way, you will be able to explain it better.
Taking this opportunity, I express my gratitude for the implementation of the possibility of working with different chips in one project (I once asked about this, and you raised a issue).