Commit graph

642 commits

Author SHA1 Message Date
Gerard Marull-Paretas d7c48d0dfb doc: guides: pm: fix incorrect Kconfig reference
Kconfig options need CONFIG_ prefix when referenced.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-08 07:02:47 -05:00
Carles Cufi 7107f7a00d doc: guides: Building the documentation
Add a couple of missing Arch packages for the .pdf build.

Fixes #41887.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-03 07:32:43 -05:00
Wealian Liao 7467dc4c12 tracing_user: Add ISR nest level parameter
For tracing_user, the sys_trace_isr_enter() & sys_trace_isr_exit()
block any nest interrupts & most SMP interrupts for the user. It is
hard to analyze the IRQ preemption(e.g., each IRQ counter and execution
time). This commit adds ISR nest level for each CPU to the user instead
of blocking user call back when nest interrupts.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2022-01-21 14:38:35 -05:00
Jordan Yates afa700d182 doc: guides: index: document Doxygen linking
Document the existance of `zephyr.tag` by providing a link on the main
documentation guide page. Also include an example of how to use this
file in an external project.

Implements #41529.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-01-21 14:26:14 -05:00
Flavio Ceolin 2b9d2f6f6c docs: pm: Add power domain information
Document power domains on Zephyr.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-01-19 13:35:32 -05:00
Dominik Ermel b36f29243e doc/guides/mgmt: Mcumgr fixes backporting process
The commit adds guide on backporting mcumgr fixes to Zephyr 2.7.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Co-Authored-By: Francesco Servidio <francesco.servidio@nordicsemi.no>
2022-01-18 13:15:38 -05:00
Erwan Gouriou 26cde3ab23 boards: b_u585i_iot02a: Add a non-secure target
Provide a _ns target for b_u585i_iot02a board.
Flash partition is given as default for most applications,
with the following sizes:
MCUBoot: 208K
Secure: 256K
Non secure: 512K

Tested using tfm_ipc sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-18 10:42:45 -05:00
Gerard Marull-Paretas d2538475c6 doc: fix PDF build issue due to extlink references
LaTeX code generated by Sphinx causes problems when using extlinks in
references. Mitigate the problem by just using the extlink role
directly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-17 12:48:43 -05:00
Henrik Brix Andersen 2c0e0a74af doc: use extlink for github issue links
Use extlink for GitHub issue links in documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-17 12:48:43 -05:00
Gerard Marull-Paretas 36515919b5 doc: fix kconfig usage issues
- Fix some syntax errors, e.g. :c:kconfig:`...`
- Remove references to missing symbols (replaced with literals)

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-17 11:42:53 -05:00
Grzegorz Ferenc feb8d96b59 doc: mcumgr: add -w 1 parameter
Added -w 1 parameter to image upload mcumgr command.

Signed-off-by: Grzegorz Ferenc <Grzegorz.Ferenc@nordicsemi.no>
2022-01-12 15:42:01 +01:00
Henrik Brix Andersen 99a310b29b drivers: can: loopback: convert the CAN loopback driver to dts
Convert the CAN loopback driver from being configured via Kconfig to
multi-instance configured via devicetree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-04 15:13:40 -06:00
Gerard Marull-Paretas c0fff657c5 pinctrl: use groupN instead of pinsN for groups
The pinsN group name can be a confusing in some circumstances, so change
it to groupN. Some platforms (e.g. nrf or gd32) are already using
groupN. Documentation and API tests have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-01 07:39:08 -05:00
Gerard Marull-Paretas 5dc6ed3ce3 pinctrl: require ; after PINCTRL_DT_(INST_)DEFINE macros
The PINCTRL_DT_(INST_)DEFINE macros already defined the trailing ;,
making its usage inconsistent with other macros such as
DEVICE_DT_DEFINE.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-01 07:39:08 -05:00
Krzysztof Chruscinski 16bd0df2fd testsuite: ztest: Add framework for stress testing
Added framework for concurrency testing. Framework setup multiple
priority contexts and executes user handlers in that context. Test
terminates after certain number of repetitions or preemptions or
when timeout occurs. It can also be aborted by the user.

