IDE cannot detect the sdkconfig.h setting

XiotSamuel
Posts: 53
Joined: Sun Aug 29, 2021 1:50 pm

IDE cannot detect the sdkconfig.h setting

Postby XiotSamuel » Fri Oct 22, 2021 1:40 am

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
Attachments
Screenshot 2021-10-22 at 9.38.54 AM.png
Screenshot 2021-10-22 at 9.38.54 AM.png (593.52 KiB) Viewed 21098 times

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: IDE cannot detect the sdkconfig.h setting

Postby boarchuz » Fri Oct 22, 2021 2:07 am

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.

XiotSamuel
Posts: 53
Joined: Sun Aug 29, 2021 1:50 pm

Re: IDE cannot detect the sdkconfig.h setting

Postby XiotSamuel » Fri Oct 22, 2021 2:29 am

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
}
Attachments
Screenshot 2021-10-22 at 10.29.25 AM.png
Screenshot 2021-10-22 at 10.29.25 AM.png (586.24 KiB) Viewed 21058 times

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: IDE cannot detect the sdkconfig.h setting

Postby boarchuz » Fri Oct 22, 2021 2:45 am

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.

XiotSamuel
Posts: 53
Joined: Sun Aug 29, 2021 1:50 pm

Re: IDE cannot detect the sdkconfig.h setting

Postby XiotSamuel » Fri Oct 22, 2021 3:32 am

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
}

XiotSamuel
Posts: 53
Joined: Sun Aug 29, 2021 1:50 pm

Re: IDE cannot detect the sdkconfig.h setting

Postby XiotSamuel » Fri Oct 22, 2021 4:25 pm

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
}

godzilla2
Posts: 19
Joined: Wed Apr 28, 2021 5:15 am

Re: IDE cannot detect the sdkconfig.h setting

Postby godzilla2 » Tue Mar 29, 2022 3:31 am

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
}

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: IDE cannot detect the sdkconfig.h setting

Postby boarchuz » Tue Mar 29, 2022 3:41 am

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).

boarchuz
Posts: 606
Joined: Tue Aug 21, 2018 5:28 am

Re: IDE cannot detect the sdkconfig.h setting

Postby boarchuz » Tue Mar 29, 2022 4:25 am

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).

godzilla2
Posts: 19
Joined: Wed Apr 28, 2021 5:15 am

Re: IDE cannot detect the sdkconfig.h setting

Postby godzilla2 » Tue Mar 29, 2022 9:30 pm

Appreciate your help, thanks for spotting that!! Your config file looks impressive. Taking a look at it.

Who is online

Users browsing this forum: No registered users and 67 guests