Skip to content
Alexey Brodkin edited this page Jun 3, 2019 · 1 revision

Building sample applications

Starting point is https://docs.zephyrproject.org/latest/getting_started.

Now when environment is set (sources checked-out, all helper tools of required versions like west, cmake installed) every time getting back to building an application it's required:

  1. Source . zephyr-env.sh from zephyr-rtos source tree
  2. Set env variables that describe your toolchain
    1. To use an ordinary cross-toolchain installed on a development host: export ZEPHYR_TOOLCHAIN_VARIANT=cross-compile
    2. Point to installed cross-toolchain: export CROSS_COMPILE=~/xxx/bin/arc-linux-
  3. Prepare build location. In an application's folder build everything in build folder as Cmake otherwise doesn't work. That also help to keep source tree clean. That said build folder might be completely outside of zephyr source tree, just point to tha application of choice on invocation of cmake: mkdir build && cd build.
  4. Configure for a desired board: cmake -DBOARD=nsim_em ... Note here .. refers to the application sources located 1 level above, one may use a full path to the app pf choice here.
  5. Build the application: make.
  6. And finally run the application with: make run.
Clone this wiki locally