Commit graph

318 commits

Author SHA1 Message Date
Lauren Murphy f014ba1ff1 doc: coding guidelines: fix links for other rules examples
This PR fixes the links to the example files in the Gitlab repository.
Fixes Dir 4.8 and Rule 2.1, 5.1, 5.8, 5.9, 8.5, 8.6, 13.1, and 13.5.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2020-07-25 10:50:03 -04:00
Daniel Leung 8fe7fbf7ee doc: coding_guidelines: sort list in natural order
Sort the MISRA lists in a more natural ascending numeric order.
So instead of 1.1 - 1.10 - 1.11 - 1.2 - 1.3, we now have
1.1 - 1.2 - 1.3 - 1.10 - 1.11.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-22 17:36:33 -04:00
Andries Kruithof f434beb2bf doc: Coding Guideline: correct reference for rule 18.6 examples
Rule 18.6 has the examples split in two files. This PR adds
the correct reference to the example files in the gitlab
repository

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-07-22 12:43:08 +02:00
Anas Nashif e8e367ada4 sanitycheck: support only_tags for boards
Support running/building only specific tags and ignoring everything
else.

Adding this to a platform yaml file will enable tests with one of of
tags listed to be executed on the platform.

This is useful for special platform configurations used for testing
specific features for example.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 17:44:16 -04:00
Andrew Boie 9ff148ac83 kernel: define arch_mem_map()
This is the low-level arch function to map a region into page
tables.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-17 11:38:18 +02:00
Carles Cufi c2df27fa0b doc: Link to guidelines from the contribution page
Link to the coding guidelines from the main contribution guidelines
page, so that users are aware of the guidelines.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-07-17 11:09:45 +02:00
Carles Cufi e924364035 doc: guidelines: Add additional guidelines
Aside from the MISRA-C derived Coding Guidelines, add a list for
additional ones that are not a subset of a standard.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-07-17 11:09:45 +02:00
Carles Cufi 611927c49b doc: guidelines: Cleanup formatting
Cleanup formatting and a couple of instances of missing "rules".

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-07-17 11:09:45 +02:00
Ruth Fuchss 81a6107343 doc: add IDs to some sections
Add documentation IDs to some sections to be able
to directly link to them.

Signed-off-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2020-07-16 08:22:48 -04:00
Anas Nashif dc85b395b0 doc: add coding guidelines
Add the coding guidelines agreed upon by the project TSC with a
description of the staged approach needed to implement them

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 23:27:15 -04:00
Kumar Gala 6bf761fc0a dts: Remove support for deprecated DTS binding syntax
We deprecated a number of aspects of the DTS binding syntax in Zephyr
2.1.  Remove the support for the deprecated syntax.  Remove from docs
about the deprecated syntax as well.

Removed reference in release-notes-2.1.rst to legacy_binding_syntax
since that anchor doesn't exist anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-08 22:03:24 -04:00
Håkon Øye Amundsen 13cf241ee6 cmake: docs: Fix 'test_relocation' -> 'code_relocation'
Incorrect name used for sample in two places.
This commit fixes these issues.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-06-17 09:40:47 +02:00
Carles Cufi a247be5ca8 doc: bluetooth: Add full name for Nordic
Add "Semiconductor" to the Nordic company name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-12 15:50:11 +02:00
Carles Cufi ac343a27ff doc: bluetooth: Add 2.2.x Host qualification listing
Add the new listing from Demant/Oticon.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-12 15:50:11 +02:00
Peter Bigot d6a492d8f1 doc: guides: sanity_chk: add documentation on hardware map keyword
The probe_id keyword was added to support overriding the inferred id
when determining the board-id to use when flashing.  Document the
keyword.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-10 12:03:17 +02:00
Peter Bigot 3c36b42d03 sanitycheck: add notes key to schema
Prior to addition of schema validation running sanitycheck
--generate-hw-map would preserve the value of any field in an existing
map that it didn't update.  These fields now cause a parsing error.
Add notes as an optional key where information relevant to the board
can be added to provide useful context (such as which serial port
corresponds to the console, or why a non-standard runner is required).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-10 12:03:17 +02:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Torsten Rasmussen 61e79bb1eb doc: updated to reflect changes introduced with Zephyr CMake package
This commit updates the Zephyr documentation with changes introduced
by Zephyr CMake package.

It removes 'zephyr-env.sh/cmd' where no longer needed, and updates
boilerplate inclusion to find_package.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-06-04 22:12:03 +02:00
Marc Herbert 3a04536487 doc,cmake: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Martí Bolívar e4a761cffe devicetree: add migration guide documentation and tests
Add test cases that verify various bits and pieces of the legacy
devicetree macros match the new APIs.

