Commit Graph

167 Commits

Author SHA1 Message Date
Keith Packard
3a197934fc doc: Switch main return type from void to int.
As both C and C++ standards require applications running under an OS to
return 'int', adapt that for Zephyr to align with those standard. This also
eliminates errors when building with clang when not using -ffreestanding,
and reduces the need for compiler flags to silence warnings for both clang
and gcc.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-04-14 07:49:41 +09:00
Marc Herbert
087add3baf docs/build-flash-debug: expand one-time CMake arguments section
- Change "re-run CMake" to "re-run CMake configuration steps" because
  `west build -v ...` displays `cmake --build ...` every time which can
  confuse non-experts.

- Explain what is the actual issue with re-configuring: it makes the
  incremental builds slower. But not much slower:

```
   $ west  build -b qemu_x86 samples/hello_world/ -DCONFIG_OUTPUT_STAT=y
   [133/133] Linking C executable zephyr/zephyr.elf
   $ west  build -b qemu_x86 samples/hello_world/ -DCONFIG_OUTPUT_STAT=y
   [16/16] Linking C executable zephyr/zephyr.elf
```

- Explain that the best solution is to simply skip to the next section

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-12 08:59:12 +02:00
Marc Herbert
fad2da39aa intel_adsp: move west sign from west flash to earlier west build
Invoking `west sign` in `west build` accelerates twister because `west
build` is run in parallel, see rationale in superseded and very
different (CMake-based) PR #52942.

To maximize backwards compatibility:
- `west sign` is optional in `west build`
- `west flash` will sign (again) if any rimage --option is passed

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-04-10 22:04:47 -04:00
Dmitrii Golovanov
f31aab58d5 twister: Add configurable flashing timeout
Use explicit flash command execution timeout at DeviceHandler
instead of the hardcoded value of 60 sec.

When a HW platform executes test cases right after the flash command,
the test case remaining timeout is affected by how much time the flash
operation consumes. Some simulation platforms need to spend significant
amount of time on each 'flash' cycle, usually adding the same delay on
each test case.

This improvement adds two new command line options and device map fields:

  --device-flash-timeout - for the flash operation timeout
  ('flash-timeout' device map field).

  --device-flash-with-test - to indicate that the platform flash
  command also runs a test case, so the overall timeout should be
  calculated as a sum of the flash timeout and the current test case
  timeout to receive all console output from the platform
  ('flash-with-test' device map field).

The device map field values override command line values for the
particular platform where configured.

Default behavior is backward compatible: flash operation fixed timeout
is 60 sec. not including the test case timeout.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-04-08 18:37:33 +02:00
Hake Huang
148c0e1773 doc: twister: test-config: enhance test config
update twister document on how to use test config

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2023-04-06 14:23:32 -05:00
Anas Nashif
b6bf269cc6 docs: remove intel_cavs platforms from docs
Remove references to dropped CAVS platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-04-06 18:51:56 +02:00
Bjarki Arge Andreasen
b557a1d711 include/drivers: Add RTC API header and handlers
This commit adds the rtc.h header file which contains
API functions for real-time-clocks, which are low power
devices which track and represent broken-down time.

It also changes one line of doxygen documentation in the
maxim_ds3132.h file to place it in its own group.

The handlers for use of the API from userspace is also
added with this commit.

The API is split into one mandatory section, setting and
getting time, and three optional sections, alarms, update
event callback, and clock calibration.

Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
2023-04-04 17:03:38 +02:00
Ivan Herrera Olivares
1cc226a283 doc: testing: Fix testing expectations example
This fixes a typo in the testing framework docs where the
ZTEST_EXPECT_SKIP MACRO seems to be referring to the wrong function.

Signed-off-by: Ivan Herrera Olivares <ivan.herreraolivares@gmail.com>
2023-04-04 14:31:52 +02:00
Abe Levkoy
255bb6b5fc doc: application: development: Organize debugging
Clarify the debugging section by adding subsections for the GDB client
and server. Add information about reading the system console while
debugging. Make formatting a bit more consistent generally.

Signed-off-by: Abe Levkoy <alevkoy@google.com>
2023-04-04 13:35:03 +02:00
Jamie McCrae
221e8bf198 doc: develop: west: sign: Add details on extending signing
Adds details on how to extend/replace the CMake files used for
west sign operations.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-29 15:53:50 +00:00
Marti Bolivar
ee4b134dd6 doc: add snippets documentation
Document this new build system feature.

Since its purpose is customizing application builds, the logical place
for the main body of documentation is in a new snippets/ directory in
doc/build/. Create that directory and add its initial documentation.

