Commit Graph

142 Commits

Author SHA1 Message Date
Jordan Yates a9456221cd doc: version: document the numeric version limits
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>
2024-06-24 08:28:54 -04:00
Jamie McCrae f1410959fd doc: sysbuild: Add tag for application configuration section
Adds a tag to the sysbuild application configuration section so it
can be referenced in other documentation

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-06-12 18:27:14 -04:00
Fin Maaß fb8b30d8d0 dts: devicetree.h: add DT_REG_HAS_NAME
Add DT_REG_HAS_NAME,
DT_REG_ADDR_BY_NAME_OR,
DT_REG_SIZE_BY_NAME_OR,
DT_INST_REG_HAS_NAME,
DT_INST_REG_SIZE_BY_NAME_OR and
DT_INST_REG_ADDR_BY_NAME_OR.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2024-06-12 17:12:23 -05:00
Martí Bolívar 74abb2bf95 devicetree: add first-class node label helpers
Add the following new macros:

- DT_FOREACH_NODELABEL
- DT_FOREACH_NODELABEL_VARGS
- DT_INST_FOREACH_NODELABEL
- DT_INST_FOREACH_NODELABEL_VARGS

These are for-each helpers for iterating over the node labels of a
devicetree node. Since node labels are unique in the entire
devicetree, their token representations can be useful as unique IDs in
code as well.

As a first user of these, add:

- DT_NODELABEL_STRING_ARRAY
- DT_INST_NODELABEL_STRING_ARRAY

The motivating use case for these macros is to allow looking up a
struct device by devicetree node label in Zephyr shell utilities.
The work on the shells themselves is deferred to other patches.

To make working with the string array helpers easier, add:

- DT_NUM_NODELABELS
- DT_INST_NUM_NODELABELS

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2024-06-12 18:49:54 +02:00
Johan Hedberg 0b8e56120c Bluetooth: doc: Update documentation for the new HCI API
Update references to devicetree chosen properties and how devicetree nodes
should be defined in order to enable the new HCI drivers.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2024-06-11 19:42:49 -04:00
Torsten Rasmussen ed954bf638 doc: describe Kconfig tracking symbol
Fixes: #73132

Add a subsection on tracking Kconfig symbols whose default values is
obtained from another Kconfig symbol.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-06-04 14:06:13 -05:00
Yong Cong Sin bbe5e1e6eb build: namespace the generated headers with `zephyr/`
Namespaced the generated headers with `zephyr` to prevent
potential conflict with other headers.

Introduce a temporary Kconfig `LEGACY_GENERATED_INCLUDE_PATH`
that is enabled by default. This allows the developers to
continue the use of the old include paths for the time being
until it is deprecated and eventually removed. The Kconfig will
generate a build-time warning message, similar to the
`CONFIG_TIMER_RANDOM_GENERATOR`.

Updated the includes path of in-tree sources accordingly.

Most of the changes here are scripted, check the PR for more
info.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-05-28 22:03:55 +02:00
Declan Snyder 79f1b23cdb doc: Add missing ABNF macros for child num
Commit 5871ff010b
added support for generated DT macros to get the number
of child nodes of a node, but we forgot to update
the documentation of the augmented Backus–Naur form
of the DT macros to reflect this addition.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-22 13:46:04 -05:00
Declan Snyder 5f938228fd doc: sysbuild: Fix namespace example
The namespace example seems to have a typo missing the CONFIG_
part of the kconfig argument in the mcuboot target, fix it.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-05-07 15:22:05 -05:00
Jamie McCrae ff823c63ee doc: build: flashing: Add documentation
Adds documentation on the new flashing configuration system

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 17:56:19 +01:00
Jamie McCrae af467659de doc: build: Add details on SoC overlays
Adds details about Kconfig fragments and devicetree overlay files
that will be included in a build if they are found in the
``socs`` folder

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-29 15:08:35 +01:00
Andrej Butok c8f12c9273 doc: kconfig: fix HAS_CONFIGURABLE_FOO
Use HAS_CONFIGURABLE_FOO instead of wrong HAS_CONFIGURABLE.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-04-29 15:53:34 +02:00
Jamie McCrae 3d48ad90c9 doc: develop: application: Fix missed HWMv2 changes
Fixes outdated information that was missed with the HWMv2 migration

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-18 08:06:49 -07:00
Benjamin Cabé 27f91456a4 doc: dts: fix link to reel board DTS file
fix broken link following hwmv2 migration

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-03-15 18:21:05 -04:00
Benedikt Schmidt 004b307206 doc: kconfig: add exemption for busses in select recommended practices
Add the exemption for busses to the recommended practices
for select.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2024-02-26 12:06:06 +01:00
Jamie McCrae 5d458d1ce6 doc: build: sysbuild: Remove mention of child image
Removes mention of child image to prevent confusion with other
systems that have no relation to sysbuild

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-02-16 06:46:25 -06:00
Jordan Yates d323acafc3 doc: build: snippets: application required snippets
Document how an application can automatically include snippets when
being built.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-02-14 14:14:20 +01:00
Jamie McCrae 425ef8abd3 doc: Add documentation on FILE_SUFFIX build variable
Adds details to the application development page and sysbuild
page documenting the variable, how it works and how it should
be used

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-02-02 19:54:21 +01:00
Torsten Rasmussen a306397818 version: cmake: kconfig: introduce extra <type>_VERSION_<x>_STRING
Fixes: #68360

