Part 1
요약·해설
추가 저장소와 revision 수동 동기화, ZEPHYR_MODULES 지정, blob 배치, flash/debug host tool과 최소 West workspace 구성을 설명합니다.
manifest projects · revisions
CMake · ZEPHYR_MODULES · blobs
flash · debug · WEST_DIR
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
07EFB92975042536A8E4881A70486890F1AB57B586F621052F49131A57B34FD9
.. _no-west:
Using Zephyr without west
#########################
This page provides information on using Zephyr without west. This is
not recommended for beginners due to the extra effort involved. In
particular, you will have to do work "by hand" to replace these
features:
- cloning the additional source code repositories used by Zephyr in
addition to the main zephyr repository, and keeping them up to date
- specifying the locations of these repositories to the Zephyr build
system
- flashing and debugging without understanding detailed usage of the
relevant host tools
.. note::
If you have previously installed west and want to stop using it,
uninstall it first:
.. code-block:: console
pip3 uninstall west
Otherwise, Zephyr's build system will find it and may try to use
it.
Getting the Source
------------------
In addition to downloading the zephyr source code repository itself,
you will need to manually clone the additional projects listed in the
:term:`west manifest` file inside that repository.
.. code-block:: console
mkdir zephyrproject
cd zephyrproject
git clone https://github.com/zephyrproject-rtos/zephyr
# clone additional repositories listed in zephyr/west.yml,
# and check out the specified revisions as well.
As you pull changes in the zephyr repository, you will also need to
maintain those additional repositories, adding new ones as necessary
and keeping existing ones up to date at the latest revisions.
Building applications
---------------------
You can build a Zephyr application using CMake and Ninja (or make) directly
without west installed if you specify any modules manually.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:tool: cmake
:goals: build
:gen-args: -DZEPHYR_MODULES=module1;module2;...
:compact:
When building with west installed, the Zephyr build system will use it to set
:ref:`ZEPHYR_MODULES <important-build-vars>`.
If you don't have west installed and your application does not need any of
these repositories, the build will still work.
If you don't have west installed and your application *does* need one
of these repositories, you must set :makevar:`ZEPHYR_MODULES`
yourself as shown above.
See :ref:`modules` for more details.
Similarly, if your application requires binary blobs and you are not using
west, you will need to download and place those blobs in the right places
instead of using ``west blobs``. See :ref:`bin-blobs` for more details.
Flashing and Debugging
----------------------
Running build system targets like ``ninja flash``, ``ninja debug``,
etc. is just a call to the corresponding :ref:`west command
<west-build-flash-debug>`. For example, ``ninja flash`` calls ``west
flash``\ [#wbninja]_. If you don't have west installed on your system, running
those targets will fail. You can of course still flash and debug using
any :ref:`flash-debug-host-tools` which work for your board (and which those
west commands wrap).
If you want to use these build system targets but do not want to
install west on your system using ``pip``, it is possible to do so
by manually creating a :term:`west workspace`:
.. code-block:: console
# cd into zephyrproject if not already there
git clone https://github.com/zephyrproject-rtos/west.git .west/west
Then create a file :file:`.west/config` with the following contents:
.. code-block:: none
[manifest]
path = zephyr
[zephyr]
base = zephyr
After that, and in order for ``ninja`` to be able to invoke ``west``
to flash and debug, you must specify the west directory. This can be
done by setting the environment variable ``WEST_DIR`` to point to
:file:`zephyrproject/.west/west` before running CMake to set up a
build directory.
.. rubric:: Footnotes
.. [#wbninja]
Note that ``west build`` invokes ``ninja``, among other
tools. There's no recursive invocation of either ``west`` or
``ninja`` involved by default, however, as ``west build`` does not
invoke ``ninja flash``, ``debug``, etc. The one exception is if you
specifically run one of these build system targets with a command
line like ``west build -t flash``. In that case, west is run twice:
once for ``west build``, and in a subprocess, again for ``west
flash``. Even in this case, ``ninja`` is only run once, as ``ninja
flash``. This is because these build system targets depend on an
up to date build of the Zephyr application, so it's compiled before
``west flash`` is run.
Part 3
한국어 전문 번역
West 없이 Zephyr 사용하기
이 페이지는 West를 사용하지 않고 Zephyr를 다루는 방법을 설명합니다. 대신 해야 할 수동 작업이 많으므로 초보자에게는 권장하지 않습니다.
- Main zephyr 저장소 외에 Zephyr가 사용하는 추가 source 저장소를 직접 clone하고 계속 최신 revision으로 맞춰야 합니다.
- 추가 저장소의 위치를 Zephyr build system에 직접 알려야 합니다.
- 각 board가 사용하는 host tool의 상세 사용법을 이해하고 직접 flash·debug해야 합니다.
Source 얻기
zephyr source 저장소뿐 아니라 그 안의 West manifest에 나열된 추가 project도 모두 수동으로 clone해야 합니다.
mkdir zephyrproject
cd zephyrproject
git clone https://github.com/zephyrproject-rtos/zephyr
# clone additional repositories listed in zephyr/west.yml,
# and check out the specified revisions as well.Zephyr 저장소를 pull할 때마다 추가 저장소 목록도 직접 관리해야 합니다. 새 project가 생기면 clone하고 기존 project는 manifest가 가리키는 최신 revision으로 맞춥니다.
Application build
필요한 module 위치를 직접 지정하면 West가 설치되지 않아도 CMake와 Ninja 또는 Make로 Zephyr application을 build할 수 있습니다.
cmake -Bbuild -GNinja -DZEPHYR_MODULES=module1;module2;... samples/hello_world
ninja -CbuildWest가 설치된 일반 구성에서는 Zephyr build system이 West를 사용해 ZEPHYR_MODULES를 설정합니다.
- West가 없고 application이 추가 저장소를 전혀 필요로 하지 않으면 build는 그대로 동작합니다.
- West가 없고 application이 추가 저장소를 필요로 하면 위 예처럼
ZEPHYR_MODULES를 직접 설정해야 합니다.
Zephyr module 안내에서 module 구조를 더 자세히 설명합니다.
Application에 binary blob이 필요하면 west blobs 대신 blob을 직접 내려받아 올바른 위치에 놓아야 합니다. Binary blob 안내를 참고합니다.
Flash와 debug
ninja flash, ninja debug 같은 build system target은 대응하는 West command를 호출합니다. 예를 들어 ninja flash는 west flash를 실행하므로 West가 설치되지 않은 system에서는 이런 target이 실패합니다.
대신 board에서 동작하는 flash/debug host tool을 직접 사용할 수 있습니다. West command도 내부에서는 바로 그 host tool을 감쌉니다.
System-wide pip 설치 없이 build target을 계속 사용하고 싶다면 최소 West workspace를 수동으로 만들 수 있습니다.
# cd into zephyrproject if not already there
git clone https://github.com/zephyrproject-rtos/west.git .west/west.west/config file을 다음 내용으로 만듭니다.
[manifest]
path = zephyr
[zephyr]
base = zephyrninja가 West를 찾아 flash·debug할 수 있도록 CMake로 build directory를 만들기 전에 WEST_DIR 환경 변수를 zephyrproject/.west/west로 설정해야 합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.