Code Monkey home page Code Monkey logo

Comments (13)

marc-hb avatar marc-hb commented on July 3, 2024

What specific problem(s) would this solve?

BTW ZEPHYR_BASE was a basically a design mistake:

west is mostly independent of Zephyr and should become totally independent.

from west.

marc-hb avatar marc-hb commented on July 3, 2024

What specific problem(s) would this solve?

Last call before closing?

from west.

mikaelj avatar mikaelj commented on July 3, 2024

@marc-hb to define a standard board for my build, I'd like a west config file. However, as soon as it's defined, zephyr is not found. So i'm forced to manually specify the default board to build for.

from west.

marc-hb avatar marc-hb commented on July 3, 2024

I still don't understand sorry. I ran west config --global build.board qemu_x86 and everything worked fine.

Please provide a specific sequence of commands that is causing an issue.

from west.

mikaelj avatar mikaelj commented on July 3, 2024

Okay, tried it with --local, which works. What I want is for the setting to be project local, i.e. stuff in my local directory, like a .west.config or whatever file.

I'm using the Nordic Connect Zephyr, so I'm guessing it's actually set semi-globally, i.e. for all projects using NCS Zephyr.

I suppose I'm just using West wrong, then...

from west.

marc-hb avatar marc-hb commented on July 3, 2024

Okay, tried it with --local, which works.

So is there any issue left?

What I want is for the setting to be project local, i.e. stuff in my local directory, like a .west.config or whatever file.

"local" directory is unfortunately vague, I guess you mean "in my workspace"?
https://docs.zephyrproject.org/latest/develop/west/config.html

so I'm guessing it's actually set semi-globally, i.e. for all projects using NCS Zephyr.

No, west has no "semi-global" option and it cannot tell which workspace are NCS versus not.

I suppose I'm just using West wrong, then...

We cannot tell until you share a specific list of commands that reproduces the issue. A reproduction ideally without nrfConnect but much better with nrfConnect than no reproduction at all.

Without a reproduction, I also miss how this can be all related to an absolute zephyr.base

from west.

mikaelj avatar mikaelj commented on July 3, 2024

It's really quite simple. Here's what I want.

  1. download nRF Connect so I can use Zephyr on the nRF platform
  2. create a directory for my app, add a bunch of sources, start hacking
  3. set the default board for use by subsequent invocations of "west build"
  4. west build

I thought 3) would be solved by creating a .west/west.yml file in my project directory, with build.board set to something causes the issue to occur, for me, using the zephyr provided with nRF Connect.

I did this since I thought it would set default parameters for the west tool when running in this directory - so I could have per-project setting for which board to use. An app directory w/ source code that does not contain the entire 480M of Zephyr checked out. Since I have many apps on-going, that is a solution I very much not want.

But "project" in west != "an application using the zephyr toolkit", but instead something completely else which I'm yet to grasp.

So in summary, what I want to do is not possible.

The soluton I'll be using is a ./build.sh with "west build -p -b my_board".

Thanks for the effort and patience.

from west.

marc-hb avatar marc-hb commented on July 3, 2024

An app directory w/ source code that does not contain the entire 480M of Zephyr checked out. Since I have many apps on-going, that is a solution I very much not want.

OK, now I think I finally understand the problem. What I think you want is to share Zephyr code between multiple apps to save disk space, correct?

There are multiple ways to do this and some of them might even let you have separate west config build.board but they're all easier if you git checkout your applications inside a west workspace (whether the apps are listed in a west manifest or not). Despite this issue being filed about zephyr.base, I think you still haven't described the directory structure you'd like. Please provide a "picture" similar to one of these:

https://docs.zephyrproject.org/latest/develop/west/workspaces.html#topologies-supported

from west.

mikaelj avatar mikaelj commented on July 3, 2024

My directory structure is simply this.

~/code/goride/fw/zephyr-test:

./CMakeLists.txt
./LICENSE
./prj.conf
./README.md
./src
./src/main.c

That's the same way I write code for other frameworks, such as Flutter, where the framework/lib lives in a read-only directory somewhere on disk, and my code lives in my git repository. I don't have the Flutter framework checked out in my source code directory, nor in any directly ascending parent directories. Instead, it's in /opt/flutter. Which is akin to nRFConnect/Zephyr residing somewhere under /opt/nordic/....

Then I run some sort of build command. For Flutter, it's "flutter build". For Zephyr, I figured out it was "west build". I thought, from the documentation, that there was a way to set default parameters to west, for my specific project. Project, by my definition, is the source code I have written, for the resulting binary I am expecting to be produced by the build command.

Maybe I'm misunderstanding your question.

from west.

marc-hb avatar marc-hb commented on July 3, 2024

Maybe I'm misunderstanding your question.

I don't think that's the main problem. I think the main "communication issue" is you making a ton of assumptions that everyone uses Zephyr and west the same way as you (or... Flutter?!) do. The bad news is: no, a lot of people do NOT use west as you do. This should be pretty obvious after even a very quick look at https://docs.zephyrproject.org/latest/develop/west/workspaces.html#topologies-supported

So you when reporting a bug, you must describe in verbose detail your configuration. When reporting a bug about zephyr.base, you must especially describe your directory structure (which you finally did, thanks!)

Also, suggesting fixes is great but that does not make describing the issue optional https://en.wikipedia.org/wiki/XY_problem

from west.

marc-hb avatar marc-hb commented on July 3, 2024

to define a standard board for my build, I'd like a west config file.

Did you mean a west manifest (e.g. west.yml ) or west config commands?

However, as soon as it's defined,

How did you define what? Share specific commands, not just plain English.

zephyr is not found.

Copy/paste a specific error message.

So i'm forced to manually specify the default board to build for.

I think you later shared a command for that one, thanks.

Okay, tried it with --local, which works.

I think I guessed what you did but next time copy/paste the complete command AND the directory where you ran it.

So if you don't have time to spend understanding how west works, just stop there and everything OK? Or is there still some error message?

If you want to go further, read these two pages:
https://docs.zephyrproject.org/latest/develop/west/basics.html
https://docs.zephyrproject.org/latest/develop/west/config.html

I thought 3) would be solved by creating a .west/west.yml file in my project directory,

This is a manifest, it's not a "configuration file". It does nothing until you run west init, which you do NOT want to run again if you already have. It's unrelated to west config.

with build.board set to something causes the issue to occur,

How did you set build.board? It's unrelated to west.yml.

from west.

marc-hb avatar marc-hb commented on July 3, 2024

I haven't tried it myself but if you don't want to spend time understanding west I've heard good things about https://docs.platformio.org/en/latest/frameworks/zephyr.html

from west.

mikaelj avatar mikaelj commented on July 3, 2024

Let's just call it a day. Thanks for the alternative suggestion and links to the documentation.

from west.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.