Commit graph

126,787 commits

Author SHA1 Message Date
Daniel Leung
81f5b781aa xtensa: fix Python script formatting via ruff
Uses ruff to format the gen_* python scripts.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-11-13 12:02:08 +02:00
Daniel Leung
36f7792ea1 xtensa: fix ruff issues in Python scripts
Fix the issues found by ruff.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2025-11-13 12:02:08 +02:00
Badr Bacem KAABIA
0719c9eca2 crypto: mbedtls_shim: Fix concurrency and deadlock issues
- **Fix session mutex handling:** Ensure the `mtls_sessions_lock` is
    always released in `mtls_get_unused_session_index` on failure
    to prevent deadlocks.
- **Protect `in_use` flag:** Added mutex protection when setting
    `in_use = false` in free functions.
- **Cleanup on setup failure:** Added calls to `mbedtls_*_free()`
    in `mtls_session_setup()` when key initialization fails.
- **Free logic fix:** Corrected `if/else` structure in
    `mtls_session_free()` to ensure the correct context is freed.

Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2025-11-13 12:01:44 +02:00
Badr Bacem KAABIA
577f60dcd7 crypto: mbedtls_shim: Remove incorrect out_len calculation in AEAD decrypt
Remove erroneous calculation of `apkt->pkt->out_len` in
`mtls_ccm_decrypt_auth` and `mtls_gcm_decrypt_auth`.
The output length should be handled by the caller or the
AEAD decryption process itself.

Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2025-11-13 12:01:44 +02:00
Badr Bacem KAABIA
01b0280bad crypto: mbedtls_shim: Fix typos
Corrected "encrypt" log messages to "decrypt."

Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2025-11-13 12:01:44 +02:00
Ofir Shemesh
b933bf5e08 net: dhcpv4: fix incorrect RFC2131 section reference to 4.4.1
Corrected the RFC2131 section reference in DHCPv4 comments and help text.
The random delay before sending the initial DHCPDISCOVER message is
defined in Section 4.4.1 of RFC2131, not in 4.1.1 as previously stated.

Signed-off-by: Ofir Shemesh <ofirshemesh777@gmail.com>
2025-11-13 12:01:31 +02:00
Robert Lubos
9e6256e853 net: iface: Prevent iface/TCP mutexes deadlock
In rare occasions iface and TCP mutexes could cause a deadlock. As
notifying the interface readiness takes place just before the iface
mutex is released, it should be not harm to release it just before the
TCP is notified about interface going down to avoid the deadlock.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Robert Lubos
ba6387fcd6 net: tcp: Close the connection unconditionally on forced close
The current approach was buggy, for example the TCP context could be
unrefed twice in case of forced close. Or in case of a race, when the
application closed the socket first, the TCP context wouldn't be
dereferenced at all.

Calling the tcp_conn_close() unconditionally in case of forced close
solves all those issues.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Robert Lubos
7fe33a5d5a net: tcp: Fix error reporting on listening socket on iface down
A listening TCP context has no active connection therefore it has no a
second ref from the TCP stack. Thereby, when shutting down connections
when interface goes down, net_tcp_put() should not be called on a
listening socket to release the ref on the TCP stack behalf.

Instead, report the error via the registered accept_cb callback no
notify the application about the error, which should then close the
socket and release the associated TCP context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 19:00:20 -05:00
Chris Friedt
c9eba65681 doc: kernel: timeutil: remove note about 64-bitness
Remove the note about time_t being 64-bit in Zephyr, since that is
generally not accurate and depends on the configuration of the C library.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-11-12 18:59:33 -05:00
Jukka Rissanen
25ab312dd7 doc: release-notes: Add wifi information to 4.3
Add information about native wifi stack changes in 4.3.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-12 18:58:51 -05:00
Marek Slowinski
9679395099 tests: drivers: memc: ram: Fix build error on hifive_unmatched
Fix 'RAM_SIZE_SRAM' undeclared error in function 'test_ram_test_ram0'.

