zephyr/samples/basic/minimal
Andy Ross 669730f030 kernel: Crank up default tick rate
When tickless is available, all existing devices can handle much
higher timing precision than 10ms.  A 10kHz default seems acceptable
without introducing too much range limitation (rollover for a signed
time delta will happen at 2.5 days).  Leave the 100 Hz default in
place for ticked configurations, as those are going to be special
purpose usages where the user probably actually cares about interrupt
rate.

Note that the defaulting logic interacts with an obscure trick:
setting the tick rate to zero would indicate "no clock exists" to the
configuration (some platforms use this to drop code from the build).
But now that becomes a kconfig cycle, so to break it we expose
CONFIG_SYS_CLOCK_EXISTS as an app-defined tunable and not a derived
value from the tick rate.  Only one test actually did this.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
..
src
CMakeLists.txt
README.rst
arm.conf
common.conf
mt.conf
no-mt.conf
no-preempt.conf
no-timers.conf kernel: Crank up default tick rate 2019-07-02 22:52:29 -04:00
sample.yaml yaml: Remove redundant document separators 2019-06-19 10:40:10 +02:00
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
       :tool: west
       :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
       :tool: west
       :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
       :tool: west
       :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
       :tool: west
       :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
       :tool: west
       :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: