Commit Graph

81971 Commits

Author SHA1 Message Date
Christopher Friedt e7c23b392f tests: posix: common: check return value in pthread_join()
Ensure that the thread return value is set by `pthread_join()`
when `status` is non-NULL.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-30 19:17:49 -04:00
Christopher Friedt 73bf557a95 posix: pthread: thread return value not set by pthread_join()
Ensure that the thread return value is set by `pthread_join()`
when `status` is non-NULL.

Additionally, we have an opportunity to synchronously clean
up thread stacks in `pthread_join()`, which is preferable.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-30 19:17:49 -04:00
Christopher Friedt 033d772d07 tests: posix: common: pthread_join should fail on detached
A thread that has been previously detached using
`pthread_detach()` should not be able to be joined. A recent
change made it so that `pthread_join()` would always report
success (0), even when `ret` (return value) had an error.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-30 12:51:12 -04:00
Christopher Friedt 52f00882d1 posix: pthread: report appropriate return value instead of 0
Discovered this while implementing c11 threads, but there
was a regression recently that made it so that `pthread_join()`
would report success when attempting to join a thread that had
been detached with `pthread_detach()`.

Technically now that is undefined behaviour, but historically,
we have reported `EINVAL`, which was the older specified
return value.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-30 12:51:12 -04:00
Christopher Friedt 5b4d275a99 tests: drivers: build_all: sensor: do not run build-only testsuite
A recent modification to the `build_all/sensor` testsuite changed
`build-only` to `false` in `testcase.yaml`, which is causing CI
to go bonkers.

https://bit.ly/3rSe0Te

Do not run build-only testsuites.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-30 12:09:11 -04:00
Christopher Friedt 9dc531be48 tests: thrift: replace unused variable with NULL in pthread_join
There is no need to pass a second parameter to `pthread_join()`
if it is unused. Just use `NULL` instead.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-29 10:26:56 -04:00
Christopher Friedt 1f278d9ae4 thrift: add temporary Mutex implementation
The Thrift library has its own abstraction for mutexes, which
normally just a wrapper around `std::mutex` using the PIMPL
idiom (pointer-to-impl).

Since Zephyr does not yet support `std::mutex`, a workaround
was added in Zephyr that was essentially no-op, and actually
the PIMPL idiom made it quite easy to do that. However,
pretending there is no synchronization requirement is not a
solution for it.

We can't yet just use a `struct k_mutex` yet, because we
don't yet support userspace, but for now we can fake a mutex
interface with a spinlock.

We hope to eventually drop this workaround entirely and just
support `std::mutex`.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-29 10:26:56 -04:00
Martí Bolívar 6009182731 MAINTAINERS: move to my ampere account
I'm using a new account now.

Do the corresponding CODEOWNERS change just for consistency as well.

Signed-off-by: Martí Bolívar <mbolivar@amperecomputing.com>
2023-07-29 12:45:00 +02:00
Johann Fischer 488fd89e2b boards: adafruit_feather_m0_basic_proto: add zephyr_udc0 nodelabel
Add zephyr_udc0 nodelabel to allow building all USB device samples
for adafruit_feather_m0_basic_proto board out of the box.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-07-28 16:23:18 +00:00
Yuval Peress 1f39e9e504 rtio: Update documentation
Revise the documentation around canceling pending SQEs.

Signed-off-by: Yuval Peress <peress@google.com>
2023-07-28 11:52:07 -04:00
Nachiketa Kumar 9f6d6a0fa7 drivers: serial: Add Intel SEDI driver
Adds a new serial shim driver for Intel SoCs. Builds upon the SEDI bare
metal UART driver in the hal-intel module.

Signed-off-by: Nachiketa Kumar <nachiketa.kumar@intel.com>
Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2023-07-28 17:49:09 +02:00
Dong Wang 4e3ec6207d ish: add module Kconfig for Intel HAL
Add a new Kconfig option to enable the build of Intel HAL and select
it always for ish SoCs

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2023-07-28 17:49:09 +02:00
Dong Wang fb03964a26 manifest: west.yml: add Intel HAL as a new HAL module
It provides a low level Hardware Abstraction Layer for Intel
specific hardware, like Intel ISH

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2023-07-28 17:49:09 +02:00
Dong Wang 445f9d28c4 boards: x86: Add boards and SoCs for Intel ISH
Adds new boards and SoCs for the Intel Sensor Hub (ISH).

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
2023-07-28 17:49:09 +02:00
Tristan Honscheid 171c1fc9d9 emul: Introduce emulator backend API and generic sensor test
This PR introduces a backend API to be implemented by sensor emulators
that creates a standardized mechanism for setting expected sensor
readings in tests. This unlocks the ability to create a generic sensor
test that can automatically set expected values in supported sensor
emulators and verify them through the existing sensor API. An
implementation of this API is provided for the AKM09918C magnetometer.

