Commit graph

81409 commits

Author SHA1 Message Date
Guillaume Gautier c9461ca783 drivers: clock_control: add support for stm32 hsi14 clock
Add support of the dedicated STM32F0 14 MHz HSI clock for ADC.
Also remove ADC clock source selection as it is obsolete.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-07-18 11:10:17 +00:00
Emil Gydesen a2ceded56f Bluetooth: ASCS: Update ISO QOS based on BAP QOS
When a CIS is established for the peripheral, then not all
QOS values are completely valid as they are simply missing
from the CIS established event. This commit updates the
missing fields based on the QOS settings provided by the
BAP Unicast Client during QoS Configuration of the endpoint.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-18 11:09:51 +00:00
Silviu Petria f3aaf33422 Bluetooth: Audio: Add TMAP broadcast samples
Add two TMAP broadcast sample applications.

tmap_bms implements the Broadcast Media Sender role. It uses CAP
Initiator broadcast APIs to broadcast an audio stream.

tmap_bmr implements the Broadcast Media Receiver role. It scans and
syncs to the PA having filtered the EA by the presence of TMAP role
information. It also instantiates the VCP.

Signed-off-by: Silviu Petria <silviu.petria@nxp.com>
2023-07-18 11:09:31 +00:00
Tristan Honscheid 613c32b03f tests: Clean up sensor driver build_all test
This PR performs a few cleanup actions for the build-all sensor driver
test:

  1. Remove many non-sensors from the test's device tree, including
     wireless radios, LED strips, flash memory, and displays. These
     devices don't belong in this test and in most cases were not being
     compiled anyways due to missing config flags and not being
     status-okay.
  2. For the remaining devices, enable them in the device tree so the
     sensors build and get instantiated. A handful of device nodes that
     caused linker errors due to the driver not instantiating are left
     disabled.
  3. Convert the test I2C and SPI buses into emulated buses to support
     upcoming live testing over these sensor devices.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-18 11:09:08 +00:00
Tristan Honscheid f119d5341a drivers: fdc2x1x: Fix compilation error
When CONFIG_PM_DEVICE is enabled, the FDC2x1x driver includes code that
doesn't access the name of the shutdown pin's GPIO port correctly.
Correct this so the code derefences the right struct members.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-18 11:09:08 +00:00
Tristan Honscheid 4ac8000bf2 drivers: fdc2x1x: Loosen newlib dependency
The FDC2X1X driver depends on newlib in Kconfig. This prevents the
driver from being built in a native_posix testing environment, which uses
an external libc from the host. Allow the driver to be built with an
external libc as well.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-18 11:09:08 +00:00
Tristan Honscheid ce3d0af183 emul: Don't panic if matching emul can't be found
When initializing emulators for devices registered on an emulated bus,
Zephyr will assert if a matching emulator for the device cannot be
found. This feels overly restrictive --there may be cases where we still
want to build a driver for testing even without an emulator and drivers
should be able to handle situations where there is no device emulator
present (the I2C/SPI transactions will simply fail and the driver never
becomes ready).

This commit removes the assert and replaces it with an warning message if
no matching emulator is found.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-18 11:09:08 +00:00
Chaitanya Tata 631312334e samples: lwm2m: Fix default ID length check for DTLS
If the default which is set to CONFIG_BOARD is used, then the lwm2m
client fails to set the client identity as the default maximum length
allowed is only 16 and for some boards this exceeds.

So, increase the default length to accomodate almost all boards. Also
add a build assert for the length validation.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2023-07-18 11:08:23 +00:00
Benedikt Schmidt a5f8c775d7 debug: add missing include to thread_analyzer
Including thread_analyzer.h implicitly requires a previous include of
thread.h. This adds this include directly to thread_analyzer to remove
this implicit dependency.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-07-18 11:07:54 +00:00
Mariusz Skamra c09c4181cf Bluetooth: audio: tbs_client: Minor Kconfig refactor
This intoduces dedicated Kconfig option to enable TBS client,
that makes the configuration more intuitive.
While configuring GTBS only, the user does not have to explicitly set
the BT_TBS_CLIENT_MAX_TBS_INSTANCES to 0 to disable the TBS client
functionality.
This adds also `tbs_only_client` test case to test the TBS only build
option.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:06:57 +00:00
Mariusz Skamra 650a0d8331 Bluetooth: audio: tbs_client: Separate GTBS from TBS instances
This improves the code readability and reduces flash usage a bit by
spliting up GTBS from other TBS instances in bt_tbs_server_inst
structure, so that some of the code could be conditionally compiled
out.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:06:57 +00:00
Bartosz Bilas e11cc216b1 tests: lib: json: add extra nested array 2dim tests
Add tests with extra JSON fields with 2dim array.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2023-07-18 11:06:39 +00:00
Wojciech Sipak 6fe016984c boards: efm32pg_stk3402a: use gecko-adc
This adds a proper ADC node that uses the gecko-adc driver.

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-18 11:05:39 +00:00
Wojciech Sipak c811a4f430 drivers: adc: add ADC driver for EFM32
This adds a driver for ADCs available on EFM32

Signed-off-by: Wojciech Sipak <wsipak@antmicro.com>
2023-07-18 11:05:39 +00:00
Kim Bøndergaard b3c46083fb drivers: rtc: stm32: New stm32 RTC driver
STM32 RTC driver for the new RTC API.
Can't coexist with old COUNTER based RTC

Though supported by HW, RTC_ALARM still to be supported by driver

Signed-off-by: Kim Bøndergaard <kim.bondergaard@prevas.dk>
2023-07-18 11:05:23 +00:00
Kim Bøndergaard 6775b263f3 drivers: counter: stm32_rtc: Make dependent of !RTC
New RTC API seems to conflict with old RTC implementations based on
COUNTER

This scheme follows Zephyrproject-rtos issue 56599 while keeping backward
compatibility.

Signed-off-by: Kim Bøndergaard <kim.bondergaard@prevas.dk>
2023-07-18 11:05:23 +00:00
Mariusz Skamra 9fa4543994 Bluetooth: audio: ascs: Defer ASE state transition
This adds handling of ASE control point operations in separate thread
so that the notifications of ASE state changes are sent from non-BT
thread. This ensures bt_gatt_notify_cb to be blocking waiting for
available buffers to send the notifications.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:05:03 +00:00
Mariusz Skamra 03d296d546 Bluetooth: audio: ascs: Remove unused variable
The `ops` variable is unused, thus can be removed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-07-18 11:05:03 +00:00
Carlo Caione 1fcb929108 ipc_service: open-amp: Add __ASSERTs on cache alignment
Add some asserts to warn the user about unaligned VDEV status area,
VRINGs and buffers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-07-18 11:04:46 +00:00
Carlo Caione 9752cbe045 ipc_service: open-amp: Align VRINGs
This patchset is doing three things:

1. It is fixing the bogus algorithm to find the optimal number of
   descriptors for a given memory size.

2. It is changing values for VDEV_STATUS_SIZE and
   IPC_SERVICE_STATIC_VRINGS_ALIGNMENT to better align to a usual cache
   line size.

3. RX/TX VRINGs are now correctly aligned to MEM_ALIGNMENT (and cache
   line alignment).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2023-07-18 11:04:46 +00:00
Emil Gydesen bdd83e7239 Bluetooth: CAP: Shell: Add support for specific audio configs
Add CAP shell commands for starting specific audio configurations
based on the BAP specification.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-18 11:04:25 +00:00
Emil Gydesen b140b70a17 tests: CAP: Add testing of all audio configs
Add test cases to test all audio configurations with
all presets.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-18 11:04:03 +00:00
Markus Fuchs 84df635384 tests: lib: json: Add tests for parsing inputs with extra fields
Add tests for both extra objects and extra arrays nested in JSON objects.
Fields in extra nested objects should be ignored and also not manipulate
subsequent fields with the same name.

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2023-07-18 11:03:21 +00:00
Markus Fuchs c0d7218ef2 json: Skip unknown fields on parsing
Skip child objects and arrays that are not specified in the given object
descriptor when parsing a JSON input string.
This patch adds support for extra child arrays which previously were not
supported by the parser as opposed to additional child objects.

Fixes #47988

Signed-off-by: Markus Fuchs <markus.fuchs@ch.sauter-bc.com>
2023-07-18 11:03:21 +00:00
Fabio Baltieri 15a2cb5a2f drivers: intel: ssp: delay initialization after dma
The SSP driver depends on DMA as there are references in the devicetree,
but it currently initialize before the DMA driver itself. This is
exposed by the build time priority checking
(CONFIG_CHECK_INIT_PRIORITIES=y) and shows up as:

ERROR: /soc/ssp@77a00 POST_KERNEL 32 < /soc/dma@7c000 POST_KERNEL 40
ERROR: /soc/ssp@77800 POST_KERNEL 32 < /soc/dma@7c000 POST_KERNEL 40
ERROR: /soc/ssp@77600 POST_KERNEL 32 < /soc/dma@7c000 POST_KERNEL 40
...

Bumping up the SSP priority so the initialization is in sync with the
devicetree node hirearchy.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-18 10:45:37 +00:00
Simon Guinot 8b5ebc010b dts: bindings: pwm-leds: add description for pwms property
This patch adds a description section for the pwms property of the PWM
LED child node. This intends to explain how the period field is used by
the led_pwm driver and to help with its configuration.

Reported-by: Scott Worley <scott.worley@microchip.com>
Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2023-07-18 10:45:05 +00:00
Simon Guinot a4645908ee drivers: led_pwm: fix overflow in set_brightness
The set_brightness function of the led_pwm driver uses a default PWM
period (defined in the pwms DT property) to compute a pulse passed to
the pwm_set_pulse_dt function. If this default period is greater than
2^32/100 nanoseconds (about 43 milliseconds) then the calculation may
overflow.

This patch prevents this overflow by running the pulse computation under
a cast with a larger type (uint64_t).

Reported-by: Scott Worley <scott.worley@microchip.com>
Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2023-07-18 10:45:05 +00:00
Benjamin Cabé 64ec7e18c8 fs: nvs: doc: fix Doxygen comments
Properly document nvs_fs struct

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-18 06:41:43 -04:00
Erwan Gouriou 97ed2b9c88 west.yml: hal stm32: Update STM32Cube packages
Update STM32Cube packages:

update stm32c0 to cube version V1.1.0
update stm32f2 to cube version V1.9.4
update stm32h5 to cube version V1.1.0
update stm32l1 to cube version V1.10.4
update stm32u5 to cube version V1.3.0
update stm32wb to cube version V1.17.0
update stm32wba to cube version V1.1.0

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-07-18 09:56:24 +00:00
Armando Visconti a29261c5f4 drivers/sensor: check xyz_mem_bank_set() ret value
Check xyz_mem_bank_set() API return value to catch and report as soon
as possible the error condition. Impacted stmemsc API:

  - lsm6dso_mem_bank_set()
  - lsm6dso16is_mem_bank_set()
  - lsm6dsv16x_mem_bank_set()

