Commit graph

10532 commits

Author SHA1 Message Date
Torsten Rasmussen a88502783b cmake: align Zephyr module variable to EXTRA_ZEPHYR_MODULES
Align Zephyr modules with other user facing variables where settings
can be defined or extended, meaning Zephyr modules now supports:
ZEPHYR_MODULES and EXTRA_ZEPHYR_MODULES.

Support for ZEPHYR_EXTRA_MODULES is kept foir backward compatibility.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2023-05-23 16:40:21 +02:00
Dawid Niedzwiecki aa0c0727b4 mgmt: ec_host_cmd: add config to create a dedicated thread
Add a config to decide if a new dedicated thread for Host Command is
created during initialization.

If not, the ec_host_cmd_task has to be called by another thread to
handle host commands.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-05-23 16:19:53 +02:00
Gerard Marull-Paretas 52aec02e96 tests: drivers: build_all: regulator: add test
Add a new _test_ that is used to build all regulator drivers. SoC
regulators, such as Raspberry Pi Pico core supply are excluded as they
are typically built as part of the platform.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-23 14:37:15 +02:00
Denis Mingulov f27d360d96 tests: boot: test_mcuboot: Add test with asserts enabled
Chain-load images might behave differently comparing to the usual
standalone boot, as for example some peripheral initialization
might be done already.

Add an additional test with CONFIG_ASSERT=y as enabled asserts
could break up chain-loaded image.

Signed-off-by: Denis Mingulov <denis@mingulov.com>
2023-05-23 08:55:00 +02:00
Fabio Baltieri 7d898edfc5 boards: nrf52_bsim: always allow testing with no optimization
Since f5830f3c3f, running tests with no optimization has to be confirmed
by setting ZTEST_ALLOW_NO_OPTIMIZATIONS. This is normally done on a per
test basis, but since nrf52_bsim disables optimizations in the
defconfig, the default option has to be flipped at board level so that
every test for this board builds correctly.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-23 15:28:44 +09:00
Fabio Baltieri f5830f3c3f ztest: error out when building tests with no compiler optimizations
Many tests are known to fail when built and no compiler optimizations.
Add a CMake check to error out when building a ztest based test with no
optimization, ask not file issues about it but also adds an opt-out
option to bypass the error for tests are actually designed to work in
this setup.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-05-22 12:25:43 -04:00
Florian Grandel fc879ffa16 net: l2: ieee802154: payload length coverage
This change introduces test coverage for payload length calculation
to stabilize the change introduced earlier and ensure that future
changes will not cause regressions in that area.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 16:33:28 +02:00
Florian Grandel ca6d552bbb net: l2: ieee802154: fix payload handling
The current implicit MAC payload length algorithm (based on
an otherwise irrelevant footer pointer) produces invalid
(non-standard) values for beacon and command frames.

This change produces standard-conforming MAC payload length
values and simplifies access to payload length.

It would have been possible to fix the current footer pointer
based approach but there are arguments in favor of the new
approach:
- The footer pointer is used nowhere in the current code
  base and makes length calculations rather non-obvious.
- The new approach does not use more memory and is easier
  to understand and use.
- This change is a first step to support of IEEE 802.15.4
  information element (IE) support. At a later stage the
  distinction between MAC payload length and frame payload
  length will be introduced and become relevant to
  distinguish between header and payload IEs. At that point
  the current implicit length calculation algorithm will
  break down anyways.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 16:33:28 +02:00
Florian Grandel 988ffe9c48 tests: net: l2: ieee802154: active scan shell/mgmnt coverage
This change introduces integration test coverage for the
stack's scan shell command including the underlying net
management and command handling methods.

Later changes will build on this test to ensure that
changes to command handling will not break backwards
compatibility

This is also the reason why a separate test suite and
test file are being introduced already as further tests
will be added later on. We avoid having to move code
and thereby loose history.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 16:33:28 +02:00
Matthias Breithaupt 82c39a7805 test: DHCPv4: Add test for option callbacks
Add tests for the option callback API. The test uses a previously unused
option already contained in the sample offer.