Writing these test cases without giving rise to deprecated macro
warnings which might break people's CI if they build with -Werror
requires turning off the __WARN() generation in
devicetree_legacy_unfixed.h. The entire file is deprecated at this
point and must be explicitly enabled with an opt-in Kconfig option, so
there isn't any harm in doing this.

Nevertheless, take a minimally invasive approach to avoiding __WARN()
generation in gen_legacy_defines.py, to avoid the possibility of
breakage. This code is basically frozen anyway, so hacks like this
won't cause maintainability problems since it isn't being actively
maintained.

Use the new tests as fodder for a migration guide from the old API in
the documentation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-28 22:12:38 +02:00
Torsten Rasmussen 9adcabe38d cmake: introduction of ZephyrBuildConfiguration package
The ZephyrBuildConfiguration package allow downstream users to control
the Zephyr build system using a cmake package.

A Zephyr Build Configuration package allows for setting of additional
DTS_ROOT, BOARD_ROOT, and similar variables without having to patch
Zephyr repo, but it also allows for inclusion of additional boilerplate
code for more advanced use cases.

The repository or folder containing the Zephyr Build Configuration
package must be on toplevel in the Zephyr workspace.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-27 17:58:50 +02:00
Martí Bolívar 69dfbd354d doc: dts: update guides
Give the guides a once-over in preparation for the v2.3 release.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-26 22:32:34 +02:00
Martí Bolívar bbcb2e276e doc: dts: update diagrams
Update the diagrams. Doing this in a separate commit so the SVG diff
doesn't clutter up other patches.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-26 22:32:34 +02:00
Martí Bolívar 9d36b4f6e4 doc: some devicetree fixes and updates
Some updates to the reference page for the "core" APIs, and associated
follow-ups in the guides:

- centralize documentation of chosen zephyr nodes in a non-legacy
  file, provide a reference to them from the intro page in the guide
- review doxygen docstrings and correct errors for generic APIs
- add introductory text to each section in the API reference
- add missing hardware-specific pages

Documentation for layers built on top of these is mostly left to future
commits, but I do have a smattering of fixes in the guides that I
noticed while I was doing this.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-26 18:12:00 +02:00
Anas Nashif ed44f0575b doc: sanitycheck: fixture documentation
Add documentation about fixtures and how to use them in the hardware
map.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-24 20:25:51 +02:00
Martí Bolívar 3ea8293ef0 Revert "cmake: introduction of ZephyrExtension package"
This reverts commit ac898bc49e.

This commit was merged by mistake, but in a way that was against the
decision of the TSC on May 20, 2020, which was to wait a week to let
people digest befor merging.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-21 00:33:06 +02:00
Torsten Rasmussen ac898bc49e cmake: introduction of ZephyrExtension package
The ZephyrExtension package allow downstream users to extend the current
Zephyr package.
A ZephyrExtension package allows for setting of additional DTS_ROOT,
BOARD_ROOT, and similar variables without having to patch Zephyr repo.

The repository or folder containing the ZephyrExtension package must be
on toplevel in the Zephyr workspace.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-20 19:27:15 +02:00
Jukka Rissanen b97adfba59 doc: net: Add info how to run multiple Zephyr network instances
Give instructions how to run multiple Zephyr instances in QEMU
or native_posix, and connect them together.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-20 15:36:39 +02:00
Erwan Gouriou 7e7b9f3ed0 doc: probes: Add info on ST-Link fw update
Add section on ST-Link Firmware update.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-05-20 10:38:27 +02:00
Ruslan Mstoi 81bca72676 doc: sanitycheck: typo fix
Fix "text execution coverage" as "test execution coverage"

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-13 21:24:03 +02:00
Kumar Gala bd97378870 devicetree: Add support for fixed-partitions
Add DT_NODE_BY_FIXED_PARTITION_LABEL that given a "label" in any
fixed-partitions map will return the node_id for that partition node.

Add DT_NODE_HAS_FIXED_PARTITION_LABEL that will test if a given
fixed-partitions "label" is valid.

Add DT_FIXED_PARTITION_ID that will return an unique ordinal value for
the partition give a node_id to the partition.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Anas Nashif bb28035a82 sanitycheck: support exporting instances
Enable exporting tests per platform.

sanitycheck --export-tests out.txt  -p qemu_x86 -T tests/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-11 17:00:26 +02:00
Martí Bolívar 6f35d3bd16 doc: write documentation about DT-based device instantiation
Add more HOWTO information for the two current devicetree-based device
instantiation styles, and a bit more information on how to create
devices that depend on others.

Point to this from the Kconfig tips page, since it is meant as a
replacement for existing Kconfig practice.

