Commit Graph

98998 Commits

Author SHA1 Message Date
Francois Ramu
f3c70b4ab8 tests: drivers: clock control testing on the stm32h7 serie
Disable the pll2 when clearing the clock config prior to
testing the clock_control driver for the stm32h7

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-07-09 19:03:10 +02:00
Krzysztof Chruściński
44c2b19d5e tests: kernel: timer: behavior: pytest: Adjust max stddev
Like in C test. If MAX STDDEV is lower than single clock cycle then
set it to a single clock cycle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 19:02:51 +02:00
Krzysztof Chruściński
1968cdf556 tests: kernel: timer: timer_behavior: Tweak expected std deviation
If frequency of the system clock is lower then deviation may exceed
default value (10us). Instead of adjusting the default value, test is
rounding up expected standard deviation to a single clock cycle.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 19:02:51 +02:00
Mykyta Poturai
3afd9429c0 json: Fix alignment calculation for nested objects
Currently, json array macros are passing the outer "container" struct
to the Z_JSON_ELEMENT_DESCR macro, causing the alignment to be calculated
from the outer struct which may be incorrect. Fix this by using the
biggest shift from the nested objects to calculate the alignment as the
struct size is calculated based on the biggest alignment of it's members.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
2024-07-09 19:02:25 +02:00
Mykyta Poturai
ddb3234884 json: test: Add test for array elements alignment
Add test to check that alignment and offsets of object array elements
are calculated correctly.

Signed-off-by: Mykyta Poturai <mykyta_poturai@epam.com>
2024-07-09 19:02:25 +02:00
Nick Kraus
29084dc06b west: Regex based version finding in OpenOCD runner
Previous OpenOCD version finding would fail when additional tokens were
prepended to the 'openocd --version' output, as happens with some third-
party OpenOCD repackages (xPack for one).

Fixes: #71955

Signed-off-by: Nick Kraus <nick@nckraus.com>
2024-07-09 19:02:13 +02:00
Mathieu Choplain
662b9803fa llext: disable verbose for SLID generation scripts
This commit removes the "-vvv" argument from the SLID generation
scripts' command line when building Zephyr or an extension with
Kconfig CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID enabled. This removes
a lot of noise in the build log (usually ~250 lines) and is fine to
do because the printed information is also saved in build artifacts.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-07-09 17:21:18 +02:00
Pisit Sawangvonganan
9b2ab20f23 bluetooth: fix typo in (include/zephyr/bluetooth, subsys/bluetooth/)
Utilize a code spell-checking tool to scan for and correct spelling errors
in all files within the `include/zephyr/bluetooth` and `subsys/bluetooth`

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-07-09 17:20:38 +02:00
Robert Lubos
e5d67adf80 net: sockets: services: Don't modify pollfd array from other threads
pollfd array used with zsock_poll() should not be modified while inside
zsock_poll() function as this could lead to unexpected results. For
instance, k_poll already monitoring some kernel primitive could report
an event, but it will not be processed if the monitored socket file
descriptor in the pollfd array was set to -1. In result,
zsock_poll() may unexpectedly quit prematurely, returning 0 events, even
if it was requested to wait infinitely.

The pollfd arrays used by zsock_poll() (ctx.events) is reinitialized
when the service thread is restarted so modifying it directly when
registering/unregistering service is not really needed. It's enough if
those functions notify the eventfd socket used to restart the services
thread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 17:19:12 +02:00
Henrik Brix Andersen
09d189cb71 drivers: can: loopback: increase default TX thread stack size
Increase the default TX thread stack size for the CAN loopback driver from
256 to 512 bytes as the former has shown to be too little when using the
loopback driver on real hardware.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-07-09 17:18:34 +02:00
Henrik Brix Andersen
7a25fbb2d7 drivers: can: loopback: set TX thread name
Set TX thread name to aid in debugging.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-07-09 17:18:34 +02:00
Andrey Dodonov
a4123a8ea2 net: lib: websocket: call socket poll for websocket
If we couldn't send all (or any data) via the socket,
invoke poll instead of blindly retrying and flooding the socket

Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2024-07-09 14:04:29 +02:00
Andrey Dodonov
15ead53ad9 net: lib: http: call socket poll for http_client send
If we couldn't send all (or any data) via the socket,
invoke poll instead of blindly retrying and flooding the socket.
Respect timeout through http_client_req

Signed-off-by: Andrey Dodonov <Andrey.Dodonov@endress.com>
2024-07-09 14:04:29 +02:00
Pieter De Gendt
9d8881816e zbus: Use section iterator for observations
Iterating the observations can be simplified to a struct iterator instead
of first getting the count and looping afterwards.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 14:03:33 +02:00
Pieter De Gendt
058bfc8065 zbus: Fix ZBUS_CHAN_DEFINE alignment
Align trailing backslashes.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 14:03:33 +02:00
Pieter De Gendt
990c5e13cb zbus: Static channel data initialization
Init the channel data semaphore and observer list statically.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 14:03:33 +02:00
Zihao Gao
6ebb65d163 Bluetooth: fix compiling issue when either A2DP SRC or SNK are not enabled
Some of the A2DP interfaces are not defined if the corresponding feature
is not enabled, and therefore shall not be initialized.
This patchs include the interfaces/variables by the configurations to
go through the compiling stage.

Signed-off-by: Zihao Gao <gaozihao@xiaomi.com>
2024-07-09 14:03:07 +02:00
Krzysztof Chruściński
4a53c69fa5 tests: logging: log_api: Fix logging.frontend.only.rt_filtering
When NO_BACKENDS was not defined then log backends were
initialized (even though not used). During the initialization
filters for that backends were configured and because of that
messages were not filtered out as expected.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Krzysztof Chruściński
347eeababf logging: Fix runtime filtering when frontend and userspace is used
When userspace is used and frontend was used for logging then runtime
filtering was failing because in user context filtering data was
accessed and filtering data is in the kernel space. Fixing that and
adding runtime filtering to the pre frontend function which is
already executed in the kernel space and filter data can be
accessed.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Krzysztof Chruściński
8ed29a625a logging: Fix UART dictionary frontend configuration
Logging string stripping depends on LOG_DICTIONARY_SUPPORT being
enabled and it was not set in UART dictionary frontend.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Krzysztof Chruściński
9876075de1 logging: Allow runtime filtering for frontend only case
Log frontend supports runtime filtering so it should be
allowed to enable it even when only frontend is used with
no backends.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-09 14:01:56 +02:00
Johann Fischer
67a31ef2d7 samples: hid-mouse: protect report buffer
Use the message queue to pass the new report from the input callback,
and use a semaphore to protect the report buffer until it is transferred
to the host.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-07-09 12:05:04 +02:00
Pieter De Gendt
5e4e51de78 tests: zbus: unittests: Add CMAKE_LINKER_GENERATOR case
Add a test case where the CMAKE_LINKER_GENERATOR is used.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 12:02:51 +02:00
Pieter De Gendt
a6effe318f cmake: linker_script: Fix zbus sections
Use the same zbus linker sections for CMAKE_LINKER_GENERATOR as for
linker scripts.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 12:02:51 +02:00
Pieter De Gendt
6488393937 cmake: linker_script: Add missing k_fifo section
Building for CMAKE_LINKER_GENERATOR needs a section for k_fifo kernel
objects.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2024-07-09 12:02:51 +02:00
Abderrahmane Jarmouni
472cf8a8e1 MAINTAINERS: STM32 Platforms: collaborators: remove ajarmouni-st
Starting next week, I will no longer be active on this work account,
& I will no longer be available to contribute to STM32 in Zephyr.
I will be reachable on my personal account: @JarmouniA

Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
2024-07-09 11:59:02 +02:00
Luca Burelli
5ce6a750a5 llext: add explicit cast to fix Coverity CID: 392507
From https://mails.dpdk.org/archives/dev/2021-December/231212.html:

    Downcasting a void* to struct aesni_gcm_session* caused the session
    data to be treated as tainted. Removing the void* temporary variable
    and adding a cast avoids this issue.

