Commit graph

41120 commits

Author SHA1 Message Date
Ulf Magnusson
a42a42cd5a kconfig: Replace defconfig singe-symbol 'if's with 'depends on'
Same deal as in commit eddd98f ("kconfig: Replace some single-symbol
'if's with 'depends on'"), for all symbols defined within defconfig
files. See that commit for an explanation.

Maybe 'if's were used originally to mirror the 'if's in the main Kconfig
files, and then it got copied around by people assuming 'if' must work
differently from 'depends on'. It doesn't match in every spot at least.
Better to keep it simple and just consistently use 'depends on' when
it's a single symbol/choice I think. Helps reinforce that 'if' isn't
magic too.

Verified by printing all Kconfig menu nodes (symbols, choices, menus,
etc.) before and after the change and diffing (should show no
difference).

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-12 10:32:13 -06:00
Peter Bigot
a8d15c1279 sensors: grove_light: convert to devicetree bindings
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels.  Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 10:31:26 -06:00
Peter Bigot
bc60245787 sensors: grove_temperature: convert to devicetree bindings
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels.  Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 10:31:26 -06:00
Peter A. Bigot
ba686f5794 devicetree: add nexus map for Arduino analog input header
This maps the ordinal analog inputs to the board-specific ADC
channels.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-02-12 10:31:26 -06:00
Kumar Gala
0ce53610f8 scripts/requirements: Remove unused packages
Remove 'git-spindle' as there are not users in any scripts or build
system and not references in any of our docs.

Remove 'wheel' as nothing seems to use or need it directly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-12 10:30:56 -06:00
Ulf Magnusson
5c908c6c4f kconfig: rv32m1: Remove redundant ENTROPY_GENERATOR dependency
Kconfig.rv32m1 is already 'source'd within an 'if ENTROPY_GENERATOR', so
ENTROPY_RV32M1_TRNG does not need a 'depends on ENTROPY_GENERATOR'.

Flagged by https://github.com/zephyrproject-rtos/ci-tools/pull/128.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-12 10:30:12 -06:00
Erwan Gouriou
d4f08c3fe2 drivers: interrupt_controller: stm32: Missing break statement
Fix missing break statement is missing in switch/case.

Fixes #22646

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-12 10:01:11 -06:00
Andrei Emeltchenko
f6ad1239f9 dts: Move IPM bindings to the right place
Move nxp,lpc-mailbox.yaml to dts/bindings/ipm/.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-02-12 10:00:47 -06:00
Jukka Rissanen
856dd3dfdd net: ppp: ipcp: Remove dead code
If nack_idx > 0, then the count_rej must be > 0. This means that
the "code" variable will never be set to PPP_CONFIGURE_NACK.

Fixes #22436
Coverity-CID: 207975

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-12 17:41:03 +02:00
Alexander Wachter
8c9553673e doc: release-notes: Added LoRa to the release-notes
Mention new LoRa support in the release-notes.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-12 17:40:40 +02:00
Alexander Wachter
a86eeb8d47 doc: release-notes: Release-notes for CAN bus
Added release-notes for the CAN bus subsystem.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-12 17:40:40 +02:00
Peter Bigot
a8bbaee75f tests: gpio_basic_api: fix filter to exclude boards without overlay
The test case no longer permits inferring input and output pins based
only on the presence of GPIO aliases.  Stop allowing presence of GPIO
aliases to enable the test.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 17:40:04 +02:00
Jukka Rissanen
ba3c5deea9 net: stats: Add RX time statistics for packet sockets
If CONFIG_NET_PKT_RXTIME_STATS is set, then update the received
packet RX time for packet sockets (SOCK_RAW). This was already
working for normal sockets but the statistics update was missing
from SOCK_RAW.

Fixes #22489

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-12 17:33:54 +02:00
Stephanos Ioannidis
f2e2b66215 arch: arm: aarch64: Fix _vector_end symbol placement
This commit relocates the `_vector_end` symbol that was previously
placed after the OpenOCD sections to before these sections, as the
OpenOCD debug sections are not part of the "vector table."

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 15:51:58 +01:00
Stephanos Ioannidis
c4cb84140f arch: arm: aarch64: linker.ld: Fix ROM section names
This commit fixes the improper naming of the ROM sections.

1. Rename the first ROM section, which was previously named using the
  `_TEXT_SECTION_NAME` definition, to `rom_start`, as this section does
  not actually represent the text section.

2. Rename the second ROM section, which was previously named
  `_TEXT_SECTION_NAME_2` which supposedly refers to the definition of
  the same name that does not exist, to `_TEXT_SECTION_NAME`. Note that
  this is indeed the section that contains the text section from the
  source image.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 15:51:58 +01:00
Stephanos Ioannidis
e619e36b1b arch: arm: aarch64: linker.ld: Clean-up
This commit cleans-up the linker.ld file for the AArch64 arch.

* Convert all TAB characters to SPACE.
* Fix insane placement of curly brackets.
* Fix overall text alignments.
* Remove the special handlings for the Cortex-M devices that were
  copied from `include/arm/aarch32/cortex_m/scripts/linker.ld`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 15:51:58 +01:00
Vincent Wan
c0a1a64228 west.yml: hal_ti: fix SemaphoreP_create/construct to initialize count
Updating west.yml to point to fixed versions of SempahoreP_create/
SemaphoreP_construct that correctly initialize the semaphore count.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-12 08:21:13 -06:00
Emil Obalski
3ed9dc3a24 usb: Fix for set/reset endpoints
setting/resetting endpoints is required when switching to alternate
interfaces. This is a common operation for usb audio class.

When audio device is enumerated host invokes set_interface request
to alternate with 0 endpoints associated. That operation lead to
disable never enabled endpoints. With previous solution error message
will appear.

This commit limits error messages to be present only if endpoint
was configured/enabled before and there was a problem when trying
to configure/enable it for the first time.

* Kinetis driver was updated with return error value when ep was
already configured/enabled.

* nxp driver updated with return error value when ep was already
enabled

* sam0 driver updated with return codes instead of magic numbers.

This is fix patch to  #21741

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-02-12 14:40:40 +02:00
Andries Kruithof
82a6208b40 Bluetooth: controller: split: fix HCI read_max_data_len
In the function le_read_max_data_len the rx-component is not set.
This PR fixes this

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-02-12 14:37:09 +02:00
Maureen Helm
72f2d396b3 tests: counter: Extend counter_basic_api timeout
Fixes a timeout failure on the frdm_k64f board.

test_short_relative_alarm iterates 100x through a 3 tick loop, but some
platforms like frdm_k64f have a 1 second counter tick period and
therefore need more time to finish this test.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-12 14:31:14 +02:00
Wayne Ren
7249fbf5ad arch: arc: fix the bug of irq_offload
* remove irq lock/unlock which is not needed because of
  the protection of offload_sem in irq_offload
* simplify the assembly codes related irq_offload, remove
  the thread switch logic
* the old codes may do thread switch in the epilogue of
  irq_offload handling with int locked, this is not correct
  may cause irq_offload related codes crash.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-02-12 14:30:38 +02:00
Piotr Mienkowski
041ccb12dd doc: release-notes-2.2: Update GPIO API section
Add release notes introducing changes to GPIO API.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-12 13:56:33 +02:00
Peter Bigot
461b20a44f tests: drivers: gpio_basic_api: add README
Successful execution of this test requires a board-specific overlay to
identify the test pins, and that the test pins be shorted together.
Document this requirement.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 13:56:11 +02:00
Peter Bigot
47cf5d295f tests: drivers: gpio_basic_api: fix deprecated API level test
Some boards don't support level interrupts; respect their rejection of
the configuration.

Also correct the code intended to disable the interrupt from within
the callback when level triggers are tested.  Note that the legacy
call emulation does not work: it's necessary to add a flag that causes
the interrupt to be disabled.

Also improve a diagnostic and fix the exit path for a failure detected
before the callback was installed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 13:55:39 +02:00
Martí Bolívar
dc1edb946f scripts: zephyr_module: hack to match west 0.7 output
The west command line output is not stable and has changed for 0.7.
Match it in zephyr_module.py's check for whether we are in a
workspace.

The real fix is to start using 'west topdir' whenever the west version
is at least 0.7.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-12 11:37:52 +01:00
Martí Bolívar
17144489d9 doc: report west version when it is found
This will help diagnose issues.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-12 11:37:52 +01:00
Stephanos Ioannidis
b110f3b936 CODEOWNERS: Add Xilinx ZynqMP platform codeowner
Add @stephanosio as a code owner for the Xilinx ZynqMP platform, which
is used as the primary testing platform for the Cortex-R architecture.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 12:02:11 +02:00
Stephanos Ioannidis
0258ba7e21 CODEOWNERS: Add ARM GIC interrupt controller driver codeowner
Add @stephanosio as a code owner for the ARM Generic Interrupt
Controller (GIC) driver.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 12:02:11 +02:00
Stephanos Ioannidis
0974366eae CODEOWNERS: Add Cortex-R arch codeowner
Add @stephanosio as a code owner for the Cortex-R architecture-related
directories and files.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-12 12:02:11 +02:00
Robert Lubos
4f9b9a4500 shell: telnet: Replace timer with a delayed work
A `k_timer` callback is called from the ISR context on certain devices
(nRF), which resulted in an assert in the kernel, as `telnet_send`, and
thus `net_context_send` used a mutex.

Fix the issue by replacing a timer used by the `shell_telnet` module
with a delayed work, which will execute it's callback in a system
workqueue context.

Fixes #22697

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-02-12 10:22:49 +02:00
Robert Lubos
da98c88cdb samples: net: telnet: Add BLE IPSP overlay config
Add `overlay-bt.conf` file to enable easy builds for boards supporting
BLE IPSP.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-02-12 10:22:49 +02:00
Joakim Andersson
08a39851dc Bluetooth: host: Rename scan recv callback info struct
Rename the scan recv callback info struct so that it reflects that it
is part of the scan recv callback. This will make it consistent with
future plans for advertising callbacks.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-11 23:57:27 +02:00
Joakim Andersson
794cbd641b Bluetooth: host: Fix handling of scan start failed
Handle scan start failed and release the connection object in this case.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-11 23:56:47 +02:00
Joakim Andersson
abd03aa3ad Bluetooth: host: Fix scanner using wrong identity to resolve peer
Fix the scanner using the advertiser identity instead of the scanners
identity, scanner always use BT_ID_DEFAULT.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-11 23:56:47 +02:00
Joakim Andersson
4702df0cec Bluetooth: HCI: Fix size of evt_type parameter
Fix the size of the evt_type, this lead to error over serialized HCI
where the event could not be interpreted correctly from the HCI
controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-11 23:56:47 +02:00
Krzysztof Chruscinski
547d623c37 debug: stack: Add missing log_strdup
Log call was missing log_strdup wrap around thread name which
is a string in RAM.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-02-11 12:55:02 -08:00
Glenn Engel
ebcb6a5e71 logging: Fixes c++ compile error using LOG_BACKEND_DEFINE
Ordered struct init properties to match declaration order.  Compiled
and ran on qemu emulator.

Fixes #22482

Signed-off-by: Glenn Engel <glenne@engel.org>
2020-02-11 20:11:12 +02:00
Stephanos Ioannidis
89132fe8bd boards: qemu_cortex_r5: Remove ignore tags for working tests
This commit removes the ignore tags for the tests that work after the
changes in the PR #22037.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-11 08:03:37 -08:00
Stephanos Ioannidis
620f55428d tests: sleep: Increase tick margin for Xilinx QEMU
The Xilinx QEMU, used to emulate the Xilinx ZynqMP platform, is
particularly unstable in terms of timing.

This commit increases the tick margin for the Xilinx ZynqMP platform
from 1 to 5 in order to allow the sleep test to pass with a reasonable
repeatability.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-11 08:03:37 -08:00
Stephanos Ioannidis
4a6e3545e9 tests: sleep: Add tick margin definition
This commit introduces the common tick margin definition that can be
used to specify the maximum allowable deviation from the expected
number of ticks.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-11 08:03:37 -08:00
Stephanos Ioannidis
bea3ee0ed0 arch: arm: Fix incorrect Cortex-R interrupt state control logic.
This commit fixes incorrect Cortex-R interrupt lock, unlock and state
check function implementations.

The issues can be summarised as follows:

1. The current implementation of 'z_arch_irq_lock' returns the value
  of CPSR as the IRQ key and, since CPSR contains many other state
  bits, this caused 'z_arch_irq_unlocked' to return false even when
  IRQ is unlocked. This problem is fixed by isolating only the I-bit
  of CPSR and returning this value as the IRQ key, such that it
  returns a non-zero value when interrupt is disabled.

2. The current implementation of 'z_arch_irq_unlock' directly updates
  the value of CPSR control field with the IRQ key and this can cause
  other state bits in CPSR to be corrupted. This problem is fixed by
  conditionally enabling interrupt using CPSIE instruction when the
  value of IRQ key is a zero.

3. The current implementation of 'z_arch_is_in_isr' checks the value
  of CPSR MODE field and returns true if its value is IRQ or FIQ.
  While this does not normally cause an issue, the function can return
  false when IRQ offloading is used because the offload function
  executes in SVC mode. This problem is fixed by adding check for SVC
  mode.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-02-11 08:03:37 -08:00
Andrzej Głąbek
aa544d678e samples: fade_led: Fix definition of PWM_FLAGS
As it incorrectly uses DT_ALIAS_PWM_LED0_PWMS_CHANNEL macro instead of
the *_FLAGS one.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-02-11 17:50:50 +02:00
Nicholas Lowell
e4e9b9d8d7 posix: fix unistd.h extern C brace mismatch
If unistd.h is included while CONFIG_POSIX_API is not
defined, there is a mismatch of extern C braces that will
cause compile errors

Signed-off-by: Nicholas Lowell <nlowell@lexmark.com>
2020-02-11 17:50:21 +02:00
Henrik Brix Andersen
855ef90f6d samples: canbus: canopen: fix python package install instructions
Fix the Python3 CANopen module installation instructions to refer to
the 'python-can' package instead of the nonexistent 'can' package.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-11 17:49:20 +02:00
Sebastian Bøe
f58e4e0e67 cmake: Fix zephyr-sdk's with a single toolchain
It used to be that zephyr-sdk's were always contained all toolchains,
but as of recently it is also possible to download partial toolchains.

This patch fixes an issue where it was assumed that the zephyr sdk
contained an x86 toolchain. Now we glob for all known toolchains.

Note that the toolchain discovered by generic.cmake can be any generic
toolchain and does not need to be the same that is discovered by
target.cmake.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-02-11 17:48:56 +02:00
Gerson Fernando Budke
886fee8b64 boards: arm: atsamr21_xpro: Add echo server/client link
Add mention and link about IPv6 echo_server/client demos.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke
19e6497d32 samples: net: sockets: echo_server: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke
cc91a734d9 samples: net: sockets: echo_server: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke
2d960aeeb7 samples: net: sockets: echo_server: Add sam4e_xpro config
Add necessary configuration to run demo on the sam4s_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke
97f210bce0 samples: net: sockets: echo_server: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00