Framework can be used for testing resiliency to preemptions.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-01 07:37:22 -05:00
Kevin Townsend 8dbf0f31f2 doc: guides: tfm: Add pages on test suites
Adds notes on how to run the two main test suites for TF-M using
the supplied sample applications.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-12-21 17:07:58 +01:00
Gerard Marull-Paretas 91b8abfb4d pm: device_runtime: suspend device on enable
The pm_device_runtime_enable did not suspend devices, so it assumed that
the device was in a physically suspended state. This change makes sure
that device is left in a suspended state if the device is initially
active.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-16 10:41:04 +01:00
Tom Burdick 0513b242d4 docs: Adds syscall tracing to tracing docs
Tracing guide in the docs was missing references to the added tracing
syscall macro hooks. This adds those.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-12-15 16:51:31 -05:00
Anas Nashif c5070dd06c twister: fix documentation of baud setting
Baud setting in the hardware map should not be enclosed by quotes.

Fixes #40450

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-15 14:09:49 -05:00
Flavio Ceolin 18b932f10d pm: device_runtime: Return possible error on enable
Change the function pm_device_runtime_enable() to return 0 on
success or an error code in case of error.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-12-14 19:23:05 -05:00
Ederson de Souza bdaac354f4 kernel: Bring back object tracking
When CONFIG_TRACING_OBJECT_TRACKING is enabled, the kernel will keep
lists of some objects (detailed below), so that debuggers or other tools
can keep track of them.

The lists of objects are:

struct k_timer *_track_list_k_timer;
struct k_mem_slab *_track_list_k_mem_slab;
struct k_sem *_track_list_k_sem;
struct k_mutex *_track_list_k_mutex;
struct k_stack *_track_list_k_stack;
struct k_msgq *_track_list_k_msgq;
struct k_mbox *_track_list_k_mbox;
struct k_pipe *_track_list_k_pipe;
struct k_queue *_track_list_k_queue;

Note that while CONFIG_TRACING is needed, one can always use
CONFIG_TRACE_NONE=y. Also, tracking will only be done for objects that
are also being traced (so, to prevent tracking of some type of object,
such as k_timer, just make CONFIG_TRACING_TIMER=n).

Some simple "sanity checking" tests are also added in this patch.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2021-12-14 07:42:31 -05:00
Lauren Murphy c1711997bc debug: coredump: add xtensa coredump
Adds Xtensa as supported architecture for coredump. Fixes
a few typos in documentation, Kconfig and a C file. Dumps
minimal set of registers shown by 'info registers' in GDB
for the sample_controller and ESP32 SOCs. Updates tests.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-12-14 07:40:55 -05:00
Martí Bolívar 71f17bcbc2 doc: restore environment variables page
This was moved into the application development guide in commit
bf9ceac ("doc: move env_vars into application development").

That commit claimed the following rationale:

  No reason why we are duplicating this information in a standalone
  guide when we already talk about env variables in the application
  developer guide.

A github comment later says the duplication was in "Important build
system variables":

https://github.com/zephyrproject-rtos/zephyr/pull/34364#discussion_r616646517

This is incorrect and a misreading of the application development
guide.

The application development guide is talking about **cmake**
variables. These are not the same thing at all as **environment**
variables; treating them as if they are the same is simply wrong and
misleading, especially the "option 4" part that is really about
CMake variables, not environment variables.

In fact, the separate environment variables page was created for a
reason, which was to have a single place to explain to people unused
to managing their environment how things work, without cluttering
things up for people who already understand this.

There is nothing wrong with small, self-contained guides and in fact I
would argue they are a good thing.

