Commit graph

42559 commits

Author SHA1 Message Date
Krzysztof Chruscinski
cd9bb3221c tests: drivers: clock_control: Add suite for onoff with clock
Added suite to test clock control with onoff.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Krzysztof Chruscinski
04e770b20c drivers: clock_control: nrf: Add clock status shell command
Added shell command to clock driver to get clock status.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Krzysztof Chruscinski
6f01c0bc79 drivers: clock_control: nrf: Add onoff service support
Updated nrf clock control driver to use onoff service for managing
multiple users.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Marcin Niestroj
add51d809c tests: posix: eventfd: test read and poll after multiple writes
When there were multiple writes to eventfd, then poll() + read() should
start behaving as just initialized. Test that by verifying poll() will
timeout first and later be notified properly when eventfd is written
once again from the other thread.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-20 16:21:37 +02:00
Marcin Niestroj
063dd51dc7 lib: posix: eventfd: fix read/poll after multiple writes
So far semaphore was used with possible values in range 0 to
UINT32_MAX. Each write resulted in semaphore increment. As an example
after two writes and single read eventfd counter was correctly zeroed,
but semaphore counter was not. This means that poll() signalled at this
stage POLLIN (semaphore counter was > 0), but it clearly should
not (eventfd counter == 0). Blocking version of read() was also
returning immediately, returning 0 as previous eventfd counter.

Change read_sem to be a binary semaphore, which counter represents
eventfd counter being zero (when semaphore counter == 0) or
non-zero (when semaphore counter == 1). Try to take the semaphore in
eventfd read() and decrement eventfd counter when semaphore was ready.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-20 16:21:37 +02:00
Joakim Andersson
c4c0e64331 Bluetooth: host: Fix infinite recursion in persistent advertising
Fix a crash in the persistent advertising handling.
This occurs because the callstack of the RX thread overflowed
due to an infinite recursion between bt_conn_unref and
bt_le_adv_resume.
This happens when starting a new advertiser is denied by the
controller, then the conn object reserved will be released again
and the host will attempt to resume advertising in the bt_conn_unerf
at the end of bt_le_adv_resume.
This situation can happen if the host supports more connections
than the controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-20 15:58:36 +02:00
Andrew Boie
476fc405e7 kernel: mem_domain: centralize assertions
Later this year I hope to overhaul the memory domain APIs,
but at least for now let's at least consolidate these checks.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-20 15:32:16 +02:00
Anas Nashif
1787663b15 actions: daily_tests: fetch all tags
Fetch all tags or otherwise we will not be able to run 'git describe'
and post a new version.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 08:57:44 -04:00
Andrew Boie
354053441d userspace: mark z_app_regions as const
These are read-only structures used to clear the various
BSS regions. Mark as constant data.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-20 13:47:10 +02:00
Marek Porwisz
a6c6e7793f net: openthread: Use different kconfig switch for shim and src
Different switch was used for build to allow including all shim body
in zephyr without the need for building openthread from this repo. This
allows developer to include custom OpenThread sources as part of the
application.
This change is needed as Thread is a subject of certification and
sources provided by zephyr may not necesairly pass certification or be
precertified. User is allowed to use certified OpenThread version
this way.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-07-20 14:42:30 +03:00
Piotr Szkotak
a6b0a3a263 net: openthread: make diag compile
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2020-07-20 14:40:29 +03:00
Martí Bolívar
dfbabb1201 openthread: avoid warning when CONFIG_NET_MGMT_EVENT=n
When this happens, ip6_addr_cb and ipv6_addr_event_handler() both look
unused, since they are passed to macros which discard them.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-20 14:28:30 +03:00
Oleg Zhurakivskyy
8aed3aa669 tests: net: tcp2: Update test_sem_take()
Fail solely on semaphore timeout.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
31aff65165 tests: net: tcp2: Check for failed connect on SYN resend
Since the peer isn't replying on SYN resend, update the
test to check for failed connect.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
f5a94e5877 tests: net: tcp2: Update timeout values
Since the connect is now blocking, update the timeout values
for the tests to pass.

In case of resend test, set the timeout to 1000ms to account
for the retransmission.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
87577cb599 net: tcp2: Implement a blocking connect
In order to implement a blocking connect, add a semaphore
and block on it in net_tcp_connect().

The semaphore is released when ESTABLISHED state is reached.

In case tcp_conn_unref() is called while waiting on the semaphore,
defer the unreference, tcp_conn_unref() will be called from
net_tcp_connect().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
ff8e08e6c7 net: tcp2: Refactor net_tcp_connect()
In order to improve readability, refactor and simplify
the control flow in net_tcp_connect().

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
f4c2772622 net: tcp2: Check for SYN and ACK in SYN_SENT
In order for events to be correctly interpreted in SYN_SENT,
check for SYN and ACK simultaneosly.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Oleg Zhurakivskyy
dc01cae8a6 net: tcp2: Send FIN only in ESTABLISHED state
net_tcp_put() can be called before ESTABLISHED state
is reached, send FIN only in ESTABLISHED state.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-20 13:55:22 +03:00
Christopher Friedt
d0629e3c4e libc: malloc: log an error when malloc is called and arena size is 0
Previously, if the arena size was zero, malloc would always fail.
However, the log message was only visible if debug messages were
enabled. Logging an error will hopefully make it more obvious that
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE should be >= if the minimal
libc and malloc are both used.

Fixes #26720

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-07-20 12:48:33 +02:00
Joakim Andersson
970e921cd7 Bluetooth: hci_ecc: Follow BT spec when public key is invalid
Follow Bluetooth specification recommendation of setting the output
of the DH_Key field in the LE Generate DHKey Complete event when the
public key is invalid.

 If the Remote_P-256_Public_Key parameter of the HCI_LE_Generate_DHKey
 command (see Section 7.8.37) was invalid (see [Vol 3] Part H, Section
 2.3.5.6.1), then all octets of the DH_Key event parameter should be
 set to 0xFF.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-20 12:48:23 +02:00
Alexandre Bourdiol
d7fb61f224 drivers: flash: stm32wb: disable Page Erase at end of erase_page()
FLASH_TYPEERASE_PAGES is null and doesn't represent a bit in the
register, thus this instruction has no effect.
It must be replaced by FLASH_CR_PER which is the bit that should
be cleared.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-20 12:48:10 +02:00
Trond Einar Snekvik
f8663774de Bluetooth: Mesh: Document shell commands
Adds a high-level documentation page for the Bluetooth Mesh Shell
subsystem, documenting all available commands and their parameters.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-07-20 12:47:31 +02:00
Vinayak Kariappa Chettimada
4bf2a0d520 Bluetooth: controller: Make coding style around ret_cb consistent
Updated implementation to have consistent initialization of
ret_cb use when passing it to ticker function calls.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-20 12:46:54 +02:00
Vinayak Kariappa Chettimada
13f079f212 Bluetooth: controller: Fix missing ticker status initialization
Fix missing ticker status callback return value
initialization.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-20 12:46:54 +02:00
Mateusz Syc
47bb6a3fdf tests: drivers: flash: added flash tests
Test include non-aligned read in nrf_qspi_nor flash and
SoC flash memory to buffer with variable size.
It checks all possible variants of alignment and size.

Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
2020-07-20 12:46:38 +02:00
Mateusz Syc
c3cc0c8787 drivers: flash: nrf_qspi_nor: supports non-aligned read
Added function read_non_aligned that reads data under
non-aligned flash addres to non-aligned read buffer of any size.

Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
2020-07-20 12:46:38 +02:00
Vinayak Kariappa Chettimada
c9332e76b3 tests: Bluetooth: shell: Remove cmd_ull_reset
Remove cmd_ull_reset command, as this would put the host out
of sync. Also, this command is seldom used/required.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-20 12:46:26 +02:00
Vinayak Kariappa Chettimada
293a2f69d0 Bluetooth: controller: Remove redundant BT_LL_SW_SPLIT conditional
Remove redundant use of BT_LL_SW_SPLIT conditional.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-20 12:46:26 +02:00
Emil Gydesen
5b59c002f6 Bluetooth: Gatt: Automatic discover of CCC when subscribing
Added a feature that allows an application to request
automatic discovery of the CCCD handle when subscriping
to a characteristic. In order to preserver RAM, the application
is expected to provide the discovery parameters, and it's up
to the application whether or not it wants to reuse the
discovery parameters or use one for each characteristic.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-07-20 12:46:18 +02:00
Saravanan Sekar
820d17110d samples: sensors: wsen_itds: add sample to test accel sensor
Add a sample to demonstrate and test the Wurth Elektronik WSEN-ITDS
accel sensor. Sample code covers accel and die temperature functions.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Saravanan Sekar
9ac3c9d42a drivers: sensors: itds: Add support for WSEN-ITDS 3-axis accel sensor
Add support for wsen-itds 3-axis accel sensor, provides acceleration,
temperature data reading and supports configuring of output data rate,
operating mode and scale.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Saravanan Sekar
57e7148613 dts: bindings: vendor-prefixes: add Würth Elektronik
WE is used as vendor for Würth Elektronik sensor drivers.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Marcin Niestroj
071e8400ad net: l2: ppp: fsm: use packet work object instead of shared one
Single work object for whole fsm was not being able to handle more than
single packet at a time. Because of that we have overwritten already
scheduled packets, resulting in fsm timeout and net_pkt leak.