This commit introduces <type>_VERSION_TWEAK_STRING which includes
the tweak field in the string, but without the extra version.
This format is used by MCUboot / imgtool, and thus makes it easier to
align code to the format used by MCUboot.

This commit also introduces <type>_VERSION_EXTENDED_STRING which
includes the tweak field in the string in addition to the extra version
field.

The new defines / variables is available in code, CMake, and Kconfig,
and it defined for KERNEL, APP, and custom types, such as MCUBOOT.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-02-01 10:28:43 +00:00
Torsten Rasmussen 738999e191 version: export tweak version in version.h
The commit export TWEAK version to code through version.h.
This aligns the symbols available in code with those available in
CMake and Kconfig.

The new define is available for both KERNEL, APP, and custom version
types (such as MCUBOOT).

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-02-01 10:28:43 +00:00
Yong Cong Sin 450a66fa36 gen_defines: output the interrupt level of a node
Currently it is tedious to know the level of an interrupt for
a node in C. One would have to go through a very complex and
error prone macros to check if there's a parent interrupt
controller & if the controller has an interrupt number and thus
not a pseudo interrupt controller like the one found in
`rv32m1`. The level of a node is required to encode the
Zephyr's multi-level interrupt number

Since it is easier to do it in the `gen_defines` script, let's
do the heavy lifting there so that we can introduce new DT
macros to get the interrupt level very easily later.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-01-23 06:48:16 -05:00
Bjarki Arge Andreasen 08d6ff059e scripts: dts: gen_defines: Generate interrupt-controller macro
Extend the gen_defines.py write_interrupts(node) function to
generate macros to get the interrupt controller for an
interrupt specifier by idx and by name.

The information is already generated by edtlib.py and stored in
node.interrupts[].controller. This addition uses the node pointed
to by the controller member to generate the following example output

define DT_N_S_device1_IRQ_IDX_0_CONTROLLER \
       DT_N_S_gpio_800

define DT_N_S_device1_IRQ_NAME_test4_CONTROLLER \
       N_S_device1_IRQ_IDX_0_CONTROLLER

Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
2024-01-17 13:18:00 +01:00
Adam Bozanich 9e4328cdcd doc: build: dts: bindings-syntax: compatible typo
The discussion and bindings for this node
assume that it is compatible with `"bar,pwm"`.

Signed-off-by: Adam Bozanich <adam.boz@gmail.com>
2023-11-29 17:39:30 -08:00
Benjamin Cabé 155420522b doc: Fix occurrences of repeated words
Another round of repeated words cleanup. This commit tries to keep the
diff minimal and line wrapping was mostly left intact in the touched
files, as having them consistent across the documentation is probably
the topic of a future tree-wide cleanup (or not)

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-11-15 17:34:39 -05:00
Chris Friedt c0064f1de8 logging: uart: support multiple instances
Extends the log_backend_uart to support logging to multiple
UART instances.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-13 09:47:06 +01:00
Yong Cong Sin 30940418b3 doc: kconfig: sort devicetree functions alphabetically
Sort these entries alphabetically to make it easier to read.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-09 15:31:38 +01:00
Yong Cong Sin 4b0fa40c71 doc: kconfig: remove duplicated devicetree function
These devicetree function entries already existed in the doc
since #21133.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-11-09 15:31:38 +01:00
Fabio Baltieri 8816852c2c doc: dts: api: update the inter-node dependencies documentation
Update the inter-node dependencies documentation to clarify the child
node dependency inheritance recently introduced in 403640b75e.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-11-08 10:06:57 +01:00
Jordan Yates 7aae40e844 doc: build: kconfig: document `configdefault`
Document the new `configdefault` Kconfig extension.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-26 09:47:06 +02:00
Jordan Yates ee1acd8ae5 doc: build: kconfig: expand on multiple symbols
Convert the warning about multiple symbol definitions to a dedicated
section. This allows the warning to be restricted to the information
that is non-intuitive, with a note for actions that should be taken
when working with multiple definitions.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-26 09:47:06 +02:00
Benjamin Cabé 70b49c7f51 doc: build: Fix highlighting of code blocks
Set appropriate language for code blocks to show up with the right
syntax highlighting.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-18 18:39:23 +03:00
Benjamin Cabé 57c17da528 doc: devicetree: Fix highlighting of code blocks
Make sure devicetree code blocks all have proper pygments language set.
Fixed a few other "none" code blocks as well.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-18 13:22:45 +03:00
Benjamin Cabé 1be457f280 doc: kconfig: Add syntax highlighting for Kconfig snippets
Add proper pygments settings to make Kconfig snippets look pretty.
Also fixed a few config and devicetree code blocks.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-10-18 13:15:51 +03:00
Yanfeng Liu a275e45c85 doc: build:kconfig:settings rewise CONF_FILE description
make item#2 as part of item#1 to reduce confusions.

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2023-10-12 09:47:19 +03:00
Yanfeng Liu fc682c35a2 doc: build:kconfig:settings align with guidelines
use unnumbered list to align with guidelines

