Commit graph

18591 commits

Author SHA1 Message Date
d8ca2b6980 boards: add documentation for the Arduino Zero.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
b85b676ba9 serial: add a serial driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
54c6fbdca7 gpio: add a GPIO driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
be8cba4bad watchdog: add a watchdog driver for the SAM0 family.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
4c47c21753 boards: add board and DTS definitions for the Arduino Zero.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
b69c452e6f arch: add support for the SAMD21G18A used in the Arduino Zero.
Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
aa6b5558fd ext: Import Atmel SAMD21 header files from ASF library
Atmel Software Framework (ASF) provides a set of low-level header
files that give access to different hardware peripherals of Atmel's
ICs.

Origin: Atmel SAMD21 Series Device Support (1.2.276)
License: Apache-2.0
URL: http://packs.download.atmel.com/Atmel.SAMD21_DFP.1.2.276.atpack
Purpose: Introduction of ASF for the SAM0 series.
Maintained-by: External

Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-04 13:18:25 -05:00
Mariusz Skamra
fdca8d8f54 Revert "Bluetooth: Mesh: Fix ignoring invalid Transport OpCode as LPN"
This reverts commit ada5771d7c.

MESH/NODE/FRND/LPN/BI-02-C in Mesh Test Specification 1.0.1
has been fixed according to TSE #9774.

IUT shall ignore the message with an RFU Transport Control Opcode
but another Friend Poll message shall be sent with an alternating
FSN value.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-04 15:33:19 +01:00
Jan Van Winkel
30b65d8986 arm: stm32l4: include RNG ll header
Include low level random generator header in case stm32 random number
generator should be used by entropy driver

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-01-04 09:18:21 -05:00
Anas Nashif
61fe98c573 kconfig: rename CONFIG_BSP_SHARED_GDT_RAM_*
We stopped using BSP_ in configs long time ago, this one got stuck for
some reason.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-04 09:17:03 -05:00
Mariusz Skamra
cc1a960730 Bluetooth: mesh: Fix status returned from mod_unbind
According to Mesh Specification v1.0 4.3.2.48 Config Model App Status:
"The Status Code shall be Success if the received request was redundant
(bind request of existing binding, or unbind of a non-existing binding),
with no further action taken."

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-04 15:08:43 +01:00
Mariusz Skamra
9d6bb0995c Bluetooth: tester: Do not start LPN automatically
This disables CONFIG_BT_MESH_LPN_AUTO flag in Kconfig.
LPN is enabled by calling BTP Low Power Node command
if requested.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-04 15:03:33 +01:00
Sebastian Bøe
a55279ac90 cmake: gen_isr_tables: Reduce verbosity of non-verbose builds.
gen_isr_tables.py's --debug flag causes it to spit out a verbose
log. Normal builds don't need to see this information.

This patch will remove this from the build log:

gen_isr_tables.py: (4041, 4477, 46, 0, 7)
gen_isr_tables.py: spurious handler: 0xfc9
gen_isr_tables.py: Configured interrupt routing
gen_isr_tables.py: handler    irq flags param
gen_isr_tables.py: --------------------------
gen_isr_tables.py: 0x14bd     0   0     0x0
gen_isr_tables.py: 0x16a1     6   0     0x20002bac
gen_isr_tables.py: 0x1975     17  0     0x0
gen_isr_tables.py: 0x7e5b     13  0     0x0
gen_isr_tables.py: 0x7e55     24  0     0x0
gen_isr_tables.py: 0x7e21     11  0     0x0
gen_isr_tables.py: 0x7e5f     1   1     0x0

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-04 08:55:26 -05:00
Sebastian Bøe
74174809da gen_isr_tables: Minor refactoring
Minor refactor to gen_isr_tables.py; "if not" is difficult to read.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-04 08:55:26 -05:00
Sebastian Bøe
b1ab5018ba cmake: ld: Ensure that a linker script change triggers a rebuild
This fixes
https://github.com/zephyrproject-rtos/zephyr/issues/5010. CMake has a
simple parser that can parse C-like files to find header
dependencies. But the parser needs to know what the include
directories are to be able to follow #include pragmas.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-04 00:03:25 -05:00
Sebastian Bøe
5d25497f90 cmake: zephyr_get_*: Add support for SKIP_PREFIX
Usually the zephyr_get_* API returns values prefixed with tokens like
-I -system, -D. But sometimes we need the values without these
prefixes, so we introduce the optional SKIP_PREFIX argument.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-04 00:03:25 -05:00
Anas Nashif
1df7e9a018 script: remove unused script: gcc-version.sh
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 19:03:41 -05:00
Anas Nashif
7256553955 scripts: python: cleanup script and fix PEP8 issues
Ran scripts through flake8 and fixed issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 19:03:41 -05:00
Michael Scott
3599d793c2 net: net_app: set packet data_len on incoming packets
This fixes a bug when calling net_pkt_append[_all] which uses
pkt->data_len as part of the maximum packet length calculation
when the net_context is set.