Like boards and samples, however, we expect people to write
documentation for each snippet within the directory that defines the
snippet itself. Therefore, add a new top-level snippets/ directory and
stub out the documentation needed to document individual snippets as
well.

Add documentation and cross-references in other required places as
well.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-03-26 16:12:41 +02:00
Andrei Emeltchenko
90e6bf8e9f smbus: doc: Add Documentation for SMBus subsystem API
Add some basic documentation and API reference for SMBus.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-03-22 08:16:23 -04:00
Marc Herbert
209eb20056 doc: modules: add link to new contributor expectations page
Also mention that drafts reduce notification spam.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-22 10:03:58 +01:00
Jamie McCrae
69cb35e3ac doc: Add retained memory API and mark as experimental
Adds the the retained memory API to the list and marks it as
experimental.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-20 15:02:09 +01:00
Marc Herbert
459935c09d doc: west: fix WestCommand self.configuration -> self.config
WestCommand has no .configuration field, it's .config.

In the same (and cursed!) sentence, also fix the broken link to
west.command.WestCommand by switching the link target from the
unusual `py:class::` to the common `autoclass::` used by all other
classes in the same page. I don't understand why that fixes the
hyperlink but it works and it's consistent.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-03-17 14:02:39 -07:00
Jamie McCrae
4b5bbb2902 docs: build system: Update note that prj.conf file is needed
Adds a note that this file is mandatory.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-17 11:49:27 +01:00
Gregory Shue
5623f54a35 fff: Add fff_extensions.h, RETURN_HANDLED_CONTEXT()
Add supplementary header <zephyr/fff_extensions.h>.  Add macro
to fff_extensions.h for simplifying definition of custom fake functions
needing call-unique information for producing desired output data.
When an array of custom fake context structures is defined and
the return field within the first structure instance is registered
with the standard SET_RETURN_SEQ() macro of FFF, the
RETURN_HANDLED_CONTEXT() macro provides the inverse logic to
recover the context structure for this called instance. The body of
the custom fake handler is provided to the RETURN_HANDLED_CONTEXT()
macro for appropriate execution and access to the custom fake
parameters.

A test suite is also provided to verify macro implementation and
illustrate usage. It is at:
zephyr/tests/subsys/testsuite/fff_fake_contexts/

This code was verified by:

1. (Pass) west build -p always \
            -b unit_testing tests/subsys/testsuite/fff_fake_contexts/ && \
         ./build/testbinary
2. (Pass) west build -p always \
            -b native_posix tests/subsys/testsuite/fff_fake_contexts/ && \
         ./build/zephyr/zephyr.exe
3. (Pass) ./scripts/twister -p unit_testing \
            -T tests/subsys/testsuite/fff_fake_contexts/
4. (Pass) ./scripts/twister -p native_posix \
            -T tests/subsys/testsuite/fff_fake_contexts/
5. (Pass) cd doc && build html-fast

Fix #55246

Signed-off-by: Gregory Shue <gregory.shue@legrand.com>
2023-03-16 13:43:33 -04:00
Stephanos Ioannidis
b4538ffcdb doc: Update installation instructions for Zephyr SDK 0.16.0
This commit updates the Zephyr SDK installation instructions for the
Zephyr SDK 0.16.0 release.

Note that the distribution bundle archive format has been changed from
`tar.gz` to `tar.xz` for Linux and macOS, and from `zip` to `7z` for
Windows.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-03-16 21:04:30 +09:00
Torsten Rasmussen
139fa8292a doc: document the sysbuild PRE/POST_CMAKE, PRE/POST_DOMAINS hooks
Document how sysbuild modules can provide functions that will be invoked
during sysbuild CMake configure time.

The following functions has been documented:
- <module-name>_pre_cmake
- <module-name>_post_cmake
- <module-name>_pre_domains
- <module-name>_post_domains

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-03-11 19:53:40 +01:00
Jamie McCrae
307b10e516 doc: modules: Change normal modules to zephyr modules
Minor doc change that was missed from a PR.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-09 17:22:08 +01:00
Jamie McCrae
388b3c237a doc: sysbuild: Add details on external modules
Adds details on how to use the new sysbuild external module
feature.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-03-09 09:25:00 +01:00
Torsten Rasmussen
3a9b2a3e83 cmake: recommend CMake >=3.20.5 as minimum CMake version
CMake versions <3.20.5 contains the following bug:
https://gitlab.kitware.com/cmake/cmake/-/issues/22310

This bug was fixed in CMake 3.20.5:
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6232

Generally Zephyr can build with CMake >=3.20.0, however the
`cmake/package_helper.cmake` is impacted by the above issue.

