Commit graph

126,787 commits

Author SHA1 Message Date
Shan Pen
cdd4460a31 drivers: disk: sdmmc_stm32: Add compatibility macros for STM32F4 SDIO
Add compatibility macros to map SDMMC constants to SDIO equivalents
for STM32F4 series MCUs. STM32F4 uses SDIO peripheral with SDIO_*
constants while newer STM32F7/H7 series use SDMMC peripheral with
SDMMC_* constants.

This fixes compilation errors on STM32F4 platforms where SDMMC_*
constants are undefined:
- SDMMC_CLOCK_EDGE_RISING
- SDMMC_CLOCK_BYPASS_ENABLE/DISABLE
- SDMMC_CLOCK_POWER_SAVE_ENABLE/DISABLE
- SDMMC_HARDWARE_FLOW_CONTROL_DISABLE

Fixes zephyrproject-rtos/zephyr#94896

Signed-off-by: Shan Pen <bricle031@gmail.com>
2025-09-02 21:40:24 +02:00
Liam Ogletree
6524cc4f22 tests: drivers: Add AT25XV021A flash device to test cases
Dummy values mirror at25 and spi-nor implementation.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2025-09-02 21:40:07 +02:00
Liam Ogletree
97752191f4 drivers: flash: Add support for Atmel AT25 SPI flash variant
The AT25XV021A variant is a flash variant of Atmel's AT25 family
that adds extra protections, requiring additional writes to the
device to program or erase data.

This commit adds a flash driver for AT25XV021A devices instead of
modifying (1) the existing AT45 SPI flash driver or (2) the
existing AT24/25 EEPROM driver because this variant poses
fundamental changes that affect all aspects of the driver.

Notably,
 - AT25XV021A includes a second status register, and the format
	and functions of the existing status register is
	changed from the existing drivers.
 - AT25XV021A requires executing page or chip erase commands
	before writing, making it incompatible with the
	existing AT24/25 EEPROM driver.
 - AT25XV021A adds a software protection layer that requires
	extra writes before executing program or erase commands.

Tested writing to and erasing from an AT25XV021A device. Tested
reading from an AT25XV021A device across page boundaries. Tested
chip erase function. Tested driver initialization from varying
initial hardware states.

Signed-off-by: Liam Ogletree <liam.ogletree@cirrus.com>
2025-09-02 21:40:07 +02:00
Terry Geng
1f53d6a2d3 drivers: spi: spi_pico_pio: Remove pio from ...data
Make use of the inline function to reduce unnecessary variables.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-09-02 21:39:55 +02:00
Terry Geng
814750d115 drivers: misc: pio_rpi_pico: Make pio_rpi_pico_get_pio inline.
The `pio` value is stored in the internal `pio_rpi_pico_config` structure
that is not exposed. However, it is the first element of the structure.
Here, I convert the pointer to `pio_rpi_pico_config` into a pointer to PIO
to access this value.

Signed-off-by: Terry Geng <terry@terriex.com>
2025-09-02 21:39:55 +02:00
Joel Guittet
7837f5e509 drivers: wifi: esp32: fix integration of connection manager
Connection manager doesn't depends on ESP32 Wi-FI AP+STA mode.
This modification fix integration of connection manager binding
in the Wi-Fi ESP32 driver.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2025-09-02 18:43:56 +02:00
Fin Maaß
29add12625 boards: nxp: frdm_mcxn947: deactivate eth phy on cpu1
deactivate eth phy on cpu1, because
mdio is also only activated on cpu0.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
2025-09-02 18:42:53 +02:00
Syver Haraldsen
bd9dc902e1 storage/stream_flash: Add test for buffered data size API
Add a test for the new API to query the buffered data size in the
stream_flash subsystem.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
2025-09-02 18:42:45 +02:00
Syver Haraldsen
6331225c94 storage/stream_flash: Add API to query buffered data size
add a wrapper function to read the number of bytes currently buffered
and pending for the next flash write operation.

Signed-off-by: Syver Haraldsen <syver.haraldsen@nordicsemi.no>
2025-09-02 18:42:45 +02:00
Charles Hardin
633246a3ea net: dns: add query support for additional types CNAME, SRV, and TXT
These types are useful for IoT deployments and should be available
thru the resolver interface to get the data. The SRV is especially
useful to find services on the local network when not using a dns-sd
deployment and just something like Avanhi or Bonjour.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Charles Hardin
b60ae6fb1a net: dns: only add periods between labels and not on the first label
When resolving SRV records - the label might not be compressed so
the first entry into the net buf is the start of the name and a
period could end up at the start - ie. ".example.local" so only add
a period when the buffer is not empty.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Charles Hardin
ece1ed567b net: dns: adjust the enum for response type to be positive on success
The enum will auto increment, so in debug the IP and DATA records are
negative numbers which initially made this look like an error, so just
push the expected good values to be positive numbers in case of a print
or something else would imply these are ok.

Signed-off-by: Charles Hardin <ckhardin@gmail.com>
2025-09-02 18:42:35 +02:00
Emil Gydesen
2dc358cee2 Bluetooth: ISO: Add check to prevent premature BIG termination
There was an issue where terminating the BIG while in the
ISO connected callbacks could lead to continueing the loops
would cause access to cleared memory.

The simple solution to this is to simply prevent
bt_iso_big_terminate from terminating the BIGs while we are
processing the BIG HCI events.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 18:42:04 +02:00
Jordan Yates
066ed265ff doc: lora_lorawan: document LoRa Basics Modem
Document the current status of LoRaMAC-node and LoRa Basics Modem.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
2270898271 samples: lora: validate LBM build
Add testcases for `CONFIG_LORA_MODULE_BACKEND_LORA_BASICS_MODEM` in the
LoRa API samples.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
03513a6910 lora: lbm: choice of reported RSSI type
Add a choice of which RSSI type should be reported to the application
layer, packet RSSI (which stops at the noise floor) or signal RSSI
(which estimates the LoRa signal strength into the noise floor).

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
611e14bd6d lora: lbm: enable SX126x RX boost option
Add the option to enable the RX boost mode in devicetree.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
38384e1233 lora: LoRa Basics Modem backend for SX12xx chips
As a first integration of the LoRa Basics Modem backend, implement the
LoRa API for the standard SX126x/SX127x chips.

Much of the logic from `lbm_common.c` is taken from the loramac-node
`sx12xx_common` implementation, but it should now be agnostic for all
LoRa RF transceivers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
26438a5563 manifest: add lora-basics-modem module
Import the lora-basics-modem module as an alternate backend for LoRa
and LoRaWAN, since loramac-node has been deprecated.

Support is currently limited and experimental.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Jordan Yates
01c97e205d lora: shift drivers to dedicated loramac-node folder
Move the current implementation of the LoRa API using `loramac-node` to
a dedicated folder in preparation for the LoRa basics modem
implementation.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-09-02 18:41:44 +02:00
Emil Gydesen
de263b2bf8 doc: Bluetooth: ISO: Add broadcast to ISO shell docs
Add examples of how to use the ISO shell with broadcast.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 18:41:32 +02:00
Emil Gydesen
258e793cc8 Bluetooth: ISO: Shell: Fix bcode for big_create
The broadcast code was attempting to read from argv[1] instead
of argv[2] that actually contains the broadcast code.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-09-02 18:41:32 +02:00
Vaishnav Achath
3015714384 MAINTAINERS: Add @glneo as TI K3 Platforms maintainer
Add Andrew Davis (@glneo) as TI K3 Platform maintainer, Andrew is an
active collaborator and permanent employee of TI Processor SW team.
Also move myself as collaborator for K3 platforms.

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
2025-09-02 11:18:06 -04:00
Gerson Fernando Budke
0034709df5 .gitignore: Ignore direnv .envrc file
Ignore the direnv .envrc file to automatically loads and unloads
environment variables from the current directory.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2025-09-02 11:17:49 -04:00
Erwan Gouriou
c7086c7e67 drivers: flash_stm32_xspi: Fix Dummy Cycles on MX66UM1G45G NOR at 200MHz
This commit is fixing configuration of mx66uw1g45g NOR when working
at 200MHz.
According to its specification, when running at 200MHz, this memory should
use a Number Dummy Cycles configuration of 20 (DC bits in CFGR2), which is
the device's default configuration.
Applying the 66MHz configuration as done today was preventing flash to run
at frequency higher than 100Mhz.

This commit doesn't solve the more generic problem of this driver which
is applying this 66MHz configuration universally, irrespective of the
frequency and the memory device, but fixes the configuration which was
reported broken today.

Providing a global change would require starting a clear split between XSPI
controller configuration an bus device configuration, which is what new
MSPI API intend to solve, so this will be tackled once this driver will be
available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-02 15:54:56 +02:00
Erwan Gouriou
f179972548 boards: stm32n6570_dk/nucleo_n657x0_q: Set NOR XSPI controller clk to HCLK5
Fix copy/paste issue on XSPI_SEL macro and use HCLK5 as kernel clk.
This has no functional impact on NOR as HCLK5 is the default clk which
was used due to the copy/paste error.
Remove now useless ic3 nodes.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-09-02 15:54:56 +02:00
Benjamin Cabé
c820085376 drivers: timer: stm32: fix typo in kconfig help
Corrected the LSE frequency value from 32678 to 32768.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-02 15:54:48 +02:00
Benjamin Cabé
c416937d9f include: drivers: flash: clean up doxygen
Rework doxygen group naming and fold "internal" Flash API into the main
Flash API group.
Also a minor fix of a missing javadoc-style comment.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-09-02 15:54:37 +02:00
Elmo Lan
6a98a11b66 soc : realtek: ec: rts5912: fix waiting time not enough
For the ULPM set, it asks for a 10ms ready time for the module.
Use k_busy_wait instead of k_msleep to ensure we wait enough clock cycles.

Signed-off-by: Elmo Lan <elmo_lan@realtek.com>
2025-09-02 15:54:31 +02:00
Theis Mejnertsen
7c7dae4f9e tests: zms: add function to test zms handling of invalid inputs
The ZMS API should not unexpectedly crash the application; this commit
adds tests to check if the ZMS API can safely handle and return -EINVAL
if called with a NULL fs pointer.

This commit also adds test to confirm the return value matches the
documentation if user calls the ZMS API before ZMS is mounted

Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
2025-09-02 15:54:17 +02:00
Theis Mejnertsen
aca602f2d0 fs: zms: add input validation of fs pointer for api
Add checks on the fs pointer passed through the api before using to
avoid causing an exception

Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
2025-09-02 15:54:17 +02:00
Theis Mejnertsen
4e4482205f fs: zms: make zms_active_sector_free_space return type signed
zms_active_sector_free_space is documented to return -EACCES on fs not
mounted error but currently returns an usigned type size_t. This fixes
that by changing the return value into a ssize_t

Signed-off-by: Theis Mejnertsen <theismejnertsen@gmail.com>
2025-09-02 15:54:17 +02:00
Fabrice DJIATSA
7ff93d7454 scripts: twister: pylib: not needed board id with BOOT-SERIAL mode
STM32CubeProgrammer does not support flashing in BOOT-SERIAL mode
using the device's serial number.

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2025-09-02 15:54:07 +02:00
Francois Ramu
c965767203 samples: drivers: spi flash testing with stm32 in memmapped mode
Add a testcase to execute the samples/drivers/spi_flash on
stm32 disco kits where the external flash is accessible
in memory mapped mode : CONFIG_STM32_MEMMAP=y.
In this testcase condition, the DMA transfer is not used but memcopy.
limit to "st,stm32-Xspi-nor" compatible only.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2025-09-02 15:54:01 +02:00
Alberto Escolar Piedras
a1466cfc60 sys: timeutil: Move and rename K_TICKS macros
These macros depend on time.h (which is not included in clock.h)
and are not really kernel related, but translation from the kernel
tick representation into time_spec values.
Let's place them in timeutils with their related macros/functions.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-02 15:53:54 +02:00
Alberto Escolar Piedras
551a7abbc5 sys: timeutil & test: Multiple fixes
* Fixes in code and test so it works with any expected time_t size.
* Fix test_timespec_normalize so it also tests the output of
  timespec_normalize(), fixing some incorrect expected values
  accordingly.
