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

Recommended way to build out-of-tree boards or shields? #1929

Open
jablko opened this issue Sep 7, 2023 · 1 comment
Open

Recommended way to build out-of-tree boards or shields? #1929

jablko opened this issue Sep 7, 2023 · 1 comment

Comments

@jablko
Copy link

jablko commented Sep 7, 2023

Is there documentation on how to build out-of-tree boards or shields?

I have three involved repositories, I think:

To build them, I added to my config/west.yml:

manifest:
  ...
  projects:
    - name: revxlp-config
      remote: petejohanson
      revision: HEAD

Then to my build.yaml I added:

include:
  - board: seeeduino_xiao_ble
    shield: revxlp
    cmake-args: -DBOARD_ROOT="${GITHUB_WORKSPACE}/revxlp-config/config"

It worked, but is this the recommended way/is there a better one? Is there documentation on how to build out-of-tree boards or shields, or on the BOARD_ROOT variable? Related: I found this completed issue on documenting the ZMK_CONFIG variable.

Before I got it working I tried adding to my config/west.yml:

manifest:
  ...
  projects:
    - name: revxlp
      remote: petejohanson
      repo-path: revxlp-config/config/boards/shields/revxlp
      revision: HEAD

That failed: fatal: repository 'https://github.com/petejohanson/revxlp-config/config/boards/shields/revxlp/' not found. West can't clone a repository's subdirectory?

In this case at least the out-of-tree repository is laid out just like the zmk repository (and my zmk-config repository, also), so the next thing I tried is cloning it over top of the zmk directory, by adding to my config/west.yml:

manifest:
  ...
  projects:
    - name: revxlp-config
      remote: petejohanson
      revision: HEAD
      path: zmk

That also failed: Hint: project revxlp-config path "zmk" is taken by project zmk. I didn't try cloning it over top of the root, zmk-config directory --- I doubt that's possible?

That's when I found the BOARD_ROOT and cmake-args variables --- is this the recommended way to build out-of-tree boards or shields?

@caksoylar
Copy link
Contributor

Building with boards/shields found in Zephyr modules is now officially supported via #1989. The setup script now creates a Zephyr module with a boards folder by default (see the template repo), but existing repos like https://github.com/petejohanson/revxlp-config will need to be updated to have /zephyr/module.yml and /config/boards folder moved to /boards.

Here is the updated documentation on building with modules and the new shield guide that encourages defining new shields as modules.

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

No branches or pull requests

2 participants