2016-01-28 17:59:49 +01:00
|
|
|
.. _getting_started:
|
|
|
|
|
|
|
|
Getting Started Guide
|
|
|
|
#####################
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Follow this guide to:
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
- Set up a command-line Zephyr development environment on Ubuntu, macOS, or
|
|
|
|
Windows (instructions for other Linux distributions are discussed in
|
|
|
|
:ref:`installation_linux`)
|
|
|
|
- Get the source code
|
|
|
|
- Build, flash, and run a sample application
|
2019-04-17 20:54:17 +02:00
|
|
|
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
.. _host_setup:
|
2017-12-02 01:16:47 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. rst-class:: numbered-step
|
2017-12-02 01:16:47 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
Select and Update OS
|
|
|
|
********************
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Click the operating system you are using.
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Ubuntu
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
This guide covers Ubuntu version 18.04 LTS and later.
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. code-block:: bash
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
sudo apt update
|
|
|
|
sudo apt upgrade
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: macOS
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
On macOS Mojave or later, select *System Preferences* >
|
|
|
|
*Software Update*. Click *Update Now* if necessary.
|
|
|
|
|
|
|
|
On other versions, see `this Apple support topic
|
2019-09-12 23:32:29 +02:00
|
|
|
<https://support.apple.com/en-us/HT201541>`_.
|
2019-07-25 20:43:13 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: Windows
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Select *Start* > *Settings* > *Update & Security* > *Windows Update*.
|
|
|
|
Click *Check for updates* and install any that are available.
|
2019-08-08 21:27:52 +02:00
|
|
|
|
2019-08-30 23:06:14 +02:00
|
|
|
.. _install-required-tools:
|
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. rst-class:: numbered-step
|
|
|
|
|
|
|
|
Install dependencies
|
|
|
|
********************
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Next, you'll install some host dependencies using your package manager.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. tabs::
|
|
|
|
|
|
|
|
.. group-tab:: Ubuntu
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Use ``apt`` to install dependencies:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo apt install --no-install-recommends git cmake ninja-build gperf \
|
|
|
|
ccache dfu-util device-tree-compiler wget \
|
2020-05-08 12:56:47 +02:00
|
|
|
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
|
2020-02-06 10:56:33 +01:00
|
|
|
make gcc gcc-multilib g++-multilib libsdl2-dev
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
#. Verify the version of cmake installed on your system using::
|
|
|
|
|
|
|
|
cmake --version
|
|
|
|
|
|
|
|
If it's not version 3.13.1 or higher, follow these steps to
|
2020-03-31 23:49:11 +02:00
|
|
|
add the `Kitware third-party apt repository <https://apt.kitware.com/>`__
|
2019-09-12 23:32:29 +02:00
|
|
|
to get an updated version of cmake.
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
a) Add the Kitware signing key:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | sudo apt-key add -
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
b) Add the Kitware apt repository for your OS release. For Ubuntu
|
|
|
|
18.04 LTS:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2019-12-11 22:05:54 +01:00
|
|
|
.. code-block:: bash
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2019-12-11 22:05:54 +01:00
|
|
|
sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
c) Then install the updated cmake with ``apt``:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
sudo apt update
|
|
|
|
sudo apt install cmake
|
|
|
|
|
|
|
|
.. group-tab:: macOS
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Install `Homebrew <https://brew.sh/>`_:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Use ``brew`` to install dependencies:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
brew install cmake ninja gperf python3 ccache qemu dtc
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. group-tab:: Windows
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
Due to issues finding executables, the Zephyr Project doesn't
|
|
|
|
currently support application flashing using the `Windows Subsystem
|
|
|
|
for Linux (WSL)
|
|
|
|
<https://msdn.microsoft.com/en-us/commandline/wsl/install_guide>`_
|
|
|
|
(WSL).
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Therefore, we don't recommend using WSL when getting started.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
These instructions must be run in a ``cmd.exe`` command prompt. The
|
|
|
|
required commands differ on PowerShell.
|
|
|
|
|
|
|
|
These instructions rely on `Chocolatey`_. If Chocolatey isn't an option,
|
|
|
|
you can install dependencies from their respective websites and ensure
|
|
|
|
the command line tools are on your :envvar:`PATH` :ref:`environment
|
|
|
|
variable <env_vars>`.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
|p|
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. `Install chocolatey`_
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Open an **Administrator** ``cmd.exe`` window: press the Windows key,
|
|
|
|
type "cmd.exe", right-click the result, and choose "Run as
|
|
|
|
Administrator".
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
#. Disable global confirmation to avoid having to confirm
|
|
|
|
installation of individual programs:
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
choco feature enable -n allowGlobalConfirmation
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Use ``choco`` to install dependencies:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'
|
2020-03-31 23:49:11 +02:00
|
|
|
choco install ninja gperf python git
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Open a new ``cmd.exe`` window **as a regular user** to continue.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. _Chocolatey: https://chocolatey.org/
|
2020-03-31 23:49:11 +02:00
|
|
|
.. _Install chocolatey: https://chocolatey.org/install
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2018-11-12 16:56:09 +01:00
|
|
|
.. _get_the_code:
|
2019-09-12 23:32:29 +02:00
|
|
|
.. _clone-zephyr:
|
2020-04-01 02:06:13 +02:00
|
|
|
.. _install_py_requirements:
|
|
|
|
.. _gs_python_deps:
|
2019-09-12 23:32:29 +02:00
|
|
|
|
|
|
|
.. rst-class:: numbered-step
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
Get Zephyr and install Python dependencies
|
|
|
|
******************************************
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
Next, clone Zephyr and its :ref:`modules <modules>` into a new :ref:`west
|
|
|
|
<west>` workspace named :file:`zephyrproject`. You'll also install Zephyr's
|
|
|
|
additional Python dependencies.
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. tabs::
|
2017-12-02 01:16:47 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: Ubuntu
|
2017-12-02 01:16:47 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Install west, and make sure :file:`~/.local/bin` is on your
|
|
|
|
:envvar:`PATH` :ref:`environment variable <env_vars>`:
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
pip3 install --user -U west
|
|
|
|
echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc
|
|
|
|
source ~/.bashrc
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Get the Zephyr source code:
|
2019-01-28 15:31:15 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
west init ~/zephyrproject
|
|
|
|
cd ~/zephyrproject
|
|
|
|
west update
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
|
|
|
|
automatically load boilerplate code required for building Zephyr
|
|
|
|
applications.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: console
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
west zephyr-export
|
2020-03-12 23:34:12 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Zephyr's ``scripts/requirements.txt`` file declares additional Python
|
|
|
|
dependencies. Install them with ``pip3``.
|
2020-03-12 23:34:12 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
2020-03-12 23:34:12 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt
|
2020-03-12 23:34:12 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. group-tab:: macOS
|
2020-03-12 23:34:12 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Install west:
|
2020-02-08 01:55:19 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
pip3 install west
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Get the Zephyr source code:
|
2019-01-28 15:31:15 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
2019-01-28 15:31:15 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
west init ~/zephyrproject
|
|
|
|
cd ~/zephyrproject
|
|
|
|
west update
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
|
|
|
|
automatically load boilerplate code required for building Zephyr
|
|
|
|
applications.
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: console
|
2018-11-12 16:56:09 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
west zephyr-export
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Zephyr's ``scripts/requirements.txt`` file declares additional Python
|
|
|
|
dependencies. Install them with ``pip3``.
|
2019-09-04 20:16:35 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
pip3 install -r ~/zephyrproject/zephyr/scripts/requirements.txt
|
2019-09-04 20:16:35 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: Windows
|
2019-09-04 20:16:35 +02:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
#. Install west:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
pip3 install west
|
|
|
|
|
|
|
|
#. Get the Zephyr source code:
|
|
|
|
|
|
|
|
.. code-block:: bat
|
|
|
|
|
|
|
|
cd %HOMEPATH%
|
|
|
|
west init zephyrproject
|
|
|
|
cd zephyrproject
|
|
|
|
west update
|
|
|
|
|
|
|
|
#. Export a :ref:`Zephyr CMake package <cmake_pkg>`. This allows CMake to
|
|
|
|
automatically load boilerplate code required for building Zephyr
|
|
|
|
applications.
|
|
|
|
|
|
|
|
.. code-block:: console
|
|
|
|
|
|
|
|
west zephyr-export
|
|
|
|
|
|
|
|
#. Zephyr's ``scripts/requirements.txt`` file declares additional Python
|
|
|
|
dependencies. Install them with ``pip3``.
|
|
|
|
|
|
|
|
.. code-block:: bat
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-04-01 02:06:13 +02:00
|
|
|
pip3 install -r %HOMEPATH%\zephyrproject\zephyr\scripts\requirements.txt
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. rst-class:: numbered-step
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Install a Toolchain
|
|
|
|
*******************
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
A toolchain provides a compiler, assembler, linker, and other programs required
|
|
|
|
to build Zephyr applications.
|
2016-01-28 17:59:49 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. tabs::
|
2019-05-07 07:36:30 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: Ubuntu
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
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 binaries and a host compiler.
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
|p|
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Download the `latest SDK installer
|
|
|
|
<https://github.com/zephyrproject-rtos/sdk-ng/releases>`_:
|
2019-02-12 22:37:44 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. code-block:: bash
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
cd ~
|
2020-05-06 22:16:31 +02:00
|
|
|
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.11.3/zephyr-sdk-0.11.3-setup.run
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
#. Run the installer, installing the SDK in :file:`~/zephyr-sdk-0.11.3`:
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. code-block:: bash
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
chmod +x zephyr-sdk-0.11.3-setup.run
|
|
|
|
./zephyr-sdk-0.11.3-setup.run -- -d ~/zephyr-sdk-0.11.3
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. note::
|
2020-05-06 22:16:31 +02:00
|
|
|
It is recommended to install the Zephyr SDK at one of the following locations:
|
2020-03-31 23:49:11 +02:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
* ``$HOME/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``$HOME/.local/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``$HOME/.local/opt/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``$HOME/bin/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``/opt/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``/usr/zephyr-sdk[-x.y.z]``
|
|
|
|
* ``/usr/local/zephyr-sdk[-x.y.z]``
|
2020-03-31 23:49:11 +02:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
where ``[-x.y.z]`` is optional text, and can be any text, for example ``-0.11.3``.
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
If installing the Zephyr SDK outside any of those locations, please read: :ref:`zephyr_sdk`
|
2019-09-12 23:32:29 +02:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
You cannot move the SDK directory after you have installed it.
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
#. Install `udev <https://en.wikipedia.org/wiki/Udev>`_ rules, which
|
|
|
|
allow you to flash most Zephyr boards as a regular user:
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. code-block:: bash
|
2019-02-12 14:03:17 +01:00
|
|
|
|
2020-05-06 22:16:31 +02:00
|
|
|
sudo cp ~/zephyr-sdk-0.11.3/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
|
2020-03-31 23:49:11 +02:00
|
|
|
sudo udevadm control --reload
|
2017-11-13 16:19:07 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: macOS
|
2016-05-01 14:58:22 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Follow the instructions in :ref:`gs_toolchain`. Note that the Zephyr SDK
|
|
|
|
is not available on macOS.
|
2018-06-05 03:58:12 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Do not forget to set the required :ref:`environment variables <env_vars>`
|
|
|
|
(:envvar:`ZEPHYR_TOOLCHAIN_VARIANT` and toolchain specific ones).
|
2019-11-20 16:45:34 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. group-tab:: Windows
|
2018-06-05 03:58:12 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Follow the instructions in :ref:`gs_toolchain`. Note that the Zephyr SDK
|
|
|
|
is not available on Windows.
|
2019-11-20 16:45:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Do not forget to set the required :ref:`environment variables <env_vars>`
|
|
|
|
(:envvar:`ZEPHYR_TOOLCHAIN_VARIANT` and toolchain specific ones).
|
2019-11-20 16:45:34 +01:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. _getting_started_run_sample:
|
|
|
|
|
|
|
|
.. rst-class:: numbered-step
|
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Build the Blinky Sample
|
|
|
|
***********************
|
2016-05-01 14:58:22 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. note::
|
2016-05-01 14:58:22 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Blinky is compatible with most, but not all, :ref:`boards`. If your board
|
|
|
|
does not meet Blinky's :ref:`blinky-sample-requirements`, then
|
|
|
|
:ref:`hello_world` is a good alternative.
|
2020-03-04 18:22:03 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Build the :ref:`blinky-sample` with :ref:`west build <west-building>`, changing
|
|
|
|
``<your-board-name>`` appropriately for your board:
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. tabs::
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. group-tab:: Ubuntu
|
2017-11-17 06:20:24 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. code-block:: bash
|
2019-05-13 22:07:57 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
cd ~/zephyrproject/zephyr
|
|
|
|
west build -p auto -b <your-board-name> samples/basic/blinky
|
2016-02-13 13:41:34 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. group-tab:: macOS
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. code-block:: bash
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
cd ~/zephyrproject/zephyr
|
|
|
|
west build -p auto -b <your-board-name> samples/basic/blinky
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. group-tab:: Windows
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. code-block:: bat
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
cd %HOMEPATH%\zephyrproject\zephyr
|
|
|
|
west build -p auto -b <your-board-name> samples\basic\blinky
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
The ``-p auto`` option automatically cleans byproducts from a previous build
|
|
|
|
if necessary, which is useful if you try building another sample.
|
2017-12-21 14:14:19 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. rst-class:: numbered-step
|
2019-05-13 22:07:57 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Flash the Sample
|
|
|
|
****************
|
2018-05-10 23:29:12 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Connect your board, usually via USB, and turn it on if there's a power switch.
|
|
|
|
If in doubt about what to do, check your board's page in :ref:`boards`.
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Then flash the sample using :ref:`west flash <west-flashing>`:
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
.. code-block:: console
|
2019-05-13 22:07:57 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
west flash
|
2019-05-13 22:07:57 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
You may need to install additional :ref:`host tools <debug-host-tools>`
|
|
|
|
required by your board. The ``west flash`` command will print an error if any
|
|
|
|
required dependencies are missing.
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
If you're using blinky, the LED will start to blink as shown in this figure:
|
2019-05-13 22:07:57 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
.. figure:: img/ReelBoard-Blinky.gif
|
|
|
|
:width: 400px
|
|
|
|
:name: reelboard-blinky
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Phytec :ref:`reel_board <reel_board>` running blinky
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2019-09-12 23:32:29 +02:00
|
|
|
Next Steps
|
|
|
|
**********
|
doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:
- The reader needs to jump forward and backward in the documents
depending on what their system already has installed (e.g. "start by
cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).
- The operating system setup guides, toolchain setup instructions, and
application build and run information have each become their own
balkanized fiefdom, with duplicated, confusing and sometimes
inconsistent results.
- Linux documentation for all distributions is incomplete in some
places (the Arch documentation in particular is vestigial)
and wrong in others (platforms like Ubuntu still nominally require
tools, like autoconf, that haven't been necessary since we stopped
using the C Kconfig tools)
- The dependencies needed to build the documentation have
gotten *huge* since the LaTeX additions and massively overstate the
footprint of Zephyr's real dependencies. This is particularly a
problem on Linux, where those dependencies were not clearly
separated from those needed to build Zephyr.
- The toolchain setup documentation is confusing and scattered across
the main file and the platform-specific files. There are various
bits of incomplete and/or incorrect information. For example, the
docs imply that you can use the Zephyr SDK on non-Linux hosts, which
isn't true. As another example, some toolchains, such as GNU Arm
Embedded, are documented several times. As a final example, some
toolchains, such as Intel's ISSM, are squirrelled away in the
Windows document when there are Linux builds available.
Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.
Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-15 07:20:24 +02:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
Here are some next steps for exploring Zephyr:
|
2018-01-17 17:32:31 +01:00
|
|
|
|
2020-03-31 23:49:11 +02:00
|
|
|
* Try other :ref:`samples-and-demos`
|
|
|
|
* Learn about :ref:`application` and the :ref:`west <west>` tool
|
|
|
|
* Find out about west's :ref:`flashing and debugging <west-build-flash-debug>`
|
|
|
|
features, or more about :ref:`debugging` in general
|
|
|
|
* Check out :ref:`beyond-GSG` for additional setup alternatives and ideas
|
2019-09-12 23:32:29 +02:00
|
|
|
* Discover :ref:`project-resources` for getting help from the Zephyr
|
2020-03-31 23:49:11 +02:00
|
|
|
community
|