Fix this confusing situation by restoring the original, separate page
and extricating the portions of it that are not related to environment
variables.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-14 13:28:20 +01:00
Gerard Marull-Paretas 459c3f918f doc: drop single quote references
Many documents relied on single quotes to create references, e.g.
`my_reference`. This is possible because `default_role = "any"` is
enabled in Sphinx conf.py. However, this method comes with its problems:

- It mixes all domains together, so it's not clear to what are you
  referencing: a document? a Kconfig option? a C function?...
- It creates inconsistencies: in some places explicit roles are used
  (e.g. :ref:`my_page`) while in some others not.
- _Conflictis_ with markdown. Single quotes are used for literals in
  Markdown, so people tend to use the same syntax in Sphinx, even though
  it has a different purpose.

Usages have been found using `git grep ' `[^`]*` ' -- **/*.rst`.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-10 16:43:34 -05:00
Henrik Brix Andersen e1ad3b2ab3 doc: guides: tfm: fix documentation build
Fix the TF-M requirements documentation build.

Fixes: ee001fa4bb

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-08 13:25:38 -06:00
Martí Bolívar fa41f4bb8f doc: update devicetree sections
Reflect the removal of BOARD.dts.pre.tmp in favor of zephyr.dts.pre in
SVG diagrams. Clean up adjacent text.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-07 13:39:37 -05:00
Jimmy Brisson ee001fa4bb boards: Add mps3-an547-ns target; build mps3-an547 with TFM in secure mode
This includes a new device tree, new target yaml and new target
defconfig

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2021-12-07 10:44:23 -06:00
Daniel Leung 38c42f69d2 doc: gdbstub: add a simple example
Adds a simple example to demonstrate how to use GDB stub.

Fixes #39415

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-12-06 20:55:32 -05:00
Henrik Brix Andersen abbc89f026 boards: add support for integer board revisions
Add support for simple integer board revisions (1, 2, 3, ...).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-01 13:53:30 -06:00
Daniel Leung bdc812c15a doc: debug: expand documentation on gdbstub
This expands the documentation on GDB stub, and adding
hints on porting to new architectures.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Bartosz Bilas 554296c1e1 doc: west: build-flash-debug: fix cmake arg example
The shorter version of --cmake argument should contain one dash only.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2021-11-22 23:04:30 -05:00
Øyvind Rønningstad 449cb60815 samples: Add TF-M sample for custom secure partitions
The sample implements a dummy ARoT (Application Root of Trust) partition
in TF-M and calls it from the app.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-22 22:19:41 -05:00
Dominik Ermel e05c3d7a57 doc/guides/doc: Correct missed htmldocs
Correct missed htmldocs to html.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-22 11:19:38 -05:00
Tomasz Bursztyka dd66bdadfa include/spi: Clarify spi_release() function behavior
It will unlock and unhold the CS line. Note that the lock and the CS
being hold on are 2 separate config bits, so if only one is selected
spi_release() will only apply on this configuration.

Note: this has been already the case in the controller drivers, where
there implementation of spi_release() calls
spi_context_unlock_unconditionally(). And that function always forces
the CS line to an inactive state.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-19 19:17:19 -05:00
Martí Bolívar 46de74b8de doc: dts: clear up DTC_OVERLAY_FILE
Make it clearer that you can set it explicitly or the build system
will try to set it for you, and try to make it clearer what the build
system is doing when it tries to set it on your behalf.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-11-17 11:14:11 -05:00
Torsten Rasmussen 1594cd38b2 doc: zephyr build process description
Updated the Zephyr build process description to include description of
all Zephyr link stages.

It extends the guide with description of the intermediate binaries as
well as the post-processing of those binaries.
- Unfixed size binary
- Fixed size binary

Post-processing
- Partition alignment
- ISR table generation

Build stages images has been updated and new images showing the
post-processing stages of the intermediate binaries has been added.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-16 10:41:59 +01:00
Gerard Marull-Paretas ffebac6578 tracing: improve Doxygen structure
- Add tracing to the subsys group
- Use `subsys_tracing` "namespace"
- Some minor header style improvements

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-15 10:12:56 -05:00
Gerard Marull-Paretas 392a0bee31 doc: guides: pm: system: improve some sentences
Improve some sentences to make them easier to understand.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas a4d257f19b doc: guides: pm: device_runtime: new guide
Add a new and more extensive guide that describes the device runtime
API. It contains a brief introduction, API design principles and goals,
some example sequence diagrams and usage guidelines.

While the API still needs important additions, such a guide will
hopefully guide developers when trying to deal with device PM in Zephyr.

Note: sequence diagrams have been created using PlantUML (2021 version).
The rendered SVG diagrams embed the original code if they have to be
edited and re-rendered.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas 40a94743a3 doc: guides: pm: device_runtime: remove outdated statement
The device runtime API does no longer use pm_device_state_set().

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas f28b57ff8d doc: guides: pm: system: fix DT bindings references
Use the :dtcompatible: role to refer to DT bindings.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas 68db978fb2 doc: guides: pm: device_runtime: remove API definitions
The API is already rendered automatically by breathe, so do not manually
add definitions again.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas d1cb73a29c doc: guides: pm: device: remove API definitions
The API is already rendered automatically by breathe, so do not
duplicate it manually.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas 51dfd38baa doc: guides: pm: system: simplify C references
- Remove duplicated information (e.g. enum list, available in the API
  docs)
- Use C domain to reference

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Gerard Marull-Paretas 4d6803383d doc: pm: split sections and move to guides
Splitted the PM reference document into smaller chunks (overview,
system, device and device_runtime). Moved this content to the guides
section, since the documentation intent is to provide general PM subsys
information and usage guidelines.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-13 07:59:51 -05:00
Joakim Andersson ba85663a42 doc: Update TF-M documentation to match current TF-M version
Update TF-M documentation to match the current integrated TF-M version.
Include mention of the Platform secure partition that can be enabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-12 14:51:22 +01:00
Gerard Marull-Paretas 2c3e12b597 doc: guides: smf: use graphviz extension
Diagrams were pre-rendered and code included at the end, however, it is
possible to use the Graphviz extension to render them directly. The
advantage is that diagrams follow pre-defined defaults, making them
consistent with the documentation style.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-10 13:54:46 -05:00
Torsten Rasmussen 1198087440 cmake: APPLICATION_CONFIG_DIR support implemented
With this commit a dedicated APPLICATION_CONFIG_DIR is added to the
Zephyr build system.

Currently, the APPLICATION_SOURCE_DIR is identical also the base
location of configuration files.

This is very practical for simple samples, but also has it limitations
for more complex setups.

Introducing a dedicated APPLICATION_CONFIG_DIR allows users more
customization options in Zephyr build system.
Especially in terms of custom build configuration files unknown to
Zephyr itself.

For example, instead of all configuration files being located directly
in the application source folder, a project might prefer to organize
their configuration files on a per board basis, for example:
<app>/boards/custom_board_A/prj.conf
<app>/boards/custom_board_A/app.overlay
<app>/boards/custom_board_A/custom_file.mine
<app>/boards/custom_board_B/prj.conf
<app>/boards/custom_board_B/app.overlay
<app>/boards/custom_board_B/custom_file.mine
...

instead of n-files located in the root of the sample.

If the user / sample specifies APPLICATION_CONFIG_DIR, then this folder
will always be used instead of the default configuration folder.

As part of this extension the behaviour of
`-DCONF_FILE=<relative-path>/prj_<build>.conf` and additional Kconfig
fragments automatic sourcing has been aligned with the default behavior
of `prj.conf`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-11-10 08:25:36 -05:00
Neil Armstrong 1fb263c9ba doc: document ranges generated macros in macros.bnf
This adds the DT ranges generated macros in the ABNF grammar file.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2021-11-10 08:23:00 -05:00
Gerard Marull-Paretas f6bff715a9 doc: guides: pinctrl: fix DT sample code
Pre-defined nodes need to be children of the pin controller device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-09 11:05:51 +01:00