Update macros.bnf.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Martí Bolívar 7e0eed9235 devicetree: allow access to all nodes
Usually, we want to operate only on "available" device
nodes ("available" means "status is okay and a matching binding is
found"), but that's not true in all cases.

Sometimes we want to operate on special nodes without matching
bindings, such as those describing memory.

To handle the distinction, change various additional devicetree APIs
making it clear that they operate only on available device nodes,
adjusting gen_defines and devicetree.h implementation details
accordingly:

- emit macros for all existing nodes in gen_defines.py, regardless
  of status or matching binding
- rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY
- rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY
- rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY
- rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY
- rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS
- resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS
- remove DT_COMPAT_ON_BUS as a public API
- use the new default_prop_types edtlib parameter

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Tomasz Bursztyka 97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
Bilal Wasim 54550c04eb net: qemu: Adding support for User Networking
Added support for Qemu User Networking and tested with
qemu_x86 model. The support is kept simple assuming that
the TAP interface will always be preferred for more
sophisticated / practical use cases.

QEMU User Networking is implemented using "slirp", which
provides a full TCP/IP stack within QEMU and uses that
stack to implement a virtual NAT'd network. As this
support is built into QEMU, it can be used with any model
and requires no admin privileges on the host machine,
unlike TAP.

Added documentation to facilitate the user.

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-05-08 10:47:38 +02:00
Dominik Ermel ba8b74d801 devicetree: Add DT_FOREACH_CHILD macro
The macro iterates through the list of child nodes and invokes provided
macro for each node.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 21:42:58 -05:00
Ruslan Mstoi b4d172dd84 doc: env_vars: Fix link to section env_vars_zephyrrc
Currently the doc says "above in env_vars_zephyrrc" without a link to
that section.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-05-06 17:22:07 -04:00
Kumar Gala fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Carles Cufi 3d16bda27d doc: Bluetooth: Document issue with certain controllers
Certain Qualcomm controllers do not accept our settings for Host Buffer
Size:

< HCI Command: Host Buffer Size (0x03|0x0033) plen 7       #19 [hci0]
22.391048
        ACL MTU: 27   ACL max packet: 6
        SCO MTU: 0    SCO max packet: 0
> HCI Event: Command Complete (0x0e) plen 4                #20 [hci0]
22.391525
      Host Buffer Size (0x03|0x0033) ncmd 1
        Status: Invalid HCI Command Parameters (0x12)

Likely due to the fact that we do not reserve space for any SCO packets
in the Host.

Other Controllers (Realtek) seem to not transmit any data at all in the
Controller to Host direction if Controller to Host flow control is
enabled.

Document this fact in the User Guide so that users know what to do when
this happens.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-30 22:17:10 +03:00
Anas Nashif 85233419a8 doc: tracing: adapt to current implementation
Adapt docs to cover tracing support introduced in 2.2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Joakim Andersson e0d38bf6a1 Bluetooth: samples: hci_uart: Add debug configuration using RTT
Add debug configuration to easily enable logging through RTT. Required
to use RTT since the UART is otherwise used for the h4 UART driver.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-28 09:11:13 -04:00
Joakim Andersson 27ef15b8f5 debug: thread_analyzer: Implement thread analyzer
Thread analyzer is simple module that helps in printing thread
information, like stacks usage statistics.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
Signed-off-by: Bartosz Gentkowski <bartosz.gentkowski@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-28 09:11:13 -04:00
Stephanos Ioannidis 0e6ede8929 kconfig: Rename CONFIG_FLOAT to CONFIG_FPU
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).

Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02:00
Martí Bolívar 6e27343e7b devicetree: add DT_PARENT()
This macro takes a node identifier, and returns the parent node's
identifier.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-15 08:27:18 -05:00
Valerii Koval e7e30e90fe doc: Update PlatformIO guide
Rephrase it in neutral tone so it won't seem like an endorsement

Signed-off-by: Valerii Koval <valeros08@gmail.com>
2020-04-15 12:49:27 +02:00
Valerii Koval 5beab97aac doc: delete redundant parts from PlatformIO guideline
Delete wordy descriptions, unnecessary opinions, trailing whitespaces

Signed-off-by: Valerii Koval <valeros08@gmail.com>
2020-04-15 12:49:27 +02:00
Valerii Koval 27ce35b0d4 doc: Add new section about using Zephyr with PlatformIO
This adds a description of PlatformIO ecosystem, tutorials, examples

Signed-off-by: Valerii Koval <valeros08@gmail.com>
2020-04-15 12:49:27 +02:00
Kumar Gala 4e2ad00496 scripts/dts: gen_defines: Generates _EXISTS for reg & irq macros
Add generation of the following macros:

DT_N_<node-id>_REG_IDX_<idx>_EXISTS 1
DT_N_<node-id>_IRQ_IDX_<idx>_EXISTS 1

This will allow us to use IS_ENABLED() in DT_REG_HAS_IDX and
DT_IRQ_HAS_IDX which matches behavior of other DT_*_HAS_* macros as
well as lets use these with COND_CODE_1.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-14 17:45:19 -05:00