Signed-off-by: Yanfeng Liu <yfliu2008@qq.com>
2023-10-12 09:47:19 +03:00
Grzegorz Swiderski 8b273a45a6 doc: sysbuild: Update documentation about BUILD_ONLY
It is now possible to `west flash` or `west debug` a build-only image.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-27 17:49:12 +02:00
Carlo Caione e4a125b6a4 dt: Make zephyr,memory-attr a capabilities bitmask
This is the final step in making the `zephyr,memory-attr` property
actually useful.

The problem with the current implementation is that `zephyr,memory-attr`
is an enum type, this is making very difficult to use that to actually
describe the memory capabilities. The solution proposed in this PR is to
use the `zephyr,memory-attr` property as an OR-ed bitmask of memory
attributes.

With the change proposed in this PR it is possible in the DeviceTree to
mark the memory regions with a bitmask of attributes by using the
`zephyr,memory-attr` property. This property and the related memory
region can then be retrieved at run-time by leveraging a provided helper
library or the usual DT helpers.

The set of general attributes that can be specified in the property are
defined and explained in
`include/zephyr/dt-bindings/memory-attr/memory-attr.h` (the list can be
extended when needed).

For example, to mark a memory region in the DeviceTree as volatile,
non-cacheable, out-of-order:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_VOLATILE |
			       DT_MEM_NON_CACHEABLE |
			       DT_MEM_OOO )>;
   };

The `zephyr,memory-attr` property can also be used to set
architecture-specific custom attributes that can be interpreted at run
time. This is leveraged, among other things, to create MPU regions out
of DeviceTree defined memory regions on ARM, for example:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-region = "NOCACHE_REGION";
       zephyr,memory-attr = <( DT_ARM_MPU(ATTR_MPU_RAM_NOCACHE) )>;
   };

See `include/zephyr/dt-bindings/memory-attr/memory-attr-mpu.h` to see
how an architecture can define its own special memory attributes (in
this case ARM MPU).

The property can also be used to set custom software-specific
attributes. For example we can think of marking a memory region as
available to be used for memory allocation (not yet implemented):

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_NON_CACHEABLE |
			       DT_MEM_SW_ALLOCATABLE )>;
   };

Or maybe we can leverage the property to specify some alignment
requirements for the region:

   mem: memory@10000000 {
       compatible = "mmio-sram";
       reg = <0x10000000 0x1000>;
       zephyr,memory-attr = <( DT_MEM_CACHEABLE |
			       DT_MEM_SW_ALIGN(32) )>;
   };

The conventional and recommended way to deal and manage with memory
regions marked with attributes is by using the provided `mem-attr`
helper library by enabling `CONFIG_MEM_ATTR` (or by using the usual DT
helpers).

When this option is enabled the list of memory regions and their
attributes are compiled in a user-accessible array and a set of
functions is made available that can be used to query, probe and act on
regions and attributes, see `include/zephyr/mem_mgmt/mem_attr.h`

Note that the `zephyr,memory-attr` property is only a descriptive
property of the capabilities of the associated memory  region, but it
does not result in any actual setting for the memory to be set. The
user, code or subsystem willing to use this information to do some work
(for example creating an MPU region out of the property) must use either
the provided `mem-attr` library or the usual DeviceTree helpers to
perform the required work / setting.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-09-15 12:46:54 +02:00
Benjamin Cabé 59e4c5aed0 samples: fully migrate basic samples to the new Sphinx extension
- Updated basic samples READMEs to use the new zephyr:code-sample::
  directive. Dropped "-sample" suffix that's not required anymore now
  that samples have their own namespace.
