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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>