Commit graph

49649 commits

Author SHA1 Message Date
Andy Ross
c65cf1cd15 soc/intel_adsp: Newlib heap should be uncached
The sentry symbols that mark the ends of the newlib heap area were
being placed in cached memory, which violates the coherence rules.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-15 08:57:46 -04:00
Lukasz Maciejonczyk
1b7755e62a net: openthread: Fix otPlatUartSend
Make sure data for transmission do not overlap each other.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-03-15 13:46:36 +02:00
Lukasz Maciejonczyk
4acaae1b1b net: openthread: Fix UART platform callback
OpenThread UART tx callback has been processed even if it was not
triggered by OpenThread otPlatUartSend function.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-03-15 13:46:36 +02:00
Martin Jäger
2857c2e984 samples: subsys: task_wdt: add sample application
The sample demonstrates how to use the task watchdog in different
threads.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-03-15 12:24:54 +01:00
Martin Jäger
1aaf508bde task_wdt: add task-level watchdog subsystem
This new subsystem can be used to supervise individual threads. It
is based on a regularly updated kernel timer, whose ISR is never
actually called in regular system operation.

An existing hardware watchdog can be used as an optional fallback if
the task watchdog itself gets stuck.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-03-15 12:24:54 +01:00
Henrik Brix Andersen
5b87cca98b samples: shields: lmp90100_evb: rtd: use newlib sqrt when available
Avoid using local sqrt() approximation when newlib is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Henrik Brix Andersen
e51e980f8b samples: shields: lmp90100_evb: rtd: mark constants as const
Mark the constant coeffiecients used in the RTD resistance to
temperature conversion as const.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Henrik Brix Andersen
0449e086c6 samples: shields: lmp90100_evb: rtd: improve readability, fix off-by-one
Improve the readability of the LMP90100-EVB RTD sample by adding
comments and further definitions instead of magic values within the
code.

This furthermore fixes an off-by-one error for the maximum ADC value
used in the formula for calculating the resistance of the RTD (8388607
vs. 8388608).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Pieter De Gendt
bbdeee65a3 i2c-mcux-lpi2c: take semaphore during transfer
Ported commit 49a3ce5881

Transfer locking is required if multiple devices use the same i2c bus.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-03-15 10:24:03 +01:00
Vinayak Kariappa Chettimada
1e79d5b9c6 Bluetooth: host: iso: Fix typo in hci_le_big_terminate
Fix typo in hci_le_big_terminate function name.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-03-15 10:23:44 +01:00
Watson Zeng
fa1d197e06 boards: nsim: add mdb unaligned memory access option
When CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS=y, we also
need to add -Xunaligned option for mdb to enable unaligned
memory access feature for nsim.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-03-15 10:23:30 +01:00
Krzysztof Chruscinski
1a5fce97b7 logging: swo: Add option to set custom reference frequency
Some devices may use different reference than cpu clock. Add
support for using swo-ref-frequency property when present.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Krzysztof Chruscinski
cc7a324493 soc: arm: nordic: Indicate SWO presence in nrf52, nrf53 and nrf91
Add HAS_SWO to nordic SoC series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Krzysztof Chruscinski
fb8be00e05 dts: arm: nordic: Add swo-ref-frequency property
Added swo-req-frequency property to nordic SoC's

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Krzysztof Chruscinski
489042d538 dts: bindings: cpu: Add cortex-m common properties
Added file with common properties for cortex-m cores.
Added optional swo-ref-frequency property.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-15 10:23:10 +01:00
Andy Ross
d809390405 boards/intel_adsp_cavs15: Add alternative integration tool for twister
The twister integration on this board is problematic:

+ It assumes that it will be building on the device's linux
  installation, which is often a somewhat slow Apollo Lake board (Up
  Squared) with extremely limited storage space (mine has only 5G left
  on the internal eMMC after Zephyr installation and can't fit a full
  twister build tree).

+ Reading the trace output before the firmware load will emit output
  from a previous test run.  Twister isn't consistent about the order
  in which the --west-flash and --device-serial-pty scripts are
  started, which means that tests show spurious failures when the
  order changes or if the device started with a test in its trace
  buffer.

This is an elaboration on the scripting I've been using.  It's a
single script that works as both the west-flash and device-serial-pty
handlers (or as an all-in-one standalone if you pass it the path to
the zephyr.elf file instead of running it under twister).  It reaches
the device host over ssh and runs the tools with sudo, minimizing
administration overhead (the device does need a checked-out Zephyr
tree and a built diag_driver kernel module though).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-15 10:22:21 +01:00
Marek Pieta
7e469c2f94 log: Fix defining CONFIG_LOG_STRDUP_MAX_STRING
Change fixes an issue related to data access out of array bounds and
suppresses compiler warning.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-03-15 10:21:18 +01:00
Joakim Andersson
1367220410 tests: Bluetooth: Fix compilation issue in direction finding test
Fix compilation issue in direction finding tests, undefined references
to radio_df_ant_switching_gpios_cfg and
radio_df_ant_switching_pin_sel_cfg

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-15 10:19:17 +01:00
Enjia Mai
4aed856d7f kernel: smp: Remove unused internal API z_smp_reacquire_global_lock()
The internal function z_smp_reacquire_global_lock() has not used by
anywhere inside zephyr code, so remove it.

Fixes #33273.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2021-03-14 18:32:26 -04:00
Ningx Zhao
7874052df2 lib/rbtree: Remove dead case in rb_remove()
This "else" clause was dead code, in a valid
tree it's not possible to have a node and
its child both be red.
Fix issue #33239.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2021-03-13 06:49:08 -05:00
Anas Nashif
15b9565b37 Revert "tests: net: socket: af_packet: fix resource leak"
This reverts commit a1ae45fecd.

The test is failing now, reverting until properly fixed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-12 19:50:54 -05:00
Anas Nashif
4bccc1db10 twister: fix integration selection
--integration without integration_platforms in the test definition is a
noop.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-12 19:50:54 -05:00
Eugeniy Paltsev
d80a11ab9d ARC: MWDT: avoid xcheck object linkage as we don't use xcheck
We don't use xcheck (we disable it by passing '-Hnoxcheck' to
linker) so let's avoid xcheck object linkage as well by
passing '-Hnoxcheck_obj' option.

'-Hnoxcheck_obj' option implies the '-Hnoxcheck' option.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-03-12 18:29:27 -05:00
Eugeniy Paltsev
8165f3ad80 ARC: cleanup instruction cache initialization
As of today during the Zephyr start we
 - invalidate I$
 - disable I$
 - enable I$

Given that we don't need to have I$ disabled during any
initialization period and ARC processors have caches enabled
after reset the I$ disabling/enabling is excessive, so we can
drop it.

By that we also aligh the I$ initialization on ARC with other
projects like U-boot and Linux kernel.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-03-12 18:29:07 -05:00
Robert Lubos
5de148d8c0 tests: net: sockets: tls: Add unit test for TLS MSG_WAITALL flag
Add a unit test that covers MSG_WAITALL flag functionality for TLS
sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-12 13:57:11 -05:00
Robert Lubos
a670c84530 net: sockets: tls: Implement MSG_WAITALL flag
Add MSG_WAITALL flag implmentation for secure sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-12 13:57:11 -05:00
Robert Lubos
4582e57903 tests: net: sockets: tcp: Add unit test for MSG_WAITALL flag
Add a unit test that covers MSG_WAITALL flag functionality for TCP
sockets.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-12 13:57:11 -05:00
Robert Lubos
d47e803976 net: sockets: Implement MSG_WAITALL recv flag
Implement MSG_WAITALL flag for stream sockets. Setting this flag on
`recv()` call will make it wait until the requested amount of data is
received.

In case both, MSG_WAITALL all is set and SO_RCVTIMEO option configured
on a socket, follow the Linux behavior, i. e. when the requested amount
of data is not received until the timeout expires, return the data
received so far w/o an error.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-12 13:57:11 -05:00
Johan Stridkvist
a81765bbe4 Bluetooth: HCI: Add option CONFIG_BT_HCI_ACL_DATA_SIZE
Add the option CONFIG_BT_HCI_ACL_DATA_SIZE which allows the user
to configure the max HCI ACL data payload. This is needed for platorms
where the BLE LL, HCI uart and host run on three different cores.

Fixes: #30441

Signed-off-by: Johan Stridkvist <johan.stridkvist@nordicsemi.no>
2021-03-12 20:40:21 +02:00
Joakim Andersson
e06bac0e4f Bluetooth: host: Overwrite existing bond when IRK has been updated
Overwrite the existing bond when the IRK of the existing bond could not
resolve the RPA of the peer. This would happen if the peer has deleted
the bond and replaced the IRK that was used.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-12 11:27:43 -05:00
Joakim Andersson
7fee6b8ae8 Bluetooth: host: Refactor update_keys_check to operate on keys as input
Refactor update_keys_check helper function to operate on input keys
input. This allows the function to be re-used on a keys structure that
is not the current connection keys.

