Getting started with Zephyr: a developer’s guide to your first project
CMake, Python, and Devicetree complier are currently installed using the following commands.
2. Extract the Zephyr SDK bundle archive: tar xvf zephyr-sdk-0.16.5_ linux-x86_64.tar.xz The official documentation recommends that you extract the SDK bundle at one of the following default locations: ■ $HOME ■ $HOME/.local ■ $HOME/.local/opt ■ $HOME/bin ■ /opt ■ /usr/local The SDK bundle should contain the zephyr-sdk-0.15.1 directory and, when extracted under $HOME, the resulting installation path will be $HOME/ zephyr-sdk-<version>. 3. Next, you’ll need to run the Zephyr SDK bundle setup script: cd zephyr-sdk-0.16.5 ./setup.sh
Installing the Zephyr software development kit Zephyr’s SDK is compatible with Linux, macOS, and Windows and comes in a compressed file. It provides toolchains for each of Zephyr’s supported architectures, which include a compiler, assembler, linker, and other programs required to build Zephyr applications. Install it by extracting the file and executing the setup script. Further OS-specific guidelines are provided below. By default, the build system uses the Zephyr SDK toolchain if no other is specified. Set the environment variable `ZEPHYR_ TOOLCHAIN_VARIANT` to `zephyr` to ensure this. For installations in non-standard locations, the Zephyr SDK must be registered in the CMake package registry via the setup script for automatic detection. Alternatively, specify the installation path by setting `ZEPHYR_SDK_INSTALL_ DIR`. 1. Visit the Zephyr project website to download the SDK installer for your operating system (Linux, macOS, or Windows). Download and verify the latest Zephyr SDK bundle here.
cmake --version python3 --version dtc --version
The minimum required values are Cmake 3.20.5, Python 3.8, Devicetree compiler 1.4.6. To install the required dependencies, enter, sudo apt install --no-install- recommends git cmake ninja-build gperf \ ccache dfu-util device-tree-compiler wget \ python3-dev python3-pip python3- setuptools python3-tk python3-wheel xz-utils file \ make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 Once installed, confirm that the required versions are now installed with the above command. You are now ready to install Zephyr and its Python dependencies. You can opt to install these into a virtual (separate) environment accessible just to Zephyr or to a globally, so all Python applications access them. Since Python package incompatibilities may be experienced when shared in a global environment, it is recommended to install within a virtual environment.
Figure 3: The Zephyr OS devicetree for the Nordic Semiconductor nRF9160-DK Image source: Zephyr
using. Some IDEs provide direct support for the Zephyr RTOS from within its workflow. Configuring the environment Follow the Zephyr documentation to set up your build system and environment variables. This will involve configuring the PATH to include the Zephyr SDK and setting up necessary environment variables. Zephyr development board - Nordic Semiconductor nRF9160-DK An example development board supported by Zephyr OS is the
nRF9160-DK cellular IoT single- board from Nordic Semiconductor. Based on the Nordic nRF9160 system-in-package, it integrates an arm Cortex-M33 core and a dedicated radio cellular transceiver for LTE-M and NB-IoT in addition to a GNSS receiver. The nRF9160-DK also incorporates Nordic nRF52840 multiprotocol wireless SoC for short range communications using Bluetooth 5 and NFC together with integrated antennas. The board hosts an Arduino Uno 3 shield header, four user-programmable LEDs, two buttons, and two switches. The nRF9160-DK is fully supported by Nordic’s nRF Connect SDK.
The Zephyr SDK includes a useful command line tool,
west. West’s features provide a multiple repository management system similar to Git submodes. Zephyr uses west for building applications, flashing, and debugging them. Setting up an IDE Using an IDE like VSCode or Eclipse can enhance your development experience with features like code development and debugging. The choice of IDE largely depends on the microcontroller target you are
Figure 2: The Nordic nRF9160 cellular IoT development board Image source: Nordic Semiconductor zephyrproject-rtos/sdk- ng/releases/download/ v0.16.5/zephyr-sdk-0.16.5_ linux-x86_64.tar.xz wget -O - https://github.com/ zephyrproject-rtos/sdk-ng/ releases/download/v0.16.5/ sha256.sum | shasum --check --ignore-missing
Here are the steps for downloading Zephyr SDK on Ubuntu:
Use these instructions to install Zephyr and its Python dependencies.
cd ~
wget https://github.com/
we get technical
64
65
Powered by FlippingBook