Commit graph

60009 commits

Author SHA1 Message Date
Daniel Leung
14ac190765 doc: release: 3.0: mention new UART API
This adds a brief mentioning of new UART API to support
datum wider than 8-bit.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-27 05:23:57 -05:00
Daniel Leung
ce238f7acf doc: release: 3.0: add info for Xtensa
This adds a few bullet points in the 3.0 release note
for Xtensa.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-27 05:23:57 -05:00
Daniel Leung
6f3f752607 doc: release: 3.0: make API changes sub-headers visible
() There are two "Changes in this release" so combine them.
() Make "Removed" and "Deprecated" into headers so they appera
   in the TOC on the left.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-27 05:23:57 -05:00
Christian Taedcke
3b271006cb drivers: spi_gecko: fix duplicated variable declaration
The commit 44679c7bd8 introduced this
duplicated declaration of the local variable data.

This commit fixes this issue.

Fixes #42117

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2022-01-27 05:23:18 -05:00
Emil Gydesen
102dcca6a4 Bluetooth: Audio: Add BT_WARN for missing stream callbacks
If any specific stream callback is attempted
to be called but is missing, a BT_WARN log statement
is added.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
9140a8ac46 Bluetooth: shell: Add LE Audio shell commands
Adds audio.c which covers all the LE Audio shell commands.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
e572fc565f Bluetooth: Audio: Add broadcast audio BSIM tests
Add broadcast babblesim test cases that tests basically
functionality. Due to the lack of ISO support in the
controller, this won't actually start any audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
cf06fa85f2 Bluetooth: Audio: Add BAP broadcast sink support
Add support for the BAP broadcast sink role. This role
allows a device to sync to a broadcast ISO stream.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
ab87e0a2ba Bluetooth: Audio: Add BAP broadcast source support
Add the BAP broadcast source implementation. This role
allows a device to broadcast ISO data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
f24d4bcf75 Bluetooth: Samples: Add unicast audio client and server samples
Adds Basic Audio Profile (BAP) unicast server and client samples.

These are the barebones versions of what is needed to scan/advertise
for audio and setup a stream using the mandatory LC3 preset defined by
the BAP spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
5b25c33554 Bluetooth: Audio: Add BAP unicast audio BSIM tests
Add initial babblesim tests for unicast audio.
Due to lack of ISO support in the babblesim, these
won't attempt to actual initate audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
59bafc430f Bluetooth: Audio: Add BAP unicast client support
Add the BAP unicast client implementation. This role
can discover BAP unicast server services and initiate
BAP audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
03862b3db5 Bluetooth: Audio: Add BAP unicast server support
Add the Basic Audio Profile (BAP) unicast server
functionality. This allows a device to act as the
unicast server role, which can accept unicast streams
initiated by a unicast client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
5de473782e Bluetooth: Tests: Fix ctrl iso audio dependency
Change the dependency from BT_AUDIO to ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Krzysztof Chruscinski
c5989c21aa tests: logging: log_api: Add test for LOG_PRINTK
Added test that validates CONFIG_LOG_PRINTK option where
printk is redirected to logging.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
9302a0119f tests: logging: log_api: Test refactoring
Refactored test to make it more flexible and prepare
for case when logging thread is enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
157c48e4eb logging: log_output: Fix immediate output for big endian
Pointer to int was passed to a function which expected pointer to
uint8_t. There was an unexpected content for big endian as the
highest byte was read instead of the lowest which contained valid char.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
a40ca6fd1c logging: printk: Fix LOG_PRINTK for v2
Fixed a dependency from printk.h to logging headers which in
certain configurations could lead to circular dependencies.
Cleaned up printk.c to call z_log_vprintk from vprintk.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
09fef8e7d2 lib: os: printk: Minor refactoring
Refactoring to remove code redundancy caused by splitted
handling based on USERSPACE enabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
8850954c6d testsuite: ztest: Add logs flushing after suite
Flushing logs here is especially vital if LOG_PRINTK is enabled.
In that case printk goes to log and without flushing after all
tests are run you will not get the final report out.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
b85689ba42 testsuite: tc_util: Flush logs before posix_exit
Flush all logs before terminating test in posix.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Krzysztof Chruscinski
07e0a5f08a tests: logging: log_core_additional: Add panic handler for test backend
Backend implemented in the test did not implemented panic
function and test crashed when log_panic was used.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-27 10:02:21 +01:00
Maciej Perkowski
0c830822ae tests: lib: ring_buffer: Increase timeot
The tests from tests/lib/ringbuffer fails on all nrf platforms due
to a timeout. Increasing the timeout value solves the issue.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-01-26 14:39:12 -05:00
Andy Ross
4c1f1edf21 test/kernel/mbox: Drop needless _1cpu_ from test cases
This test is already running with CONFIG_MP_NUM_CPUS=1.  All those
1cpu declarations are needless.  And some of them (like the init
tests) have side effects that make it difficult to do things like
"filter for only MP cases".