Signed-off-by: Matthias Breithaupt <m.breithaupt@vogl-electronic.com>
2023-05-22 15:25:40 +02:00
Emil Gydesen 3074c72d79 Bluetooth: BAP: Move endpoint discovery to new callback
Add a new endpoint callback that is used to report the found
ASEs during BAP discovery, rather than calling
the discovery callback with optional values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 1c304d9d23 Bluetooth: BAP: Move pac record discovery to new callback
Add a new pac_record callback that is used to report the found
PAC records during BAP discovery, rather than calling
the discovery callback with optional values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 5d498d78ad Bluetooth: BAP: Remove bt_bap_unicast_client_discover_params
Remove the BAP unicast client specific discover parameter struct.
This make the BAP discover work more similar to the other
profiles.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen ffca5f9b2f Bluetooth: BAP: Remove dir from BAP discovery parameters
The direction has been moved to a function parameter instead,
and we keep a local copy of the value in the stack instead.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 1199e46e0b Bluetooth: BAP: Remove num_eps from BAP discover params
The field is not required and is no longer used.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 0b10498fb1 Bluetooth: BAP: Remove num_caps from BAP discover params
The field is not needed and no longer used.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 11f5f3b080 Bluetooth: BAP: Move uni cli discov err to callback
Move the err field from the discover parameters to
the callback.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Emil Gydesen 39406a4843 Bluetooth: BAP: Move uni cli discover callback
Move the unicast client discover callback from the
parameters to the callback structure.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-22 15:24:28 +02:00
Vinayak Kariappa Chettimada 6ed100bdc9 Bluetooth: Controller: Add BT_CTLR_SW_SWITCH_SINGLE_TIMER coverage
Add BT_CTLR_SW_SWITCH_SINGLE_TIMER coverage in BabbleSim
tests.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-05-22 12:02:02 +02:00
Gerard Marull-Paretas dacb3dbfeb iterable_sections: move to specific header
Until now iterable sections APIs have been part of the toolchain
(common) headers. They are not strictly related to a toolchain, they
just rely on linker providing support for sections. Most files relied on
indirect includes to access the API, now, it is included as needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2023-05-22 10:42:30 +02:00
Mariusz Skamra 626e47514e tests: Bluetooth: ascs: Factor out call count verification function
Reduce code duplicates by using common function to verify mock function
call count.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-05-22 10:16:02 +02:00
Mariusz Skamra a61dd0c950 tests: Bluetooth: ascs: Add test for stream pair release on ACL disc
This adds test case to verify if ACL disconnects, the associated
stream pair is released.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-05-22 10:16:02 +02:00
Mariusz Skamra 6c6a66711c tests: Bluetooth: ascs: Add test for ASE release on ACL disconnection
This adds test case to verify if ACL disconnects, the associated ASE
is released.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-05-22 10:16:02 +02:00
Mariusz Skamra df5317a6f0 tests: Bluetooth: ascs: Change bap_stream asserts to expectations
Continue test execution even if assumption failed. This won't break the
test execution prematurely and allow to perform a cleanup.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-05-22 10:16:02 +02:00
Florian Grandel 51108a9ce4 net: l2: ieee802154: test: /w and /wo sockets
This change splits the IEEE 802.15.4 test into two separate
test profiles, one with and one without sockets enabled to ensure
that both configurations work correctly.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 425d252d67 net: l2: ieee802154: test: sequence number coverage
IEEE 802.15.4-2020 introduces a sequence number suppression feature.

This change covers sequence number handling to ensure that future
changes will not break sequence number handling when introducing
the sequence number suppression feature.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 60c3107ef3 net: l2: ieee802154: test: fix resource mgmt
This change fixes some minor resource leaks in the test suite.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel f9492c399e net: l2: ieee802154: test: improved pkt doc
Introduces inline documentation of binary test frames to ease
future maintenance.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 6d6630528c net: l2: ieee802154: test: simlify sockaddr config
This refactoring dries up duplicate code required to configure
the socket address structure used in tests.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 259d6678d7 net: l2: ieee802154: test: cover ACK procedure
This change introduces test coverage for the IEEE 802.15.4
acknowledgement procedure.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel c0facfbf24 net: l2: ieee802154: test: extract data pkt with ar
Additional test cases introduced in later commits will re-use
an existing test frame that requests acknowledgement. It is
therefore extracted into a function.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 254d92666a net: l2: ieee802154: test: cover raw reception
Additional test case that covers AF_SOCKET/SOCK_RAW package
reception.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 834ad1e521 net: l2: ieee802154: test: cover dgram reception
Additional test case that covers reception of AF_SOCKET/SOCK_DGRAM
packages via socket API.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 66bd007f30 net: l2: ieee802154: security: properly clean up previous session
When changing IEEE 802.15.4 security settings or setting security
to 'none' then the previous session must be cleaned up to avoid
resource leaks.

This change introduces proper clean-up of the security session.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel d9cf3b024b net: l2: ieee802154: test: extract security set up/tear down
Security set-up and clean-up is extracted into functions
to enable re-use by test cases introduced in later commits.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 773108293b net: l2: ieee802154: test: raw packet readability
Improves inline documentation of binary IEEE 802.15.4 frames
to ease future maintenance. In this case the frame required
for testing raw sockets.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Florian Grandel 0f583303f7 net: l2: ieee802154: test: prepare expectation struct enlargement
This is a purely syntactical change that makes test case
expectations configuration more readable.

