Commit graph

108437 commits

Author SHA1 Message Date
Pierrick Curt
051a2b6cd0 samples: drivers: adc: example to use AD4114 on stm32f3_disco
This examples shows how to use the AD4114 ADC on a
stm32f3_disco board.
As the AD4114 is a 24bits ADC resolution we need to be able
to pass 32bits buffer to get the samples.
CONFIG_SEQUENCE_RESOLUTION is set to 12 instead of 24, and the
gain zephyr,vref-mv is adapted to avoid overflows using the
exisiting adc_raw_to_millivolts function.

Signed-off-by: Pierrick Curt <pierrickcurt@gmail.com>
2025-01-15 19:04:20 +01:00
Pierrick Curt
8250cc68b7 drivers: adc: ad4114: add driver support
The AD4114 is a low power, low noise, 24-bit, sigma-delta ADC.
This driver allows to use it with the Zephyr ADC API. It uses
the continuous acquisition ADC feature.

This ADC allows many configutations, but this driver uses it as the
most generic way :
- each can channel can be enable or disable using the device
tree configuration
- configure two setups (one for unipolar inputs, one for bipolar inputs)
- use an external clock

Signed-off-by: Pierrick Curt <pierrickcurt@gmail.com>
2025-01-15 19:04:20 +01:00
Wenxi Xu
a490c90dc3 drivers: sensor: bmi08x: fix interfaceand trigger
1. Temperature Interface
According to BMI08x datasheet, temperature reading
requires both MSB and LSB bytes to be read and
processed correctly.

Temp data processing should follow the formula:
Temp in °C = (temp_msb * 8) + (temp_lsb / 32)

This patch implements the correct reading
sequence and calculation method as specified
in the datasheet.

2. Trigger Setting
Previously we set handler and then trigger struct.
However under some situation, as long as we set
the handler, we get into ISR immediately and never
set trigger struct.
I simply changed the sequence.

Testing:
- Verified temperature readings match datasheet
- Tested on stm32f407igh board with BMI08x sensor

Fixes: #82375

Signed-off-by: Wenxi Xu <xuwenxi0517@gmail.com>
2025-01-15 19:04:06 +01:00
Jordan Yates
d36334a08c sensor: tmp108: optimize resource usage
Optimize the resource usage of the driver for the case where
`CONFIG_TMP108_ALERT_INTERRUPTS=n`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-15 19:03:40 +01:00
Jordan Yates
093f66fe55 sensor: tmp108: fix sample_fetch API conformance
`sensor_sample_fetch` is documented as blocking until the fetch
operation is complete. Update the implementation so that this is true.

Since the fetch operation now blocks, there is no need for the data
ready trigger.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-15 19:03:40 +01:00
Jordan Yates
faf912d404 sensor: tmp108: fix one-shot mode for as6212
When configuring the device to run in one-shot mode, the AS6212 requires
the sleep mode bit to be set. From the datasheet:

```
The sleep mode is activated by setting the bit SM in the configuration
register to 1. This shuts the device down immediately and reduces the
power consumption to a minimum value.

Entering the sleep mode will take some time (120 ms maximum) and the
first conversion after the sleep mode has been entered takes longer than
the values specified in Figure 7. It is therefore recommended when
entering sleep mode to trigger a single shot conversion at the same
time. After 150 ms (max), the device has then entered the sleep mode and
subsequent conversion times are as specified in Figure 7.
```

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-15 19:03:40 +01:00
Jordan Yates
f5434c133f sensor: tmp108: use common sensor_value_ helpers
Use the common `sensor_value_*` helper functions instead of implementing
the conversions again in the driver.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-01-15 19:03:40 +01:00
Jianxiong Gu
eefbed2184 tests: drivers: Add RT1715 driver
Add a build test to verify richtek,rt1715 driver builds correctly.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Jianxiong Gu
6f0d72118a usbc: Update tcpc_sop_prime_enable() description
Clearly mention that this function enables both SOP' and SOP'' messages.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Jianxiong Gu
416bf2202c drivers: tcpc: Modify the ps8xxx.c
This commit modifies the ps8xxx.c driver to use the generic TCPCI function.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Jianxiong Gu
391008b097 drivers: tcpc: Add TCPC driver for RT1715
Add support for RT1715.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Jianxiong Gu
90530cba96 usbc: add generic TCPCI related functions
Add generic functions that will be common to all TCPCI compliant drivers.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 19:03:27 +01:00
Mark Chen
f4da9b9705 drivers: sensor: Add sensor clock API support
This commit introduces a new Sensor Clock API, enabling the retrieval
of cycle counts and conversion to nanoseconds based on the system or
external clock. The API includes:

- `sensor_clock_get_cycles()` to get the current cycle count from the
  sensor clock.
- `sensor_clock_cycles_to_ns()` to convert cycles to nanoseconds using
  the clock's frequency.

The implementation supports both system clocks and external clocks
defined in the device tree, making the sensor clock integration more
flexible for various sensor use cases.

Signed-off-by: Mark Chen <mark.chen@cienet.com>
2025-01-15 19:03:13 +01:00
Yangbo Lu
7c57fec0d0 drivers: firmware: scmi: add power domain protocol
Added helpers for ARM SCMI power dmomain protocol.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-01-15 19:03:00 +01:00
Yangbo Lu
db703919ba drivers: firmware: scmi: add more APIs of clock management protocol
Added more APIs for ARM SCMI clock management protocol.
- scmi_clock_rate_set
- scmi_clock_parent_get
- scmi_clock_parent_set

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2025-01-15 19:03:00 +01:00
Fabian Blatz
7537a142be doc: migration-guide-4.1: Add section about step interval based API
Adds a two bullet points explaining the change of the velocity based API
towards an step interval one.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-15 15:06:37 +01:00
Fabian Blatz
dfaca867ca doc: hardware: peripherals: stepper: Migrate to step interval API
Migrates the peripherals documentation to the new step interval based APi
instead of the velocity one.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-15 15:06:37 +01:00
Fabian Blatz
705365c747 drivers: stepper: Change stepper velocity to step interval
Change the stepper API to instead of changing the stepper speed based on
the velocity in microsteps per second to use the delay in usec between
successive steps. Also remove the velocity from the `stepper_run` function
as typical API usage is enable -> set step interval -> run.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-15 15:06:37 +01:00
Pieter De Gendt
6e1bedd370 include: net: ethernet: sort ptype definitions
Keep the ptype definitions sorted by name.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-15 15:06:25 +01:00
Sebastian Huber
ade1c883a8 scripts: build: Make scripts executable
Make scripts with an interpreter line executable so that they can be
invoked directly.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
2025-01-15 15:06:01 +01:00
Alberto Escolar Piedras
d72d1aaeae net: if: Fix net_if_list iteration issue with llvm & ASAN
The address sanitizer in llvm adds padding (redzones) after data.
But for those structures we are re-grouping using the linker script
and for which we iterate over we cannot have that extra padding.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-01-15 15:05:48 +01:00
Krzysztof Chruściński
0359f37263 tests: kernel: gen_isr_table: Fix test for nRF VPR targets
Test was using interrupt lines which does not exist on nRF VPR
targets. nRF54Lx FLPR has interrupts >= 16 and nRF54Hx PPR does
not have interrupt 17. Added configuration which works for
nrf54h20_cpuppr and nrf54lx_flpr.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2025-01-15 15:05:38 +01:00
Mathieu Choplain
db8a47a2ec soc: stm32wb0: replace SYS_INIT with early init hook
STM32WB0 series was missed when SoC initialization code was migrated
from SYS_INIT routines to the new soc_early_init_hook method
(c.f. commit c6a03606c2)

Update that series' initialization code to align it with all others.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2025-01-15 15:05:23 +01:00
Sylvio Alves
c93a4b99ca drivers: entropy: update espressif source
Update entropy driver to add proper ESP32-S3 waiting cycles.
Add custow ESP32C6 waiting cycles and handle LP_TIMER support.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-01-15 15:05:13 +01:00
Ioannis Damigos
b612044a93 smartbond_timer: If PM is set, take into account watchdog for timeout ticks
If PM is enabled, adjust timeout ticks according to watchdog expiration.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2025-01-15 15:04:29 +01:00
Ioannis Damigos
6b9eaa9f47 smartbond_timer: Use hw clock frequency for watchdog expire ticks
Use hardware clock frequency to calculate watchdog expire ticks
instead of kernel's "ticks".

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
2025-01-15 15:04:29 +01:00
TOKITA Hiroshi
ecefb5de5d drivers: input: ft5336: Enable interrupts in conjunction with DT config
Enabling `CONFIG_INPUT_FT5336_INTERRUPT` if the ft5336 node in DT
has `int-gpios` property.

As a result of this change, some boards can eliminate lines that
explicitly configure `CONFIG_INPUT_FT5336_INTERRUPT`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-01-15 15:04:13 +01:00
Pieter De Gendt
5d23996361 tests: application_development: Add spdx SBOM test
Add a test where the software bill of materials is generated using the
west spdx extension.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-15 15:03:59 +01:00
Pieter De Gendt
1378669736 scripts: west_command: spdx: Exit with non-zero code on failure
If the init or the generation fails, the resulting exit code should be
non-zero.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-01-15 15:03:59 +01:00
Jianxiong Gu
4e201f21c8 dts: riscv: include riscv,cpus.yaml in qingke-v2
This commit updates the qingke-v2 binding to include `riscv,cpus.yaml`
instead of `cpu.yaml`.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 11:58:58 +01:00
Jianxiong Gu
74b502e914 soc: wch: add generic vector table support
Add `VECTOR_TABLE_SIZE` Kconfig option to define the number of interrupt
and exception vectors based on the actual hardware specification.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 11:58:58 +01:00
Jianxiong Gu
957ec63897 dts: wch: add all ch32v003 packages
Add support for all ch32v003 packages.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 11:58:58 +01:00
Jianxiong Gu
384144dc65 soc: wch: reorganize series directories by core
Place ch32v003 under the qingke_v2a series.
Place qingke series under the ch32v family.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 11:58:58 +01:00
Jianxiong Gu
a7e15654eb dts: wch: move ch32v00x.dtsi to ch32v0/ch32v003.dtsi
The CH32V003 belongs to the CH32V0 series. To improve code organization
and maintainability, all related files should be grouped together in a
dedicated subdirectory.

Signed-off-by: Jianxiong Gu <jianxiong.gu@outlook.com>
2025-01-15 11:58:58 +01:00
Sudan Landge
707a81d2ed MAINTAINERS: Update maintainer information for Arm
Transitioning maintainership of Arm from @ithinuel to @wearyzen.
Many thanks to @ithinuel for your contributions and
dedication to this area.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
2025-01-15 11:53:09 +01:00
Axel Le Bourhis
cb8cb39fbf soc: nxp: rw: fix stack overflow in BLE samples
mbedtls is now used in BLE samples, increasing the stack depth needed
of the calling threads. This was causing stack overflows in several BLE
samples.
Increasing the main stack size for common samples, but also the shell
stack size for samples calling bt API from the shell thread like the
bt shell.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-01-15 11:52:52 +01:00
Axel Le Bourhis
b6e9f3d9e9 soc: nxp: mcxw: fix stack overflow in BLE samples
mbedtls is now used in BLE samples, increasing the stack depth needed
of the calling threads. This was causing stack overflows in several BLE
samples.
Increasing the main stack size for common samples, but also the shell
stack size for samples calling bt API from the shell thread like the
bt shell.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
2025-01-15 11:52:52 +01:00
Rafał Kuźnia
5064401742 samples: drivers: counter: add nRF54L09 config
Added build configuration for nRF54L09.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2025-01-15 11:52:03 +01:00
Rafał Kuźnia
6f419cd6fb tests: nrf: enable twister tests for nrf54l09pdk
Enabled tests:
- clock_control_api
- nrf_clock_calibration
- nrf_lf_clock_start
- clock_control/onoff
- counter_basic_api
- flash/common
- flahs/negative_tests
- retained_mem/api
- nrf_grtc_timer
- wdt_error_cases
- fs/fcb
- stream/stream_flash

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2025-01-15 11:52:03 +01:00
Anas Nashif
4ee6b833c5 doc: convert coding guideline rules to definition lists
Use definition list instead of deep header levels.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-01-15 11:51:42 +01:00
Jilay Pandya
9cce4841e5 docs: migration_guide_4.1: entry for renamed device tree properties
add migration guide after renaming device tree properties
- pin_mask -> pin-mask
- pinmux_mask -> pinmux-mask
- vbatts_pins -> vbatts-pins
- bit_per_gpio -> bit-per-gpio
- off_val -> off-val
- on_val -> on-val

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-01-15 11:51:33 +01:00
Jilay Pandya
c5aed65a54 dts: bindings: gpio: use hyphens instead of underscore
replace underscore with hyphens to comply with device tree spec

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
2025-01-15 11:51:33 +01:00
James Roy
0de4cdf9e1 doc: Add a new migration guide entry to display
Rename the pclk_pol and data_cmd-gpios propertys
to pclk-pol and data-cmd-gpios in the devicetree
and bindings of the display subsystem.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-01-15 11:51:23 +01:00
James Roy
32e42856bc dts: bindings: display: Change the property names in the overlay
Unify property names in bindings and overlay, using
hyphens (-) instead of underscores (_) as separators.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2025-01-15 11:51:23 +01:00
Chen Shu
5a5f05ba4e fs: ext2: Fix nbytes_to_read calculation in ext2_inode_read()
Fix incorrect nbytes_to_read calculation in ext2_inode_read() function.
Previously nbytes_to_read was decremented by read value which caused
incorrect calculation of bytes to read in subsequent iterations.
Now nbytes_to_read is decremented by to_read value which represents
the actual number of bytes read in current iteration.

This fixes potential data corruption issues when reading files from
ext2 filesystem.

Signed-off-by: Chen Shu <751541594@qq.com>
2025-01-15 11:51:10 +01:00
Tom Burdick
5de7e415a0 logging: Add a log flush operation
Ensure all pending log messages are processed by the log processing
thread when log_flush is called, blocking the caller until done.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2025-01-15 09:33:28 +01:00
Nicolas Pitre
44d5d8aef2 kernel: uninline z_dummy_thread_init()
This function is getting quite involved and it also gained more callers
lately. This is not performance critical so Uninline it to save on
binary size.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-15 07:19:40 +01:00
Yangbo Lu
314686ea03 soc: nxp: imx93: m33 early init for GPIO
M33 early init for GPIO for secure access configuration,
so that driver can operate pins.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Chunlei Xu <chunlei.xu@nxp.com>
2025-01-15 07:19:15 +01:00
Patrick Günzel
66dceba537 driver: adjust res when oversampling
The SAM0 ADC has an internal register to divide the accumulated results
of oversampling the ADC by the amount of samples collected. This value
has to be set by the driver and was missing.

Signed-off-by: Patrick Günzel <patrick.guenzel@kinexon.com>
2025-01-15 07:19:03 +01:00
Emil Gydesen
ba5971e703 Bluetooth: ISO: Move contents of Kconfig.iso to common Kconfig
Move the contents of Kconfig.iso to the common Kconfig
file.

The main reason for this is that the Kconfig.iso filename
has caused issues for some, due to the .iso filename extension.

The contents have been moved to right after the Kconfig options
for BT_CONN which are quite similar.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-15 01:39:35 +01:00