(Indeed, this is a heavily MP-unsafe test; almost all cases written to
rely on ordering between a parent thread and its child.  And that's
doubly so for COHERENE platforms because lots and lots of the test
objects are on stacks.  MP_NUM_CPUS=1 is definitely the right thing
here.)

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-01-26 13:34:45 -05:00
Andy Ross
53c8d61529 tests/kernel/interrupt: Don't wait so long just for a tick
There's no reason to wait a whole second here just to know if a tick
should have fired (though, yes, on some older/legacy/non-tickless
configurations, 128 ticks is actually more than a second).

Some simulators are very slow; busy waiting is expensive.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-01-26 13:34:45 -05:00
Andy Ross
1d5ec4e0eb soc/intel_adsp: Add cAVS IPC register interface
Add an cavs-ipc-regs.h header for the SOC with definitions for the IPC
mechanism used for host communication.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2022-01-26 13:34:45 -05:00
Steve Winslow
e12d9385c6 west: spdx: Fix missing field in build results
When using the west spdx functionality to create an SPDX SBOM
during a build, several SPDX Documents are created. In some
instances, the SPDX metadata field PackageLicenseInfoFromFiles
is required to be present according to the SPDX 2.2 spec, but is
being omitted from the build.spdx Document if no licenses were
detected.

This commit fixes this bug so that a NOASSERTION value is written
for this field for Packages that do not contain any detected
licenses.

Additionally, this ensures that Packages with a FilesAnalyzed
value of false do not have this field written, also in accordance
with the spec.

Fixes #42070

Signed-off-by: Steve Winslow <steve@swinslow.net>
2022-01-26 18:15:33 +01:00
Anas Nashif
670b8af142 cmake: fix path in comment
Use correct path for soc in the comment.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-26 11:43:30 -05:00
Vinayak Kariappa Chettimada
8a5f0b50eb Bluetooth: Controller: Restrict Extended Adv Report to max data length
Add implementation to limit Extended Scanned data to a
configurable maximum length when generating HCI reports.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-01-26 17:07:32 +01:00
Ederson de Souza
1b99804634 Revert "tests/kernel/obj_tracking: Filter cAVS 2.5 builds to prevent DSP host hangs"
This reverts commit ae8745df6f.

Patch "kernel/init.c: Initialise logging subsystem after arch" should
fix this, so no more need to filter this test out.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-01-26 10:09:19 -05:00
Ederson de Souza
75fd452bc0 kernel/init.c: Initialise logging subsystem after arch
So that logging and "satellite" subsystems, such as tracing and object
tracking can count on kernel structs being properly initialised, such
as `_current_cpu`.

Fixes #42061.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-01-26 10:09:19 -05:00
Martí Bolívar
3543df52cc api: move a devicetree.h layering violation to drivers/spi.h
The DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET macro belongs in drivers/spi.h,
not devicetree.h.

It is creating a struct gpio_dt_spec, but the devicetree.h API does
not (other than in this case) and should not depend on structures that
are defined in the GPIO API. This is because the GPIO API already
depends on the devicetree.h API, so making a dependency in the reverse
direction creates a needless circular dependency.

This macro should have been added to the drivers/spi.h API from the
beginning. Move it there under a new name, SPI_CS_GPIOS_DT_SPEC_GET.

We haven't created a Zephyr release with
DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET in it, so there is no need to go
through the stable API change process for devicetree.h to deprecate
and eventually remove it. We can just remove it directly.

Fixes: #42149
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-01-26 16:08:18 +01:00
Gerard Marull-Paretas
ac245769ab ci: run apt-get update before install
Make sure sources are up-to-date before installing any package. This is
causing failures on some workflows.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-26 08:20:24 -05:00
Emil Gydesen
ed268b734d Bluetooth: Samples: Add controller Kconfig requirement for ISO samples
Add reference to specific CONFIG_BT_CTLR_ Kconfig options
for the ISO samples. This is due to the fact that ISO
isn't fully supported in the Zephyr controller yet, and
won't be enabled by default for a while yet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-26 13:29:45 +01:00
Thomas Ebert Hansen
f10daf7c4a Bluetooth: host: Fix DB hash calculation
When hashing attributes for the UUID cases:
    BT_UUID_GATT_PRIMARY_VAL
    BT_UUID_GATT_SECONDARY_VAL
    BT_UUID_GATT_INCLUDE_VAL
    BT_UUID_GATT_CHRC_VAL
    BT_UUID_GATT_CEP_VAL

