ESP32: using compile options from ESP-IDF - values overwritten by some libraries?

Just an example I set in platformio.ini:
to unconfigure it, but still while running the program I get:
but if I do:
I get:

In file included from /home/pi/.platformio/packages/framework-arduinoespressif32/cores/esp32/USB.h:16,
                 from /home/pi/.platformio/packages/framework-arduinoespressif32/cores/esp32/USB.cpp:14:
/home/pi/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/dio_qspi/include/sdkconfig.h:402: warning: "CONFIG_FREERTOS_HZ" redefined
 #define CONFIG_FREERTOS_HZ 1000

and finally when I do first U and then D:


I still get 1000Hz rather than 2000Hz
So, is there any way of overwrite the CONFIG values in platformio?

Will break per

You can’t undefine a macro defined in code from the CL


Maybe the most important part: Even if you did directly edit the sdkconfig.h to change it to 2000 (Hz), it would have no effect, since FreeRTOS is a precompiled library in Arduino-ESP32 and is not recompiled from source with your 2000Hz setting. You would have to go the framework = espidf, arduino route (example, config) for that. Again, since 2000 Hz will break Arduino per link above, I don’t see much sense in that.

thank you @maxgerhardt - I used completely wrong example of CONFIG_…
I actually wanted to use different ones but…
When I switch from Arduino to espidf framework, these config variables are easier to manage
but I am not really skilled enough to program in ESP IDF - rather Arduino inside Platformio
But I realised while using Arduino framework, there are lots of restrictions or lets say: simplifications coming from Arduino.h