Commit graph

42567 commits

Author SHA1 Message Date
Parthiban Nallathambi 3e62d73368 drivers: wifi: eswifi: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance.
ISM43362 chip select is ACTIVE_LOW.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2020-07-06 08:24:18 -05:00
Andreas Sandberg d6f22e53eb boards: arm: b_l072z_lrwan1: Add flash support
The STM32L0 now has a working flash driver, enable the flash device on
the b_l072z_lrwan1.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-06 08:18:35 -05:00
Joakim Andersson 4f7505cb10 Bluetooth: host: Unspecified disconnect reason for no pending conn
Use an unspecified reason when disconnecting a connection that did not
have a pending connection in the host.
We don't allocate connection objects in the connection complete anymore
so using memory-capacity-exceeded is misleading.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 14:39:30 +02:00
Joakim Andersson 4281843fd7 doc: relnotes: Add release notes for updated HCI driver event handling
Add release notes for updated HCI driver event handling for calling the
bt_recv() and bt_recv_prio() functions when delivering HCI events to
the host.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Joakim Andersson a52c442fc7 Bluetooth: test: Print disconnect reason in hex value
Print the disconnect reason in hex value since the defines are in hex.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Joakim Andersson 52f9c0dd46 Bluetooth: host: Fix resume advertiser race condition
This patch fixes an issue with the advertiser not resuming connectable
advertiser if the last bt_conn_unref happens from something other
than the disconnected callback.
In this case this last bt_conn_unref was from gatt.c notify_cb called
from application main thread.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Joakim Andersson 4be66bd33d Bluetooth: Fix host RX thread deadlock
Fix host RX thread being deadlocked. The deadlock occurs because the
RX thread is stuck waiting in conn_tx_alloc with K_FOREVER but if the
connection is disconnected only the RX thread can unblock it in the
handling of the disconnect event.

This commit fixes this deadlock by splitting the processing of the
disconnected event into two parts.
The part needed to unblock the RX is to release resources held by
unack'ed TX packets and mark the connection state as not connected
anymore.
The RX thread waiting for free_tx fifo and the TX thread waiting for
the bt_dev.le.pkts semaphore will both check the connected state after
having acquired them and will abort if disconnected.
The rest of the processing will be handled at normal RX thread
priority like normal.

Move the bt_recv_prio handling to the Bluetooth host when the host
has defined its own RX thread (CONFIG_BT_RECV_IS_RX_THREAD=n).
If the HCI driver has the RX thread (CONFIG_BT_RECV_IS_RX_THREAD=y),
then the responsibility to call bt_recv and bt_recv_prio correctly
falls to the HCI driver.
The helper function bt_hci_evt_is_prio() is replaced with
bt_hci_evt_get_flags() so that the HCI driver can do this correctly.
This decision to replace was made so that existing HCI drivers
maintained out-of-tree will fail at compile time with the new system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>

Bluetooth: host: Move bt_recv_prio to host when RX thread is defined

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-06 11:15:39 +02:00
Ilya Tagunov 897b5bf60a boards: nucleo_f070rb/f303re: fix clock configuration
Fix PREDIV1 options in defconfigs.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-07-05 07:56:21 -04:00
Ilya Tagunov 301208329b drivers: clock_control: stm32f0/f3: streamline PREDIV handling
We should not set PLLSRC bits here. It is done by
LL_PLL_ConfigSystemClock_* functions which are called later.
Also, PREDIV1 setting should not be restricted to HSE only.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-07-05 07:56:21 -04:00
Ilya Tagunov 907c545837 drivers: clock_control: stm32f0/f3: fix PREDIV options
Allow CLOCK_STM32_PLL_PREDIV1 option for STM32F3 series;
correct and extend option descriptions.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-07-05 07:56:21 -04:00
Gerson Fernando Budke c001baafc8 boards: arm: atsamr21_xpro: Add PWM support
This enables PWM and connects it to the LED0.  Tested with blinky_pwm
and fade_led samples.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-04 15:13:28 -04:00
Gerson Fernando Budke c5d7679025 boards: arm: atsamr21_xpro: Fix yaml supported list order
Index supported list order by name.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-04 15:13:28 -04:00
Gerson Fernando Budke 460791278e dts: arm: atmel: samr21: Add TCC peripherals
Add TCC peripherals entries for SAMR21 SoC.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-04 15:13:28 -04:00
Dominik Ermel 5a40ff1ac5 posix/fs: Fix POSIX lseek to return position upon completion
Bring standard behaviour to lseek, where new file position is returned
on success.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-04 07:46:51 -04:00
Stephanos Ioannidis 17e8a20615 boards: atsame54_xpro: Support driving on-board LED with PWM
This commit adds the PWM LED definition in the board device tree for
the on-board LED connected to the pin PC18.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-04 07:09:28 -04:00
Stephanos Ioannidis 11c294d626 soc: arm: samd5x: Add device tree TCC definitions
This commit adds the device tree TCC (Timer/Counter for Control
Applications) peripheral definitions for the Atmel SAM D5x and E5x
series SoCs.

