Commit Graph

112793 Commits

Author SHA1 Message Date
Nicolas Pitre
457fa60bfc kernel: mempool: decouple simple alloc from aligned_alloc
When k_malloc() is expressed in terms of k_aligned_alloc() it invokes a
longer aligned allocation code path with an extra runtime overhead even
though no alignment is necessary.

Let's reference and invoke the aligned allocation code path only when an
actual aligned allocation is requested. This opens the possibility for
the linker to garbage-collect the aligning code otherwise.

Also bypass k_heap_malloc() and friends given they're invoked with
K_NO_WAIT. Go directly to sys_heap_*() instead to cut some more unneeded
overhead.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Nicolas Pitre
7c9f464b70 kernel: kheap: workaround for Percepio's TraceRecorder kludge
In .../modules/debug/percepio/TraceRecorder/kernelports/Zephyr/include/\
tracing_tracerecorder.h there is a concealed non-parameterized direct
reference to a local variable that is no longer in scope. Provide a dummy
stub for compilation to succeed until that module's layering violation is
fixed, after which this could be reverted.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Nicolas Pitre
9da06456f2 kernel: kheap: decouple simple alloc from aligned_alloc
When k_heap_alloc() is expressed in terms of k_heap_aligned_alloc()
it invokes a longer aligned allocation code path with an extra runtime
overhead even though no alignment is necessary.

Let's reference and invoke the aligned allocation code path only when an
actual aligned allocation is requested. This opens the possibility for
the linker to garbage-collect the aligning code otherwise.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Nicolas Pitre
31244724a2 kernel: k_aligned_alloc: simplify assertion
Let's avoid division and modulus operations as they're costly... and even
more so when they're unnecessary as in this case the main constraint is
about the alignment being a power of 2 which is a very small subset of
sizeof(void *) multiples.

Then move the assertion to common code for wider coverage.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Nicolas Pitre
ea7a969204 tests: benchmarks: sys_kernel: add k_malloc() test
Useful to evaluate malloc performance changes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-04-01 22:13:04 +02:00
Manimaran A
810f549ed4 drivers: eSPI: microchip: Port80 Multibyte
Updated ISR to send multibyte p80 data

Signed-off-by: Manimaran A <manimaran.a@microchip.com>
2025-04-01 22:12:28 +02:00
Dipak Shetty
033679b5d3 samples: sensor: light: add everlight light sensor
Sample extended to support the everlight light sensor on the
frdm_mcxw71 board.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-04-01 22:12:13 +02:00
Dipak Shetty
66966f7211 samples: sensor: light: refactor into generic light polling sample
Moved the grove light sensor into a generic light sensor sample.
Replaced board specific node name for light sensor with an alias.
Refactored project name to reflect generic light sensor.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-04-01 22:12:13 +02:00
Dipak Shetty
eb0050f7c9 drivers: sensor: add everlight light sensor
Adds driver for Everlight ALS-PT19 Ambient Light Sensor.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-04-01 22:12:13 +02:00
Dipak Shetty
8f789f81c3 dts: bindings: sensor: add everlight ambient light sensor binding
Added new binding for Everlight ALS-PT19 Ambient Light Sensor.

Signed-off-by: Dipak Shetty <shetty.dipak@gmx.com>
2025-04-01 22:12:13 +02:00
Konrad Sikora
c099a01760 drivers: sensor: liteon: Move to vendor subdirectory
Organizes liteon sensor drivers by vendor to make consistent
with other drivers.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Konrad Sikora
8ad2cac1b5 drivers: sensor: Add support for LTR329 sensor
Add support for Liteon LTR329 Digital Ambient Light Sensor

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Konrad Sikora
85e9cef24e drivers: sensor: Change vendor prefix from 'ltr' to 'liteon'
The vendor prefix has been changed from 'ltr' to 'liteon'.
This change is made to better reflect the actual name of
the vendor, which is LiteOn. The previous prefix 'ltr'
was referring to the LiteOn Optical Sensor family, which
could lead to misunderstandings.

Signed-off-by: Konrad Sikora <kontakt@konradsikora.pl>
2025-04-01 22:12:01 +02:00
Nikodem Kastelik
c3646a34fd soc: nordic: add option for forcing RAM power on reboot
RAM power configuration is preserved through soft reset,
meaning that there is a risk of accessing powered off RAM blocks
when booting in different application (i.e. bootloader).
Add option to force all RAM blocks to be powered on
before triggering soft reset to prevent this from happening.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-04-01 16:28:08 +02:00
Johan Hedberg
39c2605930 Bluetooth: Fix deadlock with settings and bt_hci_cmd_send_sync()
We can't do synchronous HCI command sending in any settings commit()
callback, since we don't know what context the callback is being called
from. One particular deadlock can happen if settings_load() is called from
the preemptible main thread:

main()
 |--> settings_load() (aquire settings_lock mutex)
       |-->commit callback A that defers to system wq
       |-->commit callback B that calls bt_hci_cmd_send_sync()

system wq from the previous deferral from within settings_load():
 |--> work item
       |--> settings_save_one()
             |--> attempt to aquire settings_lock mutex

In the above scenario, the bt_hci_cmd_send_sync() call from the main thread
depends on the system workqueue being processed (since that's what does HCI
command processing by default), while at the same time holding the settings
subsystem's mutex. At the same time, a system wq item tries to store
something into settings, however it deadlocks waiting for the settings
mutex.

The actual scenario that we have in the Bluetooth subsystem is where
"commit callback A" is commit_settings() in host/settings.c, and "commit
callback B" is keys_commit() in host/keys.c.

The solution to the deadlock is to take advantage of deferred bt_id_add()
handling which already exists, i.e. set a flag and deferre the actual
adding to the system workqueue.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-04-01 16:28:00 +02:00
Yassine El Aissaoui
58ea18ed75 bluetooth: hci_nxp: disallow standby usage while sending HCI MSG
Sending an HCI message requires to wake up the controller
core if it's asleep. Platform controllers may send responses using
non wakeable interrupts and those can be lost during standby usage.
Blocking standby usage until the HCI message is sent.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2025-04-01 16:27:50 +02:00
Robert Lubos
7fbdc6d734 net: lib: mqtt: Add extra MQTT 5.0 ifdefs to prevent compile errors
Add some extra ifdefs around MQTT 5.0 specific structures to prevent
compiler errors due to undefined symbols in certain configurations.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-04-01 16:27:41 +02:00
Jonathan Nilsen
8e1f27a9fd modules: hal_nordic: bump regtool to 9.0.0
Added support for VPR GPIOs and a more concise output print.

Signed-off-by: Jonathan Nilsen <jonathan.nilsen@nordicsemi.no>
2025-04-01 16:27:04 +02:00
Ryan Chu
9ba60d3eb7 bluetooth: host: Apply callback changes of CS complete events
The CS complete callbacks provide both status and params.
In the case of errors, NULL pointer is passed to the params of callbacks.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2025-04-01 16:26:58 +02:00
Ryan Chu
c9240cc99f bluetooth: host: Report status of Channel Sounding complete events
If the HCI status of a complete event is not BT_HCI_ERR_SUCCESS,
the remaining parameters could be invalid.

In this case, the params is passed as NULL pointer to the callbacks.
- LE CS Read Remote Supported Capabilities Complete event
- LE CS Read Remote FAE Table Complete event
- LE CS Config Complete event
- LE CS Security Enable Complete event
- LE CS Procedure Enable Complete event

This change avoids forwarding the invalid fileds to the applications.

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2025-04-01 16:26:58 +02:00
Krzysztof Chruściński
aaeb015ec4 logging: frontends: stmesp: Fix sending string location
String location information should only be sent for core which
do not append strings to the log message (PPR, FLPR). Without
this, cpurad was also sending that information and that was
redundant.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-04-01 16:26:50 +02:00
Krzysztof Chruściński
c8d7d577a6 logging: frontend_stmesp: Fix string addresses from remote core
When decoding logs from a remote core with memory that APP can
access, wrong address of an array with string addresses was used.
Log message contains index of a string and APP strings array was
used instead of remote core. Extend STMESP logging so that address
of string array of a remote core is send during startup to the APP
and APP is using this array to decode strings from remote cores.
Bug applies only to PPR and FLPR as APP has no access to RAD memory.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-04-01 16:26:50 +02:00
Ryan McClelland
19c2c33be6 tests: drivers: spi: add build all for cadence spi
As there is no currently known board that has the cadence spi,
add a test to just build it under the qemu cortex m3.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-04-01 16:26:38 +02:00
Ryan McClelland
8c5c74cc97 drivers: spi: add cadence spi driver
This provides a driver for the cadence spi.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-04-01 16:26:38 +02:00
Benjamin Cabé
9abfc8301a doc: nxp: adopt zephyr:board-supported-hw directive
Replace manually authored hardware features table with the new Zephyr
board supported hardware directive which automatically generates an
up-to-date table based on the boards' Devicetree.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-04-01 16:26:30 +02:00
Anas Nashif
f61c94bb1b ci: codecov: remove bsim step from workflow
This is not needed for this specific workflow. We do not do anything
with bsim here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 16:26:22 +02:00
Anas Nashif
4d2ddf06c1 ci: codecov: install pinned python environment
Need gcovr for coverage generation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 16:26:22 +02:00
Anas Nashif
1823c394c3 actions: update requirements-actions.in
pin gcovr to 6.0

See #87899

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 16:26:22 +02:00
Sudan Landge
d4d09225ca arch: arm: fix ci failure
This is to fix ci failure caused by commit d5d4d57

In the above commit, it's wrongly assumed that ROM_ADDR and RAM_ADDR
are same **only** when CONFIG_XIP is not defined.
Since aarch64 was taken as reference in the review,
we missed to see that CONFIG_FLASH_SIZE is also part of the condition
to define ROM_ADDR as RAM_ADDR.
CONFIG_XIP is not defined for qemu_cortex_a9/xc7z007s however,
CONFIG_FLASH_SIZE is not 0 so the assumption fails
and the required reset to RAM_ADDR is not applied leading to the test
failure.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-04-01 16:26:12 +02:00
Cla Mattia Galliard
f3a3ad308c thread_analyzer: Allow to override the auto-analysis thread priority
By default the thread priority is still the lowest application thread
priority. Allow the priority to be increase by specifying both, the
`override` option as well as the desired `priority`. This pattern was taken
from the shell thread.

Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
2025-04-01 11:59:39 +02:00
Armando Visconti
48f7fcd2f0 samples/sensor: stream_fifo: initialize gbias
Add an example of how to initialize gbias. The real application should
restore latest valid values taken from non-volatile memory.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-01 11:59:31 +02:00
Armando Visconti
cc9b93d50c sensor: lsm6dsv16x: sensor GBIAS initialization
Use SENSOR_ATTR_OFFSET attribute to initialize the Sensor Fusion GBIAS.
This is useful when the device is not sill (e.g. hold in hand) and so
the gyroscope calibration does not run.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-01 11:59:31 +02:00
Armando Visconti
9a8ecf0c0c sensor: lsm6dsv16x: fix place where gyro_freq get set
Move gyro_freq setting inside lsm6dsv16x_gyro_set_odr_raw() routine,
so that it is properly saved in all cases (i.e. from DT configuration
and from runtime ATTR set case).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2025-04-01 11:59:31 +02:00
Håkon Amundsen
1fac1b917f boards: nordic: add 'iron' board variant
This is needed for next generation Secure Domain firmware.

Signed-off-by: Håkon Amundsen <haakon.amundsen@nordicsemi.no>
2025-04-01 11:54:30 +02:00
Tom Hughes
785e36520f tests: subsys: usb: bos: Remove dummy_descriptor struct
When building with clang, it warns:

tests/subsys/usb/bos/src/test_bos.c:24:22: error: variable
'dummy_descriptor' is not needed and will not be emitted
[-Werror,-Wunneeded-internal-declaration]
static const uint8_t dummy_descriptor[] = {
                     ^

Only the size of dummy_descriptor is used, not the contents. Replace the
struct with a constant for the size.

Signed-off-by: Tom Hughes <tomhughes@chromium.org>
2025-04-01 11:54:20 +02:00
Jack Chistyakov
dd6adc7cad net: virtual: Clear multicast bit when generating link address
The least significant bit of the first octet of a MAC address is a
unicast/multicast bit. The bit should be cleared when generating a
random link address for a virtual interface. Any frames from such
interface/address will be dropped by the network as invalid if
the multicast bit is set.

Signed-off-by: Jack Chistyakov <jack.chistyakov@outlook.com>
2025-04-01 11:53:02 +02:00
Andrej Butok
efbe756b62 tests: ext2: reduce ram disk size for small.overlay
- Reduces the ram disc sector count from 400 to 220.
- Saves about 90KB of RAM. All tests still passed.
- Allows platforms with less RAM to run
  the ramdisc_small.overlay test.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2025-04-01 11:52:34 +02:00
Adam Kondraciuk
eb8ab0a937 modules: hal_nordic: nrfx: switch off auto clksel for GRTC
Disable automatic LFCLK selection for GRTC during driver initialization.
For Zephyr applications it is selected by `sys_clock_driver_init()`
depending on configuration and DTS.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-04-01 11:52:26 +02:00
Adam Kondraciuk
042c5c6252 drivers: timer: nrf_grtc_timer: Move up GRTC clock selection
Selection of the LF clock source for the GRTC should be performed
as early as possible, before starting GRTC.

Signed-off-by: Adam Kondraciuk <adam.kondraciuk@nordicsemi.no>
2025-04-01 11:52:26 +02:00
Tim Wang
25fcfff154 soc: mimxrt1180: Add USB Device support
This was tested on the MIMXRT1180 EVK board

Signed-off-by: Tim Wang <tim.wang@nxp.com>
2025-04-01 11:52:09 +02:00
Benjamin Cabé
daacc8c297 samples: net: wifi: remove redundant options from esp32 conf overlays
A lot of the config options are already set in the prj.conf.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-04-01 11:51:59 +02:00
Björn Bergman
98ac4becab iar: toolchain: Enable TOOLCHAIN_HAS_BUILTIN_FFS
icc has support for __builtin_ffs() and its friends,
but it was disabled in the toolchain files.

Signed-off-by: Björn Bergman <bjorn.bergman@iar.com>
2025-04-01 11:51:41 +02:00
Declan Snyder
2eb8cfb7f5 tests: spi_loopback: Fix synchronization mistakes
There are a couple things going wrong in this test code right now.

First of all, there is no syncrhonization of when the async polling
thread should start polling, causing sometimes the poll to fail on tests
before the async test ran. Add a semaphore to fix this.

The lock test was setting up a nonsense NOP transfer of 0 length.
This might cause unexpected behavior and is not the point of
this test case.
But, still we should add a seperate test case specifically for
testing this instead.

Also add a teardown function to release the locks to allow other test
cases to run in case of some failures.

Also a minor change to remove some ARG_UNUSED invocations for some
arguments that are actually used.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-04-01 04:15:31 +02:00
Hakan Jansson
f107dad6e9 west: runners: openocd: Fix version format regression
Change OpenOCD version regex to be compatible again with format strings
not having a space or newline immediately after the version nr.

Modified regex has been verified with the strings listed below.

Ubuntu:
"Open On-Chip Debugger 0.11.0"

ADI:
"Open On-Chip Debugger (Analog Devices 0.12.0-1.1.1)  OpenOCD 0.12.0 (2024-
08-27-17:25)"

Zephyr SDK:
"Open On-Chip Debugger 0.11.0+dev-00728-gb6f95a16c (2024-02-17-23:51)"

Infineon:
"Open On-Chip Debugger 0.12.0+dev-5.2.1.3248 (2024-08-08-17:29)"

Espressif:
"Open On-Chip Debugger v0.12.0-esp32-20240318 (2024-03-18-18:25)"

Fixes: 1c05f2121c

Signed-off-by: Hakan Jansson <hakan.jansson@infineon.com>
2025-04-01 04:14:58 +02:00
James Turton
cd9bcd8b0d dts: rp2350: Fix USB controller base address
Fix USB controller base address.
rp2040 was fixed in a10f2e8 and the rp2350 uses the same base address.

Signed-off-by: James Turton <james.turton@gmx.com>
2025-04-01 04:14:41 +02:00
Scott Worley
9c1cebdb70 manifest: microchip: Update Microchip HAL to latest MEC5 changes
We updated the MEC5 portion of hal_microchip. Update Zephyr west
manifest to use the updated HAL.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2025-04-01 04:14:26 +02:00
Khoa Nguyen
37c5ac4bce drivers: flash: Update api for migration of FSP to 5.8.0
Update api of Renesas flash-hp driver when FSP has been
migrated from version 5.3.0 to 5.8.0

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-01 04:14:14 +02:00
Khoa Nguyen
4cbf568f5e drivers: mipi_dsi: Update api for migration of FSP to 5.8.0
Update api of Renesas mipi_dsi driver when FSP has been
migrated from version 5.3.0 to 5.8.0

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-01 04:14:14 +02:00
Khoa Nguyen
3f0ce27cfc manifest: Update hal_renesas revision to migrate FSP 5.8.0
Update hal_renesas revision to migrate FSP 5.8.0

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2025-04-01 04:14:14 +02:00
Benjamin Cabé
6f4bb7ef62 ci: github: bump the actions-deps group across 1 directory with 8 updates
Bumps the actions-deps group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4.1.7` | `4.2.2` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5.4.0` | `5.5.0` |
| [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) | `8` | `9` |
| [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `46.0.1` | `46.0.3` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.3.5` | `4.6.2` |
| [actions/download-artifact](https://github.com/actions/download-artifact) | `4.1.9` | `4.2.1` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.11` | `3.28.13` |
| [zgosalvez/github-actions-ensure-sha-pinned-actions](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions) | `3.0.22` | `3.0.23` |

Updates `actions/checkout` from 4.1.7 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.7...11bd71901bbe5b1630ceea73d27597364c9af683)

Updates `actions/setup-python` from 5.4.0 to 5.5.0
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](42375524e2...8d9ed9ac5c)

Updates `dawidd6/action-download-artifact` from 8 to 9
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](20319c5641...07ab29fd4a)

Updates `tj-actions/changed-files` from 46.0.1 to 46.0.3
- [Release notes](https://github.com/tj-actions/changed-files/releases)
- [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md)
- [Commits](2f7c5bfce2...823fcebdb3)

Updates `actions/upload-artifact` from 4.3.5 to 4.6.2
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4.3.5...ea165f8d65b6e75b540449e92b4886f43607fa02)

Updates `actions/download-artifact` from 4.1.9 to 4.2.1
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](cc20338598...95815c38cf)

Updates `github/codeql-action` from 3.28.11 to 3.28.13
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.28.11...1b549b9259bda1cb5ddde3b41741a82a2d15a841)

Updates `zgosalvez/github-actions-ensure-sha-pinned-actions` from 3.0.22
to 3.0.23
- [Release notes](https://github.com/zgosalvez/github-actions-ensure-sha-pinned-actions/releases)
- [Commits](25ed13d062...4830be28ce)

---

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-03-31 20:16:41 -04:00