Commit graph

49649 commits

Author SHA1 Message Date
Dominik Ermel
156914f405 west.yml: Update mcumgr revision
Commits affecting Zephyr that are included with the new revision:
    99f9fd6 img_mgmt: Use IMG_MGMT_BOOT_CURR_SLOT as current running
	    slot ID (enhancement)
    6f52fd9 zephyr: fix initialization of file struct (bug fix)

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-09 14:15:49 +01:00
Emil Gydesen
a264efbcbc Bluetooth: host: Initial support for BIS
Added initial support for BIS (broadcast ISO stream), which
adds support for creating BISes as both broadcaster and receiver,
as well as managing and creating BIGs.

Extends PA sync to handle BIGInfo adveritising reports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-09 08:06:02 -05:00
Emil Gydesen
3fbff9ab77 Bluetooth: shell: Adds BT_INTERVAL_TO_MS macro
Added a simple macro for the BT shell that transforms the
interval unit (N * 1.25ms) to ms.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-09 08:06:02 -05:00
Dominik Ermel
df11f2bee6 tests/subsys/dfu/mcuboot: Fix coverity issue on not checked return val
The commit fixes coverity issue where return status bank erase operation
has not been checked prior to proceeding with tests.

Fixes: #32924, Coverity-CID: 219522

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-09 08:05:27 -05:00
Jan Van Winkel
4db2ecae2e tests: ztest: Added return data test case
Added test case to test ztest_return_data and ztest_copy_return_data.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2021-03-09 07:09:13 -05:00
Jan Van Winkel
4a9a49a185 ztest: Added support to return data via mock
Added support to mock framework to return data via function parameters

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2021-03-09 07:09:13 -05:00
Pete Skeggs
cb5ca42a0e debug: coredump: improve delayed logging
If CONFIG_LOG_IMMEDIATE=n, go to panic mode with LOG_PANIC() so full
coredump is logged.

Add missing log_strdup() call.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2021-03-09 07:04:56 -05:00
Wolfgang Puffitsch
4a01446a72 cmake: modules: Remove duplicates only from existing ZEPHYR_MODULE_NAMES
Remove duplicates from ZEPHYR_MODULE_NAMES only if that list
exists. That avoids cmake error "list sub-command REMOVE_DUPLICATES
requires list to be present" if ZEPHYR_MODULE_NAMES is empty.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2021-03-09 07:04:09 -05:00
Ying ming
fcad2b37e3 test: fatal exception: Add code description and testcases
Improve the test case of CPU exception.
Add equivalence classes and input partition testing
when give an integer reason code.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2021-03-09 12:33:51 +01:00
Guðni Már Gilbert
6c3674cd4a samples: net: mdns_responder: Fix coverity resource leak issue
Avoid resource leak by closing socket when there is an error.

Coverity-CID: 215381
Fixes #33094

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-09 13:10:48 +02:00
Guðni Már Gilbert
7713d347a2 samples: net: mdns_responder: Fix coverity issue
Check return value if sendto() fails.

Coverity-CID: 215391
Fixes #33093

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-09 13:10:48 +02:00
Jian Kang
e169015c6e tests: crypto: Add a unnormal testing condition
For z_early_boot_rand_get(), give a length less than uint32 to be input
value, ensure the API can work normally with error condition to improve
code coverage.

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2021-03-09 05:10:54 -05:00
Ruth Fuchss
0b55037d63 doc: direction_finding: fix space in file link
The line break inside the :zephyr_file: directive causes a space
to be inserted into the link to the file, which means the link
does not work.

Signed-off-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2021-03-09 04:54:46 -05:00
Jukka Rissanen
2ce87533aa net: tcp: Implement ISN calculation according to RFC6528
Calculate Initial Sequence Number (ISN) as described in RFC 6528
https://tools.ietf.org/html/rfc6528

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-09 04:54:14 -05:00
Kumar Gala
b9ed2d33fd drivers: spi: Remove unused Kconfig symbols
Remove SPI_[0-8] and SPI_[0-8]_OP_MODES Kconfig symbols as no driver
uses them anymore.  We also cleanup board and sample code to remove
use of these symbols.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-09 04:53:46 -05:00
Carlo Caione
8388794c9b aarch64: Rename z_arm64_get_cpu_id macro
z_arm64_* prefix should not be used for macros. Rename it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-09 04:52:40 -05:00
Carlo Caione
bdbe33b795 aarch64: Rework {inc,dec}_nest_counter
There are several issues with the current implemenation of the
{inc,dec}_nest_counter macros.

The first problem is that it's internally using a call to a misplaced
function called z_arm64_curr_cpu() (for some unknown reason hosted in
irq_manage.c) that could potentially clobber the caller-saved registers
without any notice to the user of the macro.

The second problem is that being a macro the clobbered registers should
be specified at the calling site, this is not possible given the current
implementation.

To fix these issues and make the call quicker, this patch rewrites the
code in assembly leveraging the availability of the _curr_cpu array. It
now clobbers only two registers passed from the calling site.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-03-09 04:52:40 -05:00
Peter Bigot
6a81a99724 Bluetooth: controller: update k_work_pending to new API
k_work_pending is now called k_work_is_pending.

These two uses are correct assuming the functions that invoke them are
not involved in race conditions: that the work is not pending is an
allowed condition for modifying state that will be used by the work
handler.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-09 04:52:23 -05:00
Mulin Chao
97db5d74c7 driver: espi: npcx: fix out-of-bounds read in espi_vw_generic_isr.
Fix out-of-bounds read in espi_vw_generic_isr func.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2021-03-09 04:51:50 -05:00
Krzysztof Chruscinski
b82a662866 samples: logging: logger: Explicitly enable deferred mode
Some boards prefers immediate mode (native_posix) but this sample is
intended to use deferred mode. Add explicit setting.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-09 08:58:02 +01:00
Raveendra Padasalagi
2acec93ba6 boards: arm: bcm958402m2_m7: Enable PAXDMA driver
Add DMA and DMA_IPROC_PAX_V2 config to enable PAXDMA driver.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
2021-03-08 20:24:04 -06:00
Raveendra Padasalagi
7169207f8e boards: arm: bcm958402m2_a72: Enable PAXDMA driver
Add DMA_IPROC_PAX_V2 config to enable PAXDMA driver.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
2021-03-08 20:24:04 -06:00
Raveendra Padasalagi
772c3620a0 dts: arm: broadcom: viper-a72: paxdma: Add interrupt property
Add interrupt parent and number property specific to a72
viper platform.

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
2021-03-08 20:24:04 -06:00
Raveendra Padasalagi
b1687ce9da dts: arm: broadcom: viper: rename paxdma label
To keep the generic DMA device name as defined
in the dma framework config, renamed paxdma device
label to "DMA_1".

Signed-off-by: Raveendra Padasalagi <raveendra.padasalagi@broadcom.com>
2021-03-08 20:24:04 -06:00
James Harris
33c9be90cc kernel: fix TOCTTOU issue in k_thread_name_set
Previously, a racing write to the provided string could result
in up to CONFIG_THREAD_MAX_NAME_LEN-2 bytes after the end
of user-accessible memory being leaked into the thread name.

For now, make a temporary copy. In an ideal world this could
copy directly from userspace into the thread name, but that
violates the current vrfy / impl split.

Signed-off-by: James Harris <james.harris@intel.com>
2021-03-08 19:27:23 -05:00
Andy Ross
6f82ebe2e8 tests/kernel/workq/work: KERNEL_COHERENCE fixups
Putting IPC elements on the stack isn't allowed when KERNEL_COHERENCE
is set, just make test case data static (not all apps or subsystems
are going to work with incoherent stacks, but we should support it
where we can).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
0fd9e4bf68 soc/intel_adsp_cavs15: Enable all twister tests
Take out the only_tags limitation.  This platform is mature now and
should run everything.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
3d81464194 tests: samples: Add targetted platform_excludes for intel_adsp_cavs15
This platform has a tiny handful of remaining tests that fail.  We
will track them as issues, but let's exclude them from integration
testing to allow full runs to complete.  Often a hung device in one
test will break an entire twister run.

Tests with known (and tracked) failures:

  samples/application_development/external_lib
  samples/posix/eventfd
  samples/userspace/hello_world_user
  tests/kernel/fatal/message_capture
  tests/net/socket/socketpair
  tests/portability/cmsis_rtos_v2

These tests never fail in isolated testing, but are reliable timeouts
when run in sequence in a big twister run.  It's possible that the bug
here may be in twister or the flash/serial scripts:

  tests/crypto/tinycrypt
  tests/subsys/logging/log_immediate
  tests/subsys/logging/log_output

See: #32836

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
589c781506 tests: No thread-shared/synchronized data on stack (coherence)
CONFIG_KERNEL_COHERENCE forbids synchronized data on the stack: no
spinlocks, IPC primitives, or things that contain them.  Application
code obviously doesn't have to follow these inconvenient rules, but
our test code needs to run on platforms with incoherent stack memory.

Make these things static.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
f5267d9ff2 soc/intel_adsp: Honor CONFIG_KERNEL_BINARY_NAME
Turns out that the user can configure the "zephyr.elf" name via
kconfig to be "something_else.elf" instead.  And there's a test the
does this.  Use the right variable; don't hardcode.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
ebd0e9f605 soc/intel_adsp: Remove LOG_PRINTK
This was added early when we had (somewhat oddly) a log subsystem
backend but not a printk char_out hook. Now we have one backend that
works with both.  No need, and this fixes build errors with a handful
of tests that specify LOG_MINIMAL (LOG_PRINTK requires the full log
subsystem and doesn't work with MINIMAL).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
881c800736 samples/posix/gettimeofday: Filter out INTEL_ADSP
This platform has a newlib which is inexplicably missing a
_gettimeofday_r symbol.  Just filter the test there.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
376e1310f6 soc/intel_adsp_cavs15: Unbreak newlib linkage
In commit efa05d1e42da ("soc/intel_adsp: Put initial stack into the
CPU0 interrupt stack") the "_end" symbol was accidentally removed from
the linker script.  Newlib needs this to size its heap.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
6fe9e408ab tests/cbprintf_fp: Filter on CONSOLE_HAS_DRIVER
Many platforms don't have a console backend, and this fails with a
kconfig warning if you try to build on them.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Kumar Gala
85aec4121b soc: atmel_sam0: Remove unused DMA macro
All users of ATMEL_SAM0_DT_INST_DMA_NAME are now using
ATMEL_SAM0_DT_INST_DMA_CTLR so we can remove the macro.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Kumar Gala
0f0308c197 drivers: spi: sam0: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Kumar Gala
c2f7382007 drivers: uart: sam0: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Kumar Gala
d7da73f432 drivers: i2c: sam0: Convert dma to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the dma controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Kumar Gala
5c904c9f5b soc: atmel_sam0: Introduce DMA CTLR macro
Add a macro similar to ATMEL_SAM0_DT_INST_DMA_NAME but instead
provides the devicetree node back via DT_INST_DMAS_CTLR_BY_NAME

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-08 18:22:27 -06:00
Erwan Gouriou
79ea590bef soc: nrf: Enable default DWT null pointer exception detection
Default null pointer exception detection to the DWT solution
instead of MPU based solution.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-08 19:19:14 -05:00
Erwan Gouriou
19314514e6 arch/arm: cortex_m: Disable DWT based null-pointer exception detection
Null-pointer exception detection using DWT is currently incompatible
with current openocd runner default implementation that leaves debug
mode on by default.
As a consequence, on all targets that use openocd runner, null-pointer
exception detection using DWT will generated an assert.
As a consequence, all tests are failing on such platforms.

Disable this until openocd behavior is fixed (#32984) and enable
the MPU based solution for now.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-08 19:19:14 -05:00
Andy Ross
afbc044322 tests/kernel/thread_apis: Fix timing order
This test understood that it can't demand equality in timing because
of races against real time, so it simply validated that the test
started at or later than the expected timeout expiration.

But when calculating the expected time, it called k_uptime_ticks()
AFTER the timeout was registered.  So on systems with fast ticks (or
just bad luck) a tick expiring between the two steps will look like an
"early" expiration and fail the test.  Do things in the proper order.

Also, use the correct APIs for unit conversion and timeout
construction.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 18:15:53 -05:00
Trond Einar Snekvik
dc6e880eab Bluetooth: Mesh: Remove unsigned typing to returns in heartbeat
Removes U-suffix from signed return codes in heartbeat.c.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Trond Einar Snekvik
f9d41595a3 Bluetooth: Mesh: Explicitly ignore gatt_service_register return code
The error code from gatt_service_register is being ignored to ensure
that repeated actions still complete. Do this explicitly by adding
(void) casts, resolving coverity warnings on accidental error code
ignores.

Fixes #33051.
Fixes #33074.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Trond Einar Snekvik
aef354c6bc Bluetooth: Mesh: Resolve dead code in store_seg
If CONFIG_BT_MESH_SEQ_STORE_RATE is 1, the check in store_seq can be
reduced to a simple if (false), and the modulo code does not need to be
included in the build.

Fixes #33036.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Trond Einar Snekvik
bba2d7b84b Bluetooth: Mesh: Check model publish pointer before dereferencing
Moves the if !(pub) check to happen before it gets used in the
initialization of the message context in bt_mesh_model_publish.

Fixes #5116.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Trond Einar Snekvik
7039675df1 Bluetooth: Mesh: Only do label lookup when there are labels
Include virtual label's pending_store function in the LABEL_COUNT > 0
compile guard to avoid including dead iteration code in the compilation.

Fixes #32928.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Trond Einar Snekvik
8309353b7f Bluetooth: Mesh: Check subnet existence in heartbeat_send
Check that the assigned subnet hasn't been removed in heartbeat_send to
avoid potential NULL defererence in transport's ctl_send.

Fixes #32907.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-08 16:18:10 -05:00
Anas Nashif
65ac2f6d1b cmake: remove TOOLCHAIN_INCLUDES
This seems to be orphaned and not being used anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-08 16:04:28 -05:00
Anas Nashif
90eaa9ee5c intel_adsp: simplify bootloader cmake file
Checking for existence if cmake files here is not needed and was used
with out of tree boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-08 16:04:28 -05:00