Skip to content

Commit 97e226c

Browse files
stephanosiocarlescufi
authored andcommitted
doc: getting_started: Add instructions for multi-platform Zephyr SDK
This commit adds the Linux, macOS and Windows instructions for installing the new multi-platform Zephyr SDK. Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent 7305905 commit 97e226c

File tree

2 files changed

+172
-86
lines changed

2 files changed

+172
-86
lines changed

doc/getting_started/index.rst

Lines changed: 115 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The current minimum required version for the main dependencies are:
163163
.. code-block:: console
164164
165165
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
166-
choco install ninja gperf python git dtc-msys2 wget
166+
choco install ninja gperf python git dtc-msys2 wget unzip
167167
168168
#. Close the window and open a new ``cmd.exe`` window **as a regular user** to continue.
169169

@@ -471,71 +471,154 @@ Install a Toolchain
471471
A toolchain provides a compiler, assembler, linker, and other programs required
472472
to build Zephyr applications.
473473

474+
The Zephyr Software Development Kit (SDK) contains toolchains for each of
475+
Zephyr's supported architectures. It also includes additional host tools, such
476+
as custom QEMU and OpenOCD builds.
477+
474478
.. tabs::
475479

476480
.. group-tab:: Ubuntu
477481

478-
The Zephyr Software Development Kit (SDK) contains toolchains for each of
479-
Zephyr's supported architectures. It also includes additional host tools,
480-
such as custom QEMU binaries and a host compiler.
481-
482-
|p|
483-
484-
#. Download the `latest SDK installer
482+
#. Download and verify the `latest Zephyr SDK bundle
485483
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_:
486484

487485
.. code-block:: bash
488486
489487
cd ~
490-
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.13.2/zephyr-sdk-0.13.2-linux-x86_64-setup.run
488+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/zephyr-sdk-0.14.0_linux-x86_64.tar.gz
489+
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/sha256.sum | shasum --check --ignore-missing
491490
492-
#. Run the installer, installing the SDK in :file:`~/zephyr-sdk-0.13.2`:
491+
If your host architecture is 64-bit ARM (for example, Raspberry Pi), replace ``x86_64``
492+
with ``aarch64`` in order to download the 64-bit ARM Linux SDK.
493+
494+
#. Extract the Zephyr SDK bundle archive:
493495

494496
.. code-block:: bash
495497
496-
chmod +x zephyr-sdk-0.13.2-linux-x86_64-setup.run
497-
./zephyr-sdk-0.13.2-linux-x86_64-setup.run -- -d ~/zephyr-sdk-0.13.2
498+
tar xvf zephyr-sdk-0.14.0_linux-x86_64.tar.gz
498499
499500
.. note::
500-
It is recommended to install the Zephyr SDK at one of the following locations:
501+
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
502+
503+
* ``$HOME``
504+
* ``$HOME/.local``
505+
* ``$HOME/.local/opt``
506+
* ``$HOME/bin``
507+
* ``/opt``
508+
* ``/usr/local``
501509

502-
* ``$HOME/zephyr-sdk[-x.y.z]``
503-
* ``$HOME/.local/zephyr-sdk[-x.y.z]``
504-
* ``$HOME/.local/opt/zephyr-sdk[-x.y.z]``
505-
* ``$HOME/bin/zephyr-sdk[-x.y.z]``
506-
* ``/opt/zephyr-sdk[-x.y.z]``
507-
* ``/usr/zephyr-sdk[-x.y.z]``
508-
* ``/usr/local/zephyr-sdk[-x.y.z]``
510+
The Zephyr SDK bundle archive contains the ``zephyr-sdk-0.14.0`` directory and, when
511+
extracted under ``$HOME``, the resulting installation path will be
512+
``$HOME/zephyr-sdk-0.14.0``.
509513

510-
where ``[-x.y.z]`` is optional text, and can be any text, for example ``-0.13.2``.
514+
#. Run the Zephyr SDK bundle setup script:
511515

