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

Command-line Zephyr meta-tool #6205

Closed
7 tasks done
carlescufi opened this issue Feb 14, 2018 · 13 comments
Closed
7 tasks done

Command-line Zephyr meta-tool #6205

carlescufi opened this issue Feb 14, 2018 · 13 comments
Assignees
Labels
area: Device Management Feature A planned feature with a milestone priority: high High impact/importance bug

Comments

@carlescufi
Copy link
Member

carlescufi commented Feb 14, 2018

This issue covers a meta-tool that would run from the command-line in order to build, flash, run, simulate, integrate, etc Zephyr-based images.

Motivation

West is to be added to the Zephyr project to fulfill two fundamental requirements:

  • The ability to work with multiple Git repositories
  • The ability to provide a user-friendly command-line interface to the Zephyr
    build system and debug mechanisms

Fundamental design constraints

  • Building, flashing and debugging must remain compatible with raw CMake
  • One must always be able to drop back to raw command-line (not using the meta-tool directly, although the tool must be installed) and continue working
  • The tools will be written in Python, and split into libraries when possible/adequate

Basic scope

  • Multiple repository management, including fetching and updating repositories that have known integration with Zephyr, such as MCUboot, OpenThread and others.
  • Build, flash, debug, run
  • Bootloader integration. Including image signing, image flashing (with offset) and building the bootloader itself
  • Advanced emulator support, including potentially networking setup with QEMU

Extended scope

Scope of the CMake build system (with the help of the tool):

  • Building
  • Flashing (raw at address 0x0)
  • Debugging
  • Basic emulator usage

Features and Commands to be supported:

  • bootstrap
  • init
  • sync (update repositories from remotes named in manifest) @ulfalizer
  • branch
  • diff
  • status
  • build (TBD, no multi-image support yet) @mbolivar
@nashif nashif added Feature A planned feature with a milestone area: Device Management labels Feb 14, 2018
@carlescufi carlescufi added this to the v1.12.0 milestone Feb 14, 2018
@carlescufi
Copy link
Member Author

carlescufi commented Feb 14, 2018

Name poll.
Reminder: Zephyr is a western wind.

  • washoe explanation
  • vayu explanation
  • breeze
  • wind
  • vind
  • west
  • zeph
  • zippy
  • zool (Zephyr Tool)
  • zmt (Zephyr Meta Tool)
  • zp
  • zt
  • zctl (Zephyr control, eventually we could have zmgr later for management )

@mbolivar
Copy link
Contributor

"zippy"?

$ grep ^z.*p.* /usr/share/dict/american-english 
zap
zap's
zapped
zapper
zapper's
zappers
zapping
zaps
zephyr
zephyr's
zephyrs
zeppelin
zeppelin's
zeppelins
zip
zip's
zipped
zipper
zipper's
zippered
zippering
zippers
zippier
zippiest
zipping
zippy
zips

@jhedberg
Copy link
Member

  • zool (for Zephyr tool)
  • zmt (Zephyr meta-tool)
  • zp
  • zt (Zephyr Tool)

I think we'd want to keep it short (say, max 4 chars), neither of the shortest two character proposals above were found at least in my Linux distro.

@carlescufi
Copy link
Member Author

I like the idea of a 4-letter name, so I will add a few to the list, including Johan's

@nashif nashif added this to v1.12 in Release Plan Feb 14, 2018
@pfalcon
Copy link
Contributor

pfalcon commented Feb 15, 2018

I think we'd want to keep it short (say, max 4 chars)

I'd think we want to keep it clear for people and non-conflicting with the previous generations of tools which smartly wanted to make it short. Existing zephyr-env.sh takes a good lead in that.

Thus, zephyr-tool seems like an obvious choice.

@henrikbrixandersen
Copy link
Member

ztool?

@carlescufi
Copy link
Member Author

@mbolivar @nashif