The SAM D5x/E5x series SoCs have five instances of the TCC peripheral:

TCC#  Channels  Waveform Output  Counter Size
 0       6             8            24-bit
 1       4             8            24-bit
 2       3             3            16-bit
 3       2             2            16-bit
 4       2             2            16-bit

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-04 07:09:28 -04:00
Xavier Chapron a94c8bb02b net: buf.h: Add static initialiser to net_buf_struct
This is necessary to avoid collision between drivers that calls
NET_BUF_POOL_DEFINE with the same name.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-07-04 07:08:33 -04:00
Andrzej Puzdrowski c7ab1a178c Kconfig: update BOOTLOADER_MCUBOOT help message
Description was updated so reflects fact that this
option activates SW_VECTOR_RELAY_CLIENT feature now.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-07-03 13:34:50 -04:00
Ioannis Glaropoulos fde3116f19 arch: arm: cortex_m: Add config for SW_VECTOR_RELAY_CLIENT
Define vector relay tables for bootloader only.
If an image is not a bootloader image (such as an MCUboot image)
but it is a standard Zephyr firmware, chain-loadable by a
bootloader, then this image will not need to relay IRQs itself.
In this case SW_VECTOR_RELAY_CLIENT should be used to setting the
vector table pointer in RAM so the parent image can forward the
interrupts to it.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Co-authored-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-07-03 13:34:50 -04:00
Aastha Grover 8213a1509f sanitycheck: Testcases for report functions of TestSuite Class
test_reporting_testsuite.py: Adding testcases for reporting
functions of Class testSuite.
test_testsuite_class.py: Testcase for add_instances function
conftest.py: Added fixture for instances_fixture

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-07-03 12:20:35 -04:00
Aastha Grover dcbd915759 sanitylib: Fix discard_report to check self.discards dict
Modifying discard_report function to fix the check for
self.discards dictionary in try block. self.discards
is None is dead code which didnot check if the dictionary was
empty. Changed it to if not self.discards.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-07-03 12:20:35 -04:00
Michael Hope 0bc3585800 drivers: timer: enable read synchronisation mode for the SAMD/E5x
The COUNT register on the SAMD/E5x RTC can only be read if the read
synchronisation mode is enabled.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-03 12:20:03 -04:00
Michael Hope 89466d57ea drivers: timer: fix the use of K_FOREVER for the SAMD/E5x
Change K_FOREVER for K_TICKS_FOREVER.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-03 12:20:03 -04:00
Sandeep Tripathy 36d1bddb41 tests: interrupt: include bcm platform
GICv3 is now support for SGI generation and test case is updated
to use GICv3 apis. bcm958402m2_a72 can be enabled now.

Signed-off-by: Sandeep Tripathy <sandeep.tripathy@broadcom.com>
2020-07-03 12:19:31 -04:00
Torsten Rasmussen 2eb897ed1c cmake: removing DTS_ROOTS in test samples as they serves no purpose
This commit is a cleanup in two test samples.

In both samples, the following line of code were found:

    set(DTS_ROOTS ${CMAKE_CURRENT_LIST_DIR})

Firstly, it is not needed to set `DTS_ROOT` in samples, as the sample
folder is always added to `DTS_ROOT`.
Secondly, the variable is named `DTS_ROOT`, but the samples used a
misspelled version `DTS_ROOTS`, which means that variable has never
had any effect.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-03 12:18:04 -04:00
Dominik Ermel a5b3e86339 subsys/fs: Fix fs_* operations crashing when file closed
Attempt to perform fs_read, fs_write, fs_seek, fs_tell, fs_truncate
and fs_sync on file that has been closed, prior to attempt, would cause
NULL pointer dereference.
With this fix, such operations would instead return -EBADF.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-03 12:16:11 -04:00
Dominik Ermel 54492c2748 subsys/fs: Fix fs_close on closed file causing NULL dereference
If fs_close gets invoked on closed file (e.g. double close) it would
cause NULL dereference and system crash. Instead now it will just
return with success, as the file is already closed anyway.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-03 12:16:11 -04:00
Henrik Brix Andersen ce426f69f0 tests: drivers: dac: loopback: use internal loopback on the twr_ke18f
Enable internal DAC to ADC loopback on the NXP TWR-KE18F
board.

