Commit graph

126,787 commits

Author SHA1 Message Date
Jordan Yates
faa2101d4e tests: lib: heap_min: test Z_HEAP_MIN_SIZE
Validate that `Z_HEAP_MIN_SIZE` is the minimum required size.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-05 11:34:00 +02:00
Jordan Yates
8aa10bdab7 kernel: Z_HEAP_MIN_SIZE for runtime stats
Increase `Z_HEAP_MIN_SIZE` values to successfully allocate a 1 byte
chunk when `CONFIG_SYS_HEAP_RUNTIME_STATS=y`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-05 11:34:00 +02:00
Andreas Schweigstill
869881ef21 drivers: disk: sdmmc_stm32.c: fix HAL_*_ConfigWideBusOperation
This fixes a compilation error in sdmmc_stm32.c. Depending on the
definition of CONFIG_SDMMC_STM32_EMMC now either
HAL_MMC_ConfigWideBusOperation() or HAL_SD_ConfigWideBusOperation()
gets called.

Signed-off-by: Andreas Schweigstill <andreas@schweigstill.de>
2025-11-04 19:07:52 -05:00
Mathieu Choplain
8619248629 drivers: usb: dc: stm32: fix usb_disable() deadlock on certain series
During a teardown sequence performed by the USB DC stack's "usb_disable()",
the controller is first disabled by calling "usb_dc_detach()", which turns
off the USB controller clock in the STM32 implementation. "usb_disable()"
then disables endpoints by calling "usb_dc_ep_disable()" on each of them,
which is merely forwarded to HAL_PCD_EP_Close() by the STM32 driver. This
order of operations means that the latter operation is actually operating
on the no-longer-clocks USB controller! Up until recently, memory accesses
to MMIO of unclocked peripherals in STM32 SoCs would not cause issues, even
if the resulting access was a no-op (read returns zero, write is ignored),
so everything worked fine even if the access was *technically* illegal...
However, on newer series with a different bus fabric, accesses to unclocked
peripherals will instead deadlock the SoC!

Prevent illegal accesses inside "usb_dc_stm32_ep_disable()" by checking if
the USB controller clock is enabled before calling HAL_PCD_EP_Close(), and
skipping the call if it isn't. This allows "usb_disable()" to complete on
series such as STM32N6.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-04 14:00:32 -05:00
Vlad Kulikov
8b31d2cad3 smf: simplify get_child_of() loop and rename local to 'state'
Replace the open-ended while(true) with a null-terminated parent walk.
Improves readability, behavior is unchanged.

Signed-off-by: Vlad Kulikov <vlad_kulikov_c@pm.me>
2025-11-04 13:59:52 -05:00
Firas Sammoura
2196d2a77d Revert "riscv: pmp: Add helper to write PMP configuration CSRs"
This reverts commit 9482f8df02.

Signed-off-by: Firas Sammoura <fsammoura@google.com>
2025-11-04 13:56:09 -05:00
Mathieu Choplain
f36f8d4fb9 runners: stlink_gdbserver: expose --external-init as runner argument
3cc9a843e8 added '--external-init' to the GDB
Server command line whenever an external loader is provided, but it is not
a *necessary* argument and sometimes causes issues.

Provide a new runner argument "--external-init" (for consistency) which
controls whether or not the argument is added to command line if an
external loader is used. (It is otherwise ignored)

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-04 13:50:56 -05:00
Mathieu Choplain
f890286d8e runners: stlink_gdbserver: make it possible to disable SWD mode
The "--swd" argument had both an action='store_true' and default value of
True so it wasn't possible to disable it: providing the argument would set
its value to True, and not providing it would use the default=True!

Add a new argument "--no-swd" which shares its destination variable with
"--swd", but with action='store_false', such that either can be provided
to enable/disable SWD mode. Both arguments are placed in a mutually
exclusive group and use a common help message.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-11-04 13:50:56 -05:00
Mario Paja
0b4819646c dts: st: l4: fix line sai feature
Fix SAI availability on STM32L4xx series

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-11-04 13:50:05 -05:00
Jérôme Pouiller
2113d56c68 soc: silabs: Fix SL_CODE_CLASSIFY conflict
SL_CODE_CLASSIFY() is a macro used by the upstream Simplicity SDK to mark
time sensitive functions (in order to relocate them in RAM). This macro
place the function in specific sections. So build scripts can identify
them.

