Skip to content

Conversation

4project-co-il
Copy link
Contributor

The scripts will search for the "variants_dir" directory specified in custom board ".json" file in:

  • project root directory
  • core_dir
  • framework installed "variants"

Tested cases with project and core_dir. When both locations were not present, the script defaulted to ~/.platformio/packages/framework-arduino-samd/variants as expected

The scripts will search for the "variants_dir" directory specified in custom board ".json" file in:
- project root directory
- core_dir
- framework installed "variants"
@valeros
Copy link
Member

valeros commented Feb 18, 2025

Hi @4project-co-il, thanks for the PR, although I had a slightly more generic implementation in mind. The idea was to allow a developer to use an arbitrary path, including PlatformIO-specific directories like $PROJECT_CORE_DIR.

Do you mind if I push additional changes to your PR?

@4project-co-il
Copy link
Contributor Author

Feel free to change whatever needed.

I saw the $PROJECT_CORE_DIR. Couldn't find what was the intention of that directive.

Everything is possible with the right configuration.
I want to easy on the end customer that should do that configuration.

Right now in order to use a custom board, the end user should copy the boards directory to the core_dir, so the board will appear in the UI during project creation.
After the project is created, the variants directory should be copied to the project root.

I want to minimize the process and remove the second step.
The manufacturer can provide the boards and variants directory and instruct the customer to copy both those directories to the `.platformio' and that's it. No need for the second step. No need to define anything else.
Just an extention to the pre-installed directories in the arduino framework.

@valeros valeros merged commit e876260 into platformio:develop Feb 18, 2025
21 checks passed
@valeros
Copy link
Member

valeros commented Feb 18, 2025

Thanks, merged to the dev branch. Now the following options are supported:

[env:zero]
platform = atmelsam
framework = arduino
board = zero
board_build.variants_dir = project_variants_dir
; board_build.variants_dir = ../../relative_variants_dir
; board_build.variants_dir = ${platformio.core_dir}/core_variants_dir
; board_build.variants_dir = $PROJECT_CORE_DIR/core_variants_dir
; board_build.variants_dir = /arbitrary/path/in/system/variants_dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants