PlatformIO is not updating ESP-IDF files

I replied to another post on this a few minutes ago but this seems pretty major given the moving target of ESP-IDF and seems to deserve its own topic.

I had some trouble with code compiling and discovered that one of my ESP-IDF files was out of date and does not match the github file for version 2.1 (found here GitHub - espressif/esp-idf: Espressif IoT Development Framework. Official development framework for Espressif SoCs.), specifically file components/bt/bluedroid/api/include/esp_gatt_defs.h.

I ran pio platform show expressif32 with the following results
Package framework-espidf

Type: framework
Requirements: ~2.210.0
Installed: Yes
Version: 2.210.0
Original version: 2.10
Description: Espressif IoT Development Framework with the ESP32

This seems to show version 2.210.0 version installed? However, I still do not have updated files. Can someone please give me some input here.

My next step is to manually install the latest version although with all of the automatic triggers of PlatformIO (like regenning c_cpp_properties), I’m not all that confident that this will work.

Hi @rweller59! Could you please point out exactly where is the difference?

in this specific file: components/bt/bluedroid/api/include/esp_gatt_defs.h

  • in version installed by PlatformIO, last line of file = line 395 (#endif /* ESP_GATT_DEFS_H */)

  • in version on GitHub, last line of file = 462 (#endif /* ESP_GATT_DEFS_H */)

fyi - I manually installed latest esp-idf (or tried). changed the original directory name and then installed new version into new directory with original name. Unfortunately PlatformIO tracked my renaming of the original file and changed the c_cpp_properties.json to the renamed location. I assume I can get past that by simply overwriting the original files but haven’t got to that step yet

Hm, are you sure we are talking about version 2.1? Because there is no line #462 in 2.1 release, this line only appeared in the master branch a month ago.
Am I missing something?

No you are not missing anything. I guess I was missing the point and looking at the ‘master’ files and not the official release 2.1 so this is my error. Sorry about that.

That said, can I use the most updated code? If so, by overwriting the files as I was going to try?

It should work unless there are critical changes in structure or component build logic. Anyway, to update the framework you can just replace all source files in framework-espidf folder (package.json file must be the same).

Unfortunately, overwriting didn’t work. As soon as I started VS Code, PlatformIO downloaded all of the other files again.

Any other options? I’m really trying to stick with PlatformIO and not have to move to the ESP-IDF but need some of this latest release stuff primarily for the BTE support

Have you left the original package.json file? The version mismatch in the platform.json and package.json in the framework-espidf folder will cause PlatformIO to rewrite your changes.

nope, I overwrote everything. will trying leaving that in place and see what happens

left the package.json, overwrote everything else. got the following when I tried to compile:

*** Two environments with different actions were specified for the same target: C:\Users\Rick\Documents\Platform
IO\Projects\OrbProject_ESP32.pioenvs\featheresp32\app_trace\app_trace.o
(action 1: xtensa-esp32-elf-gcc -o app_trace.o -c -Wno-old-style-declaration -std=gnu99 -Wall -Werror=all -Wno-e
rror=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-error=unused-function -Og -g3
-nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-s
ections -fdata-sections -fstrict-volatile-bitfields $(subst --coverage,$(CFLAGS)) -DWITH_POSIX -DIDF_VER="2.21
0.0" -DESP32 -DESP_PLATFORM -DF_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -
DPLATFORMIO=30500 -DESP32_DEV -DARDUINO_FEATHER_ESP32 @“c:\Users\Rick\Documents\PlatformIO\Projects\OrbProject_E
SP32.pioenvs\featheresp32\longcmd-5e13a7ec2319495d94810c4ba2c9ed10” app_trace.c)
(action 2: xtensa-esp32-elf-gcc -o app_trace.o -c -Wno-old-style-declaration -std=gnu99 -Wall -Werror=all -Wno-e
rror=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-error=unused-function -Og -g3
-nostdlib -Wpointer-arith -Wno-error=unused-but-set-variable -Wno-error=unused-variable -mlongcalls -ffunction-s
ections -fdata-sections -fstrict-volatile-bitfields -DWITH_POSIX -DIDF_VER="2.210.0" -DESP32 -DESP_PLATFORM -D
F_CPU=240000000L -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DPLATFORMIO=30500 -DESP32_DEV -
DARDUINO_FEATHER_ESP32 @“c:\Users\Rick\Documents\PlatformIO\Projects\OrbProject_ESP32.pioenvs\featheresp32\long
cmd-5e13a7ec2319495d94810c4ba2c9ed10” app_trace.c)
File “C:\Users\Rick.platformio\penv\lib\site-packages\platformio\builder\tools\platformio.py”, line 272, in Bui
ldLibrary

Unfortunately, seems like they’ve changed something, so there is no an easy way to update the framework without rewriting build script.

OK, guess I’ll have to switch to some other environment (just when I was getting used to this one).

Seems like there should be a setting defined so that a user can enable/disable automatic updating…