Commit graph

85282 commits

Author SHA1 Message Date
Håvard Reierstad 3d40d91f86 Bluetooth: mesh: access: Fix model relation register
Added offset to the model relation register for vendor
models to find correct model index
for Composition Data Page 1. The previous implementation used the
'mod_idx' from the 'bt_mesh_model' struct, which led to issues in the
model relation register due to SIG and vender models having the same
model index.
Modified existing functions related to the model relation
register to take in the offset.

Modified macros for determining if a model is a base- or
extending model.

Added check in 'add_items_to_page' to check whether the model relation
is an extension.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-09 15:06:06 +03:00
Håvard Reierstad ea753eb52a Bluetooth: mesh: Change cfg_cli buffer length check
Changed buffer length check in bt_mesh_comp_p1_elem_pull.
The previous threshold would result in the
method not detecting the final element when it consisted of just one
model.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-09 15:06:06 +03:00
Al Semjonovs 955d85aa67 libc: picolibc: Fix picolibc to allow third party CPP
Picolibc dependencies limit ability to use third party minimal
implementations of CPP when enablng PICOLIBC_USE_MODULE.

Signed-off-by: Al Semjonovs <asemjonovs@google.com>
2023-10-09 15:05:39 +03:00
Henrik Brix Andersen 80997cc98f doc: release-notes: add EEPROM release notes for v3.5.0
Add EEPROM related release notes for Zephyr v3.5.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-09 15:02:13 +03:00
Pavel Vasilyev 94bd09b1f8 tests: bluetooth: tester: Fix prov ctx init in PTS tests
This fixes regression introduced in
https://github.com/zephyrproject-rtos/zephyr/pull/63556

In the PR above `bt_mesh_init()` call was moved to `BTP_MESH_INIT`
command to allow to select alternative composition data when starting
the stack. AutoPTS sends `BTP_MESH_CONFIG_PROVISIONING` command
before `BTP_MESH_INIT` to prepare the provisioning context. But
because `bt_mesh_init()` is now called after
`BTP_MESH_CONFIG_PROVISIONING` command is sent, this configuration is
reset to the default which makes PTS tests to fail.

To solve this, this commit calls introduces a new command,
`BTP_MESH_START`, which will replace the original `BTP_MESH_INIT`
command. `bt_mesh_init()` will stay in `BTP_MESH_INIT` while the stack
will be started in `BTP_MESH_START` command.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-09 14:56:58 +03:00
Christopher Friedt 9cd81c1640 doc: release: 3.5: (partial) kernel release notes
Include dynamic thread stack allocation and support for
k_spin_trylock().

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-10-09 06:14:12 -04:00
Christopher Friedt 086dd2e03c doc: release: 3.5: add posix api release notes
Add release notes with  POSIX API updates for v3.5.0.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-10-09 06:08:17 -04:00
Christopher Friedt b0a3736eff doc: posix: add posix timers and clock selection
Update the POSIX API documentation with details on
POSIX_TIMERS and POSIX_CLOCK_SELECTION.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-10-09 06:08:17 -04:00
Fabio Baltieri d53b1a1c0e sensors: default_rtio_sensor: fix build warning
Fix a build warning on 64 bit architectures:

zephyr/drivers/sensor/default_rtio_sensor.c:238:17: error: format '%zu'
expects argument of type 'size_t', but argument 2 has type 'uint32_t'
{aka 'unsigned int'}

num_channels type changed to uint32_t in 96175fcc47.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-09 10:48:55 +01:00
Stephan Linz e7f399f4a3 drivers: can: avoid integer overflow in expression
Change the integer arithmetic to divide first before multiply.

The muliplication of sys_clock_hw_cycles_per_sec() by ten leads
to a really big number on boards with high-speed clocking, thus
to the overflow warning, and to errors for integration tests.

Fixes: #63678

Signed-off-by: Stephan Linz <linz@li-pro.net>
2023-10-09 10:39:43 +01:00
Brett Witherspoon f8e812aa3f dts: arm: st: u5: correct lptim2 clock enable bit
The LPTIM2 clock enable is bit 5 of RCC APB1 clock enable register 2
(RM0456 Rev 4 11.8.34).

Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
2023-10-09 10:17:07 +02:00
Flavio Ceolin 29f6ea431d doc: vuln: Add information about CVE-2023-3725
Information about CVE-2023-3725

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:53 +02:00
Flavio Ceolin 49e811bb2d doc: release: 3.5: Add info about CVE-2023-3725
Add CVE-2023-3725 info to release notes.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:53 +02:00
Peter Mitsis d66cf91706 doc: Add missing threads references to object cores
Two references to the integration of object cores with threads were
missing from the documentation. This fixes that.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-10-09 10:16:46 +02:00
Flavio Ceolin 39068456c4 entropy: sam: Remove unused parameter
Do not propagate unused parameter. ISR callback is already handling
the given flags, there is not need to propagate it through internal
calls.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Flavio Ceolin 78af988546 entropy: sam: Fix get_entropy() behavior
entropy_get_entropy blocks if required to generate the necessary
random data.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Flavio Ceolin 1dcaf4637e entropy: fake_entropy: Fix return value in isr callback
get_entropy_isr() has to return the number of bytes copied or
a negative value in case of error.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Flavio Ceolin 58b0c8f4b7 entropy: neorv32: Return ENODATA on error
Return -ENODATA in neorv32_trng_get_entropy_isr when
there is no data available. This is consistent with other
drivers.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Flavio Ceolin 5133ac8af4 entropy: b91_trng: Fix callback return
get_entropy_isr() has to return the number of bytes copied or a negative
value for error. Since this driver is assuming that it will always
(????) get the number of requested bytes, change the function to return it
instead of 0.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Flavio Ceolin ff074551b0 entropy: gecko_se: Remove unnecessary callback
get_entropy_isr is not implemented, just remove it and let the
driver interface handle it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-09 10:16:19 +02:00
Jeroen van Dooren fe8d30dd42 net: ip: tcp: Fix kernel crash on idle thread
Fixing kernel crash caused by memory release
while having a scheduled work item pending.

Signed-off-by: Jeroen van Dooren <jeroen.van.dooren@nobleo.nl>
2023-10-09 10:16:05 +02:00
Daniel Leung c91a572b0e i3c: some doxygen API doc polishing
This polishes the doxygen doc on I3C API to make it,
hopefully, more usable. Fixed some typos too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-09 10:15:49 +02:00
Daniel Leung 2c2d53c7e5 kernel: remove deprecate wording on arch_kernel_init()
The wording on deprecating arch_kernel_init() in favor of prep_c()
has never been materialized. Various architectures are using it to
perform initialization. So remove the wording.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-09 10:15:49 +02:00
Daniel Leung edfbc2d7dc kernel: userspace: fix and clean up doxygen
This fixes and cleans up the doxygen doc for architecture
specific userspace APIs.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-09 10:15:49 +02:00
Daniel Leung dd6a7eb77d kernel: demand_paging: add doc to enum arch_page_location
This adds doc to enum arch_page_location.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-09 10:15:49 +02:00
Daniel Leung 77dc74136c kernel: tls: fix doc on arch_tls_stack_setup()
There was a typo there so fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-09 10:15:49 +02:00
Kai Meinhard 06f35916e1 i2c: silabs: Fix I2C target crash on long ISR execution
Long I2C target callback functions could lead to an unresponsive
I2C peripheral. This commit ports the official ISR implementation
from Silicon labs to Zephyr:
https://github.com/SiliconLabs/peripheral_examples/blob/master/series2/i2c/i2c_follower/src/main.c

Signed-off-by: Kai Meinhard <meinhard@gessler.de>
2023-10-09 10:15:37 +02:00
Dennis Grijalva b122685eff bluetooth: conn: Fix compiler warning
When compiling conn.c using arm-none-eabi-gcc version 11.3.1 20220712
with the -Wmaybe-uninitialized flag a warning is emitted due to
pending_no_cb not being initialized. I'm not sure if initializing it to
NULL is the "correct" fix, but it's certainly not any worse then it being
uninitialized, and it fixes the warning.

Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
2023-10-08 18:17:22 +03:00
Daniel DeGrasse a6adaedd51 drivers: i2s: mcux_sai: fix PCM data format and respect CLK format
This commit fixes the following issues with the PCM data format output
by the MCUX SAI driver:

- WS signal should be only one clock cycle in length for short PCM
  format
- Word count should not be fixed to 2, except for classic I2S format
- BCLK polarity should be on falling edge for PCM long and short format

Additionally, the I2S_FMT_CLK_ constants now flip the frame and bit
clock polarity from the normal value expected for the selected I2S
format, as expected by the API.

Fixes #63041

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-08 11:25:24 +01:00
Daniel DeGrasse b12813468a boards: arm: lpcxpresso: update core clock documentation
Update documentation for core clock frequency on LPC55xxx boards, to
indicate that they are clocked from PLL1 at 150MHz by default. Add a
note about the reduction to 96MHz required when using the flash
controller.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-08 11:25:02 +01:00
Daniel DeGrasse faf5593272 soc: arm: nxp_lpc: Only clock core from PLL1 when CONFIG_FLASH=n
Do not clock the LPC55xxx cores from PLL1 when CONFIG_FLASH is set. This
is required due to the following limitation of the flash controller
(documented in the reference manual):

Flash operations (erase, blank check, program) and reading a single word
can only be performed for CPU frequencies of up to 100 MHz. These
operations cannot be performed for frequencies above 100 MHz.

The PLL1 clock source will result in a core clock of 150MHz, which
violates this requirement.

Fixes #62963

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-10-08 11:25:02 +01:00
Martin Åberg 7a9600816a tests: posix: Enable pthread_pressure test on SPARC
This sets the stack size appropriate for SPARC. Tested on the board
configurations qemu_leon3 and gr716a_mini.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2023-10-08 11:24:19 +01:00
Antoniu Miclaus 22a086216a dts: bindings: adxl372-i2c: update description
Specify only the bus corresponding to the current yaml file, as done in
the adi,adxl372-spi.yaml.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
2023-10-08 11:17:02 +01:00
Thomas Chiantia 4ebc963ed5 drivers: eth: gmac: Fixed ethernet startup when fixed-link
When upgrading to version 3.4, our hardware lost ethernet connectivity.
Our hardware assumes a fixed link and does not communicate with the
underlying phy via the mdio bus.

I confirmed that the atsame54_xpro board also will lose ethernet
functionality when the atsame54_xpro configures the phy via to use a
fixed link...

The eth_sam_gmac driver changed the initialization behavior to call
net_if_carrier_off and notes to wait until phy link is up (via
callback.)  However, when in a fixed link configuration, the callback is
never called. So the net_if_carrier_on event never occurs.

This patch adds a check to see if link is up already before calling
net_if_carrior_off. This check works because in fixed-link mode, link-up
is set synchronously during phy driver initialization.

I tested that atsame54_xpro with fixed-link configuration will now work
after this patch.

Signed-off-by: Thomas Chiantia <thomas.chiantia@gmail.com>
2023-10-08 11:16:39 +01:00
Tom Burdick ee588bae7a llext: Update the sample readme with a board
The commands showing west build had -b None which isn't quite right. Add
a :board: property with the tdk_robokit1 as its what I tested on myself.
Also noted that llext isn't supported on every architecture but
intentionally left this a bit vague as updating this little comment
every time something is added seems like a recipe for doc rot.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-10-06 20:53:04 +01:00
Johan Hedberg c1b1dd78e2 release: Zephyr v3.5.0-rc2
Bump the version to v3.5.0-rc2.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2023-10-06 20:59:57 +03:00
Keith Packard 1b057d6295 tests/timer_api: Make sure constant time conversions are constants
When the timer frequency is known at compile time, make sure we can use any
time conversion macro as a global initializer.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-06 20:05:07 +03:00
Keith Packard d8b276e929 sys/time_units.h: Make sys_clock_hw_cycles_per_sec() constant if possible
To be used in a global initializer, this must be a macro instead of a
static inline when the return value is constant.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-06 20:05:07 +03:00
Keith Packard ea61c8c1bd sys/time_units.h: Work around clang div-by-zero warning
clang emits a warning for this code:

  foo.c:1:25: warning: division by zero is undefined [-Wdivision-by-zero]
  int i = (10 > 100 ? (20 / (10 / 100)) : (20 * (100 / 10)));
	                        ^ ~~~~~~~~~~

