Commit Graph

85964 Commits

Author SHA1 Message Date
Alberto Escolar Piedras 5f57275a65 tests drivers coredump: Exclude posix arch for userspace tests
This test cannot be run in this architecture as it does not
support userspace.
Today it is filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras fb38b90481 tests kernel: Exclude posix arch for userspace tests
These tests cannot be run in this architecture as it does not
support userspace.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras 4060f1d390 tests newlib: Exclude in posix architecture
These tests cannot be run in this architecture as it does not
support this toolchain.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras df15fcb9fb tests/benchmarks/cmsis_dsp/basicmath: Filter by arch
Add a filter by (arm) architecture, as the filter as it is faster
than filtering by kconfig.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras 886d6a9f1f samples subsys logger: Exclude some subtests from posix arch
Two substests (userspace and rtt) cannot be run in the posix
architecture.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Alberto Escolar Piedras befc96f22e userspace tests/samples: Exclude in posix arch
These samples & tests cannot be run in this architecture
as it does not support userspace.
Today they are filtered by kconfig, which works but spends
time running cmake.
As native_posix is a default test platform it is better
to filter it alltogether by arch, which saves quite a lot
of time.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-24 09:05:29 +02:00
Robert Lubos c6fd2b2d44 net: shell: Fix unexpected timeout on loopback ping
In case ping is sent to own address, the request is looped back to the
stack and served before ping work had a chance to reschedule. In result,
when the final ping reply has been server, and ping operation finalized
with `ping_done()`, the work was rescheduled one last time, causing the
ping timeout to be reported. Fix this by rescheduling the work before
sending the actual request, so that the reply handler can cancel the
work properly in such case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-24 09:05:20 +02:00
Robert Lubos dcf7b1905b net: core: Set LL address on loopback packet
In case packet is looped back to the stack, set LL address information
on the packet, using the LL address set on the corresponding network
interface, so that the information can be interpreted by the SOCK_DGRAM
packet socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-24 09:05:20 +02:00
Fabian Blatz d72159d288 samples: modules: lvgl: demo: Add widgets entry to README
Adds a short description and build command for the widgets demo to the
README.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2023-10-24 09:05:12 +02:00
Jukka Rissanen 1005fbe16c tests: net: iface: Do not use eth0 name in the test
If the first Ethernet interface is not the first network
interface, then there might be two interfaces with the same name.
The test does not like that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-24 09:05:04 +02:00
Jukka Rissanen 73896eef6c net: Set Dummy net_if as default one for tests
If we run network tests under tests/net, then set the
Dummy network interface as a default one so that it will
be picked up first.

This should solve the issue if the DUT is having a real
network interfaces like onboard Ethernet interface which
could cause the test to fail. The test might fail in this
case because the network tests assume that only simulated
network interfaces are used by the tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-24 09:05:04 +02:00
Flavio Ceolin c166685fcf ztest: Do not abort k_current_get from ISR
Do not abort k_current_get() from ISR.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-24 09:04:42 +02:00
Flavio Ceolin 564adad952 treewide: Add CODE_UNREACHABLE after k_thread_abort(current)
Compiler can't tell that k_thread_abort() won't return and issues a
warning unless we tell it that control never gets this far.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-24 09:04:42 +02:00
Emil Gydesen 7ec0be76ae samples: Bluetooth: Add missing reset of sems in iso_receive
In the iso_receive sample, the semaphores were not reset in
each iteration.