This also avoids the helper function changing the connection state.
The conn->le.keys pointer should at this point always have been
assigned, as central when sending the pairing request, and as peripheral
when receiving the pairing request at the very latest.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-12 11:27:43 -05:00
Dominik Ermel
9a64eec848 doc: fs: Add information on samples that utilize VFS
There are several interesting use caseis of VFS scattered around
in samples, for example usage of FAT in RAM in USB mass storage
that are worth mentioning in VFS reference documentation.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-12 11:27:04 -05:00
Jukka Rissanen
8140fb8d2f tests: net: getaddrinfo: Verify that we receive all queries
The previous implementation of process_dns() handler did not
properly catch how many queries we sent.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-12 11:26:16 -05:00
Jukka Rissanen
8353225ce0 net: dns: Add locking to prevent concurrent access
Add mutex locks to avoid concurrent access to DNS context.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-12 11:26:16 -05:00
Aleksandr Khromykh
73e1c6a77d Bluetooth: Mesh: Fix restoring fast period divisor from settings
The Health Fast Period Divisor is stored within
the model publish parameters on the access layer.
The opposite part for divisor restoring has been missed.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2021-03-12 16:58:09 +02:00
Krzysztof Chruscinski
a02e11b118 unit: cbprintf: Extended to test without _Generic use
Updated test and extended the configuration to valided packaging when
_Generic is not being used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:25:15 -05:00
Krzysztof Chruscinski
844800365a tests: lib: cbprintf: Added configuration without _Generic
Extended test to validate case when _Generic keyword is not used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:25:15 -05:00
Krzysztof Chruscinski
d82e31f903 lib: os: cbprintf: Fix Z_C_GENERIC not being used
Due to the fact that define was created after including
cbprintf_internal.h, it was not used there. Change the order and fix
the issue that was revealed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:25:15 -05:00
Krzysztof Chruscinski
7e125fe7e4 logging: Add backend parameter to the init function
Added backend parameter to the backend init interface function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:24:54 -05:00
Martí Bolívar
85b6a28f7d doc: coding_guidelines: replace a whitelist replacement
Nothing in the tree is using the "passlist" term in the "blocklist /
passlist" pair. However, west is using "blocklist / allowlist" already
in a released version.

Recommend blocklist/allowlist instead of blocklist/passlist to avoid
having to add yet another possible replacement, since nothing is using
passlist right now.

Note that blocklist/allowlist is in widespread use throughout many
projects, including Chrome.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-12 09:23:54 -05:00
Erwan Gouriou
56ea0e51f4 west.yml: Update hal_stm32 with recent cube packages
F0: from version v1.11.1 to version v1.11.2
F1: from version v1.8.2 to version v1.8.3
F2: from version v1.9.1 to version v1.9.2
F3: from version v1.11.1 to version v1.11.2
F4: from version v1.25.1 to version v1.25.2
L0: from version v1.11.3 to version v1.12.0

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-12 09:23:32 -05:00
Tomasz Bursztyka
915f4ac3c7 drivers/interrupt_controller: Get the IOAPIC RTEs dynamically
The fixed number of 24 RTEs is a legacy thing, and long gone by now.
IOAPICs expose the maximum number of RTEs they have via the version
register, so let's use it.

This avoids to manually tweak a Kconfig option (which is now removed)
and fixes the RTE number for all x86 targets relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-03-12 09:23:08 -05:00
Guðni Már Gilbert
a1ae45fecd tests: net: socket: af_packet: fix resource leak
Fix resource leak by closing opened
sockets

Coverity-CID: 219491
Fixes #32949

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-12 09:22:26 -05:00
Trond Einar Snekvik
bbc9da3d69 Bluetooth: Mesh: Add bsim tests for transport
Adds a test suite for Bluetooth Mesh in bsim_bt tests, including 10
tests for common transport behavior. This test suite includes a readme
and a simple framework for adding more mesh tests in the future.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Trond Einar Snekvik
20ce680d79 Bluetooth: Mesh: Make internal virtual addr pointers const
Adds the const qualifier to the internal api for adding and removing
virtual addresses, to allow them to accept const hardcoded values in
tests.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Trond Einar Snekvik
9b4266b591 Bluetooth: Mesh: Resolve keys before logging subnet
Moves the debug log printing the transport packet metadata to after the
keys are resolved, so that the subnet pointer is valid.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Trond Einar Snekvik
66699b8170 Bluetooth: Mesh: Add net transmit status rx in config client
Adds an opcode handler for the network transmit status opcode.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:17:27 +02:00
Trond Einar Snekvik
243e29cc29 Bluetooth: Mesh: Add poll callback for friend role
Adds a "polled" function to the friend callback structure, that gets
called every time the friend receives a poll message. The polled
callback is called before the establish callback, to match the LPN
behavior.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-12 16:14:58 +02:00
Jukka Rissanen
ac55c63f08 net: tcp2: Add more debugging for connection unref
Print information who is freeing the connection struct,
this is useful for debugging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-12 15:59:30 +02:00
Jukka Rissanen
1269a23e97 net: shell: The tcp connect command must have a timeout
If there is no timeout, the connect will timeout immediately
and the connection is not established.

Fixes #33185

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-12 15:59:30 +02:00