Therefore, specifically request CMake >=3.20.5 for package helper
and update documentation to recommend CMake version 3.20.5 in order
to minimize risk of users being impacted by this bug.

Users invoking package helper with CMake 3.20.0-3.20.4 will see:
> CMake Error at cmake/package_helper.cmake:45 (cmake_minimum_required):
>  CMake 3.20.5 or higher is required.  You are running version 3.20.x

Rest of Zephyr still builds with CMake versions >=3.20.0.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-03-07 18:15:58 +01:00
Anas Nashif
f4dc918d53 twister: doc: test configuration and test levels
Document test configurations and levels.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-03-07 15:49:16 +01:00
João Dullius
79d9f45296 scripts: runners: bossac: Enable BOSSAC to run on Windows (native)
Fixes #37538 by correctly detecting WSL and blocking bossac from running
on that platform, but allowing it to run on Windows native.

Signed-off-by: João Dullius <joaodullius@bpmrep.com.br>
2023-03-06 13:17:09 -08:00
Fabio Baltieri
456a1cab2f doc: api: overview: add an entry for input
Add an entry for the input subsystem, experimental, 3.4.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-03-06 11:47:32 -08:00
Martí Bolívar
9c18b3854a doc: ztest: various fixes
This page is:

- using literal blocks [1] where it should be using code
  blocks [2], which won't produce the desired results [3]

- missing required whitespace between code block directives and their
  pygments syntax arguments [4]

  In other words, this:

    .. code-block::foo

  should be:

    .. code-block:: foo

