Commit graph

41120 commits

Author SHA1 Message Date
Andrew Boie
2b67ca8ac9 x86: improve exception debugging
We now dump more information for less common cases,
and this is now centralized code for 32-bit/64-bit.
All of this code is now correctly wrapped around
CONFIG_EXCEPTION_DEBUG. Some cruft and unused defines
removed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-17 11:39:22 -08:00
Vincent Wan
94140b6816 tests: kernel: gen_isr_table: exclude from testcase.yaml
Excluding this test for cc13x2/cc26x2 platforms where ISR4 is not
available for it to use.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-12-17 13:48:25 -05:00
Paul Sokolovsky
165896959a CODEOWNERS: Add @pfalcon for subsys/net/lib/config/
net/lib/config/ is important generic part of the network stack, and
should be reviewed by the same people as net/lib/. (Besides, I
originally factored out this lib in the first place.)

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-12-17 13:48:01 -05:00
Pavlo Hamov
03baef9975 libc: syscall: make aliases WEAK by default
make all syscall functions overridable

Signed-off-by: Pavlo Hamov <pavlo_hamov@jabil.com>
2019-12-17 10:35:20 -08:00
Jukka Rissanen
023e78da87 sys_clock: Fix typo in SYS_CLOCK_HW_CYCLES_TO_NS64() macro
The macro was having "t" as a parameter but then used "X" when
calling k_cyc_to_ns_floor64(X). This caused a compile error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-17 13:06:55 -05:00
Jukka Rissanen
5bbdf56769 net: stats: Fix RX time statistics update
The commit 8892406c1d ("kernel/sys_clock.h: Deprecate and convert
uses of old conversions") changed code to not use deprecated macro.
Unfortunately there was some changes done to RX stats update that were
missing from that commit. This commit fixes the issue and removes use
of the deprecated SYS_CLOCK_HW_CYCLES_TO_NS64() macro.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-17 13:06:55 -05:00
Torsten Rasmussen
5a703c8d58 cmake: use zephyr_library_app_memory for mem partition placement
This commit removes the hard coded mbed TLS library name
`lib..__modules__crypto__mbedtls.a` in top-level CMakeLists.txt file
and instead uses zephyr_library_app_memory function.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2019-12-17 13:05:36 -05:00
Paul Sokolovsky
feac5c1c45 Revert "samples: sockets: Don't open the socket if the test protocol is enabled"
This reverts commit da0f3311ff. It was
clearly intended to be a debugging aid when developing TCP2, not
intended for mainline. This fixes building this sample on POSIX
systems with Makefile.posix.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-12-17 18:09:19 +02:00
Robert Lubos
31ee76d248 net: openthread: Move OT CMake configuration into OT repo
Follwing the convention in Zephyr, all CMake configuration related to
a module, should be placed within the module repostiory.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-17 18:08:09 +02:00
Jukka Rissanen
51fc680ba2 samples: net: google_iot_mqtt: Do not compile by sanitycheck
The sample needs key.c file but that cannot be generated by
sanitychecker. So disable compilation by sanitycheck.
Eventually we should make it possible to compile the sample
using some pre-defined values so that the sample will not
bit-rot but that is for later.

Fixes #21450

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-17 15:44:55 +02:00
Krzysztof Chruscinski
00156ad80a drivers: clock_control: nrf: Switch to single clock device
Low frequency and high frequency clocks had separate devices
while they are actually handled by single peripheral with single
interrupt. The split was done probably because opaque subsys
argument in the API was used for other purposes and there was
no way to pass the information which clock should be controlled.
Implementation changes some time ago and subsys parameter was
no longer used. It now can be used to indicate which clock should
be controlled.

Change become necessary when nrf5340 is taken into account where
there are more clocks and current approach would lead to create
multiple devices - mess.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-17 14:38:19 +01:00
Vinayak Kariappa Chettimada
9128200e6c Bluetooth: controller: legacy: Fix compiler warnings
Fix compiler warnings when central only support is used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-17 13:14:37 +01:00
Vinayak Kariappa Chettimada
e23c7fbba6 Bluetooth: controller: legacy: Fix length and ping rsp
Fix LENGTH_RSP and PING_RSP to be send after Encryption
Setup under the cases where LENGTH_REQ or PING_REQ cross-
over with ENC_REQ in the same connection event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-17 13:14:37 +01:00
Vinayak Kariappa Chettimada
1ede7db159 Bluetooth: controller: legacy: Fix Tx Ctrl PDU leak
Overlapping Feature Exchange requested by host with
Encryption Setup requested by the application caused the
controller to corrupt its Tx queue leading to Tx Ctrl PDU
buffers from leaking from the system.

Relates to #21299.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-17 13:14:37 +01:00
Andrei Stoica
f72d5577f9 Bluetooth: samples: Added dynamic Tx power ctrl sample (#17731)
This commit provides a sample dummy application demonstrating
the usage of the added dynamic Tx power control over the HCI
commands and HCI interfaces.

Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
2019-12-17 12:29:57 +01:00
Andrei Stoica
cc19e72497 docs: Bluetooth: HCI_VS: Updated docs on VS HCI commands
This commit complements documentation of Zephyr HCI VS
commands. In particular, it documents the newly introduced
commands

- BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL
- BT_HCI_OP_VS_READ_TX_POWER_LEVEL

These provide HCI-level control over the Tx power of the
BLE radio on a per role/connection basis.

The functionality is enabled upon the Kconfig advanced configuration
triggered by

- BT_CTLR_TX_PWR_DYNAMIC_CONTROL

depending on the enablement of Zephyr HCI vendor-specific command
extensions.

Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
2019-12-17 12:29:57 +01:00
Andrei Stoica
930d178c69 Bluetooth: controller: enable dynamic TXP over LEGACY arch (#17731)
This commit targets solving issue #17731 over the Nordic LL LEGACY
arch of the BLE stack in Zephyr. This functionality is exposed
to the user as HCI Zephyr Command extensions

- BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL
- BT_HCI_OP_VS_READ_TX_POWER_LEVEL

which enable Tx power read/write operations within BLE radio events
on a per role/connection basis.

The functionality is enabled upon the Kconfig advanced configuration
triggered by

- BT_CTLR_TX_PWR_DYNAMIC_CONTROL

depending on the enablement of Zephyr HCI vendor-specific command
extensions.

Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
2019-12-17 12:29:57 +01:00
Andrei Stoica
abd1d047dd Bluetooth: controller: enable dynamic TXP over LL_SPLIT arch (#17731)
This commit targets solving issue #17731 over the LL_SW_SPLIT
arch of the BLE stack in Zephyr. This functionality is exposed
to the user as HCI Zephyr Command extensions

- BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL
- BT_HCI_OP_VS_READ_TX_POWER_LEVEL

which enable Tx power read/write operations within BLE radio events
on a per role/connection basis.

The functionality is enabled upon the Kconfig advanced configuration
triggered by

- BT_CTLR_TX_PWR_DYNAMIC_CONTROL

depending on the enablement of Zephyr HCI vendor-specific command
extensions.

Necessary low-level radio HAL functionality and power definitions
are also supplied to address the high-level functionality of
controlling the Tx power.

Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
2019-12-17 12:29:57 +01:00
Paul Sokolovsky
3e706833bd include: net: ethernet.h: Clarify checksum offloading options
Both ETHERNET_HW_TX_CHKSUM_OFFLOAD and ETHERNET_HW_RX_CHKSUM_OFFLOAD
apply to all of IPv4, UDP, and TCP heafers (there's no checksum in
IPv6 header). Consequently, these options should be enabled only for
hardware which supports offloading for all of these options. (And
hardware which has fine-grained control over individual protocol
headers, should enable them all).

Based on the handling in the current source code and discussion
in #21269.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-12-17 11:32:09 +02:00
Emil Obalski
27186a8606 drivers: hwinfo: Use HAL for reading deviceID.
Do not refer to registers directly when reading DEVICEID.
Rely on HAL instead.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-17 09:11:37 +01:00
Emil Obalski
dddc435f80 drivers: hwinfo: Depend HWINFO_NRF on all SoCs
Depend chosing HWINFO_NRF on any nRF device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-17 09:11:37 +01:00
Ravi kumar Veeramally
523a88ea4f samples: net: cloud: Move cloud based samples
MQTT Azure and Google IoT samples are based on cloud
infrastructure. It would be nice to place all cloud
based samples in one single folder.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-17 08:33:52 +02:00
Peter A. Bigot
8328159b09 include: respect line limit in api pointer initialization
The automated process used to remove implicit casts resulted in code
that exceeded the documented line length limits.  Break the assignment
into two lines where this happened.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-16 21:14:08 -05:00
Andrzej Puzdrowski
ce753ea491 manifest: add reference to mcuboot project
MCUBoot is the bootloader on which zephyr DFU solutions
base. It is worth to reference certain compatible version
of this external project. So fare it was expected that
mcuboot works with zephyr in master to master relation. This patch
starts to give the user real information about compatible version.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-16 20:00:32 +01:00
Anas Nashif
36e1fb630b ci: run sanitycheck on tests and samples
If modules announce they have tests, run sanitycheck on those modules.
This will run on first matrix node and as the last step after running
regular testsuite.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-16 18:56:28 +01:00
Anas Nashif
c7ef4f0506 doc: modules: document out-of-tree samples/tests
Document how to configure out-of-tree tests/samples and boards in the
module.yml file to be used by sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-16 18:56:28 +01:00
Anas Nashif
286a9eda84 modules: support tests/samples/boards in modules
Generate options for sanitycheck to run tests and samples in modules.
Use the --sanitycheck-out <file> to generate a file that can be supplied
to sanitycheck on the commandline which will add additional testroots
and boards if the module does contain out of tree boards.

the module.yaml file now accepts the following:

samples:
  - path/to/samples
tests:
  - path/to/tests
boards:
  - path/to/boards

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-16 18:56:28 +01:00
Vinayak Kariappa Chettimada
f95a7faa58 Bluetooth: controller: split: Fix compiler warnings
Fix compiler warnings when PHY update feature is not selected.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-16 16:16:08 +01:00
Vinayak Kariappa Chettimada
9bd8518baf Bluetooth: controller: split: Fix length and ping rsp
Fix LENGTH_RSP and PING_RSP to be send after Encryption
Setup under the cases where LENGTH_REQ or PING_REQ cross-
over with ENC_REQ in the same connection event.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-16 16:16:08 +01:00
Vinayak Kariappa Chettimada
f7c890e08c Bluetooth: controller: split: Fix Tx Ctrl PDU leak
Overlapping Feature Exchange requested by host with
Encryption Setup requested by the application caused the
controller to corrupt its Tx queue leading to Tx Ctrl PDU
buffers from leaking from the system.

Fixes #21299.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-16 16:16:08 +01:00
Kamil Piszczek
3a39f79d9b soc: arm: nordic: nrf53: add nfct hw in kconfig
Added the NFCT Peripheral capability to the Application Core
Kconfig of the nRF5340 SoC.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-12-16 15:44:09 +01:00
Kamil Piszczek
067351ec13 modules: nordic: pick proper timer for nfct on nrf5340
Added the NFC Timer default for nRF5340.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-12-16 15:44:09 +01:00
Dominik Ermel
220f7607da settings: Moving initialization code to proper backend sources
Backend initialization code has been moved from common settings_init.c
to proper backend source files. Missing static specifiers have been
added.
Minor cleanup has been done to source files: exported functions have
been moved to the end of source files and definitions of static
variables, that are used by only a single function, have been moved from
global scope into functions that use them.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2019-12-16 12:11:20 +01:00
Alberto Escolar Piedras
a6f6179cd9 samples/userspace/prod_consumer: Fix main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Alberto Escolar Piedras
0b8678a2b0 samples & tests: Correct main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Ravi kumar Veeramally
f1a1e5382e samples: net: mqtt: Add a sample to connect to Azure
This samples demonstrates how to connect to Azure Cloud
IoT hub which is based on MQTT protocol. User has to
create an account in Azure Cloud and provide those details
using Kconfig options. This sample first acquires DHCPv4
address and opens a secure connection with Azure cloud.
Then opens a MQTT connection and publish messages randomly.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-16 11:42:06 +02:00
Ravi kumar Veeramally
50631d66b9 tests: net: icmpv4: Add unit tests
ICMPv4 basic unit tests.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-16 11:35:24 +02:00
Ravi kumar Veeramally
1c33951318 net: icmpv4: Add support for Timestamp and RR
Timestamp and RecordRoute options are supported
in only ICMPv4 EchoRequest call as per
RFC 1122 3.2.2.6.

Fixes #14668

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-16 11:35:24 +02:00
Ravi kumar Veeramally
cf9ad748ba net: ipv4: Add IPv4 options length to net pkt
IPv4 header options length will be stored in ipv4_opts_len
in net_pkt structure. Now IPv4 header length will be in
net_pkt ip_hdr_len + ipv4_opts_len. So modified relevant
places of ip header length calculation for IPv4.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-16 11:35:24 +02:00
Robert Lubos
649ec80c9e net: openthread: Update OpenThread version and better CMake integration
OpenThread recently introduced CMake build system into its repostiory
so we no longer need autotools to build OpenThread libraries and can
integrate them natively.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-16 11:08:09 +02:00
Jukka Rissanen
b92a4c5cff net: sockets: tls: Mark accepted socket correctly in accept()
The TCP code expects that we know when the socket has called accept()
in order to continue connection attempt.

Fixes #21335

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-16 11:07:06 +02:00
Andrzej Puzdrowski
073e0b77d6 drivers/flash: remove NRF flash protection emulation
NRF devices hardware has flash protection which doesn't
reflect flash API definition well. So fare protection
mechanism was emulated by the software and the driver deals
with hardware flash protection on its own.
Recent change to protection behavior requirement allows
to remove flash API behavior emulation at all.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-15 10:35:09 -05:00
Andrzej Puzdrowski
aa0d41f7ec drivers/flash: protection API clarification
On some targets hardware (or middelware) doesn't allow
implement functionality flash protection API -
so fare it have to be emulated by software on such a target.

This patch changes documentation of this API, so on such a targets
API might implements no-operation.

fixes #15729

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-15 10:35:09 -05:00
Sebastian Bøe
5f75c0f4a7 cmake: Fix cache directory detection
To detect where the cache directory has been located we have been
checking if $HOME is writable, and if it is assuming that $HOME/.cache
must be writable as well.

This is broken in environments where $HOME is owned by users and
$HOME/.cache is owned by admin. To fix this we check $HOME/.cache for
write-ability instead.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-12-15 10:33:03 -05:00
Emil Obalski
797d463d82 usb: samples: Do not depend remote wakeup on SoCs
Remote wakeup for Nordic SoCs should always be enabled.
Thus do not depend it for each SoC. Instead depend it on
chosen driver.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-15 10:29:13 -05:00
Andrzej Puzdrowski
beb229b803 tests/subsys/dfu/img_util: progressively erase testcase
Extended test by testcase for testing progressively erase feature.
native posix flash page size was set to 1 kB in order to by aligned
with native_posix partitions boundaries.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-15 10:26:36 -05:00
Erwan Gouriou
3a95dda66c drivers/eeprom: stm32: Enables only for L1 series
Setting EEPROM_STM32 with `default y` under `if SOC_FAMILY_STM32`
overrides `depends on SOC_SERIES_STM32L1X` in EEPROM_STM32
definition.
Then, if ever EEPROM is set in any file (as in
tests/drivers/build_all`), EEPROM_STM32 will be indeed set,
with potential issues on series where driver is not yet correctly
handled.

Fix this by removing EEPROM_STM32 definition in STM32 generic
file and set `default y` along with the `depends on` to keep
it effective.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-15 10:19:25 -05:00
Peter A. Bigot
2e358f11d0 include/drivers: remove implicit casts from api pointer initialization
C++ disallows implicit cast of void pointers to a non-void pointer
type.  Presence of implicit casts prevents use of these headers in C++
applications.

Process: Run the following coccinelle script:

@@
identifier V;
identifier TAG =~ "driver_api";
type T;
expression E;
@@
 T* V =
+(T *)
 E->TAG;

in this command line from $ZEPHYR_BASE:

spatch --sp-file expcast.cocci \
   --include-headers --dir include/ --very-quiet \
 | sed -e '/^\+/s@\*) @*)@' \
 | (cd include/ ; patch -p1)

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-15 10:18:17 -05:00
Lingao Meng
6e260af889 Bluetooth: Mesh: Fixes Friend Add Another Update
Fixes: #20746

According MESH/NODE/FRND/FN/BV-20-C should add another
Friend Update.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2019-12-14 16:59:59 +02:00
Peter A. Bigot
6ade720851 treewide: avoid use of unsupported C++ specifiers
constexpr and noexcept were introduced as specifiers in C++11.  Avoid
referencing them when compiling for earlier versions of the language.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-13 17:19:54 -06:00