Commit Graph

98755 Commits

Author SHA1 Message Date
Yong Cong Sin f87539081d lib/libc: picolibc: select its source with Kconfig choice
Implement the selection of the picolibc source in a Kconfig
choice as they are mutually exclusive.

The following table represents the possible choices, where 'X'
means that `PICOLIBC_SUPPORTED=n` and is guarded in the parent
level as `PICOLIBC=n`, so we do not need to care.

Module  Toolchain    C++   |       Choice
  0         0         0    |          X
  0         0         1    |          X
  0         1         0    |    Toolchain only
  0         1         1    |    Toolchain only
  1         0         0    |      Module only
  1         0         1    |          X
  1         1         0    |   Toolchain/Module
  1         1         1    |    Toolchain only

The current implementation favors `PICOLIBC_USE_TOOLCHAIN` over
`PICOLIBC_USE_MODULE` whenever possible, that preference is
maintained in this implementation as well - the TOOLCHAIN
source will be the default choice when the toolchain supports
it or when the C++ is enabled. Otherwise, fallback to MODULE.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-07-09 17:29:12 -04:00
Johann Fischer 38753852c8 MAINTAINERS: move generate_usb_vif to USB-C section
Script was introduced by USB-C people.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-09 17:26:58 -04:00
Johann Fischer 46b849b586 MAINTAINERS: add maintainer and collaborator for DAP controller
Add maintainer and collaborator for DP drivers and DAP controller.
Followup on the commit 7c9259abbc
("dap: add CMSIS-DAP compatible controller")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-09 17:26:58 -04:00
Daniel Leung 0b76fd92fc tests: logging/dictionary: pytest only looks at last output
There are instances where on hardware tests would result in
multiple dictionary logging blocks. This is usually due to
flashing and running via twister in separate steps. Once
flashing is done, the device starts running and sending
logging string to output, but twister is not ready to read
them, thus leaving the strings in the host's UART buffer.
Then twister starts its testing run by resetting the device
which results in another dictionary logging block to show
up. So the pytest script has to be updated to only look at
the last dictionay logging block.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-09 17:25:22 -04:00
Daniel Leung ea109ce39b tests: logging/dictionary: filter for backend
Since only the UART backend supports output in hexidecimal form
with dictionary logging, so filter for that or else the pytest
would fail due to none, or wrong captured output.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-07-09 17:24:02 -04:00
Mathieu Choplain 1fd9dc85b2 tests: drivers: adc_api: use proper printf format
This commit changes the adc_api test to use the proper printf
format specifier when printing the ADC samplings. This ensures
that all values are printed on 16-bit. Without this specifier,
negative values are sign-extended and printed on full integer
size (e.g., 0x8000 -> "0xFFFF8000").

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-07-09 17:23:30 -04:00
Kevin Wang 6cb8956a08 drivers: watchdog: Refine the atcwdt200 driver's code.
Remove the reset vector setting from driver layer,
the reset vector is more suitable to be set at the board layer.

Signed-off-by: Kevin Wang <kevinwang821020@google.com>
2024-07-09 17:21:28 -04:00
Luis Ubieda 00a3be90d7 sensor: icm42688: Use RTIO workq on icm42688_submit
To make its execution path non-blocking from the caller's perspective.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 8d0c2f15df sensor: bme280: Use RTIO workq on bme280_submit
To make its execution path non-blocking from the caller's perspective.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 5521fc4410 sensor: bma4xx: Use RTIO workq on bma4xx_submit
To make its execution path non-blocking from the caller's perspective.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 59e8919da7 sensor: akm09918c: Use RTIO workq on akm09918c_submit
To make its execution path non-blocking from the caller's perspective.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda aff6e31ec4 sensor: fallback: Decouple RTIO request using RTIO workqueues service
Incorporate RTIO workqueues to turn sensor_submit_callback into an
asynchronous request.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 5686ac48cc tests: rtio: workq: Add testsuite to exercise RTIO work-queues
Basic tests demonstrating ability to decouple, batch-submit, preempt
and keep track of used items.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 3646b63217 rtio: Add RTIO Work-queues service
Adds ability to process synchronous requests in an asynchronous
fashion, relying on dedicated P4WQ's and pre-allocated work items.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda 1f3a0910d7 tests: sensor: generic: Set thread priorities for back-to-back readings
In order to support back-to-back readings, it's required that the
RTIO workq threads priority is higher than the caller issuing the
back-to-back requests, otherwise the requests will fail as P4WQ won't
have the opportunity to clear the is_done semaphore, and the subsequent
request will be rejected.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Luis Ubieda cc139b85df sensor: Enable RTIO Semaphores for Async API
In order to decouple the read request from its implementation, we need
to be able to yield to potential lower-priority threads, which is not
possible with k_yield() itself. As such, using RTIO Consume semaphore
enables us to achieve this.