Increase the ADC sample time to 5 microseconds since there is no
buffer between the DAC and ADC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-07-03 08:05:25 -04:00
Henrik Brix Andersen 6494ce2607 drivers: dac: mcux_dac32: add Kconfig option for enabling test output
Add a Kconfig option for enabling the DAC test output. On the NXP
KE1xF the DAC test output is internally routed to ADCx SE23.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-07-03 08:05:25 -04:00
Andreas Sandberg 69f0e3b15f drivers: flash: Add support for STM32L0X
Add support for STM32L0X using the generic STM32 backend. This is
quite a significant change since the L0 series uses a slightly
different flash controller. Refactor the generic backend to better
support different block sizes and the L0's register interface.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-03 08:05:03 -04:00
Andreas Sandberg b9da052e51 drivers: flash: Remove redundant code in STM32 drivers
Several STM32 chips have identical chip-specific code that has been
duplicated in different source files. Unify the F0x, F1x, and F3x to
use a single implementation.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-03 08:05:03 -04:00
Anas Nashif 3cb1b437d2 ci: do not run sanitycheck on linter config changes
Do not run sanitycheck on linter configuration changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-03 07:58:31 -04:00
Anas Nashif f04461e8d0 sanitycheck: fix --failed-only handling
- Report build errors as errors, not test failures
- Do not try and build/run tests with build failures
- Fix issue with empty reports when running --only-failed
- Report build errors in the detailed and target reports

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-03 07:25:49 -04:00
Daniel Leung 95717db0f4 benchmarks: timing_info: fix x86 cycles to nsec conversion
The conversion from cycles to nanoseconds was using the incorrect
macro which resulted in microseconds instead. So fix it by
using the correct macro.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-02 20:51:12 -04:00
Anas Nashif 7d10b68baa boards: qemu_arc: disable as default test platform
Still unstable in CI and causing lots of failures. Disabling for now
while it is getting stablised.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 20:50:50 -04:00
Anas Nashif 8ff5417dfc Revert "tests: dlist to add a testcase and add some tags"
This reverts commit 2c92af5a80.

See #26619

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 14:40:20 -05:00
Anas Nashif 9d0c633f88 Revert "tests: rbtree to add and modify some tastcases"
This reverts commit 09310462fd.

See #26619

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 14:40:20 -05:00
Torsten Rasmussen bab3a2562e xtensa: changing $ENV{ZEPHYR_SDK_INSTALL_DIR} to CMake var
ZEPHYR_SDK_INSTALL_DIR will be set as an internal CMake variable when
using the Zephyr SDK.
The Zephyr SDK zephyr/host-tools.cmake will ensure to set the CMake
ZEPHYR_SDK_INSTALL_DIR variable to the environment setting, or the
install directory in case the CMake package was used.

Users not using the environment variable will experience the following
error:
```
Linking C executable zephyr/.../bootloader/bootloader.elf
FAILED: zephyr/.../bootloader/bootloader.elf
<path>/xtensa-zephyr-elf/bin/ld: cannot find -lhal
```

This commit ensures code build correctly both when setting the
environment variable ZEPHYR_SDK_INSTALL_DIR, and when using Zephyr SDK
CMake `find_package(Zephyr-sdk)`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-02 11:32:58 -07:00
Johann Fischer 0a87f9359e drivers: uart_mcux: add UART set configuration function
Add UART set configuration function.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-02 11:09:09 -04:00
Anas Nashif 743d2c4d3e actions: disable conflict action for now
Too much traffic is causing this workflow to generate noise and
conflicting labeling. Disabling for now while we investigate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 10:59:34 -04:00
Anas Nashif 8516d19ffd actions: use one label for stale PRs and issues
Lets just use one single label for stale items.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 10:59:34 -04:00
Anas Nashif 2a82acc6d6 boards: waveshare_open103z: remove unused Kconfig
Remove CONFIG_CLOCK_STM32_PLL_XTPRE as it is not longer being defined or
used.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-02 10:55:07 -04:00
ZhongYao Luo ddf5152bb8 Bluetooth: br/edr: store link key
Save link key to settings_subsys, no need to re-pair after restart.
Overwrite old pairing records with aging counts.

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2020-07-02 16:32:41 +03:00
Andries Kruithof 2bfb128463 Bluetooth: shell: allow multiple parameters for bt hci-cmd
The hci-cmd currently accepts only a 1 byte parameter. This
disables use of commands that requires more than 1 byte,
for ex. the feature exchange that requires a 16 bit parameter.

This commit allows a datafield parameter up to 65 bytes long.
65 bytes comes from the nr. of parameters for the
HCI_LE_Generate_DHKey command

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-07-02 16:32:04 +03:00
Michał Narajowski 91761767dd mesh: Ignore Friend Request from local interface
Friend Request is also transmitted over local queue and
if both Friend and LPN features are enabled then we would
try to establish friendship with ourselves.

Fixes MESH/NODE/FRND/LPN testcases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 1e29b2dceb mesh: Replace hardcoded duplicate cache size
The hardcoded value was arbitrary and interfered with message cache
mechanism causing invalid behavior and PTS test to fail.

Fixes MESH/NODE/RLY/BV-02-C.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski cc6d9f1072 mesh: Do not ignore message with DST as RFU group address
According to Mesh Profile Test Specification we should still
relay messages with DST address that is RFU.

Fixes MESH/NODE/RLY/BV-01-C.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 3e7c64dda9 mesh: Fix net_buf leak in advertising provisioning bearer
Unsegmented buffer in bearer_ctl_send was not unrefed causing
a memory leak.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 7c06f3c38e mesh: Adjust config values to pass Transport test cases
These values were derived experimentally by running PTS test cases.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 73e1cccdbb mesh: Fix Vendor Model Subscription Get procedure
Invalid argument was passed to bt_mesh_model_tree_walk.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00