Signed-off-by: Marek Slowinski <mslowinski@antmicro.com>
2025-11-12 17:57:48 +02:00
Yves Wang
4f2f391fc8 doc: contribute: Fixed missing code block new line
dts-linter command was not correctly rendered in doc site.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2025-11-12 09:18:39 -05:00
Laurentiu Mihalcea
6a0edac6fb doc: releases: add v4.3 release notes for firmware subsystem
Add v4.3 release notes for the firmware subsystem.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2025-11-12 09:09:29 -05:00
Flavio Ceolin
8757978f68 doc: release/4.3: CVE-2025-9408 left embargo
Disclose information about CVE that left embargo.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-11-12 09:09:11 -05:00
Flavio Ceolin
b886f82cad doc: security: Disclose CVE-2025-9408
Disclose information about published CVE.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-11-12 09:09:11 -05:00
Benjamin Cabé
b8bbd5047d MAINTAINERS: add instrumentation documentation path
Add path to Instrumentation documentation to the corresponding area.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-12 09:08:45 -05:00
Benjamin Cabé
5d5a907648 doc: releases: update link to instrumentation subsystem documentation
Documentation has been added for the instrumentation subsystem, link to
it in the Zephyr 4.3 release highlights instead of code sample.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-12 09:08:45 -05:00
Benjamin Cabé
dba7304c98 doc: instrumentation: add documentation for the instrumentation subsystem
Add documentation for the instrumentation subsystem as this was missing
from the initial contribution.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-12 09:08:45 -05:00
Robert Lubos
efef1f54dc doc: release-notes-4.3: Update release notes for networking
Update release notes for 4.3.0 release with networking subsystem
changes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 09:06:18 -05:00
Emil Dahl Juhl
598d03c404 dts: arm: st: n6: fixup adc2 missing properties
The added stm32-adc properties in c21cdd8569 ("dts: bindings: adc:
stm32: add new properties to simplify the driver") were missing from adc2
within the stm32n6.dtsi.

Since adc1 and adc2 are almost identical, just copy the missing properties
from adc1 which was fixed up as part of 5f0c63ea35 ("dts: arm: st: fill
out adc nodes with the new properties").

This fixes compilation when using adc2:

```
devicetree error: 'st,adc-internal-regulator' is marked as required in
'properties:' in [...]/zephyr/dts/bindings/adc/st,stm32n6-adc.yaml, but
does not appear in <Node /soc/adc@50022100 in
[...]/zephyr/dts/arm/st/n6/stm32n6.dtsi:456>
```

Signed-off-by: Emil Dahl Juhl <emil@s16s.ai>
2025-11-12 09:01:53 -05:00
Valerio Setti
e0fdb87929 manifest: tf-m: align Mbed TLS header files to v3.6.5
Update manifest to align the copy of Mbed TLS header files which lives
in the TF-M repository to what's in Mbed TLS release v3.6.5.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-11-12 09:01:43 -05:00
Anas Nashif
e455e6a39b modbus: fix spdx license identifier
Fix APACHE-2.0 -> Apache 2.0

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-12 14:38:32 +02:00
Emil Gydesen
29f097b2c5 tests: Bluetooth: tester: Add info on running with native_sim
Add a few useful commands and information when running the
BT Tester with native_sim, either with or without the
Zephyr controller.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-11-12 14:38:23 +02:00
Robert Lubos
3e537db71e net: lwm2m: Fix SenML CBOR resource instance encoding
Consecutive resource instance name should be encoded regardless of
whether timestamp is present or not.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-11-12 12:57:30 +02:00
Stoyan Bogdanov
2a9f21482b tests: sensor: Fix fdc2x1x in build_all test suite
Add missing new line before channel entry for fdc2x1x
which was causing CI fail

Signed-off-by: Stoyan Bogdanov <sbogdanov@baylibre.com>
2025-11-12 11:16:59 +02:00
Flavio Ceolin
240960ebdd doc: release/4.3: Add CVE under embargo
Add information about CVE-2025-12899 under embargo.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-11-12 11:14:23 +02:00
Flavio Ceolin
80f4d8427c doc: vuln: Add CVE under embargo
Add an entry to CVE-2025-12899.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-11-12 11:14:23 +02:00
Flavio Ceolin
3cfa7c22f2 doc: security: Disclose CVE-2025-12890
Disclose information about published CVE.

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-11-12 11:14:23 +02:00
Chris Friedt
13daf245a8 tests: drivers: build_all: smbus: add build-all suite for smbus drivers
To ensure that code compiles error (and warning) free, add a build-all
testsuite for smbus drivers.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-11-11 19:48:27 +02:00
Chris Friedt
e6fcd9e09a drivers: smbus: stm32: add cast to avoid warning
Previously, the function `smbus_stm32_pcall()` implicitly cast
`uint16_t *` to `uint8_t *`. Add an explicit cast to avoid warning.

```shell
..drivers/smbus/smbus_stm32.c:358:32: error: initialization of \
  'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type \
  'uint16_t *' {aka 'short unsigned int *'} \
  [-Werror=incompatible-pointer-types]
  358 |                         .buf = &send_word,
      |                                ^
..drivers/smbus/smbus_stm32.c:358:32: note: (near initialization \
  for 'messages[1].buf')
..drivers/smbus/smbus_stm32.c:363:32: error: initialization of \
  'uint8_t *' {aka 'unsigned char *'} from incompatible pointer type \
  'uint16_t *' {aka 'short unsigned int *'} \
  [-Werror=incompatible-pointer-types]
  363 |                         .buf = recv_word,
      |                                ^~~~~~~~~
```

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-11-11 19:48:27 +02:00
Chris Friedt
07d29ec96d drivers: smbus: use correct device initialization priority
The smbus driver initialization priority was previously set to
`KERNEL_INIT_PRIORITY_DEFAULT` (which is 40). However, the default init
priority of devices is typically `KERNEL_INIT_PRIORITY_DEVICE` (which is
50).

Since the stm32 smbus driver uses a reference to the underlying i2c
device, and since this driver was not being built in CI, this led to the
discovery that the smbus driver was initialized too early.

```shell
ERROR: Device initialization priority validation failed, the sequence of \
initialization calls does not match the devicetree dependencies.
ERROR: /smbus1 <smbus_stm32_init> is initialized before its dependency \
/soc/i2c@40005400 <i2c_stm32_init> (POST_KERNEL+1 < POST_KERNEL+4)
```

By setting the initialization priority to `KERNEL_INIT_PRIORITY_DEVICE`,
both smbus1 and i2c1 have their priorities evaluated in the same group,
and it becomes possible to determine relative priorities via phandle
dependency.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-11-11 19:48:27 +02:00
Sudan Landge
deb8437d48 tests: fix: skip stack unwind on unsupported platforms
Add ARCH_HAS_STACKWALK as a dependency to the stack unwind test to avoid
running it on 64bit Cortex-R platforms, which do not implement the
arch_stack_walk() api.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-11-11 19:47:47 +02:00
Yves Wang
c46454781a ci: compliance: update dts-linter to 0.3.6
Update dts-linter to 0.3.6 and dts-lsp to 0.6.7

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2025-11-11 19:47:38 +02:00
Yves Wang
14bba90725 ci: compliance: call dts linter safely under windows
subprocess run without shell requires npx shim under windows.

Signed-off-by: Yves Wang <zhengjia.wang@nxp.com>
2025-11-11 19:47:38 +02:00
Yasushi SHOJI
6d6508ae12 scripts: kconfig: gnuconfig: Ignore loc
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but guiconfig.py is left untouched. This make menuconfig to
die with:

  Exception in Tkinter callback
  Traceback (most recent call last):
    File "/usr/lib/python3.13/tkinter/__init__.py", line 2077, in __call__
      return self.func(*args)
             ~~~~~~~~~^^^^^^^
    File ".../scripts/kconfig/guiconfig.py", line 917, in _tree_double_click
      return _tree_enter(event)
    File ".../scripts/kconfig/guiconfig.py", line 942, in _tree_enter
      _change_node(node, tree.winfo_toplevel())
      ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".../scripts/kconfig/guiconfig.py", line 1125, in _change_node
      s = _set_val_dialog(node, parent)
    File ".../scripts/kconfig/guiconfig.py", line 1219, in _set_val_dialog
      range_info = _range_info(sym)
    File ".../scripts/kconfig/guiconfig.py", line 1339, in _range_info
      for low, high, cond in sym.ranges:
          ^^^^^^^^^^^^^^^
  ValueError: too many values to unpack (expected 3)

This commit ignores the last element in the tuples.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2025-11-11 12:46:17 -05:00
Yasushi SHOJI
090d294ae0 scripts: kconfig: menuconfig: Ignore loc
The commit 125d0daaa1 added 'loc' to the sym.ranges tuples and fixed
kconfiglib.py but menuconfig.py is left untouched. This make menuconfig to
die with:

  Traceback (most recent call last):
    File ".../scripts/kconfig/menuconfig.py", line 3284, in <module>
      _main()
      ~~~~~^^
    File ".../scripts/kconfig/menuconfig.py", line 663, in _main
      menuconfig(standard_kconfig(__doc__))
      ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File ".../scripts/kconfig/menuconfig.py", line 732, in menuconfig
      print(curses.wrapper(_menuconfig))
            ~~~~~~~~~~~~~~^^^^^^^^^^^^^
    File "/usr/lib/python3.13/curses/__init__.py", line 94, in wrapper
      return func(stdscr, *args, **kwds)
    File ".../scripts/kconfig/menuconfig.py", line 872, in _menuconfig
      _change_node(sel_node)
      ~~~~~~~~~~~~^^^^^^^^^^
    File ".../scripts/kconfig/menuconfig.py", line 1586, in _change_node
      s, _range_info(sc))
         ~~~~~~~~~~~^^^^
    File ".../scripts/kconfig/menuconfig.py", line 3119, in _range_info
      for low, high, cond in sym.ranges:
          ^^^^^^^^^^^^^^^
  ValueError: too many values to unpack (expected 3)

This commit ignores the last element in the tuples.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2025-11-11 12:46:17 -05:00
Benjamin Cabé
8fa6a3a214 include: drivers: rtc: add missing doxygen docs
document all the RTC Alarm Time Mask macros

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-11-11 16:26:53 +02:00
Josuah Demangeon
f955d541a4 MAINTAINERS: USB: add @josuah as collaborator
Add a 3rd reviewer to USB area.

Signed-off-by: Josuah Demangeon <me@josuah.net>
2025-11-11 14:13:30 +02:00
Geoffroy Jabouley
16840cc6bd MAINTAINERS: update hal_tdk maintainers
Add rbuisson-invn and gjabouley-invn as maintainers for hal_tdk.

Signed-off-by: Geoffroy Jabouley <geoffroy.jabouley@tdk.com>
2025-11-11 14:13:21 +02:00
Erwan Gouriou
df8b43d330 boards: st: stm32h7s78_dk: Document use of ext_flash_app variant
As stated, document use of ext_flash_app variant (build, flash and debug).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-11-10 09:58:28 -05:00
Erwan Gouriou
da571acff4 boards: st: stm32h573i_dk: Document use of ext_flash_app variant
As stated, document use of ext_flash_app variant (build, flash and debug).

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-11-10 09:58:28 -05:00
Arnaud Pouliquen
1db02b373f MAINTAINERS: Add open-amp and libmetal maintainers
- Add Iulia Prodan as she is already a maintainer of the OpenAMP module.
- Add myself as I am maintainer of the openAMP project.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2025-11-10 09:57:55 -05:00
Johan Hedberg
91b1b84eee release: Zephyr 4.3.0-rc3 v4.3.0-rc3
Update the version to 4.3.0-rc3.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
2025-11-08 16:41:32 +02:00
Anas Nashif
a1b406d844 drivers: promote APIs to unstable status
Many APIs are stuck at experimental status although they already fullfil
the requirements to be considered unstable, i.e. they have multiple
implementations and have been in the tree for more than 2 releases.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-08 08:29:14 -05:00
Badr Bacem KAABIA
8c8d1b5166 Bluetooth: hci_nxp: Improve MAC address uniqueness using CRC-32 hash
The previous method of deriving the local MAC address from the MCU's
Unique ID (UID) by slicing the last 3 bytes had two issues:

1.  **Low Entropy:** Risk of address collision because only a small
    portion of the UID was used, and this portion may not vary much.
2.  **Offset Error:** An incorrect offset calculation could copy
    non-intended bytes.

This commit resolves both issues by replacing the slice operation
with a **CRC-32 hash** over the **entire 16-byte UID**.

The lower 3 bytes (24 bits) of the resulting CRC-32 are used as the
local part of the MAC address, maximizing randomization and ensuring
a high probability of uniqueness across all devices.

Signed-off-by: Badr Bacem KAABIA <badrbacemkaabia@gmail.com>
2025-11-08 08:28:43 -05:00
Derek Snell
50e29d0e5a shields: nxp: lcd_par_s035: fix gt911 touch initialization
Defers init of GT911 touch, MIPI DBI, and display device drivers.
lcd_par_s035_init() in shield.c now initializes these to control the
GT911 INT_GPIO state during the Reset sequence.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
2025-11-08 08:01:03 -05:00
Jerzy Kasenberg
de8cdf0b9e manifest: Update hal_renesas revision for smartbond
hal/renesas was updated with fix for the case when
watchdog was unnecessary disabled after deep sleep.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg.xr@bp.renesas.com>
2025-11-08 07:55:09 -05:00
BUDKE Gerson Fernando
c66f08818c tests: lib: json: fix test expectation
Update the test_json_decoding test to expect correct unescaped values
based on descriptor type semantics:

- JSON_TOK_STRING: Stores pointer to original JSON string, preserving
  escape sequences as they appear in the source. Used when the original
  escaped format needs to be maintained.

- JSON_TOK_STRING_BUF: Copies and unescapes the string into a fixed-size
  buffer, converting JSON escape sequences (\n, \t, \", etc.) to their
  actual character equivalents. Used when the processed, unescaped string
  is needed.

The test was incorrectly expecting the nested_string_buf field (which
uses JSON_TOK_STRING_BUF) to contain the escaped form "esc: \\t". With
the proper unescaping implementation, this field should contain the
unescaped version "esc: \t" (with actual tab character).

This aligns with the documented behavior where JSON_TOK_STRING_BUF
performs unescaping during the copy operation, while JSON_TOK_STRING
simply references the original escaped string.

Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
2025-11-08 10:22:50 +02:00
BUDKE Gerson Fernando
66d13d7028 tests: lib: json: add escape handling tests
Add extensive test coverage for JSON escape sequence handling to
ensure robustness and prevent regression in string encoding/decoding
operations.

The new test suite includes:

1. **Escape Sequence Stability**: Tests multiple encode/decode cycles
   to prevent backslash duplication bugs where sequences like \n, \t
   could be duplicated with each cycle.

2. **Individual Escape Sequences**: Comprehensive testing of each JSON
   escape type:
   - \n (newline), \t (tab), \r (carriage return), \f (form feed)
   - \b (backspace), \\ (backslash), \" (quote), \/ (slash)

3. **Quote Handling**: Special focus on quote escaping/unescaping to
   ensure proper JSON syntax and data integrity.

4. **Mixed Escape Sequences**: Complex scenarios with multiple
   different escape sequences in single strings to test edge cases.

5. **Multiple Cycle Stability**: Repeated encode/decode operations to
   simulate real-world usage patterns and detect gradual corruption.

6. **Backslash Duplication Detection**: Specific tests targeting the
   common bug where backslashes accumulate during multiple processing
   cycles.

7. **Round-trip Validation**: Complete encode → decode → encode cycles
   to verify data preservation.

8. **Edge Cases**: Testing boundary conditions like strings containing
   only quotes or complex escape combinations.

These tests use a new `escape_test_data` structure with both string
value and string buffer fields to verify proper handling of both
JSON_TOK_STRING and JSON_TOK_STRING_BUF descriptor types.

The test suite ensures that:
- Escape sequences are properly encoded in JSON output
- Escape sequences are correctly unescaped during parsing
- No data corruption occurs during multiple processing cycles
- Both string pointer and string buffer fields behave correctly
- Complex escape scenarios are handled robustly

Signed-off-by: BUDKE Gerson Fernando <gerson.budke@leica-geosystems.com>
2025-11-08 10:22:50 +02:00