So firstly I created an esp-idf project selecting the board “esp-wrover-kit”, this is the platformio.ini file:
platform = espressif32
board = esp-wrover-kit
framework = espidf
The problem is after running pio to build the project, it generates a sdkconfig.esp-wrover-kit file, where the frequency is set as 160MHz on default in this snippet:
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
So seems like platformio ignored the json configuration for this board. Just to test it further, I added the following line to platformio.ini:
board_build.f_cpu = 240000000L
Cleaned and rebuilt it, but still got the same issue in the sdkconfig.esp-wrover-kit file
From what I could test and understand it seems that platformio ignores these configurations stated in platformio.ini
I also tested another board (esp32dev) by building the espidf-arduino-blink example here
Then followed the exact instructions provided in the README.md file and still got the same issue in the sdkconfig file (sdkconfig.esp32dev)
It’s still set as 160MHz despite the board json config and platformio.ini board_build.f_cpu
PS: The cpu frequency not being the default value is not the only wrong parameter in the sdkconfig file, it also sets the flash size to 2Mb despite being defined as 4Mb in the board json.
There’s probably other configurations ignored as well. So why is platformio not generating the sdkconfig file correctly? I also uninstalled everything clean and reinstalled platformio just in case, and the problem persisted. Thanks.