where (handle || UUID || value) is to be hashed, the worst case size of
attribute value can be deduced from the associated union that describes
all the attribute values in the given cases.

Update the data array to accommodate for the worst case size.

Fixes #39131

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Thomas Ebert Hansen
5b721ef63b manfiest: update edtt
Update edtt sha to 1fc2e6f7d2a01a01074456f2ef2ccf1f3df7fac1
>> Fix Database Hash value after GATT fix

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Thomas Ebert Hansen
520a5b11c7 tests: Bluetooth: bsim: Fix test names
The LL test for LLCP are using the old non-inclusive names.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Thomas Ebert Hansen
22f8143286 tests: Bluetooth: bsim: Remove unknown tests
Remove unknown tests from the GATT test list.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-01-26 13:10:29 +01:00
Johann Fischer
388001456c usb: bluetooth: check buffer tailroom before copying
If HCI packet length is greater than endpoint MPS or currently
received data block (over USB), next block could be larger
than allocated net_buf buffer.

Check buffer tailroom before copying data using net_buf_add_mem().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-01-26 11:54:31 +01:00
Johann Fischer
0be729de8a bluetooth: hci_raw: avoid possible memory overflow in bt_buf_get_tx()
Function bt_buf_get_tx(), which is used to allocate buffer from
fixed-size pool, does not check size argument before copying
the data with the length size into fixed-size buffer, wich may
not be large enough.

Check immediately before copying if the tailroom of the buffer
is large enough.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-01-26 11:54:31 +01:00
Robert Lubos
df09440926 net: igmp: Update function stubs when module is disabled
Current solution throws an error during build if IGMP module is
disabled (statement with no effect).

Update the stubs in a similar fashion as other network modules implement
them.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-01-26 10:50:24 +01:00
Robert Lubos
e718c8c2dc net: if: Leave all IPv4 mcast groups when interface goes down
In a similar way as its done for IPv6. This allows to rejoin the group
once the interface is up again.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-01-26 10:50:24 +01:00
Robert Lubos
4da1a75a6c net: llmnr: Rejoin IPv4 multicast group when iface is brought up
When network interface is brought up, rejoin the IPv4 multicast group
used by LLMNR service.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-01-26 10:50:24 +01:00
Robert Lubos
6f19b6e59e net: mdns: Rejoin IPv4 multicast group when iface is brought up
When network interface is brought up, rejoin the IPv4 multicast group
used by mDNS service.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-01-26 10:50:24 +01:00
Daniel Leung
2f5976d674 kernel: C++ friendly version of Z_WORK_USER_INITIALIZER
Officially, designated initializers for struct are not valid
until C++20. Strangely enough, XCC only complains about this
particular initializer. So use anonymous struct initializer
instead.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:17:04 -05:00
Daniel Leung
df6e80a097 clock: Z_TIMEOUT_NO_WAIT initializer to {0}
Clang under XCC does not like Z_TIMEOUT_NO_WAIT's initializer
to be simple "{}". So change it to "{0}", which is functionally
the same and XCC-Clang likes it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:17:04 -05:00
Daniel Leung
0e73ffcfe2 cpp: BUILD_ASSERT() uses static_assert() iff C++11
The #if to use static_assert() for BUILD_ASSERT() only checks
whether compiler is in C++ mode, but does not check what
C++ standard is being used. Since static_assert() is only
valid since C++11, for compilers not supporting C++11 (XCC...),
this will result in error. So add the correct #if to also
check for C++ standard being used.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:17:04 -05:00
Daniel Leung
1e16feacda tests: semaphore: fix empty loop error for XCC
When building with XCC, k_therad_access_grant() expands to
a loop but does nothing if no building for userspace. XCC
does not like this and emits error:

  main.s: Assembler messages:
  main.s:4563: Error: invalid empty loop

So add #ifdef to only enable the loop if userspace is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:16:32 -05:00
Daniel Leung
35c1d3615f xtensa: xcc: add a dummy atexit()
Some XCC toolchains do not provide atexit() which results
in undefined reference error. So add a weak dummy atexit()
for this siutation.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:16:32 -05:00
Daniel Leung
b6854d0cbc tests: condvar_api: fix empty loop error for XCC
When building with XCC, the for loop to call k_therad_access_grant()
is an empty loop because k_thread_access_grant() does nothing
if no building for userspace. XCC does not like this and emits
error:

  main.s: Assembler messages:
  main.s:1951: Error: invalid empty loop

So add #ifdef to only enable the loop if userspace is enabled.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-25 21:16:32 -05:00