* Test: Do not force a C library in the integration platform
  and do not filter by libC as it is not necessary anymore.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-09-02 15:53:54 +02:00
Chris Friedt
f4936880a8 Revert "tests/lib/timespec_util: Skip two tests by now"
This reverts commit 8f092623ae.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-02 15:53:54 +02:00
Chris Friedt
4ff059395b sys: timeutil: compute the remainder in timespec to timeout conversion
Since it's possible that rounding up might not always be the right thing
to do in every situation, in order to allow the application to make more
informed decisions, we created a modified timespec_to_timeout() that also
returns the remainder (or difference) between the requested time to
convert and resulting k_timeout_t. The difference is expressed as a
timespec object.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-02 15:53:54 +02:00
Chris Friedt
fd41e08f4e tests: lib: timespec_util: elaborate timespec to k_timeout_t conversion
Elaborate on testing for functions that convert between timespec and
k_timeout_t.

We explicitly add tests to verify functionality in the regions of
interest, verify the semantic equivalence of specific time points.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-02 15:53:54 +02:00
Chris Friedt
4a72b590c6 sys: timeutil: ensure safety of timespec conversion routines
Originally, the timespec_to_timeout() and timespec_from_timeout() tests
assumed that tv_sec and tv_nsec values divided evenly with the number of
ticks per second (CONFIG_SYS_CLOCK_TICKS_PER_SEC). However, those
assumptions broke down when testing with 32768 ticks/s .

Upon further investigation, there were additional corner cases
discovered that were not handled in an ideal or safe way.

Part of this fix involved identifying several "domains" and special
values that have semantic meaning that must be handled particularly
carefully.

Additional hidden-API constants were made to simplify the solution.

K_TICK_MIN (1)
K_TICK_MAX (UINT32_MAX-1 in 32-bit, INT64_MAX in 64-bit)

K_TIMESPEC_NO_WAIT (like K_NO_WAIT)
K_TIMESPEC_FOREVER (like K_FOREVER)

1. Converting a negative k_timeout_t

These only exist in 64-bit representation and actually encode absolute
timepoints via ticks. Since the stated purpose of the conversion
functions is to convert between durations, we must reject absolute
time points in timespec_from_timeout().

2. Converting a negative timespec

We assume that this duration means a timeout has already expired, and
round these up to K_NO_WAIT in timespec_to_timeout().

3. Due to the larger numeric space in the timespec representation,
the reverse mapping of timespec to k_timeout_t is "fuzzy". However,
K_NO_WAIT (K_TIMESPEC_NO_WAIT) and K_FOREVER (K_TIMESPEC_FOREVER) must
remain semantically equivalent. The previous implementation also held this
to be true, but the test cases are a bit clearer about it now.

4. Also, due to the larger numeric space in timespec representation,
there was a special requirement to round up to the nearest tick
boundary for any timespec in the strictly exclusive range
(K_TIMESPEC_NO_WAIT, K_TIMESPEC_MAX). We must round up, since
a) rounding down to K_NO_WAIT is most certainly not representative
   of a non-zero finite duration delay
b) the kernel operates on tick boundaries

5. Above the K_TIMESPEC_MAX boundary, which is the highest possible
timespec that can be represented by a tick, and specifically in the
64-bit timeout representation, there is a domain that cannot be
rounded up to K_TIMESPEC_FOREVER and should always be rounded down to
K_TIMESPEC_MAX.

