Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix support for multiple sdkconfig files #1252

Merged
merged 9 commits into from
Oct 11, 2024

Conversation

brianignacio5
Copy link
Collaborator

@brianignacio5 brianignacio5 commented Jul 17, 2024

Description

Fix support of multiple sdkconfig when using Project Configuration and multiple profiles.

Fixes #1202
Fixes #1265
Fixes #1283
Fixes #1299

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Steps to test this pull request

Using a project with multiple configurations like https://github.com/espressif/esp-idf/tree/master/examples/build_system/cmake/multi_config run the ESP-IDF: Open Project Configuration and configure 2 profiles with different SDK Configuration Editor, resulting in a esp_idf_project_configuration.json like this:

{
  "gen1": {
    "build": {
      "compileArgs": [],
      "ninjaArgs": [],
      "buildDirectoryPath": "${workspaceFolder}/build_gen1",
      "sdkconfigDefaults": [
        "sdkconfig.prod_common",
        "sdkconfig.prod1"
      ],
      "sdkconfigFilePath": "${workspaceFolder}/sdkconfig1"
    },
    "env": {},
    "flashBaudRate": "",
    "idfTarget": "",
    "monitorBaudRate": "",
    "openOCD": {
      "debugLevel": 0,
      "configs": [],
      "args": []
    },
    "tasks": {
      "preBuild": "",
      "preFlash": "",
      "postBuild": "",
      "postFlash": ""
    }
  },
  "gen2": {
    "build": {
      "compileArgs": [],
      "ninjaArgs": [],
      "buildDirectoryPath": "${workspaceFolder}/build_gen2",
      "sdkconfigDefaults": [
        "sdkconfig.prod_common",
        "sdkconfig.prod2"
      ],
      "sdkconfigFilePath": "${workspaceFolder}/sdkconfig2"
    },
    "env": {},
    "flashBaudRate": "",
    "idfTarget": "",
    "monitorBaudRate": "",
    "openOCD": {
      "debugLevel": 0,
      "configs": [],
      "args": []
    },
    "tasks": {
      "preBuild": "",
      "preFlash": "",
      "postBuild": "",
      "postFlash": ""
    }
  }
}

Note: If using the former ESP-IDF multi config example, remember to remove from root CMakeLists.txt the line:

set(SDKCONFIG "${CMAKE_BINARY_DIR}/sdkconfig")
  1. Click on "SDK Configuration Editor" using profile 1. SDK Configuration changes should be saved in ${workspaceFolder}/sdkconfig1 and c_cpp_properties.json should have compileCommands set to the build path of profile 1.

  2. Click on "SDK Configuration Editor" using profile 2. SDK Configuration changes should be saved in ${workspaceFolder}/sdkconfig2 and c_cpp_properties.json should have compileCommands set to the build path of profile 2.

  3. Observe results.

  • Expected behaviour:

  • Expected output:

How has this been tested?

Manual Testing

Test Configuration:

  • ESP-IDF Version: 5.2
  • OS (Windows,Linux and macOS): macOS

Checklist

  • PR Self Reviewed
  • Applied Code formatting
  • Added Documentation
  • Added Unit Test
  • Verified on all platforms - Windows,Linux and macOS

@brianignacio5 brianignacio5 self-assigned this Jul 17, 2024
Copy link

github-actions bot commented Jul 17, 2024

Download the artifacts for this pull request:

@executer-uno
Copy link

Hello.
Thanks for fast fix. But can you please check #1265 - as for me, there is one issue left.

Copy link
Collaborator

@radurentea radurentea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brianignacio5
Copy link
Collaborator Author

Hi @executer-uno , please take a look at latest changes. It should kill the current sdkconfig editor process as described in your GitHub issue.

@executer-uno
Copy link

Thanks. That one tested and no issues left, as for me.

Copy link

github-actions bot commented Sep 4, 2024

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Sep 4, 2024
@brianignacio5 brianignacio5 removed the stale Stale PR or Issue label Sep 9, 2024
Copy link

Pull request has been marked as stale since there are no activities, and this will be closed in 5 days if there are no further activities

@github-actions github-actions bot added the stale Stale PR or Issue label Sep 24, 2024
@brianignacio5 brianignacio5 added ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot and removed stale Stale PR or Issue labels Sep 24, 2024
@brianignacio5 brianignacio5 force-pushed the bugfix/multi-config-sdkconfig-editor branch from fddd0d5 to d18baa4 Compare September 24, 2024 07:01
@brianignacio5 brianignacio5 force-pushed the bugfix/multi-config-sdkconfig-editor branch from cc0d319 to 9024eee Compare September 29, 2024 03:14
@Fabricio-ESP
Copy link
Collaborator

Tested on Windows 11 and Ubuntu 24.04 environment. The sdkconfig files define in the project configuration abe being updated properly when running menuconfig, instead of the file in the build folder.
The target configuration is now being read from the sdkconfig file, for the scenario where the file does not exist (not created by the user, and not being generated yet) the target device is not updated in the status bar. As an improvement we could set the target as ESP32 (which is the default target) when a target is not found in the sdkconfig file, to avoid any confusion for the user. But understood that this feature is used mainly by advanced users, which are familiar with the workflow to set the device target.

@brianignacio5 brianignacio5 merged commit ed521c9 into master Oct 11, 2024
7 checks passed
@brianignacio5 brianignacio5 deleted the bugfix/multi-config-sdkconfig-editor branch October 11, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ongoing Ongoing Issue or PR, this label will be used for issue or PR which is to be excluded by stale bot
Projects
None yet
4 participants