Without this change the maximum packet length is calculated as 0
(the value of pkt->data_len) and an ENOMEM error is returned.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-01-03 19:02:31 -05:00
Michael Scott
e71f95b946 net: ip: net_pkt: set pkt context, iface and family in net_pkt_get()
Commit 753daa6 ("net: pkt: Compute TX payload data length")
removed the default packet setup on incoming packets when they
belong to the rx_pkt pool.

Let's restore this behavior, as MBEDTLS processing in net_app library
needs to use packet family to determine IP header length on
incoming packets.

NOTE: A future cleanup patch could set the IP header length based
on the context IP family.  However, there are many places in the code
where this is being set, so care should be taken.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-01-03 19:02:31 -05:00
Sebastian Bøe
8062a88e82 cmake: LD: Add comment explaining the -P flag
Add a comment that explains what the -P flag does. The explanatory
comment is useful when you want to find the flag so you can comment it
out while debugging the link stage.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
47542598b6 cmake: Ninja: Fix the external_lib sample
This samples was failing to build with Ninja because Ninja detected
that libmylib.a was missing. Adding it as a BYPRODUCT in the
ExternalProject fixes the issue.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
1c2de10c06 cmake: ninja: Change how CMake names the kernelspace archives
The linker script places kernelspace and userspace archives in
different sections. But the linker script itself does not determine
what archives are in what space, that is done by CMake.

CMake passes the list of kernelspace archives to the linker script
through defines, like this:

-DNUM_KERNEL_OBJECT_FILES=3
-DKERNEL_OBJECT_FILE_0=path/to/archive_a.a
-DKERNEL_OBJECT_FILE_1=path/to/archive_b.a
-DKERNEL_OBJECT_FILE_2=path/to/archive_c.a

These paths are relative, and since Ninja and Make invoke the linker
with different "working directories"[0], the relative paths need to be
different. This patch rectifies the relative path when using Ninja.

This fixes #5343

[0] https://gitlab.kitware.com/cmake/cmake/issues/17448

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
a0b9129e85 cmake: Ninja: ld: Use the correct depfile in the second pass
When building for Ninja we were accidentally using the wrong depfile
in the second pass. This commit moves the LINKER_SCRIPT_DEP logic into
the custom command function so that it can be linker-pass-aware and
set the depfile appropriately.

This should fix an issue where Ninja reported:

ninja: error: expected depfile 'zephyr/linker.cmd.dep' to mention
'zephyr/linker_pass2.cmd', got 'zephyr/linker.cmd'

But this has not been reproduced. It has however been confirmed that a
dependency issue with linker_pass2.cmd has been fixed because ninja no
longer regenerates linker_pass2.cmd on every build like this:

$ ninja
[1/79] Generating always_rebuild
Building for board qemu_x86
[2/3] Generating linker_pass2.cmd
[3/3] Linking C executable zephyr/zephyr.elf

Now:

$ ninja
[1/78] Generating always_rebuild
Building for board qemu_x86

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
b85dd3c238 cmake: ld: Refactor the linker script's cpp command construction
Construct the custom command for preprocessing the linker script with
a function to avoid copy-paste errors between linker passes.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe
270deade0e doc: checkpatch: Fix pre-commit hook
The pre-commit hook was or'ing with true and therefore never
triggering when there were checkpatch errors.

Also;

Documented that the file needs to be made executable.

Made it more clear that the file is located in the zephyr git
directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:15:14 -05:00
Anas Nashif
34aebad4b1 coverage: build with -O0 to get more information
per the gcov man page:

 You should compile your code without optimization if you plan to use
 gcov because the optimization, by combining some lines of code into one
 function, may not give you as much information .