This caused the ISO receiver to act incorrectly and cause
issues with some controllers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-10-24 09:04:25 +02:00
Maciej Perkowski 0752d60443 scripts: Add arg to test_plan.py for alternative test locations
The arg --testsuite-root was copied from twister. When it is used
for test_plan.py it will be propagated to twister calls. This allows
to make alternative test locations (e.g. from another repo) to work
with test_plan.py

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-10-24 09:04:09 +02:00
Maciej Perkowski 7692610004 scripts: Add arg to set_plan.py for alternative tag relation list
Add --alt-tag arg for test_plan.py script. User can use it and point
to an alternative file with tag-directories relations. If so, such
file will be used instead of the default one.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-10-24 09:04:09 +02:00
Maciej Perkowski 47405a114a scripts: Allow using alternative ignore-patters in test_plan.py
Expand test_plan.py args with --ignore-path. This allows to provide an
alternative lists of patterns for the script.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-10-24 09:04:09 +02:00
Maciej Perkowski f7c4d5f9d4 scripts: Allow test_plan.py to work with other than zephyr repos
The test_plan.py script has a path to repository to be scanned for
changes hard coded to zephyr. This patch separates zephyr path from
such repository's path and adds an arg to pass repo to scan

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-10-24 09:04:09 +02:00
Maciej Perkowski f9178926a9 scripts: Add --no-detailed-test-id arg to test_plan.py script
An option --no-detailed-test-id was added to twister to help align
names for test outside of zephyr tree. This commit add this arg
to test_plan.py script which is then propagated to twister.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2023-10-24 09:04:09 +02:00
Aron Lander aa2879a397 modules: Updated the Percepio module to v4.8.1.hotfix1
This synchronizes the percepio module with the upstreams
repository.

Signed-off-by: Aron Lander <aron.lander@percepio.com>
2023-10-23 20:58:41 -05:00
Flavio Ceolin 9a7a22a68b pm: Fix possible undefined reference
Function pm_state_cpu_get_all is declared in state.h
but it is only implemented if CONFIG_PM is set.

Add an inline implementation for when CONFIG_PM is not set.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-23 20:57:57 -05:00
Flavio Ceolin 0b01671fe9 tests: pm: Test pm_state_cpu_get_all
Add test for pm_state_cpu_get_all API

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-23 20:57:57 -05:00
Sophie 'Tyalie' Friedrich 7857996e90 boards: esp23: m5stack_core2: Fix i2c1 pin definitions
For GPIO pins above 31, one needs to use the `&gpio1` (or similar)
definition, as zephyr seperates GPIOs into chunks of 32.

Signed-off-by: Sophie 'Tyalie' Friedrich <dev@flowerpot.me>
2023-10-23 20:56:54 -05:00
Sophie 'Tyalie' Friedrich 70cb934959 boards: xiao_esp32s3: Fix connector definition
Previously the seed connector was defined incorrectly and as such D6 and D7
weren't usable as i.e. inputs. Zephyr distinguishes GPIO pins in blocks of
32, a distinction the ESP32 reference manual doesn't do. As such one needs
to write `&gpio1 11` in order to access `GPIO43`.

Signed-off-by: Sophie 'Tyalie' Friedrich <dev@flowerpot.me>
2023-10-23 20:56:54 -05:00
Henrik Brix Andersen 4737706794 drivers: can: sja1000: add CAN statistics support
Add support for CAN statistics to the SJA1000 CAN controller driver. The
hardware does not support distinguishing between being unable to transmit
dominant versus being unable to transmit recessive bits.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-23 18:20:23 +02:00
Henrik Brix Andersen 40ad8c8711 drivers: can: add bit error counter
The bit error counter is incremented when the CAN controller is unable to
transmit either a dominant or a recessive bit.

This new error counter should only be incremented directly if the CAN
controller is unable to distinquish between failure to transmit a dominant
versus failure to transmit a recessive bit. If the CAN controller supports
distinguishing between the two, either the `bit0` or `bit1` error counter
shall be incremented instead. Incrementing one of these will automatically
increment the bit error count as well.

Typically, a CAN controller driver will either use this new bit error
counter or the discrete bit0 and bit1 error counters depending on the
features supported by the hardware. Mixing the two on driver level should
not be required.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-23 18:20:23 +02:00
Jordan Yates 322d4c1f98 bluetooth: hci: spi: avoid `rxmsg` re-use
Don't re-use the `rxmsg` buffer in the `bt_spi_send` function. This
buffer is still used by the RX thread after releasing the SPI semaphore.
The current re-use can result in buffer corruption if the RX thread is
swapped out as a result of the `k_sem_give`.

Moving the semaphore release later can result in deadlocks due to
buffer allocation being performed while holding the semaphore, so
instead just eliminate the re-use entirely.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-23 18:19:58 +02:00
Jordan Yates 00e67753ac bluetooth: hci: spi: extract message handling to func
Extract the HCI message handling out to a dedicated function to simplify
the main thread function. This also solves a bug as a side effect.

Previously `discardable` and `timeout` were never being reset after
an advertising report was received, resulting in ALL events after the
first advertising report being treated as discardable.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-23 18:19:58 +02:00
Fabio Baltieri 96ed3a68a9 dts: mec1727nsz: fix few build issues
This files has been changed as part of a refactoring in 13a87081b9.
Unfortunately the refactoring introduced few issues:

- usage of devicetree macros before their definition
- usage of pinctrl label before the definition of the corresponding node
- removal of few node overrides that are causing build errors

Unfortunately there's no board usptream using this specific dts file, so
the issue has not been caught in CI and was only found downstream.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-23 16:33:45 +01:00
Anas Nashif b643692fa5 ci: test_plan: use integration mode for architectures
Reduce the scope to integration only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-23 11:20:57 -04:00
Anas Nashif 99bb4b9581 ci: testplan: fix include path
Add zephyr to the include path detection.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2023-10-23 11:20:57 -04:00
Tom Burdick f0326f7249 tests: dma_loopback: Intel ADSP ACE15 disable PM
Disable power management for this particular test case as it expects a
particular pattern of pm get/puts that isn't matched by the driver and
usage in SoF.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2023-10-23 10:01:09 -05:00
Jukka Rissanen 63d9c8fa06 net: shell: Print v4-mapping-to-v6 address properly
The remote address of the connection is checked whether
it is v4-mapping-to-v6 address in which case we should
print it such.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 2238baa831 net: tcp: Do not overwrite remote address in new conn
When a new incoming connection is accepted, do not overwrite
the listening remote address. The remote address for the
listening socket is the any address (like :: for IPv6)
and not the accepted socket remote address.
This only affects the "net conn" shell command which prints
the remote address incorrectly. There is no problem accepting
new connections in this case.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen bc41d03e28 tests: net: socket: misc: Fix memory leak
The sent pkt must be removed after we have cloned it
in the simulated driver otherwise there is a memory leak.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen e3f664dfe2 net: conn: Fix the rank value print
We should use the NET_CONN_RANK() macro when printing the
current rank value as that macro masks the rank values properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 8a4ef3e67a samples: net: sockets: echo: Convert to work both IPv6 and IPv4
The sample enables CONFIG_NET_IPV4_MAPPING_TO_IPV6 and then
turns off IPV6_V6ONLY option which allows it to support both
IPv6 and IPv4 using the same socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 1b4a76cc36 net: tcp: Fix the accepted socket address
The socket address passed in accept() call should point
to the new connection address and not the old one.
Fortunately this only affects things after the v4-mapping-to-v6
support so older code than this works fine.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen dea896f6e7 net: tcp: Set address len properly when accepting a socket
The address length of the accepted socket must reflect the
size of the address struct, so it should either be
sizeof(struct sockaddr_in) for IPv4 or sizeof(struct sockaddr_in6) for
IPv6 socket.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 83aaeadddd tests: net: socket: Add tests for IPV6_V6ONLY option
The IPV6_V6ONLY option is only checked if
CONFIG_NET_IPV4_MAPPED_TO_IPV6 option is set.
By default the IPV6_V6ONLY option is set.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 4f37d63ed1 net: Add support for v4-mapping-to-v6 sockets
This allows IPv4 and IPv6 share the same port space.
User can still control the behavior of the v4-mapping-to-v6
by using the IPV6_V6ONLY socket option at runtime.
Currently the IPv4 mapping to IPv6 is turned off by
default, and also the IPV6_V6ONLY is true by default which
means that IPv4 and IPv6 do not share the port space.
Only way to use v4-mapping-to-v6 is to enable the Kconfig
option and turn off the v6only socket option.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 256d5fac4f net: utils: Print IPv4 mapped IPv6 addresses properly
Add support for IPv4 mapped IPv6 addresses when converting
IP address to a string in inet_ntop() function.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Jukka Rissanen 67309968cb net: utils: Add helpers for manipulating IPv4 mapped address
Create a function that can create IPv4 mapped to IPv6 address.
Create a function that can check if the IPv6 address is a
mapped IPv4 one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-23 09:57:22 -05:00
Markus Becker e51c044216 sensor: ltrf215a: LiteOn LTR-F216A
New driver for I2C illuminance sensor LiteOn LTR-F216A.