- Updated all references to the samples to use the :zephyr:code-sample:
  role. Checked and updated the wording of said references to account
  for the fact that samples should not have "... sample" in their name
  anymore.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-13 09:15:34 +02:00
Grzegorz Swiderski a768a05e62 doc: sysbuild: Add documentation for image ordering
Add a brief subsection to explain `sysbuild_add_dependencies()`.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-09-05 15:27:04 +02:00
Xudong Zheng d2ba2ec987 doc: sysbuild: Update note regarding CONFIG_ZEPHYR_TRY_MASS_ERASE
The configuration option was deprecated and removed as the default in
MCUBoot commit 9315654d7951fb2c269251db94e04cd062d0b89a.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2023-08-17 15:12:57 +02:00
Nico Lüthi cd2a0389ed cmake: add ZephyrAppConfiguration package
Fixes #56200
Add the ZephyrAppConfiguration package and update the corresponding
documentation. This adds flexibility to the CMake build configuration
by providing a workspace configuration package and an application
package, which only applies to the current application. The workspace
package stays the same as before, but the application package is
new and lives, per default, inside the application folder.

Signed-off-by: Nico Lüthi <nylnx@outlook.com>
2023-08-17 10:36:45 +02:00
Grzegorz Swiderski d821655def doc: sysbuild: Document the BUILD_ONLY parameter
Add a brief subsection about how to build a Zephyr application without
flashing it.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
2023-08-08 12:35:21 +00:00
Jamie McCrae 945b91ca2d doc: build: Add details on application version system
Adds details on how to use Zephyr's VERSION file for setting the
version of an application.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-08-04 10:44:09 +02:00
Jordan Yates fe498ada60 scripts: snippets: add `DTS_EXTRA_CPPFLAGS` support
Add an additional option to the `append` schema for appending to the
`DTS_EXTRA_CPPFLAGS` cmake cache variable, enabling finer control over
the content of devicetree files.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-08-02 16:27:11 +02:00
Jordan Yates 999afdc728 scripts: kconfig: size/addr by nodelabel
Add new devicetree kconfig function to get a node size or addr by
nodelabel.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-08-02 10:38:23 +02:00
Carlo Caione 7483e43f0c devicetree: Add 'zephyr,memory-attr' and DT helpers
The 'zephyr,memory-region-mpu' property was addede gqas a
convenient way to create and configure MPU regions using information
coming from DT. It has been used a lot since it was introduced so I
guess we can consider it a Zephyr success story ™ .

Unfortunately it has been proved to be a bit limited and with some
important limitations:

1. It was introduced as a property of the compatible
   zephyr,memory-region that is used to create linker regions and
   sections from DT data. This means that we can actually create MPU
   regions only for DT-defined regions and sections.
2. The naming is unfortunate because it is implying that it is used only
   for MPU.
3. It is misplaced being in include/zephyr/linker/devicetree_regions.h
   and still it has nothing to do with the linker at all.
4. It is exporting a function called LINKER_DT_REGION_MPU that again has
   nothing to do with the linker.

Point (1) is also particularly limiting because it is preventing us to
characterize memory regions that are not generated using the
'zephyr,memory-region' compatible, like generic mmio-sram regions.

While we fix all the issues, we also want to extend a bit the range of
usefulness of this property. We are renaming it 'zephyr,memory-attr' and
it is now carrying information about the type of memory the property is
attached to (cacheable, non-cacheable, IO, eXecutable, etc...). The user
can use this property and the DT API coming with it to act on the memory
node it is accompanied by.

We are still providing the DT_MEMORY_ATTR_APPLY() macro that can be used
to create the MPU regions as before, but we are adding also a
DT_MEMORY_ATTR_FOREACH_NODE() macro that can be used to cycle through
the memory nodes and act on those.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-07-25 11:22:10 +02:00
Gerard Marull-Paretas 92707866d1 device: s/gen_handles/gen_device_deps
Rename the gen_handles script and all of its references/associated files
to gen_device_deps. The new new makes things more clear, because the
script just take care of generating, for each device, an array of device
dependencies. While device handles are used internally to store this
information, it is in reality an implementation detail.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-06-21 09:32:05 +02:00
Benjamin Cabé 8cbe2d83b4 doc: snippets: fix bad link
Fixed incorrect reference to snippets/ folder

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-06-07 04:40:47 -04:00
Benjamin Cabé a76396fb7a doc: update stale links to MCUboot documentation
mcuboot.com/documentation --> docs.mcuboot.com

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-06-07 04:40:47 -04:00
Fabio Baltieri 5f68ea686d doc: release: 3.4: add a note about build time priority checking
Add a release note entry about the new build time priority check option.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-26 09:54:41 -04:00