Use net_pkt work object instead, so we can safely schedule more than a
single packet.

This commit also drops workaround for qemu_x86 unit testing.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-20 13:19:28 +03:00
Andrew Boie
98bcc51b09 x86: gen_gdt: improve docstring
Describe what info we're snarfing out of the prebuilt kernel.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-19 08:50:52 -04:00
Johan Hedberg
38333afe0e arch: x86: zefi: Reduce data section alignment requirement from 8 to 4
It's not safe to assume that the data section is 8-byte aligned.
Assuming 4-byte alignment seems to work however, and results in
simpler code than arbitrary alignment support.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-07-18 08:44:31 -04:00
Anas Nashif
48216b33a5 boards: up_squared: add a post build target
Build an EFI image as a post build step.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-18 08:44:31 -04:00
Anas Nashif
4382532fd3 x86: zefi: support arguments and make compatible with windows
Add argument parsing and use os.path.join where possible to support
building on windows.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-18 08:44:31 -04:00
Marcin Niestroj
aec0b5ae84 mgmt: smp: add missing kernel.h include statement
There is following error when compiling applications using smp:

  /zephyr/include/mgmt/smp.h:77:16: error: field 'zst_work' has \
  incomplete type
     77 |  struct k_work zst_work;
        |                ^~~~~~~~
  /zephyr/include/mgmt/smp.h:80:16: error: field 'zst_fifo' has \
  incomplete type
     80 |  struct k_fifo zst_fifo;
        |                ^~~~~~~~

Fix that by adding missing kernel.h include statement in mgmt/smp.h.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-18 08:43:18 -04:00
Andrew Boie
4df734683e x86: 32-bit: enable thread stack info
The hardware stack overflow feature requires
CONFIG_THREAD_STACK_INFO enabled in order to distingush
stack overflows from other causes when we get an exception.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-07-18 07:21:53 -04:00
Anas Nashif
5092541e2b sanitycheck: disable erroring on warnings
--warnings-as-errors was basically doing nothing, it is the default.
Replace this with an option to disable erroring on warning:

 -W, --disable-warnings-as-errors

Fixes #26910

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-17 13:03:36 -05:00
Krzysztof Chruscinski
88be2ea2d2 drivers: uart: Make all API function available
Conditional API was removed by preprocessor which violates zephyr
coding style. Removed ifdefs around conditional API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-17 13:00:52 -05:00
Andrei Gansari
5224481e82 boards: shields: mikroe_eth_click: add lpcxpresso55s69 support
Add devicetree overlay for connecting an Mikroe ETH click shield to an
NXP LPCXpresso55S69 development board.

The LPCXpresso55S69 uses SSEL1 (CS1) for mikroBUS SPI, whereas the
generic Mikroe ETH click board definition assumes SPI CS0.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-07-17 11:59:41 -05:00
Andrei Gansari
aaee2864f8 boards: mikroe_eth_click conditional configuration
Replaces .conf type configuration with .defconfig.
Makes configuration conditional, it depends on shield definition and
networking.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-07-17 11:59:41 -05:00
Brian Bradley
8ec1cbc95d boards: arm: stm32: Add WeAct Black Pill V2.0 definitions
Includes support for spi, usb, i2c, uart, pwm, adc, dfu,
and onboard led and switch.

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-07-17 16:54:22 +02:00
Johann Fischer
8eb99bcbb5 usb: cdc_acm: re-trigger transfer for OUT endpoint on resume
Transfers are cancelled on suspend event, OUT transfers
needs to be re-trigger on resume.
Rework event handling to filter out spurious resume
events and re-trigger transfer if previous event was
a suspend event.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-17 13:37:08 +02:00
Johann Fischer
5700a6227d usb: usb_transfer: log which endpoint transfer will be cancelled
Log which endpoint transfer will be cancelled.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-17 13:37:08 +02:00
Peter Bigot
5f68b63896 dts: ti,bq274xx: remove default properties
The parameters for this fuel gauge depend on the hardware design and
the expected battery.  These should not be defaulted to a value that
may be inappropriate.  Require that they be explicitly provided.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-17 13:35:52 +02:00
Ioannis Glaropoulos
0292df5489 doc: release: add note for SW_VECTOR_RELAY feature in Mainline Cortex-M
Add a note in 2.4 release notes regarding SW_VECTOR_RELAY
feature, now supported also in Mainline Cortex-M architecture.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-17 13:22:17 +02:00
Rubin Gerritsen
742358c6a6 bluetooth: controller: Kconfig: debug pins depends on BT_LL_SPLIT
When BT_LL_SPLIT is not selected, it should not be visible.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2020-07-17 12:57:49 +02:00