Problem adding CONFIG_ADC to build flags in platformio.ini

Hi, I’m trying to add a build flag but it isn’t working for some reason:

platform = espressif32  
board = esp32-c3-devkitm-1
framework = arduino 
build_flags = 

For context, my device is complaining that:

E (166733) ADC: ADC2 is no longer supported, please use ADC1. Search for errata on espressif website for more details. You can enable ADC_ONESHOT_FORCE_USE_ADC2_ON_C3 to force use ADC2

So I’m trying to work around it by enabling this espressif adc config value. I’ve tried variations, with/without “CONFIG_” at the start, adding “=1” at the end, etc. but the device still spurts out that error message so I guess it isn’t kicking in :frowning:

Since you are using framework = arduino, changing any CONFIG_.. flags has exactly 0 effect since it’s using a precompiled ESP-IDF base (where these macros are all evaluated). If you wanted to change parameters for the ESP-IDF build, you would have to convert your project into an ESP-IDF project with Arduino-ESP32 on top, like the official example shows.

This may however be an X-Y question and what you really might want is to in fact use ADC1.

Oh blimey, that’s irritating. Well I’m using all the ADCs, and they function just fine with my hardware so it’s annoying that they’ve disabled it around espressif32@6.4.0

Thank you though, that’s just the information I need @maxgerhardt :slight_smile:

If an Arduino-ESP32 core update brought about the issue, you can downgrade the espressif32 platform so that an older working version is used instead. See docs and releases.

Can confirm that both work, either downgrading to espressif32@5.4.0 or adapting it to ESP-IDF style with the sdkconfig value of CONFIG_ADC_ONESHOT_FORCE_USE_ADC2_ON_C3=y
Thanks again.