Actually the question: How to compile the firmware for two devices ESP32 and ESP32-S2 in one project?
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 = Radiola2
default_envs =
release
debug
[env]
platform = https://github.com/platformio/platform-espressif32.git
framework = espidf
board = esp-wrover-kit
monitor_speed = 115200
board_build.partitions = partitions.csv
extra_scripts =
pre:pre_extra_script.py
extra_script.py
[common]
build_flags =
-DCONFIG_SPIRAM_CACHE_WORKAROUND
-DCONFIG_RELEASE
-D LV_CONF_INCLUDE_SIMPLE
-Ilib/audio_player/src
-Ilib/fifo/src
-Icomponents/websocket/include
-Icomponents/tda7313
[env:release]
build_type = release
build_flags =
-D FILENAME=Radiola2-release
${common.build_flags}
[env:debug]
build_type = debug
monitor_filters = esp32_exception_decoder
build_flags =
-D FILENAME=Radiola2-debug
${common.build_flags}
-UCONFIG_RELEASE
ESP32 and ESP32-S2 need different sdkconfig
. And in the root of the project, only 1 sdkconfig
file is always created.
In my project Radiola-2 there is a lot of common code for both ESP32 and ESP32-S2.
Please help with advice or an idea on how to implement compilation of firmware for ESP32 and ESP32-S2 in one project.
Thank you.