zephyr/samples/basic/minimal
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
..
src
CMakeLists.txt cmake: use find_package to locate Zephyr 2020-03-27 16:23:46 +01:00
README.rst
arm.conf
common.conf
mt.conf
no-mt.conf
no-preempt.conf
no-timers.conf
sample.yaml
x86.conf

README.rst

.. _minimal_sample:

Minimal sample
##############

Overview
********

This sample defines An empty ``main()`` and a set of minimal configurations
that provide tests for the smallest ROM sizes possible with the Zephyr kernel.

The following configuration files are available:

* :file:`mt.conf`: Enable multithreading
* :file:`no-mt.conf`: Disable multithreading
* :file:`no-preempt.conf`: Disable preemption
* :file:`no-timers.conf`:: Disable timers
* :file:`arm.conf`: Arm-specific disabling of features

Building and measuring ROM size
*******************************

In order to compare ROM sizes with different minimal configurations, the
following combinations are suggested:

* Reel board (Arm architecture)

  * Multithreading enabled

    * Reference ROM size: 7-8KB

    .. zephyr-app-commands::
       :zephyr-app: samples/basic/minimal
       :host-os: unix
       :board: reel_board
       :build-dir: reel_board/mt/
       :conf: "common.conf mt.conf arm.conf"
       :goals: rom_report
       :compact:

  * Multithreading enabled, no preemption

    * Reference ROM size: 7-8KB

    .. zephyr-app-commands::
       :zephyr-app: samples/basic/minimal
       :host-os: unix
       :board: reel_board
       :build-dir: reel_board/mt-no-preempt/
       :conf: "common.conf mt.conf no-preempt.conf arm.conf"
       :goals: rom_report
       :compact:

  * Multithreading enabled, no preemption, timers disabled

    * Reference ROM size: 3-4KB

    .. zephyr-app-commands::
       :zephyr-app: samples/basic/minimal
       :host-os: unix
       :board: reel_board
       :build-dir: reel_board/mt-no-preempt-no-timers/
       :conf: "common.conf mt.conf no-preempt.conf no-timers.conf arm.conf"
       :goals: rom_report
       :compact:

  * Multithreading disabled, timers enabled

    * Reference ROM size: 4-5KB

    .. zephyr-app-commands::
       :zephyr-app: samples/basic/minimal
       :host-os: unix
       :board: reel_board
       :build-dir: reel_board/no-mt/
       :conf: "common.conf no-mt.conf arm.conf"
       :goals: rom_report
       :compact:

  * Multithreading disabled, timers disabled

    * Reference ROM size: 2-3KB

    .. zephyr-app-commands::
       :zephyr-app: samples/basic/minimal
       :host-os: unix
       :board: reel_board
       :build-dir: reel_board/no-mt-no-timers/
       :conf: "common.conf no-mt.conf no-timers.conf arm.conf"
       :goals: rom_report
       :compact: