Skip to content

Commit

Permalink
doc: version: document the numeric version limits
Browse files Browse the repository at this point in the history
The `VERSION` numeric fields are used to construct the `uint32_t`
`KERNELVERSION` and `APPVERSION` values, which only allocates a single
byte for each field.

The field in `app_version.h` is `APP_TWEAK`, not `APP_VERSION_TWEAK`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
  • Loading branch information
JordanYates authored and nashif committed Jun 24, 2024
1 parent e82e358 commit a945622
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions doc/build/version/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,21 @@ a newline. The basic ``VERSION`` file has the following structure:
VERSION_TWEAK =
EXTRAVERSION =
Each field and the values it supports is described below (note that there may be further
restrictions depending upon what the version is used for, e.g. bootloaders might only support some
of these fields or might place limits on the maximum values of fields):
Each field and the values it supports is described below. Zephyr limits the value of each numeric
field to a single byte (note that there may be further restrictions depending upon what the version
is used for, e.g. bootloaders might only support some of these fields or might place limits on the
maximum values of fields):

+---------------+----------------------------------------+
| Field | Data type |
+---------------+----------------------------------------+
| VERSION_MAJOR | Numerical |
| VERSION_MAJOR | Numerical (0-255) |
+---------------+----------------------------------------+
| VERSION_MINOR | Numerical |
| VERSION_MINOR | Numerical (0-255) |
+---------------+----------------------------------------+
| PATCHLEVEL | Numerical |
| PATCHLEVEL | Numerical (0-255) |
+---------------+----------------------------------------+
| VERSION_TWEAK | Numerical |
| VERSION_TWEAK | Numerical (0-255) |
+---------------+----------------------------------------+
| EXTRAVERSION | Alphanumerical (Lowercase a-z and 0-9) |
+---------------+----------------------------------------+
Expand Down Expand Up @@ -91,7 +92,7 @@ following defines are available:
+-----------------------------+-------------------+------------------------------------------------------+-------------------------+
| APP_PATCHLEVEL | Numerical | ``PATCHLEVEL`` | 3 |
+-----------------------------+-------------------+------------------------------------------------------+-------------------------+
| APP_VERSION_TWEAK | Numerical | ``VERSION_TWEAK`` | 4 |
| APP_TWEAK | Numerical | ``VERSION_TWEAK`` | 4 |
+-----------------------------+-------------------+------------------------------------------------------+-------------------------+
| APP_VERSION_STRING | String (quoted) | ``VERSION_MAJOR``, |br| | "1.2.3-unstable" |
| | | ``VERSION_MINOR``, |br| | |
Expand Down

0 comments on commit a945622

Please sign in to comment.