Part 1
요약·해설
지원 architecture, SDK bundle과 탐지 변수, 여러 version 선택, 호환성 matrix, Ubuntu·macOS·Windows용 v0.16.8 설치·검증·setup 절차를 설명합니다.
ARC · ARM · RISC-V · x86
CMake registry · install dir
Linux · macOS · Windows
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
310907E12CEEB97D8A40BCFC6CADDF1F5E725F5991F246F16089FF26571BD19F
.. _toolchain_zephyr_sdk:
Zephyr SDK
##########
The Zephyr Software Development Kit (SDK) contains toolchains for each of
Zephyr's supported architectures. It also includes additional host tools, such
as custom QEMU and OpenOCD.
Use of the Zephyr SDK is highly recommended and may even be required under
certain conditions (for example, running tests in QEMU for some architectures).
Supported architectures
***********************
The Zephyr SDK supports the following target architectures:
* ARC (32-bit and 64-bit; ARCv1, ARCv2, ARCv3)
* ARM (32-bit and 64-bit; ARMv6, ARMv7, ARMv8; A/R/M Profiles)
* MIPS (32-bit and 64-bit)
* Nios II
* RISC-V (32-bit and 64-bit; RV32I, RV32E, RV64I)
* x86 (32-bit and 64-bit)
* Xtensa
.. _toolchain_zephyr_sdk_bundle_variables:
Installation bundle and variables
*********************************
The Zephyr SDK bundle supports all major operating systems (Linux, macOS and
Windows) and is delivered as a compressed file.
The installation consists of extracting the file and running the included setup
script. Additional OS-specific instructions are described in the sections below.
If no toolchain is selected, the build system looks for Zephyr SDK and uses the toolchain
from there. You can enforce this by setting the environment variable
:envvar:`ZEPHYR_TOOLCHAIN_VARIANT` to ``zephyr``.
If you install the Zephyr SDK outside any of the default locations (listed in
the operating system specific instructions below) and you want automatic discovery
of the Zephyr SDK, then you must register the Zephyr SDK in the CMake package registry
by running the setup script. If you decide not to register the Zephyr SDK in the CMake registry,
then the :envvar:`ZEPHYR_SDK_INSTALL_DIR` can be used to point to the Zephyr SDK installation
directory.
You can also set :envvar:`ZEPHYR_SDK_INSTALL_DIR` to point to a directory
containing multiple Zephyr SDKs, allowing for automatic toolchain selection. For
example, you can set ``ZEPHYR_SDK_INSTALL_DIR`` to ``/company/tools``, where the
``company/tools`` folder contains the following subfolders:
* ``/company/tools/zephyr-sdk-0.13.2``
* ``/company/tools/zephyr-sdk-a.b.c``
* ``/company/tools/zephyr-sdk-x.y.z``
This allows the Zephyr build system to choose the correct version of the SDK,
while allowing multiple Zephyr SDKs to be grouped together at a specific path.
.. _toolchain_zephyr_sdk_compatibility:
Zephyr SDK version compatibility
********************************
In general, the Zephyr SDK version referenced in this page should be considered
the recommended version for the corresponding Zephyr version.
For the full list of compatible Zephyr and Zephyr SDK versions, refer to the
`Zephyr SDK Version Compatibility Matrix`_.
.. _toolchain_zephyr_sdk_install:
Zephyr SDK installation
***********************
.. toolchain_zephyr_sdk_install_start
.. note:: You can change |sdk-version-literal| to another version in the instructions below
if needed; the `Zephyr SDK Releases`_ page contains all available
SDK releases.
.. note:: If you want to uninstall the SDK, you may simply remove the directory
where you installed it.
.. tabs::
.. group-tab:: Ubuntu
.. _ubuntu_zephyr_sdk:
#. Download and verify the `Zephyr SDK bundle`_:
.. parsed-literal::
cd ~
wget |sdk-url-linux|
wget -O - |sdk-url-linux-sha| | shasum --check --ignore-missing
If your host architecture is 64-bit ARM (for example, Raspberry Pi), replace ``x86_64``
with ``aarch64`` in order to download the 64-bit ARM Linux SDK.
#. Extract the Zephyr SDK bundle archive:
.. parsed-literal::
tar xvf zephyr-sdk- |sdk-version-trim| _linux-x86_64.tar.xz
.. note::
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
* ``$HOME``
* ``$HOME/.local``
* ``$HOME/.local/opt``
* ``$HOME/bin``
* ``/opt``
* ``/usr/local``
The Zephyr SDK bundle archive contains the ``zephyr-sdk-<version>``
directory and, when extracted under ``$HOME``, the resulting
installation path will be ``$HOME/zephyr-sdk-<version>``.
#. Run the Zephyr SDK bundle setup script:
.. parsed-literal::
cd zephyr-sdk- |sdk-version-ltrim|
./setup.sh
.. note::
You only need to run the setup script once after extracting the Zephyr SDK bundle.
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
the initial setup.
#. Install `udev <https://en.wikipedia.org/wiki/Udev>`_ rules, which
allow you to flash most Zephyr boards as a regular user:
.. parsed-literal::
sudo cp ~/zephyr-sdk- |sdk-version-trim| /sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
sudo udevadm control --reload
.. group-tab:: macOS
.. _macos_zephyr_sdk:
#. Download and verify the `Zephyr SDK bundle`_:
.. parsed-literal::
cd ~
curl -L -O |sdk-url-macos|
curl -L |sdk-url-macos-sha| | shasum --check --ignore-missing
If your host architecture is 64-bit ARM (Apple Silicon), replace
``x86_64`` with ``aarch64`` in order to download the 64-bit ARM macOS SDK.
#. Extract the Zephyr SDK bundle archive:
.. parsed-literal::
tar xvf zephyr-sdk- |sdk-version-trim| _macos-x86_64.tar.xz
.. note::
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
* ``$HOME``
* ``$HOME/.local``
* ``$HOME/.local/opt``
* ``$HOME/bin``
* ``/opt``
* ``/usr/local``
The Zephyr SDK bundle archive contains the ``zephyr-sdk-<version>``
directory and, when extracted under ``$HOME``, the resulting
installation path will be ``$HOME/zephyr-sdk-<version>``.
#. Run the Zephyr SDK bundle setup script:
.. parsed-literal::
cd zephyr-sdk- |sdk-version-ltrim|
./setup.sh
.. note::
You only need to run the setup script once after extracting the Zephyr SDK bundle.
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
the initial setup.
.. group-tab:: Windows
.. _windows_zephyr_sdk:
#. Open a ``cmd.exe`` terminal window **as a regular user**
#. Download the `Zephyr SDK bundle`_:
.. parsed-literal::
cd %HOMEPATH%
wget |sdk-url-windows|
#. Extract the Zephyr SDK bundle archive:
.. parsed-literal::
7z x zephyr-sdk- |sdk-version-trim| _windows-x86_64.7z
.. note::
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
* ``%HOMEPATH%``
* ``%PROGRAMFILES%``
The Zephyr SDK bundle archive contains the ``zephyr-sdk-<version>``
directory and, when extracted under ``%HOMEPATH%``, the resulting
installation path will be ``%HOMEPATH%\zephyr-sdk-<version>``.
#. Run the Zephyr SDK bundle setup script:
.. parsed-literal::
cd zephyr-sdk- |sdk-version-ltrim|
setup.cmd
.. note::
You only need to run the setup script once after extracting the Zephyr SDK bundle.
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
the initial setup.
.. _Zephyr SDK Releases: https://github.com/zephyrproject-rtos/sdk-ng/tags
.. _Zephyr SDK Version Compatibility Matrix: https://github.com/zephyrproject-rtos/sdk-ng/wiki/Zephyr-SDK-Version-Compatibility-Matrix
.. toolchain_zephyr_sdk_install_end
Part 3
한국어 전문 번역
Zephyr SDK
Zephyr Software Development Kit(SDK)는 Zephyr가 지원하는 각 architecture용 toolchain과 custom QEMU, OpenOCD 같은 추가 host tool을 함께 제공합니다.
Zephyr SDK 사용을 강하게 권장하며, 일부 architecture에서 QEMU test를 실행하는 경우처럼 특정 조건에서는 필수일 수도 있습니다.
지원 architecture
Zephyr SDK는 다음 target architecture를 지원합니다.
- ARC: 32-bit·64-bit, ARCv1·ARCv2·ARCv3
- ARM: 32-bit·64-bit, ARMv6·ARMv7·ARMv8, A·R·M Profile
- MIPS: 32-bit·64-bit
- Nios II
- RISC-V: 32-bit·64-bit, RV32I·RV32E·RV64I
- x86: 32-bit·64-bit
- Xtensa
설치 bundle과 변수
SDK bundle은 Linux, macOS, Windows를 지원하는 압축 file로 배포됩니다. 압축을 풀고 포함된 setup script를 실행하는 것이 설치의 기본 흐름이며 OS별 명령은 아래에 나옵니다.
Toolchain을 따로 선택하지 않으면 build system이 Zephyr SDK를 찾아 그 안의 toolchain을 사용합니다. 이를 명시하려면 ZEPHYR_TOOLCHAIN_VARIANT=zephyr로 설정합니다.
SDK를 OS별 기본 위치가 아닌 곳에 설치하면서 자동 탐지를 원하면 setup script를 실행해 CMake package registry에 등록해야 합니다. Registry에 등록하지 않을 경우 ZEPHYR_SDK_INSTALL_DIR가 SDK 설치 directory를 직접 가리키게 합니다.
ZEPHYR_SDK_INSTALL_DIR는 여러 SDK를 담은 상위 directory를 가리킬 수도 있습니다. 예를 들어 /company/tools 아래에 다음 directory가 있을 수 있습니다.
/company/tools/zephyr-sdk-0.13.2/company/tools/zephyr-sdk-a.b.c/company/tools/zephyr-sdk-x.y.z
이 구성은 여러 SDK를 한 위치에서 관리하면서 Zephyr build system이 필요한 version을 자동 선택하게 합니다.
Zephyr SDK version 호환성
일반적으로 이 페이지가 가리키는 SDK version이 해당 Zephyr version의 권장 version입니다. 전체 조합은 Zephyr SDK Version Compatibility Matrix에서 확인합니다.
Zephyr SDK 설치
필요하다면 아래 명령의 SDK version을 다른 것으로 바꿀 수 있습니다. 사용 가능한 release는 Zephyr SDK Releases에 있습니다. SDK를 제거하려면 설치 directory를 삭제하면 됩니다.
Ubuntu
- Zephyr SDK v0.16.8 bundle을 내려받고 checksum을 검증합니다.
- Bundle archive를 풉니다.
- SDK directory에서 setup script를 실행합니다.
- udev rule을 설치해 일반 사용자로 대부분의 Zephyr board를 flash할 수 있게 합니다.
cd ~
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_linux-x86_64.tar.xz
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/sha256.sum | shasum --check --ignore-missingHost가 Raspberry Pi 같은 64-bit ARM이면 Linux SDK URL의 x86_64를 aarch64로 바꿉니다.
tar xvf zephyr-sdk-0.16.8_linux-x86_64.tar.xzcd zephyr-sdk-0.16.8
./setup.shSetup script는 archive를 푼 뒤 한 번만 실행하면 됩니다. 설치 directory를 나중에 옮기면 새 위치를 등록하도록 다시 실행해야 합니다.
sudo cp ~/zephyr-sdk-0.16.8/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
sudo udevadm control --reloadmacOS
- curl로 SDK bundle과 checksum을 받아 검증합니다.
- macOS용 bundle archive를 풉니다.
- SDK directory에서 setup script를 실행합니다.
cd ~
curl -L -O https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_macos-x86_64.tar.xz
curl -L https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/sha256.sum | shasum --check --ignore-missingApple Silicon 같은 64-bit ARM host에서는 macOS SDK URL의 x86_64를 aarch64로 바꿉니다.
tar xvf zephyr-sdk-0.16.8_macos-x86_64.tar.xzcd zephyr-sdk-0.16.8
./setup.shSetup script는 최초 압축 해제 후 한 번 실행하고, SDK directory를 옮겼다면 다시 실행합니다.
Windows
cmd.exeterminal을 administrator가 아닌 일반 사용자로 엽니다.- Home path에서 Windows SDK bundle을 내려받습니다.
- 7-Zip으로 archive를 풉니다.
setup.cmd를 실행합니다.
cd %HOMEPATH%
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/zephyr-sdk-0.16.8_windows-x86_64.7z7z x zephyr-sdk-0.16.8_windows-x86_64.7zcd zephyr-sdk-0.16.8
setup.cmdSetup script는 압축을 푼 뒤 한 번만 실행하면 되지만 SDK directory를 옮긴 경우에는 다시 실행해야 합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.