However, Wiseconnect is not able to leverage this feature. Worse, this
mechanism conflict with gen_relocate_app.py and zephyr_code_relocate(). So,
we really need to disable this mechanism for Wiseconnect on Zephyr.

Fortunately, SLI_CODE_CLASSIFICATION_DISABLE allow to disable
SL_CODE_CLASSIFY().

Note that on Simplicity SDK, these macro also conflict with
zephyr_code_relocate(). However, the mechanism is officially supported by
Simplicity SDK and we could leverage the feature for the on going support
of Series-3.

Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
2025-11-04 13:48:41 -05:00
Daniel DeGrasse
3d075c4e68 drivers: i2c: i2c_dw: make target stop callback after read/write callbacks
In target mode, issue the stop callback from the I2C DW driver after the
read/write callbacks. This mirrors the behavior of other I2C target mode
drivers, and allows target handler code to correctly service any pending
read or write requests before it handles the stop condition.

Fixes #98675

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-11-04 13:45:34 -05:00
Nicolas Pitre
af7ae5d61f kernel: sched: plug assertion race in z_get_next_switch_handle()
Commit d4d51dc062 ("kernel:  Replace redundant switch_handle assignment
with assertion") introduced an assertion check that may be triggered
as follows by tests/kernel/smp_abort:

CPU0              CPU1              CPU2
----              ----              ____
* [thread A]      * [thread B]      * [thread C]
* irq_offload()   * irq_offload()   * irq_offload()
* k_thread_abort(thread B)
                  * k_thread_abort(thread C)
                                    * k_thread_abort(thread A)
* thread_halt_spin()
* z_is_thread_halting(_current) is false
* while (z_is_thread_halting(thread B));
                  * thread_halt_spin()
                  * z_is_thread_halting(_current) is true
                  * halt_thread(_current...);
                  * z_dummy_thread_init()
                    - dummy_thread->switch_handle = NULL;
                    - _current = dummy_thread;
                  * while (z_is_thread_halting(thread C));
* z_get_next_switch_handle()
* z_arm64_context_switch()
* [thread A is dead]
                                    * thread_halt_spin()
                                    * z_is_thread_halting(_current) is true
                                    * halt_thread(_current...);
                                    * z_dummy_thread_init()
                                      - dummy_thread->switch_handle = NULL;
                                      - _current = dummy_thread;
                                    * while(z_is_thread_halting(thread A));
                  * z_get_next_switch_handle()
                    - old_thread == dummy_thread
                    - __ASSERT(old_thread->switch_handle == NULL) OK
                  * z_arm64_context_switch()
                    - str x1, [x1, #___thread_t_switch_handle_OFFSET]
                  * [thread B is dead]
                  * %%% dummy_thread->switch_handle no longer NULL %%%
                                    * z_get_next_switch_handle()
                                      - old_thread == dummy_thread
                                      - __ASSERT(old_thread->
                                             switch_handle == NULL) FAIL

This needs at least 3 CPUs and the perfect timing for the race to work as
sometimes CPUs 1 and 2 may be close enough in their execution paths for
the assertion to pass. For example, QEMU is OK while FVP is not.
Also adding sufficient debug traces can make the issue go away.

This happens because the dummy thread is shared among concurrent CPUs.
It could be argued that a per-CPU dummy thread structure would be the
proper solution to this problem. However the purpose of a dummy thread
structure is to provide a dumping ground for the scheduler code to work
while the original thread structure might already be reused and
therefore can't be clobbered as demonstrated above. But the dummy
structure _can_ be clobbered to some extent and it is not worth the
additional memory footprint implied by per-CPU instances. We just have
to ignore some validity tests when the dummy thread is concerned.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-04 13:45:24 -05:00
Nicolas Pitre
1c8f1c8647 kernel: sched: use clearly invalid value for halting thread switch_handle
When a thread halts and dummifies, set its switch_handle to (void *)1
instead of the thread pointer itself. This maintains the non-NULL value
required to prevent deadlock in k_thread_join() while making it obvious
that this value is not meant to be dereferenced or used.

The switch_handle should be an opaque architecture-specific value and
not be assumed to be a thread pointer in generic code. Using 1 makes
the intent clearer.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-04 13:45:24 -05:00
Mahesh Mahadevan
11dbae8a32 pm: Fix warning with pm_policy_priv_device_find_device_constraints
pm_policy_priv_device_find_device_constraints() function
is available only when zephyr_power_state is defined.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2025-11-04 13:45:14 -05:00
Henrik Brix Andersen
103370782d tests: drivers: pwm: api: remove board configurations without overlays
Remove board configurations without a proper devicetree overlay. The test
suite relies on pwm-test alias to be defined in a board overlay, which is
not set for these boards.

Fixes: #98775

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2025-11-04 13:45:04 -05:00
Johan Hedberg
73b6f8bd4a Bluetooth: Host: Fix build error with observer-only config
When building an observer-only build the check_pending_conn label would
result in CI warnings/errors due to this only being a C23 feature:

scan.c:692:1: error: label at end of compound statement is a C23 extension

Turns out the #ifdefs are completely unnecessary, and the code can simply
take advantage of IS_ENABLED(), which should get rid of the warning.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-11-04 12:00:35 -05:00
Szymon Janc
d054025fa3 tests: Bluetooth: Tester: Implement TBS Terminate Call BTP command
This allows upper tester to terminate existing call.
Was affecting TMAP/CG/VRC/BV-01-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2025-11-04 16:56:28 +02:00
Erwan Gouriou
9f26a42591 MAINTAINERS: stm32 module: Add missing collaborators
For better agility add etienne-lms, mathieuchopstm and djiatsaf-st
as collaborators to STM32 module.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-11-04 16:56:14 +02:00
Erwan Gouriou
35ccb92bc6 MAINTAINERS: stm32: Add juickar as collaborator
We need juickar to take part in reviews in these areas.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-11-04 16:56:14 +02:00
Erwan Gouriou
540607f46b MAINTAINERS: stm32: Remove inactive collaborators
@marwaiehm-st and @benothmn-st are not collaborating anymore
on those area.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-11-04 16:56:14 +02:00
Zhijie Zhong
87e351f8bc Bluetooth: Host: Fix handling of adv reports when scanning for connection
In some cases, the host starts scanning internally for establishing
connections (BT_LE_SCAN_USER_CONN), such as host-based resolving or
auto-connection. In this situation, even if the application does not
start explicit scan, the host still needs to handle the advertising
reports to continue the connection process.

Previously, both bt_hci_le_adv_report() and bt_hci_le_adv_ext_report()
will break or discard all reports when explicit scan is not active.
This causes the connection to stay in SCAN_BEFORE_INITIATING and never
move forward.

This patch adds checking of BT_LE_SCAN_USER_CONN to allow advertising
reports to be processed during connection-purpose scanning. When the
scan is started explicitly by application, the behavior remains the
same, only small comments are updated to describe this behavior and keep
the original code style unchanged.

Signed-off-by: Zhijie Zhong <zhongzhijie1@xiaomi.com>
2025-11-04 16:55:45 +02:00
Cristian Bulacu
11d74f2bfe modules: openthread: platform: udp: Fix otPlatUdpClose bug
This commit fixes a bug which occurred when a socket was closed.

It was observed when multiple attempts to obtain dataset using ephemeral
key were performed. Failure was seen starting with attempt number 2,
incoming packets were not processed.

In a open-close-open scenario, incoming traffic was dropped, most likely
because there was stale data in the corresponding socket service
structure.

By calling, `net_socket_service_register` after a socket in closed, the
problem was resolved, and data shown in `net sockets` cli command is now
updated and correct.

Signed-off-by: Cristian Bulacu <cristian.bulacu@nxp.com>
2025-11-04 16:55:31 +02:00
MBatuhan Altun
d9999a4884 boards: st: Clean up nodes with status = "disabled"
- drop redundant board-level disables already handled in the SoC .dtsi

- document intentional disables (pin conflicts, optional peripherals

  and shared resources)

- fix DTS lint spacing warnings (stm32h747i_disco)

Signed-off-by: MBatuhan Altun <mbatuhanaltun3388@gmail.com>
2025-11-04 16:54:34 +02:00
Tim Pambor
a4d99f5de2 net: core: only set l2_processed flag for NET_CONTINUE
If verdict is NET_OK net_pkt may already be unreferenced and reutilized,
so that setting the `l2_processed` flag would be set on a different
packet, corrupting its state. Avoid this situation by only setting the
l2_processed flag for NET_CONTINUE.

Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
2025-11-04 16:54:14 +02:00
Patryk Koscik
1bd934dbba drivers: uart: ambiq: enable driver for apollo4x
Enable Ambiq serial driver for the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
Patryk Koscik
0b89d298a1 drivers: uart: ambiq: make driver compatible with apollo4x
This patch makes `uart_ambiq.c` compatible with the Apollo4x SoC series.

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2025-11-04 16:53:51 +02:00
Jamie McCrae
88176a795d doc: hardware: porting: board_porting: Fix outdated merged info
Fixes some information that is very outdated to do with board
Kconfig files, which are not merged, and multiple dts files

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-04 16:53:40 +02:00
Jamie McCrae
c060a33bb0 github: workflows: Disable getting all toolchains
This fixes an issue of CI failing due to the github runner being
out of memory when cleaning up, and speed up the build prep stage

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-04 16:53:31 +02:00
Georgios Vasilakis
6cc7bdb58a tests: secure_storage: Exclude nRF54H20 targets
Exclude the application and radio core targets for nRF54H20 since
they use Ironside as their PSA storage provider.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2025-11-04 07:30:53 -05:00
Nicolas Pitre
6c6f1a5e99 arch: arm64: mmu: revert useless cache handling
This reverts the following commits:

commit c9b534c4eb
("arch: arm64: mmu: avoid using of set/way cache instructions")

commit c4ffadb0b6
("arch: arm64: avoid invalidating of RO mem after mem map")

The reason for the former is about Xen not virtualizing set/way cache
operations used by sys_cache_data_invd_all() originally used prior to
enabling the MMU and data cache. But the cure is worse than the Xen
issue as:

- Cache invalidation is performed on _every_ mapping change.

- Those invalidations are completely unnecessary with a PIPT data cache.
  ARM64 implementations use Physically Indexed, Physically Tagged (PIPT)
  data caches where cache maintenance is not needed during MMU operations.

- arch_mem_map() invoked with K_MEM_MAP_UNPAGED triggers page faults
  when accessing the unmapped region for cache operations. The page
  fault handler in do_page_fault() tries to reacquire z_mm_lock which
  is already held by the caller of arch_mem_map(). This results in a
  deadlock.

And the latter commit disables cache operations for read-only mappings,
effectively rendering the workaround described in the first commit
inoperative on half the mappings, making the performance cost of the
first commit's approach unjustifiable since it doesn't actually solve
the problem it set out to fix.

Given the above, the actual "fix" should simply have been the removal of
the sys_cache_data_invd_all() as, in theory, it isn't strictly needed
and its replacement is already ineffective on read-only areas as mentioned.

So let's revert them, which fixes the deadlock-induced CI test failures
on ARM FVP SMP configurations that were triggered when demand paging or
memory mapping operations were involved.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-04 07:22:39 -05:00
Nicolas Pitre
5b43674098 arch: arm64: Fix SMP TLB invalidation on SMP systems
Use Inner Shareable (IS) TLB invalidation instructions in SMP
configurations to broadcast TLB invalidations to all CPUs.

Use TLBI VMALLE1IS instead of VMALLE1 in invalidate_tlb_all().

While at it, implement proper page-specific invalidation using TLBI VAE1IS
in invalidate_tlb_page() instead of falling back to full invalidation.

This fixes many SMP test failures with userspace enabled onArm's FVP.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-04 07:22:03 -05:00
Mario Paja
fcaf35ccb3 drivers: i2s: stm32 sai code cleanup
Replace series-specific macros with generic macros shared across
multiple STM32 series to improve readability and maintainability.

Signed-off-by: Mario Paja <mariopaja@hotmail.com>
2025-11-04 07:19:50 -05:00
Ricardo Rivera-Matos
5cd5e152b3 MAINTAINERS: Adds Liam-Ogletree as a Haptics collaborator
Adds Liam-Ogletree as a collaborator for the haptic driver API.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
2025-11-04 07:13:34 -05:00
Jordan Yates
0c117869bc Revert "doc: Releases: Add notes about deprecated bt_ctlr_set_public_addr"
This reverts commit a60ed23d19.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-04 07:10:45 -05:00
Jordan Yates
3801d1d38c Revert "Bluetooth: Controller: Deprecate bt_ctlr_set_public_addr"
This reverts commit b07be641e7.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-11-04 07:10:45 -05:00
Martin Hoff
cd0448496a tests: uart: silabs: add board overlays to test silabs eusart peripheral
This patch introduces overlays to test the silabs eusart peripheral.
It requires 3 different boards in order to test minor differences
between peripheral chip IP versions.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-11-04 07:10:19 -05:00
Martin Hoff
730502ef62 tests: uart: silabs: add overlay files for slwrb4180b board
Introduce new overlay files for the slwrb4180b board in the UART test
suite.

Signed-off-by: Martin Hoff <martin.hoff@silabs.com>
2025-11-04 07:10:19 -05:00
David Leach
01e3b167af west: blobs: fix UnicodeDecodeError on Windows
Ensure the blobs command is trying to display the license file for
click-through approval. Ensure that special characters doesn't
cause a problem in Windows by opening the file with utf-8 encoding.

Fixes #98520

Signed-off-by: David Leach <david.leach@nxp.com>
2025-11-04 07:06:08 -05:00
Qingsong Gou
302064c9a5 drivers: i2c: fix CI CMakeStyle error
Replace CMAKE tabs with spaces

Signed-off-by: Qingsong Gou <gouqs@hotmail.com>
2025-11-04 07:05:39 -05:00
Vincent Tardy
0df9c5fb1f west.yml: update hal_stm32 revision for LL 802.15.4 lib url fix
Update hal_stm32 revision to fix url vulnerability of link layer
802.15.4 libraries for stm32wba.

Signed-off-by: Vincent Tardy <vincent.tardy@st.com>
2025-11-04 11:27:41 +02:00
Thomas Decker
eab91fe55f boards: st: nucleo_h7s3l8: Fix size of ext_memory and ram
Change size of ext_memory node to 32MB, as the board uses a Macronix
MX25UW25645GXDI00 with 256MBits.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2025-11-04 11:27:29 +02:00
Thomas Decker
93df422d5b dts: arm: st: h7rs: Increase memory size of sram0
The h7rs option byte default setting configures the AXI SRAM1-4 as one
contiguous memory, sram0 can therefore be increased to 456k (3x128k + 72k).
The .yaml files of the boards nucleo_h7s3l8 and stm32h7s78_dk are adjusted
accordingly.

Signed-off-by: Thomas Decker <decker@jb-lighting.de>
2025-11-04 11:27:29 +02:00
Etienne Carriere
8510764505 boards: st: fix Bluetooth and BLE references
Add registered trademark symbol to Bluetooth where missing and
replace BLE with explicit Bluetooth Low Energy where applicable
in ST boards documentation.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
2025-11-04 11:27:18 +02:00
Pete Johanson
f69f7b1b80 tests: drivers: flash: Fix for MAX32 flash1 testing
Remove the erronously added chosen node for the MAX32690EVKit, to ensure
the flash base address is correct for the build.

Signed-off-by: Pete Johanson <pete.johanson@analog.com>
2025-11-04 11:27:08 +02:00
Arun Kumar Nagelly
4b9bbc5006 drivers: bluetooth: hci: siwx91x: add RF power config
Add vendor-specific RF power mode configuration during HCI setup
for SiLabs SiWx91x devices. This configures the BLE TX power
index in the controller's RF subsystem.

The implementation sends a vendor command (OCF 0x0006) with
protocol mode (2) and power index (RSI_BLE_PWR_INX) during the
setup phase. This ensures proper RF power configuration before
normal Bluetooth operations begin.

Technical details:
- Uses bt_hci_cmd_alloc() with manual HCI header construction
- Command opcode: 0xFC06 (OGF=0x3F, OCF=0x0006)
- Parameters: protocol_mode=2, power_index from RSI_BLE_PWR_INX
- Executed during bt_hci_setup callback

Signed-off-by: Arun Kumar Nagelly <arnagell@silabs.com>
2025-11-04 09:26:46 +00:00
Keith Packard
3e615fa533 drivers: comparator: Silence GCC 14 uninitialized variable warning.
When the renesas-rv-lvd driver is built with SDK 1.0 using GCC 14, the
compiler emits a spurious uninitialized variable warning because it can't
follow the control flow to figure out that the variable wasn't ever used
without being initialized. Work around this by simply initializing it
to one of the valid values.

Signed-off-by: Keith Packard <keithp@keithp.com>
2025-11-04 11:26:34 +02:00
Benjamin Cabé
74572a787b include: drivers: sensor: doxygen docs for max17055
Fixup doxygen documentation

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-04 11:26:14 +02:00
Benjamin Cabé
dc0993f13f include: drivers: sensor: doxygen docs for max32664c
Fixup doxygen documentation

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-04 11:26:14 +02:00
Benjamin Cabé
344caf3ec1 include: drivers: sensor: doxygen docs for mmc56x3
Fixup doxygen documentation

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-04 11:26:14 +02:00
Benjamin Cabé
0d9c76012b include: drivers: sensor: doxygen docs for sht4x
Fixup doxygen documentation

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-04 11:26:14 +02:00