Commit graph

107460 commits

Author SHA1 Message Date
Peter Mitsis
5710e034e7 kernel: Introduce _THREAD_SLEEPING state bit
At the present time, Zephyr does has overlap between sleeping and
suspending. Not only should sleeping and suspended be orthogonal
states, but we should ensure users always employ the correct API.
For example, to wake a sleeping thread, k_wakeup() should be used,
and to resume a suspended thread, k_thread_resume() should be used.
However, at the present time k_thread_resume() can be used on a
thread that called k_sleep(K_FOREVER). Sleeping should have nothing
to do with suspension.

This commit introduces the new _THREAD_SLEEPING thread state along
with some prep-work to facilitate the decoupling of the sleeping and
suspended thread states.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-12-18 18:17:03 +01:00
Karthikeyan Krishnasamy
b0389ce5b5 drivers: adc: add ads131m02 adc driver
ADS131M02 is Texas Instruments 2-channel, 24-Bit differential
input ADC which support wide range datarate.
Driver add support for adc read, channel configure, adc sampling
mode configuration and power management.

[1]. https://www.ti.com/lit/ds/symlink/ads131m02.pdf

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-12-18 18:16:40 +01:00
Karthikeyan Krishnasamy
1f2e15d43d dts: bindings: adc: add ads131m02 adc driver binding
add binding for Texas Instruments ADS131M02 ADC driver

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2024-12-18 18:16:40 +01:00
Gerard Marull-Paretas
47d17f4542 boards: shields: sparkfun_carrier_asset_tracker: remove defconfig
Shield was enabling some Kconfig options for no reason. Shields do
not need to enable driver classes unconditionally, these are enabled
either by drivers or samples that require them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:16:21 +01:00
Marcin Szymczyk
db7365e286 drivers: mbox: nrf_vevif_event: add workaround for nRF54L errata 16
Prevent events from being triggered again on the next CNT0 event.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2024-12-18 18:15:29 +01:00
Gerard Marull-Paretas
5504fefb0d samples: boards: espressif: deep_sleep: add missing select GPIO
Kconfigs enabled functionality that requires GPIO, but they did not
select GPIO.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
87c6693f43 samples: drivers: espi: add option to control board_power
Add a new option to control usage of DT nodelabel board_power. This
option also allows to select GPIO when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
17ce2a19e4 samples: drivers: i2s: echo: add options to control sw0/sw1
Add options to control the behavior of sw0/sw1. These options also allow
to select GPIO when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
cf4fb7a560 samples: subsys: display: lvgl: add option to control sw0
Add a new option to control the behavior of sw0. This option also allows
to select GPIO when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
75154a6443 samples: bluetooth: periodic_sync: add option to control led0
Add a new option to control led0 behavior. If enabled, led0 will be used
for blinking. This option also allows to select GPIO when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
ecdb4ffaf1 samples: bluetooth: mesh_provisioner: add option to control sw0
Add a new Kconfig option to control the behavior of sw0. If enabled, sw0
button will be used for provisioning. This option also allows to select
GPIO.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
ef4278de0d samples: bluetooth: iso_receive: add option to control led0
Add a new Kconfig option to control the behavior of led0. This option
also allows to select GPIO only when needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
123c00aa10 samples: fix zephyr/drivers/gpio.h usage
Only include the header if using any of the GPIO API calls/
struct/defines.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Gerard Marull-Paretas
caa61af2fd samples: add missing CONFIG_GPIO=y
All samples using the GPIO API must enable the CONFIG_GPIO Kconfig
option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2024-12-18 18:15:15 +01:00
Robert Lubos
3be01802cf tests: net: lib: http_server: Add tests for PUT/PATCH/DELETE methods
Add additional test cases which verify that the HTTP server code can
handle PUT/PATCH/DELETE request types.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-12-18 18:15:02 +01:00
Robert Lubos
6e37d31c15 net: http_server: Support PUT/PATCH/DELETE for dynamic resources
Extend the list of methods supported by dynamic resources with
PUT/PATCH/DELETE. The methods does not require any extra handling
from the server perspective, so the existing method handlers could be
reused.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-12-18 18:15:02 +01:00
Guillaume Gautier
2460e894e4 drivers: adc: stm32: remove unused cast
config->base is already defined as ADC_TypeDef so no there is no need to
cast it as such. Remove all occurrences throughout the file.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
47b2bb7652 drivers: adc: stm32: listify some tables
Listify the content of the tables used for sequencer and oversampling.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
420b2a053c drivers: adc: stm32: move define from dt-binding into driver
Now that clock source and sequencer are defined with strings in device
tree, move the old defines directly in the driver

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
e0554aa453 drivers: adc: stm32: use a string for sequencer and clock source property
Now that st,adc-sequencer and st,adc_clock-source use a string, update the
ADC driver.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>

fu drv adc update driver with string
2024-12-18 15:32:35 +01:00
Guillaume Gautier
8e4518a012 dts: arm: st: change sequencer and clock source properties into string
In all STM32 dtsi and board dts, update the st,adc-sequencer and the
st,adc-clock-source properties so they are strings.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>

fu dts: arm: st: use string instead of enum
2024-12-18 15:32:35 +01:00
Guillaume Gautier
439d19e371 dts: bindings: adc: stm32: use string enum instead of number enum
STM32 sequencer property and clock source were defined using
arbitrary numbers. Use string instead.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
ccf5e1ede2 tests: drivers: adc: api: add test for nucleo_f103rb with dma
Adds an ADC DMA test for Nucleo F103RB board now that support for it is
added in the ADC driver.
Reading multiple channels in F1 is only possible with the DMA, hence the
necessity to have a dedicated twister test for it.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
afa97d12ec drivers: adc: stm32: simplify adc dma enable function
Remove specific cases for H7 and U5: group them together and only call a
single function. ADC3 of H72x/H73x and ADC4 of U5 are different from other
ADC of their series, and have dedicated functions in the LL for enabling
DMA, but they're doing the exact same operation as
LL_ADC_REG_SetDataTransferMode.

Incidentally, this change allows H7A/H7B to use the DMA (it seems to have
been missed before).

Last, this change enables the DMA support for F1x ADC.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
4cfbf78939 drivers: adc: stm32: simplify oversampling with new property
Use the new oversampler property to simplify the management of the
ADC oversampling.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
057d61ca9d dts: arm: st: add adc oversampler to all stm32 series
Add ADC oversampler type to all ADC of all series.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
49e2511dc6 dts: bindings: adc: stm32: add oversampler
On STM32 ADC, there are currently two types of oversamplers (if present),
one with 8 available oversampling values, the other with 1024.
To simplify the driver, add the oversampler as a dts property.
Also add defines to avoid magic values in the dtsi.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
fb5ff902e8 drivers: adc: stm32: better express f3 and h7 adc versions
STM32F3 and H7 have multiple ADC versions difficult to differentiate.
Use clearer macros to make code more readable.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Guillaume Gautier
e978164a6b drivers: adc: stm32: add log message when adc overrun
Displays an error log message when an ADC overrun occurs.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2024-12-18 15:32:35 +01:00
Raffael Rostagno
30542797d9 tests: drivers: pwm: Revert PWM capture change for pulse check
Reverts a change regarding how the test checks the pulse output
from a capture event. A pulse capture will produce a value that has
the same polarity (and range) as programmed by pwm_capture().
Checking 'pulse_capture' against 'period - pulse' means expecting
the driver to return a capture value that is not inverted as well,
which would cause test cases to fail.

Signed-off-by: Raffael Rostagno <raffael.rostagno@espressif.com>
2024-12-18 15:32:23 +01:00
Yishai Jaffe
1b4cef325b shell: use shell_device_get_binding
Use shell_device_get_binding() instead of device_get_binding() so that
we get the device based on its name and in addition by its label.

Signed-off-by: Yishai Jaffe <yishai1999@gmail.com>
2024-12-18 15:32:10 +01:00
Hongquan Li
13ea58775b drivers/wifi/esp_at: Use mode 2 to connect when using as a UDP server
Mode 0 cannot establish a connection when used as a UDP server,
replace mode 0 with mode 2 to save the client's IP and port as
the communication address when a message is received.

Fixes #82898

Signed-off-by: Hongquan Li <hongquan.prog@gmail.com>
2024-12-18 15:31:55 +01:00
Jamie McCrae
6dc185b560 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  f5454f16358225f69ff729301c8e56d8a580f81a

Brings following Zephyr relevant fixes:
  - f5454f16 boot: bootutil: loader.c: Add check if has upgrade
    before pushing state change
  - 0946c7a7 boot: zephyr: boards: add ctcc/nrf52840 and
    ctcc/nrf9161 targets
  - 7ba0e552 boot: zephyr: nxp: Add NXP platforms to the allow
    list
  - 4f393563 bootutil: Fix device brick after power failure
    during swap-move revert
  - 2ac79767 bootutil: Fix the reading of image headers after
    partial swap completion
  - 84416fd2 boot: zephyr: boards: Add frdm-mcxa156 configuration
  - 15909d60 scripts: imgtool: fix sha512 for compression
  - f2a61462 boot: zephyr: boot_record: Save boot data with
    single image

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-12-18 15:31:43 +01:00
James Roy
3cf4347c15 drivers: gpio: Fix unchecked return value in gpio_pca_series
Fix unchecked return value scanned by Coverity.

Signed-off-by: James Roy <rruuaanng@outlook.com>
2024-12-18 15:31:33 +01:00
Guennadi Liakhovetski
6f1fc6e96c drivers: dai: ssp: remove unused variables
Fix compiler warnings
/zep_workspace/zephyr/drivers/dai/intel/ssp/ssp.c:2079:18: error: \
unused variable 'ssrsa' [-Werror=unused-variable]
 2079 |         uint32_t ssrsa = 0;
      |                  ^~~~~
/zep_workspace/zephyr/drivers/dai/intel/ssp/ssp.c:2078:18: error: \
unused variable 'sstsa' [-Werror=unused-variable]
 2078 |         uint32_t sstsa = 0;
      |                  ^~~~~

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-12-18 15:31:18 +01:00
Jordan Yates
17925dde0e tests: zbus: channel_id: test channel IDs
Test the new channel identifiers.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-12-18 12:47:24 +01:00
Jordan Yates
d2bb5973ae zbus: optional unique channel numeric identifiers
Add the option for a unique numeric identifiers to be attached to a
zbus channel. This identifier can then be used to lookup the channel
structure at runtime. This is useful in two situations (that I can
immediately think of).

Firstly for external interaction, i.e a text shell or remote procedure
calls. The current state of a channel can be queried by an ID that never
changes, as opposed to the external entity needing to know the exact
memory address of the channel for a given application binary.

Secondly for integrating with dynamically loaded extensions (llext).
These extensions can hook into the existing data streams without each
individual channel needing to be exported and visible to the loader.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-12-18 12:47:24 +01:00
Khoa Nguyen
40744c36d7 tests: drivers: adc: Support RA8, RA6, RA4 to test accuracy and api
Add overlay to support test adc_accuracy_test and adc_api in boards:
EK-RA8D1, MCK-RA8T1, EK-RA6M1, EK-RA6M2, EK-RA6M3, EK-RA6M4, EK-RA6M5,
EK-RA6E2, FPB-RA6E1, FPB-RA6E2, EK-RA4M2, EK-RA4M3, EK-RA4E2, EK-RA4W1

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Khoa Nguyen
c26c87e958 boards: renesas: Add ADC support for Renesas RA8, RA6, RA4
Add ADC support for EK-RA8D1, MCK-RA8T1, EK-RA6M1, EK-RA6M2,
EK-RA6M3, EK-RA6M4, EK-RA6M5, EK-RA6E2, FPB-RA6E1, FPB-RA6E2,
EK-RA4M2, EK-RA4M3, EK-RA4E2, EK-RA4W1

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Khoa Nguyen
4db0c07b8c dts: arm: renesas: Add dts node to support ADC for RA6, RA4
Add dts node to support canfd for RA6, RA4 MCU: r7fa6m5xh,
r7fa6m4ax, r7fa6m3ax, r7fa6m2ax, r7fa6m1ad3cfp, r7fa6e10x,
r7fa6e2bx, r7fa4w1ad2cng, r7fa4m3ax, r7fa4m2ax, r7fa4e2b93cfm

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Khoa Nguyen
e95d18587f drivers: adc: Add ADC properties in Renesas RA ADC node
- Add "channel-available-mask" property in ADC node
to detect which channels are available to use

- Add "add-average-count" property in ADC node to chose
number of count of the addition or average mode

- Change the source code of ADC to match with 2 new properties.

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Khoa Nguyen
d54353bce8 tests: drivers: adc: Remove test id for EK-RA8M1
- Remove test id device of ek_ra8m1 in testcase.yaml of
adc_accuracy_test

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Khoa Nguyen
d88c56b343 boards: renesas: Add missing document for ADC in EK-RA8M1
- Add missing description for ADC in EK-RA8M1 document

Signed-off-by: Khoa Nguyen <khoa.nguyen.xh@renesas.com>
2024-12-18 12:46:31 +01:00
Gerard Marull-Paretas
bcb2b3620e drivers: clock_control: nrf54h-fll16m: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
f267c339f7 drivers: clock_control: nrf54h-lfclk: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
d5041aecec drivers: clock_control: nrf54h-common: add utility to obtain LFOSC acc
Add a utility function to obtain LFOSC accuracy in PPM from BICR.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
5415c42dd4 drivers: clock_control: nrf54h-hfxo: use values from BICR
The real, applicable and trusted values are the ones flashed into BICR.
So, drop DT properties that replicate BICR and use runtime reads to BICR
instead.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
3d3dce61b6 dts: common: nordic: nrf54h20: define BICR node
BICR (Board Information Configuration Registers) are located within the
application UICR region (ref. MRAM mapping, table 38).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Gerard Marull-Paretas
2db20cd00e dts: bindings: misc: add nordic,nrf-bicr
Add binding for the Nordic nRF BICR memory.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2024-12-18 12:46:20 +01:00
Johann Fischer
dd5492b3ce usb: device_next: rework wSequence check in CDC NCM implementation
The consequences of a wSequence mismatch are unspecified and are
primarily for debugging purposes. Our checks are a bit too strict, and
if the header check fails, the sequence is not updated, and the header
check subsequently fails. Rework the code to just log a warning on
mismatch and also reset OUT sequence counter the same way as the IN
sequence counter.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-12-18 12:46:08 +01:00