Try the same approach here to prevent the ldr->sect_hdrs pointer from
being treated as tainted.

May fix #74817.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-07-09 11:51:29 +02:00
Luis Ubieda
05f8b9c54b sensor: lps22hh: Prevent overwriting values that weren't overwritten
Previously both temperature and pressure were updated regardless of
which one was requested.

Fixes CID: 392519, GH: 74779.
Fixes CID: 392497, GH: 74777.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-07-09 11:51:16 +02:00
Benjamin Bigler
1db356e35c net: mgmt: Fix build error when event direct enabled without event info
If CONFIG_NET_MGMT_EVENT_DIRECT is enabled and CONFIG_NET_MGMT_EVENT_INFO
disabled it does not build because mgmt_push_event writes to non existing
struct members

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2024-07-09 11:49:47 +02:00
Benjamin Bigler
06a725c1c8 net: mgmt: prevent event_work_handler from blocking
Fix system workqueue block caused by mgmt_event_work_handler
when CONFIG_NET_MGMT_EVENT_SYSTEM_WORKQUEUE is enabled.

Signed-off-by: Benjamin Bigler <benjamin.bigler@securiton.ch>
2024-07-09 11:49:47 +02:00
Aksel Skauge Mellbye
a677e974ef soc: silabs: Include series-specific Kconfig
The series-specific Kconfig files were not included, leading
to RTT not being considered available.

Fixes #75511.

Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
2024-07-09 08:59:02 +02:00
Jared Kangas
c0fd916fbc drivers: sensor: wsen_itds: fix device ID mismatch return value
During initialization, zero is returned if an unexpected device ID is
read because the returned variable is not written to after a previous
non-zero check. Return -EIO instead to indicate an error occurred.

Detected with the following Coccinelle script:

        @@
        identifier I;
        @@

        *if (I) {
             ...
             return ...;
         }

         if (...) {
             ... when != I
                 when any
        *    return I;
         }

Signed-off-by: Jared Kangas <kangas.jd@gmail.com>
2024-07-09 08:56:04 +02:00
Emil Gydesen
62da8152d0 Bluetooth: BAP: Remove doc for past_sync in pa_sync_req
The past_sync field is no longer there and should not
be documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-07-09 08:50:06 +02:00
Evgeniy Paltsev
4b9828c2a8 tests: logging: fix build error
Currently we get the build error when building
'tests/subsys/logging/log_backend_uart':

error: static_assert expression is not an integral constant expression
BUILD_ASSERT(strlen(TEST_DATA) < SAMPLE_DATA_SIZE);
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It can be easily workarounded by using sizeof instead of strlen
to calculate string size.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-09 08:49:05 +02:00
Evgeniy Paltsev
edfb690587 test: logging: dictionary: fix build error
In `tests/subsys/logging/dictionary` we don't include stdio.h
header but use standard stream definitions (i.e. `stdout`)
which cause build issues (if the minimal libc is used).

Fix that.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-07-09 08:48:24 +02:00
Jordan Yates
af0cbb19c0 scripts: twisterlib: coverage: ignore __ASSERT branches
Disable branch coverage for the `__ASSERT` family of macros. Covering
all of the assertion branches by definition means triggering the
assertion, which can be either challenging or impossible to exercise,
and in either case results in the immediate termination of the test.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-08 20:41:31 -04:00
Jordan Yates
53bd9ead64 scripts: twisterlib: coverage: fix multiple branch excludes
Multiple values for `--exclude-branches-by-pattern` will result in only
the last value taking effect. Resolve this by merging all the provided
regex patterns into a single pattern with the `|` operator.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2024-07-08 20:41:31 -04:00
Sylvio Alves
6ade0cf715 wifi: esp32: fix memory leak
In case where the system is overloaded, net stack buffer
could fail to allocate next packet. That scenario requires
wifi internal Wi-Fi driver to free current rx buffer. This is
currently not being called. This fixes it by making sure
esp_wifi_internal_free_rx_buffer() is called in all scenarios.