The warning is generated for code whose value does not affect the
expression result, but technically it is still 'undefined behavior'.

Work around this warning by checking for a zero divisor and substituting
one to make the compiler happy.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-10-06 20:05:07 +03:00
Carles Cufi f2af4a7bfd Bluetooth: host: document the connection states
Connection states are non-trivial to understand based on their names
only, so add short descriptions in the header file explaining what they
do.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-10-06 17:50:03 +03:00
Henrik Brix Andersen 410c02ac57 drivers: can: sja1000: remove excessive debug logging
Remove excessive debug logging from the SJA1000 driver backend. Logging
each register access makes generic CAN debug logging unusable.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-06 17:43:36 +03:00
Fredrik Danebjer fefbb28edb Bluetooth: Audio: Fix return code in PACS notify
Fix errenous return value in pacs_gatt_notify function. The function
would always return zero, and not forward the error correctly.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-10-06 17:43:08 +03:00
Andy Sinclair df23b0177f maintainers: Change regulator maintainer
Change regulator maintainer to aasinclair
Move gmarull from maintainer to collaborator

Signed-off-by: Andy Sinclair <andy.sinclair@nordicsemi.no>
2023-10-06 15:06:33 +01:00
Yuval Peress 96175fcc47 sensors: Fix alignment issues
Add padding to the header and remove unnecessary memset in order to fix
alignment faults in cores such as M0 or ones that support
CONFIG_TRAP_UNALIGNED_ACCESS

Signed-off-by: Yuval Peress <peress@google.com>
2023-10-06 14:54:37 +01:00
Laurentiu Mihalcea 3563347b10 modules: Kconfig.mcux: Remove implicit selection of HAS_CMSIS_CORE
CONFIG_HAS_MCUX is also selected by ARM64 and XTENSA-based cores
which don't have any CMSIS files. As such, it's wrong to implicitly
select CONFIG_HAS_CMSIS_CORE when CONFIG_HAS_MCUX is selected. Since
the ARM32-based cores implicitly select CONFIG_HAS_CMSIS_CORE there's
no point in CONFIG_HAS_MCUX also selecting it too.

The old approach caused config-related warnings
in external projects such as SOF after the introduction of
Commit '8d5ed53' ("modules: remove uncessary source for
external cmsis kconfig"). The warnings were in the form of:
"HAS_CMSIS_CORE (defined at modules/cmsis/Kconfig:7) has
direct dependencies 0 with value n ..."

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2023-10-06 16:49:51 +03:00
Pavel Vasilyev f4a592f3bb Bluetooth: Mesh: Don't reset mod pointer
Don't reset values set in init callback as it is called only once by
bt_mesh_init call. The reset callback is called on every node reset.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 16:47:09 +03:00
Anders Storrø 65f029e185 Bluetooth: Mesh: Common comp page parse func
Create common composition page parser function.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-06 16:21:02 +03:00
Anders Storrø 2e3ae017e3 tests: Bluetooth: Mesh: LCD test all comp pages
Adds test for verifying split get operation for all
composition data pages.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-06 16:21:02 +03:00
Anders Storrø 57cb1b1ccb Bluetooth: Mesh: Add missing comp pages to LCD mod
Adds support for all composition data pages to the
Large Composition Data model.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-06 16:21:02 +03:00
Pavel Vasilyev 0eb027ab7c tests: bluetooth: tester: Fix self-update test DFU/SR/FD/BV-59-C
DFU/SR/FD/BV-59-C tests Distributor self-update. Because the actuall
firmware swapping doesn't happen, we need to just simulate the swapping
by setting new Firmware ID sent by LT. We use slot to take firmware id
as by procedure, Fw Update Server doesn't know about it.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-06 16:20:14 +03:00