Datasheet:
https://optoelectronics.liteon.com/upload/download/DS86-2019-0016/LTR-F216A_Final_DS_V1.4.PDF

* Applied suggestions from code review
* Removed retry mechanism

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
Co-authored-by: Andy Sinclair <andy@aasinclair.co.uk>
2023-10-23 09:47:09 -05:00
Robert Lubos 05361edb1b net: shell: Fix TCP connect behavior
Fix two issues with net tcp command:

* The `net tcp` commands are still based on net_context API. For TCP,
  the API caller (net shell) should add one extra reference to the
  allocated net context, to prevent premature context release in case of
  connection teardown. Currently that was not the case, and the context
  was released too early, resulting in missing final ACK from the Zephyr
  side on connection close.

* The net context API should not be called from the registered connect
  callback, as this creates a temporary deadlock situation. The
  net_context_connect() function blocks until the connection is
  established, or an error or timeout occurs. For that time the
  net_context mutex is being locked. In case of connection error (for
  example after receiving RST packet) the connect callback is called,
  indicating an error. If we try to call net_context API from within, a
  deadlock situation takes place, as the context mutex is still locked
  by the net_context_connect() (called from the shell thread). This
  blocks the further execution of the TCP stack and can result in an
  unexpected behavior (like for example retransmitting the SYN packet,
  which takes place from yet another thread, TCP work queue).
  Fix this, by releasing the net context not from the callback directly,
  but based on the return value from net_context_connect().

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-23 16:08:37 +02:00
Patryk Duda ad1b1cf978 clang: target: Include gcc-m-fpu.cmake file
File gcc-m-fpu.cmake is responsible for determining what should be
passed to -mfpu option. Fortunately GCC and Clang options are compatible
so we can use the file for clang.

The list of supported -mfpu options can be found at
https://github.com/llvm/llvm-project in
llvm/include/llvm/TargetParser/ARMTargetParser.def file.

Signed-off-by: Patryk Duda <pdk@semihalf.com>
2023-10-23 16:04:39 +02:00
Xudong Zheng 9ddca0bfc6 debug: coredump: add name for backend and dump options
This makes the backend and dump options more easily configurable via
Kconfig.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2023-10-23 15:22:37 +02:00
Andries Kruithof e3d6aac5c0 Bluetooth: ISO: use IN_RANGE for CIG create parameters
Use IN_RANGE instead of explicitly checking that a value is
in between two other values

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-23 15:22:10 +02:00
Andries Kruithof 8b3b8cf2ad Bluetooth: ISO: extend API for setting SDU interval
The BT Core Spec v5.4 allows separate SDU_Interval to
be set on C_To_P and P_To_C directions,
but this is not possible with the existing interface.

This PR splits the interval parameter in the call to
bt_iso_sig_create into one for C_To_P
and one for P_To_C

It also splits the latency parameter into one for
C_To_P and one for P_To_C

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>

Bluetooth: ISO: update UI for extended API

The API for setting the SDU interval and latency have been updated.
This PR also updates the setting of these by the user in the shell
and the iso_connected_benchmark sample

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2023-10-23 15:22:10 +02:00
Yong Cong Sin 1f60c1379e net: shell: fix compilation errors
`suspend.c` and `resume.c` are missing the `zephyr/pm/device.h`
add that to fix compilation warning

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2023-10-23 14:20:23 +01:00