Here is the roadmap I propose for this tool:

  1. Pick a name
  2. Start development of the tool in scripts/, documented but not as the default mechanism to build and debug.
  3. Add features in this order:
  • Build, including specifying conf file and board
  • Flash, including the different options like masserase or not
  • Debug
  1. Decouple the tool at the same time we introduce multiple repositories, by having a repo for the tool itself. This includes adding support for fetching the repositories themselves. At the same time make the tool the default way of building and flashing, since users will already have to deal with it for repo management. Instead of pypi, I think that maybe having it in a repo could be better, so that the repo itself is updated in the manifest. Need to solve bootstrapping though.

@mbolivar
Copy link
Contributor

mbolivar commented Apr 25, 2018

@carlescufi I'm fine with that if we can come to a resolution quickly on the name.

If the bikeshedding takes more than a week or two, though, I'd like to merge #6832 through the following path:

  • call the tool zprog.py instead of zephyr_run.py, as that's hopefully more clear but won't be a name clash with the meta tool
  • keep it undocumented for now to have it as an experimental implementation detail

I have also been investigating ways to support on Windows the Unix feature that adds ZEPHYR_BASE/scripts to PATH via zephyr_env.sh.

One solution is to add the following to zephyr_env.cmd:

set PYTHONPATH="%PYTHONPATH%;%ZEPHYR_BASE%\scripts"
DOSKEY zprog.py=py -3 -m zprog

This will let cmd users type zprog.py at the command line and have the Windows Python launcher (available since 3.3) find the right Python 3 and invoke zprog.py as a module.

Using zprog.py here is just an example. We could do this only for the meta tool as another option.

@mbolivar
Copy link
Contributor

@nashif and any other interested parties, any comments on the two above proposals?

@mbolivar
Copy link
Contributor

mbolivar commented May 2, 2018

We've been discussing a bit and have come up with the name west.

This name is:

  • short
  • hopefully easy to pronounce by a large proportion of the community
  • ergonomic to type (at least in my opinion on QWERTY and AZERTY)
  • not taken on pip
  • evocative of Zephyr as the western wind
  • not an offensive term in any language we're aware of (checked informally as well as with http://wordsafety.com/)

The name was proposed to the TSC today and received no objections.

If anybody would like to post a strong objection to the name (with a rationale), please do here!

@mbolivar
Copy link
Contributor

Initial west post is up. Old PR which had introduced zephyr_run.py is now obsolete. Future development will proceed through integration into west.

@carlescufi
Copy link
Member Author

Linking this to #6770

@carlescufi carlescufi modified the milestones: v1.12.0, v1.13.0 Jun 19, 2018
@nashif nashif moved this from v1.12 to v1.13 in Release Plan Jun 19, 2018
@nashif nashif moved this from v1.13 to v1.12 in Release Plan Jun 19, 2018
@nashif nashif moved this from v1.12 to v1.13 in Release Plan Jun 19, 2018
@raveslave
Copy link

re:

Bootloader integration. Including image signing, image flashing (with offset) and building the bootloader itself

Good to see this generic tool, things that would be great to see featurewise:

  • Flashing over serial and usb (incl. re-flashing the bootloader itself)
  • Uploading code directly to (where applicable)
    • RAM, external SPI/NAND/eMMC attached to the CPU
  • Standard way signal the application to jump to the bootloader and vice versa
  • Read/Write of "device meta data"
    • i.e. hardware revision & unique serial-no, boot & appl sw version tags, etc.
  • File system interaction (read/write/tree)
  • Pluggable serial-protocol on how to talk to the device
    • i.e. when some exotic USB class might be the only way in
  • Consider some way to add project specific commands?
    • RTC clock(s) read/write
    • raw access to i2c/gpio's and such (usually great for factory testing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Device Management Feature A planned feature with a milestone priority: high High impact/importance bug
Projects
None yet
Development

No branches or pull requests

8 participants