512-
If installing the Zephyr SDK outside any of those locations, please read: :ref:`zephyr_sdk`
516+
.. code-block:: bash
513517
514-
You cannot move the SDK directory after you have installed it.
518+
cd zephyr-sdk-0.14.0
519+
./setup.sh
520+
521+
.. note::
522+
You only need to run the setup script once after extracting the Zephyr SDK bundle.
523+
524+
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
525+
the initial setup.
515526

516527
#. Install `udev <https://en.wikipedia.org/wiki/Udev>`_ rules, which
517528
allow you to flash most Zephyr boards as a regular user:
518529

519530
.. code-block:: bash
520531
521-
sudo cp ~/zephyr-sdk-0.13.2/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
532+
sudo cp ~/zephyr-sdk-0.14.0/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
522533
sudo udevadm control --reload
523534
524535
.. group-tab:: macOS
525536

526-
Follow the instructions in :ref:`gs_toolchain`. Note that the Zephyr SDK
527-
is not available on macOS.
537+
#. Download and verify the `latest Zephyr SDK bundle
538+
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_:
528539

529-
Do not forget to set the required :ref:`environment variables <env_vars>`
530-
(:envvar:`ZEPHYR_TOOLCHAIN_VARIANT` and toolchain specific ones).
540+
.. code-block:: bash
541+
542+
cd ~
543+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/zephyr-sdk-0.14.0_macos-x86_64.tar.gz
544+
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/sha256.sum | shasum --check --ignore-missing
545+
546+
If your host architecture is 64-bit ARM (Apple Silicon, also known as M1), replace
547+
``x86_64`` with ``aarch64`` in order to download the 64-bit ARM macOS SDK.
548+
549+
#. Extract the Zephyr SDK bundle archive:
550+
551+
.. code-block:: bash
552+
553+
tar xvf zephyr-sdk-0.14.0_macos-x86_64.tar.gz
554+
555+
.. note::
556+
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
557+
558+
* ``$HOME``
559+
* ``$HOME/.local``
560+
* ``$HOME/.local/opt``
561+
* ``$HOME/bin``
562+
* ``/opt``
563+
* ``/usr/local``
564+
565+
The Zephyr SDK bundle archive contains the ``zephyr-sdk-0.14.0`` directory and, when
566+
extracted under ``$HOME``, the resulting installation path will be
567+
``$HOME/zephyr-sdk-0.14.0``.
568+
569+
#. Run the Zephyr SDK bundle setup script:
570+
571+
.. code-block:: bash
572+
573+
cd zephyr-sdk-0.14.0
574+
./setup.sh
575+
576+
.. note::
577+
You only need to run the setup script once after extracting the Zephyr SDK bundle.
578+
579+
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
580+
the initial setup.
531581

532582
.. group-tab:: Windows
533583

534-
Follow the instructions in :ref:`gs_toolchain`. Note that the Zephyr SDK
535-
is not available on Windows.
584+
#. Open a ``cmd.exe`` window by pressing the Windows key typing "cmd.exe".
585+
586+
#. Download the `latest Zephyr SDK bundle
587+
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_:
588+
589+
.. code-block:: console
590+
591+
cd %HOMEPATH%
592+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/zephyr-sdk-0.14.0_windows-x86_64.zip
593+
594+
#. Extract the Zephyr SDK bundle archive:
595+
596+
.. code-block:: console
597+
598+
unzip zephyr-sdk-0.14.0_windows-x86_64.zip
599+
600+
.. note::
601+
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
602+
603+
* ``%HOMEPATH%``
604+
* ``%PROGRAMFILES%``
605+
606+
The Zephyr SDK bundle archive contains the ``zephyr-sdk-0.14.0`` directory and, when
607+
extracted under ``%HOMEPATH%``, the resulting installation path will be
608+
``%HOMEPATH%\zephyr-sdk-0.14.0``.
609+
610+
#. Run the Zephyr SDK bundle setup script:
611+
612+
.. code-block:: console
613+
614+
cd zephyr-sdk-0.14.0
615+
setup.cmd
616+
617+
.. note::
618+
You only need to run the setup script once after extracting the Zephyr SDK bundle.
536619

