Commit graph

82141 commits

Author SHA1 Message Date
Emil Gydesen 5a66daa94d Bluetooth: ISO: Add broadcast RTN check in valid_chan_io_qos
The RTN value range for broadcast is more limited than
connected ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-31 09:04:52 +00:00
Emil Gydesen 63aca8d868 Bluetooth: ISO: Add advanced unicast ISO parameters
Add support for setting advanced unicast ISO parameters
using the ISO test commands. This allows the host to
set ISO parameters that the controller normally would
handle.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-07-31 09:04:52 +00:00
Jamie McCrae 588f6acbd5 mgmt: mcumgr: grp: img_mgmt: Fix not checking write bounds
Fixes an issue whereby the data packets were not checked to ensure
that the client has not attempted to write more data than the size
that was provided in the original upload packet.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-31 10:43:54 +02:00
Jamie McCrae 9422fc6e20 mgmt: mcumgr: grp: img_mgmt: Fix not checking image upload size
Fixes an issue whereby upload image size would not be checked in
the first packet of an upload, which would allow an image to be
uploaded until it reached the point of it being too large to
fit anymore.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-31 10:43:54 +02:00
Jamie McCrae 8a2e768ff7 doc: services: device_mgmt: smp_groups: Clarify img_mgmt upload
Clarifies the details in the upload section of img_mgmt for MCUmgr
to better describe when fields should be sent, including a note
when a server responds with offset of 0.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-31 10:43:40 +02:00
Jamie McCrae 097c568c81 mgmt: mcumgr: grp: fs_mgmt: Fix wrong error checking
Fixes an issue with not properly checking error responses.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-07-31 10:43:28 +02:00
Fabio Baltieri dfeb2d9027 ethernet: eth_stm32_hal: fix unused variable build warning
Fix an unused variable build warning that was happening in certain
configurations. Move the variables in the only condition where they are
actually used.

west build -p -b nucleo_f429zi \
	-T samples/net/cloud/aws_iot_mqtt/sample.net.cloud.aws_iot_mqtt

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-31 10:11:52 +02:00
Christopher Friedt b42212eeaa tests: thrift: re-order shared_ptr reset to prevent fd leak
This change fixes a file descriptor leak that snuck-in
undetected in the original `gsoc-2022-thrift` project.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-07-31 10:09:55 +02:00
Henrik Brix Andersen b809d5ce10 drivers: can: stm32h7: fix message RAM address calculations
Calculate the Bosch M_CAN Message RAM addresses relative to the Message RAM
Base Address (MRBA), not the offset.

Fixes: #59624

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2023-07-31 10:09:47 +02:00
Henrik Brix Andersen 71a7afacbd drivers: can: mcan: add CAN_MCAN_DT_MRBA() and CAN_MCAN_DT_INST_MRBA()
Add CAN_MCAN_DT_MRBA() and CAN_MCAN_DT_INST_MRBA() macros for retrieving
the Bosch M_CAN Message RAM Base Address (MRBA) and clarify that the
existing CAN_MCAN_DT_MRAM_ADDR() and CAN_MCAN_DT_INST_MRAM_ADDR() macros do
not retrieve the base address, but rather the base address + the offset, if
any.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2023-07-31 10:09:47 +02:00
Francois Ramu 248cd36505 samples: subsys: nvs on nucleo_g474re requires 6kB for storage partition
Add the overlay for running the samples/subsys/nvs/ application
on the nucleo_g474re. Define a 6kB storage_partition at the end of the
512kB flash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-07-31 10:09:38 +02:00
Francois Ramu 07d2b62cc7 tests: subsys: canbus changing the test thread priority
The test thread and the system workqueue have the same priority,
so it is a bit arbitrary whether the workqueue cleans up
the send context before the next send.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2023-07-31 10:09:25 +02:00
Fabio Baltieri 258fc16570 bindings: ethernet: rename ethernet to ethernet-controller
Rename the ethernet.yaml template to ethernet-controller.yaml to match
the Linux one.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-31 10:09:16 +02:00
Fabio Baltieri c2f4200ad5 bindings: ethernet: replace phy-dev with phy-handle
Rename the phy-dev property with phy-handle to match the Linux
ethernet-controller binding and move it up to ethernet.yaml so that it
can be used by other drivers.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-07-31 10:09:16 +02:00
Sjors Hettinga e14935ec6c net: tcp: Avoid partial ACK canceling retransmission timer
At any ack, the retransmission timer was cancelled. This means when an ACK
is only partially acknowledging pending data, followed by a packet loss,
the connection ended in a deadlock eventually timing out.
By checking if there is any pending data for transmission before canceling
the retransmission timer, there is no risk of this lock-up any more.

Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
2023-07-31 10:09:05 +02:00
Joshua Lilly 67268f5cbd drivers: interrupt_controller: plic: support edge triggered interrupts
This adds a check and option for edge triggered interrupts

Signed-off-by: Joshua Lilly <jgl@meta.com>
2023-07-31 10:08:52 +02:00
Peter Mitsis 38352ae13c test: Relocate posix mqueue receive buffer
For platforms that select Kconfig option CONFIG_KERNEL_COHERENCE,
the receive buffer used in mq_timedreceive() must not be on the
stack. This is because the k_msgq that underlies the POSIX mqueue
will attempt to perform a direct to buffer copy from the sender
when there is a waiting reader.

Fixes #60796

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2023-07-31 10:08:34 +02:00
Ryan McClelland 0ae1e37ead tests: logging: fix double-promotion warnings
Double promotion warnings are generated with the flag -Wdouble-promotion

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2023-07-31 10:08:27 +02:00
Benjamin Cabé d8bc8c0f1d drivers: w1: doc: Doxygen doc for 1-Wire commands
Added Doxygen comments for 1-Wire commands

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-07-31 10:07:59 +02:00
Erwan Gouriou f3f1ed6595 boards: stm32: Fix vendor name when required
Now that vendor name in board compatible is meant to be actually used,
it should be properly filled.
Update when not correct and don't put any name when vendor is not known

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2023-07-31 10:07:45 +02:00
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