A generic sensor test is also created to exercise this implementation.
Observe that this test knows nothing about the AKM09918C; info about
supported channels and sample ranges is discovered through the backend
API. The test iterates over all devices attached to the virtual I2C and
SPI buses in the test binary's device tree, which (theoretically) covers
all sensors. Sensors whose emulator does not exist yet or does not
support the backend API are skipped.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-28 17:48:31 +02:00
Tristan Honscheid 4f8c90ead2 sensor: akm09918c: Fix conversion constant
The sensor driver uses the value 500 to convert bit counts to microgauss
values, but it should actually be 1500. Edit the driver unit test to use
the macro instead of a magic number.

Signed-off-by: Tristan Honscheid <honscheid@google.com>
2023-07-28 17:48:31 +02:00
Théo Battrel ff54350ef0 Bluetooth: Host: Remove 'Experimental' flag of EAD
Nordic Semiconductor has been testing the feature extensively on its CI.
The tests includes the sample data and the PTS tests.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2023-07-28 17:48:16 +02:00
Daniel Gaston Ochoa 1b3e2d98e4 drivers: stm32: SPI: Check that SPI buffers are in a nocache region
DMA only works with non-cached memory regions in H7. Check them
and return an error if they don't match this condition.

Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
2023-07-28 17:47:57 +02:00
Cong Nguyen Huu 19f33b8ecb samples: drivers: adc: enbale test for mr_canhubk3
Enable all channels that available connector on board.
ADC0 channel 6 on precision group with normal end chain
callback.
ADC1 channel 2 on precision group with normal end of
conversion callback.
ADC2 channels 3, 4, 5 on precision group with normal end
of conversion callback.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-07-28 08:55:38 -05:00
Cong Nguyen Huu 5ea07017ca tests: drivers: adc: adc_api: enbale test for mr_canhubk3
Enable adc0 with 2 channels 22, 23 on standard group with
normal end of conversion callback. Channels correspond to
VREFL(0V), VREFH(3.3V).

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-07-28 08:55:38 -05:00
Cong Nguyen Huu a0db65e6ae boards: mr_canhubk3: add support adc
Add device tree of adc instances for s32k344

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-07-28 08:55:38 -05:00
Cong Nguyen Huu f809614136 drivers: adc: add NXP S32 ADC SAR driver
Add support ADC SAR for NXP S32. ADC SAR diver
support 3 group channels (precision, standard
and external), run normal trigger in oneshot
conversion mode with 2 callbacks normal end
of conversion and normal end chain callbacks.
An instance only run on 1 group channel and
1 kind of callback at the same time.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-07-28 08:55:38 -05:00
Anas Nashif 3191d08130 twister: improve handling of ELF file parsing
We have been dealing with missing and multiple binaries the same way and
both would result in a build error, which is not accurate. multiple
binaries in the build directory are fine, we just need to pick the right
one for parsing.

If we get no binaries, raise an exception and report failure, however,
if we have multiple binaries, filter intermediate artifacts out and
parse what remains.

qemu binaries generated after a run are also being filtered here. Those
are not build artificats and appear only after running in qemu. However
they have been causing issues on retries.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-07-28 14:34:19 +02:00
Flavio Ceolin 250748bfe6 intel_adsp: Add option about switch off hpsram
Add an option to control whether or not hpsram banks should
be switched off during the power down. This is particular useful
when running tests because we don't want to lose the contents
of the memory window before we capture it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-07-28 08:30:26 -04:00
Daniel Leung 56a8123eed toolchain: xcc/xt-clang: include llvm.h for xt-clang...
...and removed the copied macros. This allows xt-clang to
inherit macros from llvm.h to align with any LLVM related
additions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-07-28 08:08:13 -04:00
Daniel Leung 2a66f94326 boards: up_squared: override CPU devicetree node to have 2 CPUs
The device tree file for up_squared includes the base dts file
for Apollo Lake which only defines 1 CPU. UP Squared have
different SKUs with different CPUs, and overall has a minimal
of 2 CPUs. So amend the up_squared device tree overlay to have
2 CPU nodes.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-07-28 08:06:53 -04:00
Maciej Perkowski 3e398cbb0b twister: bugfix: Make BuildError exception cause test to report error
When no/too many elf files are detected after a build a BuildError
exception is raised. However, it was not being counted as an issue
with a test. With the patch satuses of tests' with such exception
are reported as errors. Whithout it, twister finished without
reported errors and was getting green CI checks.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-07-28 06:32:48 -04:00
Carles Cufi 3d37cc3da9 doc: bin blobs: State that blobs will not be fetched in CI
As a follow-up to a recent discussion in the PR below:
https://github.com/zephyrproject-rtos/zephyr/pull/59991

document that binary blobs will not be fetched in CI.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2023-07-28 09:47:39 +00:00
Cong Nguyen Huu 5920159f0f boards: mr_canhubk3: enable GPIO when CAN is enabled
Currently, mr_canhubk3 is enabling GPIO by default.
GPIO will be built even if it is not necessary.
Update to enable it for supporting CAN transceiver
when CAN is enabled.

Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
2023-07-28 11:17:34 +02:00
ferar alashkar 595bcda87c lib: os: dec: add misra-c2012 compliance changes
1. change explicit type cast of essential character type, complying with
required [misra-c2012-10.2] rule which states; Expressions of
essentially character type shall not be used inappropriately in addition
and subtraction operations, and

2. add explicit boolean type to 'if' statement controlling expression,
consolidating it with 'buflen' type, thus improving code readability and
maintainability , complying with required [misra-c2012-14.4] rule which
states; ; The controlling expression of an if statement and the
controlling expression of an iteration-statement shall have essentially
boolean type, and

3. add enclosing parentheses enforcing and clarifying precedence of
operators, improving code readability and maintainability, complying
with *advisory* [misra-c2012-12.1] rule which states; The precedence of
operators within expressions should be made explicit.

Found as a coding guideline violation (Rules 10.2, 14.4), and coding
guideline recommendation (Rule 12.1) by static code scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
2023-07-28 11:15:44 +02:00
ferar alashkar dddc034923 lib: os: hex: correct explicit cast type
change explicit type cast of essential character type, complying with
required [misra-c2012-10.2] rule which states; Expressions of
essentially character type shall not be used inappropriately in addition
and subtraction operations.

Found as a coding guideline violation (Rule 10.2) by static code
scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
2023-07-28 11:15:19 +02:00
ferar alashkar bba6a1d69e lib: os: hex: add explicit unsigned suffices
add explicit unsigned suffices to various immediate numbers, matching
them to size_t, complying with required [misra-c2012-10.4] rule which
states; Both operands of an operator in which the usual arithmetic
conversions are performed shall have the same essential type category.

Found as a coding guideline violation (Rule 10.4) by static code
scanning tool.

Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).

Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
2023-07-28 11:15:12 +02:00
Gerard Marull-Paretas 8081fb3150 tests: subsys: pm: pwer_mgmt_multicore: remove PM_STATE_ACTIVE
pm_state_set() is never called with PM_STATE_ACTIVE.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-28 09:09:01 +00:00
Gerard Marull-Paretas bc522affc7 samples: subsys: pm: latency: remove redundant PM_STATE_ACTIVE case
pm_state_set() will never be called with PM_STATE_ACTIVE.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-28 09:09:01 +00:00
Gerard Marull-Paretas 0b49b86f06 soc: arm: st_stm32: remove redundant PM_STATE_ACTIVE case
pm_state_exit_post_ops() will never be called with PM_STATE_ACTIVE.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-07-28 09:09:01 +00:00
Grant Ramsay b7f88b4301 tests: canbus: isotp: conformance: Add helper function to prepare FC frames
This reduces duplication in the tests

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-07-28 09:08:20 +00:00
Grant Ramsay e326b72bc0 tests: canbus: isotp: conformance: Update test to check padding correctly
The tests now properly validate frames under all padding configurations.
Part of test_sender_fc_errors was testing a receive FC error, this sub-test
is moved to test_receiver_fc_errors

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-07-28 09:08:20 +00:00
Grant Ramsay e98fa4e590 canbus: isotp: Enable TX padding by default if RX padding is required
It would be strange to enforce padding for other bus participants but not
use it yourself. This default suggests the likely proper usage, although
it is not a hard dependency

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-07-28 09:08:20 +00:00
Grant Ramsay 42dcc4e57f canbus: isotp: Fix ISO-TP padding config usage
ISOTP_ENABLE_TX_PADDING makes the device transmit frames with TX padding.
ISOTP_REQUIRE_RX_PADDING ensures other devices on the bus use TX padding,
by rejecting non-padded RX frames

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-07-28 09:08:20 +00:00
Daniel DeGrasse f9daa0397c drivers: sdhc: enable pwr-gpios property within SPI SDHC driver
Enable SPI SDHC driver to manage card power via pwr-gpios property.
Control for this property was previously partially implemented. When
this property is present, the SPI SDHC driver will use it to control
power to the SD card.