This is to ensure that finite durations remain finite (even if
they are beyond the heat death of the universe).

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-02 15:53:54 +02:00
Chris Friedt
f68af2d4c7 sys: clock: additional constants and macros for timespec conversion
Define additional constants and macros for converting between timespec
objects and k_timeout_t.

There are four semantically important durations identified with new
constants identified via '.

1. K_NO_WAIT / K_TIMESPEC_NO_WAIT'
  *  duration of zero

2. K_TICK_MIN' / K_TIMESPEC_MIN'
  * minimum number of ticks strictly greater than K_NO_WAIT

3. K_TICK_MAX' / K_TIMESPEC_MAX'
  * maximum number of ticks strictly and semantically less than K_FOREVER

4. K_FOREVER / K_TIMESPEC_FOREVER'
  * the familiar non-expiring number of ticks (i.e. infinity)

With these definitions, there are 3 meaningful regions for conversion
between timespec and k_timeout_t representation:

1. < K_TIMESPEC_NO_WAIT (i.e. a negative timespec)
  * should be rounded up to K_TIMESPEC_NO_WAIT
  * < K_NO_WAIT in ticks is an absolute time point in 64-bit
    representation should no be permitted in the affected conversion
    routines, as they are explicitly  for converting time durations rather
    than absolute time points.

2. K_TIMESPEC_NO_WAIT < x < K_TIMESPEC_MAX
  * should be rounded-up to the next tick boundary
  * must be represented as the minimal non-zero duration in ticks

3. K_TIMESPEC_MAX <= x < K_TIMESPEC_FOREVER
  * must be represented as the maximum expiring duration in ticks
  * should be rounded-down to K_TIMESPEC_MAX

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
2025-09-02 15:53:54 +02:00
Luc BEAUFILS
f743822acc dts: arm: stm32mp2_m33.dtsi: add iwdg4 watchdog node
This is the independent watchdog for the non-secure world of M33 core.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
b30d291030 dt-bindings: stm32mp2_clock: add iwdg4 clock
Add the IWDG4 clock definition to the STM32MP2 clock bindings.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
d31f0138ad drivers: wdt_iwdg_stm32.c: freeze watchdog in debug mode for mp2x SoCs
The IWDG4 is on the APB3 bus on STM32MP2x SoCs. When the system is
in debug mode, the watchdog should be frozen to prevent it from
expiring and resetting the system during debugging sessions.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
df4ed5e281 clock_control: clock_stm32_ll_mp2: add wwdg1 clock support
WWDG1 clock = ((MCU clock / LSMCU div) /APB3 prescaler)

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
dd86d70923 dts: arm: stm32mp2_m33: add wwdg1 node
Add the wwdg1 node, which is the wwdg for non-secure world.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
d67bb71435 dt-bindings: stm32mp2_clock: add wwdg1 clock
Add clock binding for WWDG1 peripheral in STM32MP2 series.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Luc BEAUFILS
43b63b13e6 drivers: wdt_wwdg_stm32: freeze watchdog in debug mode for mp2x SoCs
Like the H7x series, the MP2x series has a WWDG1 peripheral in the APB3
bus. The MP2 has the same LL function to freeze the watchdog in debug
mode.

Signed-off-by: Luc BEAUFILS <luc.beaufils@savoirfairelinux.com>
2025-09-02 15:53:41 +02:00
Tim Lin
d3d334c584 drivers/bbram: Enable bbram driver for it51xxx series
The BBRAM driver of it51xxx is compatible with it8xxx2.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2025-09-02 12:33:48 +02:00
cyliang tw
16f2b2fc1c boards: nuvoton: add support for numaker m5531
Add new development board numaker_m5531 for m5531h2l.

Signed-off-by: cyliang tw <cyliang@nuvoton.com>
2025-09-02 12:33:43 +02:00