This is required as later commits will introduce further
expectations.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-05-22 08:06:14 +00:00
Bill Waters 61246e2592 driver: adc: infineon: Adding ADC driver support to cy8cproto_063_ble
- The boards\arm\cy8cproto_063_ble board now has ADC enabled
- This includes overlay files for the test app and sample app

Signed-off-by: Bill Waters <bill.waters@infineon.com>
2023-05-19 20:22:51 -04:00
Peter Rowley 66c568e300 drivers: fuel_gauge: sbs_gauge: Add support for buffer registers
The buffer registers (chemistry, manufacturer name, device name) were
not implemented. Implemented by adding a new api interface for
retrieving buffer properties. fuel_gauge_get_block_property has been
added, and uses a memory buffer allocated in the app in order to
store the fuel gauge information.

Signed-off-by: Peter Rowley <perowle@microsoft.com>
2023-05-19 16:39:25 -04:00
Miika Karanki d8166e813b json: add json_calc_encoded_arr_len
Analog to json_obj_encode vs. json_calc_encoded_len which
calculates the object len using json_obj_encode, introduce
json_calc_encoded_arr_len which calculates the length using
json_arr_encode. That is needed when the object to be encoded
is array on the root level.

Signed-off-by: Miika Karanki <miika.karanki@vaisala.com>
2023-05-19 19:52:04 +00:00
Vincent Geneves d4d20c5826 drivers: sensor: add helper functions to convert float
These helper functions can be used to avoid dependency to double
type and save some space in ROM.

Signed-off-by: Vincent Geneves <vgeneves@kalray.eu>
2023-05-19 13:18:05 -05:00
Peter Rowley ff36548616 drivers: fuel_gauge: Add support for RSOC and ASOC
Current driver only allows state-of-charge.  Adding relative-state-
of-charge and absolute-state-of-charge to differentiate between the
different types.  Updated sbs and max drivers to support new enum.
Discussed in issue #57523

Signed-off-by: Peter Rowley <perowle@microsoft.com>
2023-05-19 13:40:19 -04:00
Robert Hancock 9988067c5a tests: drivers: build_all: add build for wdt_xilinx_axi
There is currently not an in-tree Zephyr board which enables the
wdt_xilinx_axi driver as part of its standard configuration. (It can be
enabled fairly easily with the Digilent Arty board, but that requires
modifying the ARM-provided FPGA block design in Vivado and rebuilding
the FPGA image, so it cannot be used with the default FPGA image.)

Add a build_all target to provide build coverage for this driver.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
2023-05-19 16:14:24 +02:00
Mohamed ElShahawi 8300e670e9 tests: drivers: build_all: Add test for display drivers
Add a blank test to cover building drivers that are in drivers/display/

Signed-off-by: Mohamed ElShahawi <ExtremeGTX@hotmail.com>
2023-05-19 15:24:56 +02:00
Sumit Batra 815b8fc664 board: Adds MIMXRT1062-FMURT6 board support package
Also enables all the usable CAN, Ethernet, I2C, PWM,

SPI, UARTs interfaces for this board

Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
2023-05-18 14:08:06 -05:00
Armando Visconti e5b7799ce3 drivers/sensor: add support to LSM6DSV16X IMU sensor
The LSM6DSV16X is a system-in-package featuring a 3-axis digital
accelerometer and a 3-axis digital gyroscope for industrial and IoT
solutions. The LSM6DSV16X embeds advanced dedicated features such as
a finite state machine (FSM) for configurable motion tracking and a
machine learning core (MLC) for context awareness.

https://www.st.com/en/mems-and-sensors/lsm6dsv16x.html

This driver is based on stmemsc HAL i/f v2.02

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2023-05-18 11:43:36 -05:00
Emil Gydesen cdc84f7867 tests: Bluetooth: CAP initiator unicast invalid param tests
Add tests for testing invalid parameters for the CAP
initiator unicast APIs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-18 13:13:13 +00:00
Emil Gydesen bd069c36be tests: Bluetooth: CAP initatior broadcast invalid param testing
Add testing of using invalid parameters for the CAP initiator
broadcast APIs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-18 13:13:13 +00:00
Emil Gydesen cf39633c80 tests: Bluetooth: CAP Initiator broadcast test to smaller functions
Split the CAP Initiator broadcast test into smaller functions.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-05-18 13:13:13 +00:00
Fredrik Danebjer f3fdb1f96f Bluetooth: Audio: Make VCS optional notify characteristics optional
This change makes VCS Volume Flag characteristic Notify property
optional and selectable through Kconfig.

Signed-off-by: Fredrik Danebjer <frdn@demant.com>
2023-05-17 19:26:54 +02:00