This patch also refactors blocking API (sensor_read) to also block upon
consumption, so as not to require RTIO_SUBMIT_SEM enabled.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 17:21:05 -04:00
Devansh Tanna 6d4fba1f86 drivers: cc13xx_cc26xx: pwm: enable pwm(gpt) in sleep/deepsleep mode
- enabled GPT(PWM) peripheral for sleep/deepsleep mode in init_pwm()
- Fixed: undefined behaviour when using k_sleep()

Signed-off-by: Devansh Tanna <devansht0210@gmail.com>
2024-07-09 17:20:46 -04:00
Benjamin Cabé 95caf476f1 drivers: ptp_clock_nxp_enet: add module_dev to driver config
c8d8dce755 introduced a regression whereby driver config should hold
module device pointer, except it didn't.
This commit adds module_dev to the driver config.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-07-09 17:20:12 -04:00
Jean Nanchen 77f9f0e965 drivers: sensor: maxim: max31865: Fix fault bit clearing
Ensures D1 sets and D5, D3, D2 reset, preventing undefined states.

Signed-off-by: Jean Nanchen <jean.nanchen@gmail.com>
2024-07-09 15:38:19 -04:00
Thomas Stranger 48e235445b samples: sensor: ds18b20: clearly indicate any errors
Any errors are clearly indicated and program execution
ended.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-07-09 15:37:58 -04:00
Thomas Stranger b5d3dea894 drivers: sensor: ds18b20: indicate error for missing response
When multiple devices are on the bus, and no slave matches
the sent rom, the master receives only ones.
This should be handled explicitly and the error reporting
should not rely on the crc mismatch of the scratchpad.

Note: Make sure that the sensor configuration is loaded to the
eeprom (copy scratchpad), otherwise the resolution will not match
the expectations in case a node looses power and recovers.
As in that case the configuration will not be applied again.
Also the sensor may still report the power on reset value
of +85°C just after the sensor powered up.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-07-09 15:37:58 -04:00
Thomas Stranger 6fd767d6e4 drivers: sensor: ds18b20: verify scratchpad write
Verify that the scratchpad write was successful by
reading back the configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-07-09 15:37:58 -04:00
Thomas Stranger 53e3936a2e drivers: sensor: ds18b20: verify crc of scratchpad.
After each read of the scratchpad the crc of the data
is checked and in case of a mismatch an error is returned.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-07-09 15:37:58 -04:00
Thomas Stranger f4acf390dd drivers: sensor: ds18b20: cleanup header/includes
- Move the content of the header file into the source file,
and drop unnecessary includes.
- Also, drop the bus access function.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2024-07-09 15:37:58 -04:00
Brett Witherspoon 97190d76ec drivers: dac: dac_ad56xx: Fix channel range check
An off by one error in the channel range check results in an out of
bound access to the channel lookup array.

Signed-off-by: Brett Witherspoon <brett@witherspoon.engineering>
2024-07-09 15:31:58 -04:00
Emil Gydesen 35c7cd2e00 MAINTAINERS: Remove thalley from Bluetooth group
Thalley is not working with BT mesh nor BT classic
and shouldn't be assigned as reviewer for those.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-09 15:27:54 -04:00
Omer Gozderesi 1fc97561ed config: esp32: configurable UART FIFO thresholds
The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes #74311

Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>

config: esp32:  configurable UART FIFO thresholds

The existing configuration of the ESP32 UART FIFO thresholds
was fixed, leading to inefficiencies in handling
Modbus RTU packages exceeding this size.
This commit introduces two new Kconfig options,
allowing users to adjust the esp32 fifo thresholds as needed.
fixes #74311
Signed-off-by: Omer Gozderesi <omer.gozderesi@enda.com>
2024-07-09 15:24:02 -04:00
Simon Hein a5668c78d1 doc: guidelines: update coding guidelines docs
Remove references to a timline for the coding guidelines enforcement
stages. Mark the current stage better and add notes about the
current stage.

Signed-off-by: Simon Hein <Shein@baumer.com>
2024-07-09 15:23:18 -04:00
Declan Snyder dd86bc63e9 boards: nxp: mimxrtxxx: Fix partition unit address
Fix the partition unit addresses not matching tthe reg addresses.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Declan Snyder 275ba61577 dts: nxp: rtxxx: Fix LPADC unit address
Fix unit address having an extra 0 in RT6xx/5xx dtsi

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Declan Snyder d8a7b694dc dts: rt6xx: Fix DTC warnings
Fix DTC warnings caused by sram and flexspi definitions.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Declan Snyder fb693c18ac dts: rt5xx: Fix DTC warnings
Fix DTC warnings caused by flexspi and sram node definitions.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Declan Snyder 67877e7a27 dts: rw6xx: Fix SRAM node address
DTC warning caused by reg address not matching unit address,
but SRAM node address is translated by ranges property anyways.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Declan Snyder 8c8338d456 dts: rw6xx: Fix flexspi address warnings
The unit address didn't match reg which causes the warning, but
flexspi should be part of the peripheral node space anyways.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-07-09 15:21:36 -04:00
Mateusz Holenko 82a83896c8 dts: npx: Fix sramx offset for LPC55S06
The current value is wrong and overlaps with `syscon`.

