How to change ESPIDF Framework Version or Modify c_cpp_properties.json?

Hi,

I’ve been fighting an issue with an include file: qrcode.h ever since I updated my Espressif Platform version to a newer one (5.1.0).

Looking back to an old commit of my project (building fine), I had in my c_cpp_properties.json the following include:

"/Users/loganbenda/.platformio/packages/framework-espidf@3.40300.0/components/qrcode/include",

With the new version I don’t have that line, but the file is located at the following local directory (not in c_cpp_properties.json):

/Users/loganbenda/.platformio/packages/framework-espidf/examples/common_components/qrcode/include

How can I do either of the following to potentially fix?

  1. Modify c_cpp_properties.json to include the new path? /Users/loganbenda/.platformio/packages/framework-espidf/examples/common_components/qrcode/include
  2. Add custom library definition to platformio.ini? I tried adding but it didn’t work:
lib_extra_dir = /Users/loganbenda/.platformio/packages/framework-espidf/examples/common_components/qrcode/include
  1. Roll the Framework back to framework-espidf@3.40300.0? *As a last resort.

Thanks!
Logan

If your project needs ESP-IDF v4.3.0 and is incompatible with anything else, best to use

platform = espressif32@4.3.0

in the platformio.ini. (in accordance to the releases).

@maxgerhardt thanks for the insight on selecting the different platforms. I tried a few different versions to get back to working after I upgraded my Espressif 32 Platform but it did not work.

This issue is that at compilation, it cannot find the source location for qrcode.h. I wanted to find a way to directly add that include location but not sure how to do that:

/Users/loganbenda/.platformio/packages/framework-espidf/examples/common_components/qrcode/include

However, I just was able to fix the include, but I’m not sure if it is a viable long term fix. Basically I copied the following:

/Users/loganbenda/.platformio/packages/framework-espidf/examples/common_components/qrcode/include

into the following:

/Users/loganbenda/.platformio/packages/framework-espidf/components/qrcode

I think I’d have to do that for any new release I adopt, since the examples folder in the frameworks isn’t mapped inherently in the includes. Maybe that’s ok though?

So, do you add this extra component into your projects by specifying

list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/qrcode)

in the CMakeLists.txt in the root of the project? Adding stuff from examples/ doesn’t happen automatically.

I had done that before (see full CMakeLists.txt)

set(COMPONENT_SRCS "subscribe_publish_sample.c")
set(COMPONENT_ADD_INCLUDEDIRS ".")
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/qrcode/include)

register_component()

if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
endif()

but it still gave me the following error:

src/subscribe_publish_sample.c:60:10: fatal error: qrcode.h: No such file or directory

****************************************************************
* Looking for qrcode.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:qrcode.h"
* Web  > https://registry.platformio.org/search?q=header:qrcode.h
*
****************************************************************

 #include "qrcode.h"
          ^~~~~~~~~~
compilation terminated.
Archiving .pio/build/esp32dev/esp-idf/app_update/libapp_update.a
Indexing .pio/build/esp32dev/esp-idf/app_update/libapp_update.a
Archiving .pio/build/esp32dev/esp-idf/asio/libasio.a
Indexing .pio/build/esp32dev/esp-idf/asio/libasio.a
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_mem.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_random.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_random_esp32.o
Compiling .pio/build/esp32dev/bootloader_support/src/bootloader_utility.o
Compiling .pio/build/esp32dev/bootloader_support/src/esp_image_format.o
Compiling .pio/build/esp32dev/bootloader_support/src/flash_encrypt.o
Compiling .pio/build/esp32dev/bootloader_support/src/secure_boot.o
Compiling .pio/build/esp32dev/bootloader_support/src/flash_partitions.o
Compiling .pio/build/esp32dev/bootloader_support/src/flash_qio_mode.o
*** [.pio/build/esp32dev/src/subscribe_publish_sample.o] Error 1

When I removed the EXTRA_COMPONENT_DIRS and copied the qrcode files directly into the framework-espidf/components it built fine.

I don’t think the include folder is a valid component directory, but rather the qrcode directory above it.

Same error with the following:

set(COMPONENT_SRCS "subscribe_publish_sample.c")
set(COMPONENT_ADD_INCLUDEDIRS ".")
list(APPEND EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/qrcode)

register_component()

if(CONFIG_EXAMPLE_EMBEDDED_CERTS)
target_add_binary_data(${COMPONENT_TARGET} "certs/aws-root-ca.pem" TEXT)
target_add_binary_data(${COMPONENT_TARGET} "certs/certificate.pem.crt" TEXT)
target_add_binary_data(${COMPONENT_TARGET} "certs/private.pem.key" TEXT)
endif()
src/subscribe_publish_sample.c:60:10: fatal error: qrcode.h: No such file or directory

****************************************************************
* Looking for qrcode.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:qrcode.h"
* Web  > https://registry.platformio.org/search?q=header:qrcode.h
*
****************************************************************

 #include "qrcode.h"
          ^~~~~~~~~~
compilation terminated.
*** [.pio/build/esp32dev/src/subscribe_publish_sample.o] Error 1

@maxgerhardt I just figured it out based on a previous one of your threads: https://community.platformio.org/t/how-to-create-examples-from-platformio-packages-framework-espidf-examples/29822

I had put the path into

/src/CMakeLists.txt

and should have put in the project CMakeLists.txt

/CMakeLists.txt

@maxgerhardt I missed the part about in the root of the project. Works now, thanks!