537-
Do not forget to set the required :ref:`environment variables <env_vars>`
538-
(:envvar:`ZEPHYR_TOOLCHAIN_VARIANT` and toolchain specific ones).
620+
You must rerun the setup script if you relocate the Zephyr SDK bundle directory after
621+
the initial setup.
539622

540623
.. _getting_started_run_sample:
541624

doc/getting_started/installation_linux.rst

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -210,87 +210,90 @@ environment is recommended to avoid interfering with your system Python.
210210
Install the Zephyr Software Development Kit (SDK)
211211
*************************************************
212212

213-
Use of the Zephyr SDK is optional, but recommended. Some of the dependencies
214-
installed above are only needed for installing the SDK.
213+
The Zephyr Software Development Kit (SDK) contains toolchains for each of
214+
Zephyr's supported architectures. It also includes additional host tools, such
215+
as custom QEMU and OpenOCD.
215216

216-
Zephyr's :abbr:`SDK (Software Development Kit)` contains all necessary tools to
217-
build Zephyr on all supported architectures. Additionally, it includes host
218-
tools such as custom QEMU binaries and a host compiler. The SDK supports the
219-
following target architectures:
217+
Use of the Zephyr SDK is highly recommended and may even be required under
218+
certain conditions (for example, running tests in QEMU for some architectures).
220219

221-
* :abbr:`X86 (Intel Architecture 32 bits)`
220+
The Zephyr SDK supports the following target architectures:
222221

223-
* :abbr:`Arm (Advanced RISC Machine)`
222+
* ARC (32-bit and 64-bit; ARCv1, ARCv2, ARCv3)
223+
* ARM (32-bit and 64-bit; ARMv6, ARMv7, ARMv8; A/R/M Profiles)
224+
* MIPS (32-bit and 64-bit)
225+
* Nios II
226+
* RISC-V (32-bit and 64-bit; RV32I, RV32E, RV64I)
227+
* x86 (32-bit and 64-bit)
228+
* Xtensa
224229

225-
* :abbr:`ARC (Argonaut RISC Core)`
226-
227-
* :abbr:`MIPS (Microprocessor without Interlocked Pipeline Stages)`
228-
229-
* :abbr:`Nios II`
230+
Follow these steps to install the Zephyr SDK:
230231

231-
* :abbr:`RISC-V`
232+
#. Download and verify the `latest Zephyr SDK bundle
233+
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_:
232234

233-
* :abbr:`SPARC`
235+
.. code-block:: bash
234236
235-
* :abbr:`Xtensa`
237+
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/zephyr-sdk-0.14.0_linux-x86_64.tar.gz
238+
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.14.0/sha256.sum | shasum --check --ignore-missing
236239
237-
Follow these steps to install the Zephyr SDK:
240+
You can change ``0.14.0`` to another version if needed; the `Zephyr SDK
241+
Releases`_ page contains all available SDK releases.
238242

239-
#. Download the `latest SDK
240-
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_ as a
241-
self-extracting installation binary:
243+
If your host architecture is 64-bit ARM (for example, Raspberry Pi), replace
244+
``x86_64`` with ``aarch64`` in order to download the 64-bit ARM Linux SDK.
242245

243-
.. code-block:: console
246+
#. Extract the Zephyr SDK bundle archive:
244247

245-
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.13.2/zephyr-sdk-0.13.2-linux-x86_64-setup.run
248+
.. code-block:: bash
246249
247-
(You can change *0.13.2* to another version if needed; the `Zephyr
248-
Downloads`_ page contains all available SDK releases.)
250+
cd <sdk download directory>
251+
tar xvf zephyr-sdk-0.14.0_linux-x86_64.tar.gz
249252
250-
#. Run the installation binary, installing the SDK at
251-
:file:`~/zephyr-sdk-0.13.2`:
253+
#. Run the Zephyr SDK bundle setup script:
252254