Fix:

  Coverity-CID: 316212 (issue #58579)
  Coverity-CID: 316224 (issue #58580)
  Coverity-CID: 316307 (issue #58586)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-07-18 09:54:44 +00:00
Raoul Rubien 6f74f53efc drivers: sensors: ilps22qs: added item in kconfig
The ILPS22QS sensor cannot be enabled unless USE_STDC_ILPS22QS is defined.
This PR fixes #57825 add adds the missing item in Kconfig.st file.

Signed-off-by: Raoul Rubien <rubienr@sbox.tugraz.at>
2023-07-18 09:53:40 +00:00
Anas Nashif e7acd7199e MAINTAINERS: fix path for native_simulator
Fix syntax of path for native_simulator.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-07-18 09:32:20 +02:00
Kyra Lengfeld c607179cc4 Bluetooth: Controller: Add missing nRF53x Tx Power Kconfig
This commit adds missing tx power config options for nRF53x SoCs, as
well as the missing Radio defines for nRF53x SoCs.

Signed-off-by: Kyra Lengfeld <kyra.lengfeld@nordicsemi.no>
2023-07-17 21:41:08 +00:00
Robert Lubos 87ee12ae72 samples: net: echo_client: Fix build with UDP disabled
In case UDP is disabled, init_udp() is not compiled and the build
fails. Fix this, by providing dummy implementations for UDP functions,
in case UDP is disabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Robert Lubos 1f1f550ad6 samples: net: echo_client/server: Fix mbed TLS dependency
All application level TLS operations should be guarded with
"#if defined(CONFIG_NET_SOCKETS_SOCKOPT_TLS)" and not mbed TLS configs
only. Otherwise, in case mbed TLS is enabled, but the sample is not
configured to use TLS (hence TLS credential library is not available
for example), the build may fail or produce spurious warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-07-17 17:21:33 -04:00
Flavio Ceolin 2b1106a407 kernel: userspace: Use only list for dynamic objs
Since the rbtree is using as list because we no longer
can assume that the object pointer is the address of the
data field in the dynamic object struct, lets just use
the already existent dlist for tracking dynamic kernel
objects.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Flavio Ceolin 4feb182f12 kernel: dynamic: Fix stack allocation logic
Fix the preference allocation logic. If pool is preferred but POOL_SIZE
is 0 or pool allocation fails, it fallbacks to heap allocation if it
is enabled.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Flavio Ceolin 3b7e0b672e kernel: userspace: Dynamic thread stack object
Add support for dynamic thread stack objects. A new container
for this kernel object was added to avoid its alignment constraint
to all dynamic objects.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Flavio Ceolin fc6d9eeb3e kernel: dynamic: Support usermode thread stack
Allocate kernel object for userspace thread stack.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Flavio Ceolin 67e66e4807 kernel: userspace: Add k_object_alloc_size
Add a new API to dynamically allocate kernel objects that allow
passing an arbitrary size. This new API allows to allocate dynamic
thread stack.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Flavio Ceolin d58c9a1ca4 tests: kernel: threads: stack: Enable USERSPACE
Test that automatic thread stack allocation works for
both user and kernel threads.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-17 16:56:01 -04:00
Nerijus Bendžiūnas 397ed142ad doc: fix :zephyr-app: paths
During testing I've found one bad path and looked if
there is more.

I've used this oneliner to find more:

```
rg :zephyr-app: | awk '{ print $3 }' | while read dir
do
    test -d $dir || echo $dir
done | grep '^samples' | grep -v '<' | sort | uniq

```

Signed-off-by: Nerijus Bendžiūnas <nerijus.bendziunas@gmail.com>
2023-07-17 16:51:16 -04:00
Daniel Leung e55fb88bcb soc: intel_adsp/ace: update clock rate
The clock rates for ACE series of Intel Audio DSP have changed.
The values come from the SOF project in their board configs.

CONFIG_XTENSA_CCOUNT_HZ is also set so the arch timing test
can pass.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-07-17 16:27:08 -04:00
Grzegorz Chwierut 57c27cd736 twister: pytest: Added fixture for mcumgr with unittests
Added mcumgr fixture to pytest-twister-harness. Added unittests for
new fixture.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2023-07-17 16:23:59 -04:00
Dmitrii Golovanov 7afeefd7dd twister: Fix flashing timeout command line options check
Fix `--device-flash-with-test` command line options check logic
to be effective with `--device-testing`.

Remove `--device-flash-timeout` check for `--device-testing`
presence as marginal.

Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
2023-07-17 15:57:03 -04:00
Andrei Emeltchenko 39928ae4a7 tests: smbus: Rename smbus api test
Rename test to drivers.smbus.api.access.io to indicate access type.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-07-17 15:13:38 -04:00
Andrei Emeltchenko 20a7552868 boards: qemu_x86_64: Add smbus to supported list
Add smbus to supported list to run tests on qemu_x86_64 Q35 which
supports ICH SMBus controller.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-07-17 15:13:38 -04:00
Andrei Emeltchenko f41dffd735 tests: smbus: Use depends_on instead of platform_allow
Using depends_on instead of platform_allow helps to add new boards and
makes test description more clean.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-07-17 15:13:38 -04:00
Benjamin Cabé c544926b37 gpio: doc: fix Doxygen doc
A couple of trivial Doxygen fixes.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-17 14:56:29 -04:00
Randy Palamar 0683060dc0 boards: arm: seeeduino_xiao: support onboard DAC
this allows you to use the onboard DAC on the Seeed Xiao

Signed-off-by: Randy Palamar <palamar@ualberta.ca>
2023-07-17 13:43:53 -05:00