'Setting sdkconfig using platform.io for the ESP32

I was wondering if anybody managed to set the SDKConfig.h file for the ESP32 when using platform.io to upload code, and if so how it is done.

Thanks in advance!

✌️



Solution 1:[1]

You can copy and modify the file SDKConfig.h into your project include folder from:

/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config/

or paste "CONFIG_ULP_COPROC_RESERVE_MEM" in your code and <Ctrl+LClick> to go to this file in your system.

And add this to your platformio.ini so that the file in your project has priority

build_flags = 
  -Iinclude

Tested with framework-arduinoespressif32 Version 3.10006.210326 (1.0.6)

Let me know if it works for you, I'm guessing it could work with the other frameworks?

if some of the definitions gives you a problem because they are defined elsewhere just add a guard like this:

#ifndef CONFIG_FLASHMODE_DIO
#define CONFIG_FLASHMODE_DIO 1
#endif

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 genghisnico13