253-
.. code-block:: console
255+
.. code-block:: bash
254256
255-
cd <sdk download directory>
256-
chmod +x zephyr-sdk-0.13.2-linux-x86_64-setup.run
257-
./zephyr-sdk-0.13.2-linux-x86_64-setup.run -- -d ~/zephyr-sdk-0.13.2
257+
cd zephyr-sdk-0.14.0
258+
./setup.sh
258259
259-
You can pick another directory if you want. If this fails, make sure
260-
Zephyr's dependencies were installed as described in `Install Requirements
261-
and Dependencies`_.
260+
If this fails, make sure Zephyr's dependencies were installed as described
261+
in `Install Requirements and Dependencies`_.
262262

263-
If you ever want to uninstall the SDK, just remove the directory where you
264-
installed it.
263+
If you want to uninstall the SDK, remove the directory where you installed it.
264+
If you relocate the SDK directory, you need to re-run the setup script.
265265

266266
.. note::
267-
It is recommended to install the Zephyr SDK at one of the following locations:
267+
It is recommended to extract the Zephyr SDK bundle at one of the following locations:
268268

269-
* ``$HOME/zephyr-sdk[-x.y.z]``
270-
* ``$HOME/.local/zephyr-sdk[-x.y.z]``
271-
* ``$HOME/.local/opt/zephyr-sdk[-x.y.z]``
272-
* ``$HOME/bin/zephyr-sdk[-x.y.z]``
273-
* ``/opt/zephyr-sdk[-x.y.z]``
274-
* ``/usr/zephyr-sdk[-x.y.z]``
275-
* ``/usr/local/zephyr-sdk[-x.y.z]``
269+
* ``$HOME``
270+
* ``$HOME/.local``
271+
* ``$HOME/.local/opt``
272+
* ``$HOME/bin``
273+
* ``/opt``
274+
* ``/usr/local``
276275

277-
where ``[-x.y.z]`` is optional text, and can be any text, for example ``-0.13.2``.
276+
The Zephyr SDK bundle archive contains the ``zephyr-sdk-0.14.0`` directory and, when
277+
extracted under ``$HOME``, the resulting installation path will be
278+
``$HOME/zephyr-sdk-0.14.0``.
278279

279-
If you install the Zephyr SDK outside any of those locations, then it is
280-
required to register the Zephyr SDK in the CMake package registry during
281-
installation or set :envvar:`ZEPHYR_SDK_INSTALL_DIR` to point to the Zephyr
282-
SDK installation folder.
280+
If you install the Zephyr SDK outside any of these locations, you must
281+
register the Zephyr SDK in the CMake package registry by running the setup
282+
script, or set :envvar:`ZEPHYR_SDK_INSTALL_DIR` to point to the Zephyr SDK
283+
installation directory.
283284

284-
:envvar:`ZEPHYR_SDK_INSTALL_DIR` can also be used for pointing to a folder
285-
containing multiple Zephyr SDKs, allowing for automatic toolchain selection,
286-
for example: ``ZEPHYR_SDK_INSTALL_DIR=/company/tools``
285+
You can also use :envvar:`ZEPHYR_SDK_INSTALL_DIR` for pointing to a
286+
directory containing multiple Zephyr SDKs, allowing for automatic toolchain
287+
selection. For example, ``ZEPHYR_SDK_INSTALL_DIR=/company/tools``, where
288+
the ``company/tools`` folder contains the following subfolders:
287289

288290
* ``/company/tools/zephyr-sdk-0.13.2``
289291
* ``/company/tools/zephyr-sdk-a.b.c``
290292
* ``/company/tools/zephyr-sdk-x.y.z``
291293

292-
this allow Zephyr to pick the right toolchain, while allowing multiple Zephyr
293-
SDKs to be grouped together at a custom location.
294+
This allows the Zephyr build system to choose the correct version of the
295+
SDK, while allowing multiple Zephyr SDKs to be grouped together at a
296+
specific path.
294297

295298
.. _sdkless_builds:
296299

@@ -316,5 +319,5 @@ To make sure this variable is unset, run:
316319
317320
unset ZEPHYR_SDK_INSTALL_DIR
318321
319-
.. _Zephyr Downloads: https://github.com/zephyrproject-rtos/sdk-ng/releases
322+
.. _Zephyr SDK Releases: https://github.com/zephyrproject-rtos/sdk-ng/releases
320323
.. _CMake Downloads: https://cmake.org/download

0 commit comments

Comments
 (0)