Fixes #5548

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 13:12:03 -05:00
Anas Nashif
8a67369887 tests: coverage depends on native applications
Build with coverage enabled for any other boards or applications is
useless at least right now. Make sure we only enable coverage for native
applications.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 13:12:03 -05:00
Anas Nashif
8dc143591c ci: coverage: do not parse boards without coverage
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 13:12:03 -05:00
Anas Nashif
8ba32e9ef7 ci: add .codecov.yml for codecov.io configuration
This is the default config with the exclusion of tests/samples added for
Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-03 13:12:03 -05:00
Dong Xiang
f60b2a6b0f doc: devices: correct devicetree specification path
Signed-off-by: Dong Xiang <dong.xiang@linaro.org>
2018-01-03 10:01:59 -05:00
Mariusz Skamra
813ec50838 Bluetooth: btp: Add event indicating expiration of incomp timer
This event indicates that segmented message incomplete timer
expired.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
9977caefa1 Bluetooth: testing: Move bt_test_mesh_net_recv to internal API
This function is called only within mesh stack.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
8274cbabf6 Bluetooth: btp: Add Mesh Clear Replay Protection List Cache command
This command is needed for Bluetooth Mesh testing against PTS.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
a909aa3a0b Bluetooth: btp: Add LPN Subscribe/Unsubscribe commands
This adds commands to manage Friend node Subscription List.
Those will be used to add or remove and group/virtual address
from subscription list.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
0bd3790d5b Bluetooth: btp: Add event indicating invalid provisioning BearerOpcode
This adds BTP event indicating reception of provisioning message
with invalid (RFU) BearerOpcode.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
083937be32 Bluetooth: tester: Do not send BTP error if fault_update failed
This may fail, if model publication was not set by remote.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Mariusz Skamra
0d71cef1f2 Bluetooth: tester: Add BTP Mesh Model Send command implementation
This command will be used to test if model can properly send
segmented and unsegmented messages to a given destination address.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-01-03 10:48:13 +01:00
Sebastian Bøe
6f642a19fd cmake: Ported mbedTLS to use Zephyr interface libraries
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-02 22:09:01 -05:00
Sebastian Bøe
3c8331d390 cmake: Introduce Zephyr interface libraries
Introduce Zephyr interface libraries to fix #5351.

From the documentation:

A Zephyr interface library is a thin wrapper over a CMake INTERFACE
library. The most important responsibility of this abstraction is to
ensure that when a user KConfig-enables a library then the header
files of this library will be accessible to the 'app' library.

This is done because when a user uses Kconfig to enable a library he
expects to be able to include it's header files and call it's
functions out-of-the box.

A Zephyr interface library should be used when there exists some
build information (include directories, defines, compiler flags,
etc.) that should be applied to a set of Zephyr libraries and 'app'
might be one of these libraries.

Zephyr libraries must explicitly call
zephyr_library_link_libraries(<interface_library>) to use this build
information. 'app' is treated as a special case for usability
reasons; a Kconfig option (CONFIG_APP_LINK_WITH_<interface_library>)
should exist for each interface_library and will determine if 'app'
links with the interface_library.

This API has a constructor like the zephyr_library API has, but it

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-02 22:09:01 -05:00
Alberto Escolar Piedras
e04764dbc7 native: Handle gracefully SIGTERM and SIGINT
When SIGTERM or SIGINT are received handle them
by gracefully exiting the program.

Fixes #5477

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-02 15:26:34 -05:00
Jan Van Winkel
36e2efaf91 fs: nffs: Corrected types in OS specific functions
Corrected types in OS specific functions to be inline with NFFS
declarations.

Fixes #5467

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-01-02 13:34:02 -05:00
Vakul Garg
aded95b888 eth: mcux: Enable ETH_MCUX_0 conditionally
ETH_MCUX_0 needs to be turned on when CONFIG_NET_L2_ETHERNET is enabled.
If CONFIG_NET_L2_ETHERNET is disabled (e.g. when configured for 6loble),
then ETH_MCUX_0 should remain disabled.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
2018-01-02 13:33:18 -05:00
Anas Nashif
9b1b0fc838 ci: upload coverage data to codecov.io
Use codecov.io to track test coverage.

See https://codecov.io/gh/zephyrproject-rtos/zephyr

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 12:11:11 -05:00
Anas Nashif
712d34513e sanitycheck: encode logs correctly
We were encoding logs twice.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
43e4127df0 sanitycheck: remove unused map
This map is not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
a8a1388ae4 sanitycheck: support ninja builder
Add an option to support building with ninja instead of make.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
4f02888b58 sanitycheck: use global command line options variable
Now use glabal options instead of passing them around as function
arguments.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Anas Nashif
e10b651e2d sanitycheck: declare command line options global
We have been passing around options from one function to the next making
it very difficult to add a new option easily and requiring changes to
man function prototypes.
This declated the parsed command line options global and renames args to
options. args is being used elsewhere and this was confusing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-02 11:54:02 -05:00
Manivannan Sadhasivam
c4b24f87da boards: arm: 96b_neonkey: doc: Remove flash goal
This board doesn't support `make flash` way of programming.
So, remove that from documentation.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-01-02 09:42:22 -05:00