Signed-off-by: Mateusz Hołenko <mholenko@antmicro.com>
2024-07-09 15:21:14 -04:00
Robert Lubos 9db2dc4aa2 net: lib: http_server: Move stream-specific flags to stream context
The information about replied headers or END_OF_STREAM flag are
stream-specific and not general for a client. Hence, need to move them
to the stream context.

For the upgrade case, we need to allocate a new stream now when HTTP1
request /w upgrade field is received. The stream ID in such case is
assumed to be 1 according to RFC.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos 0e1c0a7b6b net: lib: http_server: Fix trailing headers frame processing
In case client decides to send a trailing headers frame, the last data
frame will not carry END_STREAM flag. In result, with current logic
server would not include END_STREAM flag either, causing the connection
to stall. This commit fixes this logic, so that the server replies
accordingly in case END_STREAM flag is present in the trailing headers
frame.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos b4cfee090d net: lib: http_server: Implement proper CONTINUATION frame processing
CONTINUATION frames are tricky, because individual header fields can be
split between HEADERS frame and CONTINUATION frame, or two CONTINUATION
frames. Therefore, some extra logic is needed when header parsing
returns -EAGAIN, as we may need to remove the CONTINUATION frame header
from the stream before proceeding with headers parsing.

This commit implements the above logic and additionally adds more checks
to detect when CONTINUATION frame is expected. Not receiving a
CONTINUATION frame when expect should be treated as a protocol error.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos 7e22dd45a0 net: lib: http_server: Fix frame printouts
Frame printouts should not be done from the state handlers, but rather
during state transition, otherwise a single frame can be printed several
times as new data arrive. This also simplifies code a bit, as we just
print the frame in a single place, instead of duplicating code.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos 78c2f48091 net: lib: http_server: Remove upper bounds on buffer sizes
There's really no good reason to have an upper bound on the buffer sizes
and this limits testing in some cases, so just remove them.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos ccf2e9b025 net: lib: http_server: Implement proper RST_STREAM frame processing
In case RST_STREAM frame is received it should not be ignored, but the
corresponding stream should be closed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos b98edfd951 net: lib: http_server: Fix parsing of HTTP2 header frames with priority
In case priority flag is present in the HTTP2 headers frame header, we
should expect additional priority fields before the actual frame
content.

The stream priority signalling has been deprecated by RFC 9113, however
we should still be able to handle this in case some implementation
(nghttp for instance) sends them.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos 2e288aed08 net: lib: http_server: Fix handling of HTTP2 frames with padding
Data and header frames can contain padding - we need to take this into
account when parsing them, otherwise the stream is broken.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos 245b8351f4 net: lib: http_server: Unify HTTP2 header flags checking
Instead of multiplying function to check header flags, just have a
single one, with flag mask as parameter.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos adfdc54434 net: lib: http_server: Update HTTP2-specific structs/enums naming
For HTTP2-specific structures and enums, use "http2_" prefix to clearly
indicate the distinction from the generic HTTP stuff.

Additionally, some structures/enums describing HTTP2 protocol details
had "server" in the name, while in reality they describe nothing
server-specific. Hence, drop the "server" part where applicable.

Remove unused macros.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Robert Lubos e1e50bdda9 net: lib: http_server: Simplify HTTP2 frame header parsing
* Remove unneeded variable.
* Use system utilities to read big endian numbers instead of parsing
  manually.
* Remove `payload` member from the http_frame structure. It's not used
  for anything useful, and could actually be misleading, as in case of
  large frames, where not entire frame is parsed at once it will point
  to incorrect location.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 15:20:57 -04:00
Guy Morand 0c9858879c samples: logging: disable usermode for some platforms
Those platfroms use rtt as debug port that conflicts with usermode, as
in 27d519b260.

Fixes #75617

Signed-off-by: Guy Morand <guy.morand@bytesatwork.ch>
2024-07-09 15:20:34 -04:00
Chaitanya Tata a63a96428e wifi_nm: Fix Wi-Fi interface backward compatibility
If newly introduced interface type is unset then return the first Wi-Fi
interface as a fallback, this fixes backward compatibility.

Also, add NM APIs and use them for type checks, rather than directly
using the type enumeration.

Fixes #75332.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-07-09 13:07:11 -04:00
Chaitanya Tata 0e6db9c918 modules: hostap: Fix interface addition
WPA supplicant as a network manager monitors interface events and
registers to the Wi-Fi NM module, so, adding a check for NM type before
registering the interface is wrong.

Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
2024-07-09 13:07:11 -04:00
Brandon Allen 19d49114a6 net: net_mgmt: fixed typo in doxygen
Replaced "tight" with "tied"

Signed-off-by: Brandon Allen <brandon.allen@exacttechnology.com>
2024-07-09 19:06:56 +02:00