- using an incorrect syntax (option:`CONFIG_FOO` or
  :kconfig:option:`CONFIG_FOO=y1) to refer to Kconfig
  options (should be :kconfig:option:`CONFIG_FOO`, etc)

Fix these issues so we get syntax-highlighted code blocks in the
correct pygments highlight syntax and valid references to Kconfig
options.

Adjust directive content indentation to match the usual .rst style and
make some grammar tweaks as well.

[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#literal-blocks

[2] https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-code-block

[3] Use of literal blocks can produce the same results if there is a
    consistent choice of highlight language specified for the file, but
    this file is intermixing code blocks that should be highlighted as
    either C or shell commands, so there is no single choice of
    highlight syntax that works.

[4] https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#directives

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-03-06 09:14:02 -08:00
Maciej Perkowski
85dd4975a4 twister: cmake: Add prefiltration based on cmake package helper script
Twister allows filtering based on kconfigs and dts, however the
filtration is a part of the cmake stage, i.e. the stage has to pass
first and then twister checks if required properties are available.
This causes problems, when the full cmake stage is unable to pass.
If so, other filtration methods had to be used, e.g. platform_allow.
The commit modifies the twister workflow:
if a test defines filters based on kconfig/dts first a cmake package
helper script is used to extract dt and/or kconfigs and if the
conditions are fulfilled  it proceeds to a regular cmake stage.
If not, test is skipped.

Co-authored-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-03-02 15:38:08 -05:00
Andy Ross
10b9aab86b doc: Clarify C++ standards support
We weren't explicit about what we mean by "C++ support" as it relates
to standards versions, and it's been causing some friction in the tree
vs. some of our cruftier toolchains.  Add a paragraph to clarify
things.

Fixes #55204

Signed-off-by: Andy Ross <andyross@google.com>
2023-03-01 19:42:32 -05:00
Dawid Niedzwiecki
b2674a4b34 subsys/mgmt/ec_host_cmd: rename peripheral to backend
Follow naming pattern in the subsystems(logging or shell) and name
the layer between generic handler and peripheral driver "backend".

The name doesn't suit that well to the SHI backend, because there isn't
SHI API itself and the SHI interface is used only for the host
communication. So the backend code includes the peripheral driver itself.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-02-28 10:42:23 +01:00
Anas Nashif
1d5fc67b40 twister: doc: clarify build_only keyword
Add more details on the build_only keyword and where it should be used.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-27 08:14:22 -08:00
Anas Nashif
f78040e5bd twister: doc: clarify harness keyword in test metadata
Clarify the harness keyword in test metadata.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-27 08:14:22 -08:00
Gerard Marull-Paretas
a1e983fef0 drivers: pinmux: drop driver class
Pinctrl is the new pinmux.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-02-23 16:56:04 -05:00
Aaron Massey
107cb86bb3 ztest: Add initial zexpect API for delayed failing
Add the zexpect API, inspired by GoogleTest's EXPECT API. This API reports
test failures while allowing test execution to continue. This enables test
reports to show more than a singule failing property on a failing test.

Signed-off-by: Aaron Massey <aaronmassey@google.com>
2023-02-23 20:34:39 +01:00
Benjamin Cabé
5ed3b678ba doc: tests: Fix incorrect table syntax
This fixes an incorrect use of the reStructuredText grid table syntax.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-02-23 07:53:24 -05:00
Daniel Leung
53316d5c8e toolchain: rename xcc-clang to xt-clang
This reflects the actual compiler executable name of the Xtensa
LLVM/Clang compiler.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-02-22 08:35:46 -05:00
Anas Nashif
9d6446a7a1 doc: api: rename API WG to Arch WG
The API WG was renamed to Architecture WG.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-02-21 08:23:37 -06:00
Martí Bolívar
0de8c6bf29 .github: doc-build: move to west 1.0.0
The release notes are in and west==1.0.0 is installable via pypi.
Move the doc build over to it and fix a typo while we are here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-02-21 19:39:50 +09:00
Martí Bolívar
5e0a6cd076 doc: west: release notes for west v1.0
Document the west v1.0 release, which brings with it stable APIs,
removal of legacy APIs, and other changes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2023-02-20 13:00:47 -08:00
Alp Sayin
e2546cdf1f doc: application development: brief about setting QEMU gdbserver listener
Briefly explain how a user can change their gdbserver listening device via
the Kconfig option or via shell environment. User is reminded about caveats
regarding using environment variables with CMake systems. Finally, another
invokation of QEMU-with-gdb via west from root directory is presented.

Signed-off-by: Alp Sayin <alpsayin@gmail.com>
2023-02-20 09:48:52 +01:00
Evgeniy Paltsev
c2f52a7548 ARC: doc overhaul for nSIM board (with few fixes to MWDT docs)
Completely rewrite nSIM board documentation with additional fixes
to ARC MWDT toolchain documentation.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2023-02-18 06:55:51 +09:00
Stephanos Ioannidis
5d7398761d doc: toolchains: Add deprecation notice for xtools toolchain variant
This commit adds a deprecation notice for the `xtools` toolchain
variant, which was deprecated in the commit
a9d85ae472.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-02-16 23:59:16 +09:00
Marc Herbert
3539f3ddfa doc: Use Copy/paste: mention accessibility
Trying to stem the tide of screenshots; every little helps?

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-02-09 11:12:32 +01:00
Keith Packard
ed51e48ba5 doc/develop: Add picolibc documentation
This describes the capabilities offered by Picolibc along with some of the
requirements applications have when using it.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-02-01 10:07:05 -08:00
Torsten Rasmussen
a8a4df0476 doc: document the Static Code Analysis (SCA) tool infrastructure
This commit documents the new SCA tool infrastructure.

The existing documentation for sparse are relocated into a dedicated
documentation folder for SCA tools.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-01-27 20:28:58 +09:00
Marti Bolivar
dc5cf7b76c doc: west: improve 'manifest --validate' section
I got a couple of questions about what this command's purpose is and
how to debug 'valid' manifests that aren't working as desired. Add
some information to address this.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2023-01-24 10:14:13 -08:00
Grzegorz Chwierut
0a7a61f15c twister: docs: Update twister docs with quarantine
Docs updated with changes proposed in #52179
Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-01-19 06:51:00 -05:00
Al Semjonovs
403f28603e west: Update documentation on twister script integration
Adding documentation for twister wrapper west command

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-01-13 15:39:04 -08:00
Stephanos Ioannidis
3f058cc04e doc: languages: cpp: Improve C++ standard library documentation
This commit improves the C++ standard library documentation by adding
the list of supported C++ standard libraries.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis
669a0f5bec lib: cpp: Rework C++ standard library configurations
This commit reworks the C++ standard library configurations such that:

* the separation between the Zephyr minimal C++ library and the fully
  featured C++ standard libraries, such as GNU libstdc++, is clear.
  This is done by deprecating the Kconfig `CONFIG_LIB_CPLUSPLUS`
  symbol, which implies that the minimal C++ library is selected when
  set to `n`, and introducing the `CONFIG_MINIMAL_LIBCPP` symbol.

* the type of the selected C++ standard library is clear. This is done
  by introducing a Kconfig choice, `LIBCPP_IMPLEMENTATION`, for the C++
  standard library type and providing the choice symbols for each
  library type supported, such as `CONFIG_MINIMAL_LIBCPP` and
  `CONFIG_GLIBCXX_LIBCPP`.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00
Stephanos Ioannidis
404e7a9bf7 treewide: Use CONFIG_CPP_EXCEPTIONS instead of CONFIG_EXCEPTIONS
This commit updates all in-tree code to use `CONFIG_CPP_EXCEPTIONS`
instead of `CONFIG_EXCEPTIONS`, which is now deprecated.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2023-01-13 17:42:55 -05:00