Power is toggled during SD init, so this power control can make SD init
more reliable as the power toggle will insure the SD card state is reset.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-28 09:07:55 +00:00
Florian Grandel 3a0615d048 doc: release-notes: document net subsys time consolidation
Documents the changes to the internal API in the release notes.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel a4cd5cee40 drivers: ieee802154: consistent high res timestamps
The IEEE 802.15.4 API and networking subsystem were using several
inconsistent timestamp resolutions and types. This change defines all
timestamps with nanosecond resolution and reduces the number of
available types to represent timestamps to two:
* `struct net_ptp_time` for PTP timestamps
* `net_time_t` for all other high resolution timestamps

All timestamps (including PTP timestamps) are now referred to a
"virtual" local network subsystem clock source based on the well-defined
types above. It is the responsibility of network subsystem L2/driver
implementations (notably Ethernet and IEEE 802.15.4 L2 stacks) to ensure
consistency of all timestamps and radio timer values exposed by the
driver API to such a network subsystem uptime reference clock
independent of internal implementation details.

The "virtual" network clock source may be implemented based on arbitrary
hardware peripherals (e.g. a coarse low power RTC counter during sleep
time plus a high resolution/high precision radio timer while receiving
or sending). Such implementation details must be hidden from API
clients, as if the driver used a single high resolution clock source
instead.

For IEEE 802.15.4, whenever timestamps refer to packet send or receive
times, they are measured when the end of the IEEE 802.15.4 SFD (message
timestamp point) is present at the local antenna (reference plane).

Due to its limited range of ~290 years, net_time_t timestamps (and
therefore net_pkt timestamps and times) must not be used to represent
absolute points in time referred to an external epoch independent of
system uptime (e.g.  UTC, TAI, PTP, NTP, ...).

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 2668a7d83f tests: subsys: openthread: support CSL
Introduces coverage for OpenThread CSL platform API as far as channel
samples are concerned.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 7232dd260e tests: subsys: openthread: support TXTIME
Adds a test suite configuration that enables TXTIME.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 8737550f48 tests: subsys: openthread: simplify configure mocks
Removes redundant fakes.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 29988b5c04 drivers: ieee802154: nRF5: fix return type
Adapts a return type to the API specification. The changed return type
is not referenced anywhere so it can be changed without breaking
backwards compatibility.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 69212bb169 doc: drivers: ieee802154: radio API
Improves the documentation of the IEEE 802.15.4 radio API.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel 7378b91294 doc: net: ptp: PTP structs
Improves documentation of PTP structs and explains basic underlying
concepts to increase the probability that these structs will be used
correctly and consistently.

Also introduces references to the underlying specifications.

Note: We currently (ab)use the PTP structs for timestamps in the IEEE
802.15.4 context for which they are undefined. It is also not ideal that
the generic `struct net_pkt` depends directly on PTP. Future changes
will therefore have to remove the reference to PTP structs in net_pkt
and replace them by net_time_t. Clients will then have to convert these
to PTP structures if required.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Florian Grandel bd34c946fc net: introduce scalar nanosecond time representation
Introduces a well-defined intermediate concept of syntonized scalar
nanosecond resolution time with overflow protection above low-level
counters/cycles/ticks and below higher level time abstractions
(timescales, calenders, etc.).

The rationale of this type has been extensively documented and
contrasted to already existing time representations to ensure that it
fills a well defined gap without overlap.

This change prepares for later changes in this change set that will
unify the usage of time across the network subsystem (RX/TX timestamps,
timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.).

The type is EXPERIMENTAL and named net_time_t while it is not used in a
larger clock subsystems, the details of which are still being discussed
(see #60400 for details).

See
https://github.com/zephyrproject-rtos/zephyr/issues/19030#issuecomment-1597226731
for its embedding in a larger clock subsystem architecture relevant to
the network stack, IEEE 802.15.4 and the POSIX roadmap.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-07-28 09:06:35 +00:00
Daniel DeGrasse 638e3d5d9c boards: shields: add rk055hdmipi4ma0 shield
Add rk055hdmipi4ma0 shield, which uses an HX8394 TFT LCD controller and
GT911 touch IC. This shield is enabled on the RT595 and RT1170 EVK,
which have 40 pin FFC interfaces capable of connecting to the display.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2023-07-28 09:06:17 +00:00