Fixes #63043

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-07-08 20:41:16 -04:00
Glenn Andrews
1c19d43564 Driver: i2c_ll_stm32_v2: Remove log msg on boot
Converts the `<inf> i2c_ll_stm32_v2: I2C TIMING` message
displayed by the driver to a LOG_DBG. Also makes an actual
error message a LOG_ERR instead of a LOG_DBG.

Signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
2024-07-08 20:40:54 -04:00
Marc Herbert
65f63622e2 tests: cpp: add C++ coverage for pm/device.h
Note CONFIG_PM_* affects device.h too. Even if not compiled, the more
code the pre-processor sees the better.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Marc Herbert
c1852b83cd pm: device.h: fix pm_device designated initializers order for C++
Fixes the following error appearing in the test coverage added by the
next commit:

In file included from zephyr/tests/lib/cpp/cxx/src/main.cpp:18:
```
zephyr/include/zephyr/pm/device.h:275:9: error: designator order for
  field 'pm_device_base::state' does not match declaration order
                        in 'pm_device_base'
  275 |         }
      |         ^
zephyr/include/zephyr/pm/device.h:315:17: note: in expansion of
                                                macro 'Z_PM_DEVICE_INIT'
  315 |              Z_PM_DEVICE_INIT(Z_PM_DEVICE_NAME(dev_id), node_id,
```

Note this failure is observed with any g++ -std=c++NN standard value -
even before C++20.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Marc Herbert
c25b9b240e tests: cpp: add some C++ coverage for device.h / Device Tree
This provides C++ build test coverage for device.h (notably:
Z_DEVICE_INIT() fixed in the previous commit) and for some other Device
Tree macros.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Marc Herbert
c275eaac2d device.h: conditionally remove init braces for C++20 compatibility
Conditionally remove braces for designated initializers of anonymous
unions. This makes it compatible with C++20 while not breaking pre-C11
gcc.

This does for device.h what commit c15f029a71 ("init.h: restore
designated initializers in SYS_INIT_NAMED()") did for init.h

See https://docs.zephyrproject.org/latest/develop/languages/cpp/ and
long discussion in #69411 for more obscure C/C++ compatibility details.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-07-08 17:20:26 -04:00
Sylvio Alves
e04964aebd requirements: bump pyelftools to >=0.29
The minimum version of pyelftools is 0.29 to make it working
with scripts/footprint/size_report

Fixes #75605

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-07-08 17:18:29 -04:00
Tom Burdick
983ee54dfd sensors: ICM42688 read/writes chain callbacks
RTIO expects the CHAINED flag to be set when ordering of operations is
important. The callbacks in the icm42688 stream handling were not
chained into, meaning the callbacks would have occured immediately
rather than *after* the SPI reads/writes.

Update all the spi transactions to chain into the desired callbacks in
the driver.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-07-08 17:18:16 -04:00
Krzysztof Chruściński
47df73e51b lib: os: mpsc_pbuf: Do not use sem when CONFIG_MULTITHREADING=n
When multithreading is off packet buffer should not use feature which
allows waiting for available buffer.

mpsc_pbuf is used by logging which can work in deferred mode in
no multithreading build.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-07-08 14:58:32 -04:00
Zhaoxiang Jin
1e93796f8f boards: frdm_mcxn947: Update index.rst
Update index.rst, lowercase regulator.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00
Zhaoxiang Jin
5b8bac37d0 tests: adc: Add 'zephyr,vref-mv' property.
Add 'zephyr,vref-mv' property to frdm_mcxn947 overlay file.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00
Zhaoxiang Jin
599fddc867 tests: Add frdm_mcxn947 into regulator and adc test scope
Add frdm_mcxn947 into regulator and adc test scope

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00
Zhaoxiang Jin
2bd4151ac6 docs: migration-guide: Add NXP LPADC driver update info
Add NXP LPADC (nxp,lpc-lpadc) driver update info.

Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
2024-07-08 14:57:55 -04:00