Page 1 of 2

IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 1:40 am
by XiotSamuel
Hi. I am using VScode and always found that the IDE seem cannot detect the sdkconfig.h setting before or after the build.

I have done a idf.py full clean and idf.py menuconfig and save, but the error seem still here. The weird part is I can still build normally. Any solution for this???

Image

Re: IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 2:07 am
by boarchuz
Add "${workspaceFolder}/build/config" to your includePath in c_cpp_properties.json

Also helps to include sdkconfig.h directly in files where CONFIG_ values are used.

Re: IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 2:29 am
by XiotSamuel
Seem not really work. The error still stuck here.

Code: Select all

{
    "configurations": [
        {
            "name": "MACOS",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/include/**",
                "${workspaceFolder}/components/**",
                "/Users/esp32/.espressif/esp-mdf/components/**",
                "/Users/esp32/.espressif/esp-mdf/esp-idf/components/**",
                "${workspaceFolder}/build/config"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "cStandard": "c17",
            "cppStandard": "c++17",
            "compilerPath": "/Users/esp32/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
            "intelliSenseMode": "macos-gcc-x64",
            "browse": {
                "path": [
                    "${workspaceFolder}/",
                    "${workspaceFolder}/include/",
                    "${workspaceFolder}/components/",
                    "/Users/esp32/.espressif/esp-mdf/components/",
                    "/Users/esp32/.espressif/esp-mdf/esp-idf/components/",
                    "${workspaceFolder}/build/config"
                ]
            }
        }
    ],
    "version": 4
}

Re: IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 2:45 am
by boarchuz
Some suggestions:

Add compileCommands: https://github.com/espressif/vscode-esp ... mmandsjson

Move the build/config entry to first in the includePath list

Improve other settings: cStandard to "c11", cppStandard to "c++17", intellisenseMode to "gcc-x86"

Ensure the Intellisense configuration is selected ("C/C++: Select a Configuration..."). I would expect to see the name, "MACOS", somewhere along the status bar.

Reset Intellisense database, restart VS Code, rescan workspace.

Re: IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 3:32 am
by XiotSamuel
This one seem work now. Thanks

Code: Select all

{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "/Users/esp32/.espressif/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${workspaceFolder}/build/config",
                "${config:idf.espIdfPath}/components/**",
                "${config:idf.espIdfPathWin}/components/**",
                "${config:idf.espAdfPath}/components/**",
                "${config:idf.espAdfPathWin}/components/**",
                "${config:idf.espMdfPath}/components/**",
                "${config:idf.espMdfPathWin}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${workspaceFolder}/build/config",
                    "${config:idf.espIdfPath}/components",
                    "${config:idf.espIdfPathWin}/components",
                    "${config:idf.espAdfPath}/components/**",
                    "${config:idf.espAdfPathWin}/components/**",
                    "${config:idf.espMdfPath}/components/**",
                    "${config:idf.espMdfPathWin}/components/**",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            },
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

Re: IDE cannot detect the sdkconfig.h setting

Posted: Fri Oct 22, 2021 4:25 pm
by XiotSamuel
updated the compiler Path

Code: Select all

{
    "configurations": [
        {
            "name": "ESP-IDF",
            "compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp32-elf/esp-2021r1-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "includePath": [
                "${workspaceFolder}/build/config",
                "${config:idf.espIdfPath}/components/**",
                "${config:idf.espIdfPathWin}/components/**",
                "${config:idf.espAdfPath}/components/**",
                "${config:idf.espAdfPathWin}/components/**",
                "${config:idf.espMdfPath}/components/**",
                "${config:idf.espMdfPathWin}/components/**",
                "${workspaceFolder}/**"
            ],
            "browse": {
                "path": [
                    "${workspaceFolder}/build/config",
                    "${config:idf.espIdfPath}/components",
                    "${config:idf.espIdfPathWin}/components",
                    "${config:idf.espAdfPath}/components/**",
                    "${config:idf.espAdfPathWin}/components/**",
                    "${config:idf.espMdfPath}/components/**",
                    "${config:idf.espMdfPathWin}/components/**",
                    "${workspaceFolder}"
                ],
                "limitSymbolsToIncludedHeaders": false
            },
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

Re: IDE cannot detect the sdkconfig.h setting

Posted: Tue Mar 29, 2022 3:31 am
by godzilla2
I'm hitting this issue still.

Edit: deleting compileCommands seems to have fixed it.

Code: Select all

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/build/config",
                "${workspaceFolder}/../../esp-idf/components/nvs_flash/include",
                "${workspaceFolder}/../jamcorder_common",
                "${workspaceFolder}/../../esp-idf/**",
                "${workspaceFolder}/**"
            ],
            "defines": [],
            "compilerPath": "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/.espressif/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64",
            "compileCommands": "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/jamcorder-firmware/jamcorder_app/build/bootloader/compile_commands.json"
        }
    ],
    "version": 4
}

Re: IDE cannot detect the sdkconfig.h setting

Posted: Tue Mar 29, 2022 3:41 am
by boarchuz
godzilla2 wrote:
Tue Mar 29, 2022 3:31 am
deleting compileCommands seems to have fixed it.

Code: Select all

            "compileCommands": "/Volumes/User/MBP-Google-Drive/jamcorder/firmware/jamcorder-firmware/jamcorder_app/build/bootloader/compile_commands.json"
You will get better help with compileCommands, you just have the wrong path there (that's the bootloader path).

Re: IDE cannot detect the sdkconfig.h setting

Posted: Tue Mar 29, 2022 4:25 am
by boarchuz
Also, having just seen your GitHub issue with includes ordering, you might be interested in copying/referencing my config here which should resolve that: https://github.com/boarchuz/espidf-vsco ... rties.json (make sure to select "ESP-IDF [Xtensa | esp-2021r2-patch3-8.4.0]" for your environment).

Re: IDE cannot detect the sdkconfig.h setting

Posted: Tue Mar 29, 2022 9:30 pm
by godzilla2
Appreciate your help, thanks for spotting that!! Your config file looks impressive. Taking a look at it.