Commit graph

7035 commits

Author SHA1 Message Date
Daniel Leung
ae415272c1 sys: heap_listener: extend to cover more events
This extends the heap_listener to cover more events,
specifically, allocation, free and realloc.

Note that typedef are used so the callback can be
documented.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-10 10:28:04 -05:00
Daniel Leung
39d17a180a sys: heap_listener: resize_cb to also take heap ID
Add a parameter to the resize callback to also take the heap ID.
This allows a single callback to be used for multiple heaps if
so desired.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-10 10:28:04 -05:00
Henrik Brix Andersen
e0ac59f31c tests: canbus: isotp: implementation: switch to DEVICE_DT_GET()
Switch from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 11:24:51 +01:00
Henrik Brix Andersen
b8d8b69440 tests: canbus: isotp: conformance: switch to DEVICE_DT_GET()
Switch from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 11:24:51 +01:00
Henrik Brix Andersen
5d05d2e3c7 tests: drivers: can: timing: switch to DEVICE_DT_GET()
Switch from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 11:24:51 +01:00
Henrik Brix Andersen
c8f72460be tests: drivers: can: fd: switch to DEVICE_DT_GET()
Switch from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 11:24:51 +01:00
Henrik Brix Andersen
1c4d10b8f7 tests: drivers: can: api: switch to DEVICE_DT_GET()
Switch from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 11:24:51 +01:00
Henrik Brix Andersen
8af4bb722d drivers: can: rename API functions for better consistency
Rename a few CAN API functions for clarity and consistency with other
Zephyr RTOS APIs.

CAN_DEFINE_MSGQ() becomes CAN_MSGQ_DEFINE() to match K_MSGQ_DEFINE().

can_attach_isr() becomes can_add_rx_filter() since a filter callback
function is not an interrupt service routine (although it is called in
isr context). The word "attach" is replaced with "add" since filters are
added, not attached. This matches the terminology used is other Zephyr
APIs better.

can_detach() becomes can_remove_rx_filter() to pair with
can_add_rx_filter().

can_attach_msgq() becomes can_add_rx_filter_msgq() and documentation is
updated to mention its relationship with can_add_rx_filter().

can_register_state_change_isr() becomes can_set_state_change_callback()
since a state change callback function is not an interrupt service
routine (although it is called in isr context). The word "register" is
replaced with "set" since only one state change callback can be in
place.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 10:44:37 +01:00
Francois Ramu
e5554d741c tests: drivers: spi loopback with DMA testing on stm32h743 nucleo
with this config, the testcase PASSED on the nucleo_h743zi
using DMA for SPI transfer (through DMAMUX request)
Connect pins D11 and D12 on the ARDUIno connector CN7

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-07 15:06:28 -06:00
Erwan Gouriou
b5b32b9b3e tests/drivers/clock_control: stm32: Add test suite for H7 series
Add clock_control test suite for H7 boards

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
fc23da19af tests/drivers/clock_control: stm32u5: Factorize tests in yaml file
To ease maintenance, add a common section.
It appears that using DTC_OVERLAY_FILE in the common section
preserves the required overlay order.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
73c1233461 tests/drivers/clock_control: stm32u5: Add a pll_msis_160 overlay
Instead of relying on default board configuration,
add a specific test for this config.

Additionally rename existing pll_msi_80 to pll_msis_160.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
228a96e41e tests/drivers/clock_control: stm32u5: Use a clear_clocks overlay
Instead of relying on existing board clock configuration,
use a clear_clocks.overlay file to first reset the clock
configuration to the default .dtsi state, then apply a
new configuration.
This method should be more robust when trying to use on more
boards and has the benefit to provide correct configuration
examples.

This relies on the fact that overlays are applied in the order
they are provided in DTC_OVERLAY_FILE CMake variable.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Erwan Gouriou
c6fd75af54 tests/drivers/clock_control: stm32: Move u5 tests in dedicated folder
Before adding more tests, organize things a little.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-07 18:19:16 +01:00
Tomasz Bursztyka
20b653f387 tests/x86: Improve ACPI output on info test
Print out DMAR's device id for each device scopes.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2022-01-07 10:47:27 -05:00
Daniel DeGrasse
e6cac6f029 tests: disk: Add fixture for sdcard test
Add fixture disk_sdcard for the sdcard test, since the test requires an
SD card to be present on the board.

Fixes #41331

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-07 08:01:22 -06:00
Immo Birnbaum
aa6245603b tests: subsys: logging: revert #40848
revert #40848 which excluded certain logging test cases on qemu_cortex_a9
due to #39978.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-01-07 07:58:43 -06:00
Immo Birnbaum
095d92a697 tests: subsys: logging: revert #40842
revert #40842 which excluded certain logging test cases on qemu_cortex_a9
due to #39978.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2022-01-07 07:58:43 -06:00
Herman Berget
6ede31428d Bluetooth: Host: Reassemble extended advertising reports
The host reassembles fragmented advertising reports from the controller.

Non-complete advertising reports from different advertisers may not be
interleaved. If non-complete advertising reports from an advertiser
is received while advertising reports from another advertiser is
reassembled, an error message is logged and the advertising report is
discarded. Future scan results may be incomplete.

Advertising reports from legacy PDUs or complete extended advertising
reports may be interleaved as these do not require reassembly.

If the controller sends more advertising data than fits in the
reassembly buffer, the data is truncated. Further advertising reports
from the advertiser are discarded until the final complete advertising
report is received and discarded.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-01-07 15:35:39 +02:00
Jakub Rzeszutko
2caf587095 tests: lib: getopt
Add tests for the getopt library.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2022-01-06 21:26:59 +01:00
Jordan Yates
d336954d1c tests: remove manual CONFIG_GPIO_EMUL
Remove the manual selection of `CONFIG_GPIO_EMUL` as it is now enabled
by default when devicetree nodes exist.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-01-06 11:56:15 -05:00
Dino Li
e79b6f1a81 tests: drivers: gpio: basic: add it8xxx2_evb test configuration
Add basic GPIO API test configuration for the IT8XXX2.

Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
2022-01-05 14:57:54 -05:00
Gerard Marull-Paretas
38d583bbf4 tests: drivers: gpio: gpio_basic_api: add support for gd32f403z_eval
Add DT overlay to run gpio_basic_api test on GD32F403Z-EVAL board. In
order to make testing easy a couple of accessible pins have been
selected: PD0 and PD1 pins exposed via P3 and P2 respectively.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-01-04 20:49:00 -05:00
Gerard Marull-Paretas
3bf7a7a326 tests: drivers: gpio: gpio_basic_api: add support for gd32f450i_eval
Add DT overlay to run gpio_basic_api test on GD32F450I-EVAL board. In
order to make testing easy a couple of accessible pins have been
selected: PC6 and PC7, the last 2 pins on the DCI camera 2.54" header.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-01-04 20:49:00 -05:00
Henrik Brix Andersen
2ff9de3741 tests: drivers: can: timing: enable loopback tests on native_posix
Enable the CAN timing tests on native_posix and native_posix_64.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-04 15:13:40 -06:00
Henrik Brix Andersen
5bc57c1139 tests: drivers: can: api: enable loopback tests on native_posix
Enable the CAN driver loopback tests on native_posix and
native_posix_64.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-04 15:13:40 -06:00
Henrik Brix Andersen
99a310b29b drivers: can: loopback: convert the CAN loopback driver to dts
Convert the CAN loopback driver from being configured via Kconfig to
multi-instance configured via devicetree.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-04 15:13:40 -06:00
Flavio Ceolin
23335e1cc1 tests: pm: mgmt_soc: Remove log in state notification entry
The notification is sent after the subsystem select the power state to
use and after suspend devices. The callback should not try to access a
device. In this case, uart through LOG macros.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-01-04 15:04:57 -06:00
Flavio Ceolin
451667c1da tests: pm: mgmt_soc: Cleanup headers
Removed not necessary headers.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-01-04 15:04:57 -06:00
Flavio Ceolin
cd495321de tests: pm: mgmt_soc: Use PM_STATE_COUNT
Use PM_STATE_COUNT to know the number of existent states.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-01-04 15:04:57 -06:00
Gerard Marull-Paretas
32bea9a7fb tests: lib: devicetree: use vnd,gpio-device
The vnd,gpio-device compatible is now used by the test GPIO driver
(CONFIG_GPIO_TEST) introduced in #41387. This means that we can't define
new devices with this compatible when CONFIG_GPIO=y.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-01-04 14:44:07 -05:00
Enjia Mai
e8119640c0 tests: benchmark: fix code coverage incorrect for latency_measure
Fixing code coverage data cannot be generated correctly when running
tests/benchmark/latency_measure test suite. This is because the gcov
data do not generate completely when the measuring thread stop. So
our solution is:

In main(), just waiting for the measuring thread to complete before
the gcov data start to dump out, to make sure all the gcov data can
be output completely.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-01-04 11:53:17 -05:00
Jedrzej Ciupis
fcda8699cb drivers: timer: extend nrf_rtc_timer
This commit introduces the following changes:

* nrf_rtc_timer is extended with a capability to handle RTC overflow,
allowing it to operate on absolute RTC ticks, rather than relative
ticks.
* overflow handling is ZLI-proof and relies on the sys clock
handler being executed twice every RTC counter's overflow.
* callbacks are given an absolute RTC tick value as a parameter instead
of CC register's value. The absolute RTC tick value is the RTC counter
value set during CC channel configuration extended to 64 bits.
* in case the timer's target time is in the past or is the current tick,
the timer fires as soon as possible, however still from the RTC's ISR
context.
* in case an active timer is set again with the same target time, it is
not scheduled again - only its event data is updated. Otherwise, the
timer is scheduled as usual.
* a scheduled timer can be aborted.
* system clock functions are now using 64 bit values internally.

Signed-off-by: Andrzej Kuroś <andrzej.kuros@nordicsemi.no>
Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Signed-off-by: Paweł Kwiek <pawel.kwiek@nordicsemi.no>
2022-01-04 17:44:32 +01:00
Lixin Guo
b5b629a115 tests: work: add support for k_work_flush() API
Add test for flushing work items in order, see if it works
as expected.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2022-01-04 09:27:18 -05:00
Lixin Guo
874c893b03 tests: work: add support for k_work_queue_unplug API
Validate unplug a already unplugged queue, this should not
affect the status of queue and return expected value.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2022-01-04 09:27:18 -05:00
Lixin Guo
ef7e01091e tests: work: add support for work_cancel_sync API
Add test for cancelling unqueued(idle) work items, this should not
affect the work item and return value as expected.

Signed-off-by: Lixin Guo <lixinx.guo@intel.com>
2022-01-04 09:27:18 -05:00
Daniel DeGrasse
f6497e37da tests: kernel: Fix assumption in test_kernel_cpu_idle
test_kernel_cpu_idle assumes that CPU's next timer wakeup will be
1 millisecond in the future based on kernel timer it sets. Move tick
synchronization delay into test loop so this will always be the case.

Fixes #41347

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-01-04 09:13:57 -05:00
Francois Ramu
433424d1ca tests: drivers: uart async on stm32wl55jc nucleo board
connect USART1 D1 / TX (pb6) to D0 / RX (pb7)
on the ARDuino connector CN9 of the nucleo board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-04 09:12:32 -05:00
Francois Ramu
8f8830e22a tests: drivers: spi loopback on the stm32wl55jc nucleo board
connect SPI1 MISO pin D12 (pa6) on SPI1 MOSI pin D11 (pa7)
on the ARDuino connector CN5 of the nucleo board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-04 09:12:32 -05:00
Francois Ramu
148db8b187 tests: drivers: dac loopback on stm32wl55jc nucleo board
define DAC1 output1 on PA10 (ARD connector A2)
define ADC1 in1 on PB14 (ARD connector A4)
connect A2 to A4 on the nucleo target board (CN8)

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-04 09:12:08 -05:00
Jordan Yates
ca6a329c9f tests: drivers: remove custom vnd,gpio inst
Remove the custom GPIO driver instantiation for `vnd,gpio` compatibles
in "build_all" tests. The devices are now instantiated in `gpio_test.c`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-01-04 09:10:40 -05:00
Piotr Pryga
26a66ee299 tests: Bluetooth: df: Fix not building unit tests
There were changes done to controller code that cause
tests to do not build and fail during execution.
Changes are related with:
- modified code related with extended advertising ADI
  field handling
- added generic double buffer data structure that is
  used in controller
- moved code that was building only when DF is enabled
- added EVENTS_PHYEND that is not available in nrfbsim
  board

The PR addresses those issues.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Piotr Pryga
578902960d Bluetooth: Controller: Add CTE recv and sample in connected mode
In connected mode when Receiving Constant Tone Extensions feature
is enabled, controller shall be able to receive CTE in any
data channel packet.
The commit adds required changes to allow receive of CTE for
all data channel packets in peripheral role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 09:10:05 -05:00
Sebastian Bøe
5536e6198b tests: arm_thread_swap_tx: nucleo_l552ze_q: Update flash partition
Due to a recent change in TFM, some more space should be allocated
to mcuboot flash partition (some space should be allocated for OTP)
(Cf commit db07170a34f ("Platform: Allocate space in flash for OTP")
in trusted-firmware-m repo)
Take this into account and increase mcuboot flash partition for
nucleo_l552ze_q_ns target.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-04 12:33:23 +01:00
Jimmy Brisson
2e1f26fd77 Tests: disable mps3_an547_ns fpu sharing test
TFM disables the FPU on this target, so the test will usagefault
with a NOCP exception type when run.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-01-04 12:33:23 +01:00
Alberto Escolar Piedras
8baee12f71 tests: bsim: Make all tests scripts executable
Test scripts should be executable.
The regression system will work around it by making them executable
if they are not, but that causes changes to the local tree.
Fix it instead so people doesn't get local changes when running regression.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-01-04 11:06:19 +01:00
Alberto Escolar Piedras
2e3acec199 tests: bsim: Use different sim_ids for different tests
Different tests should use different simulation ids so they don't
collide with each other at random when run in parallel.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2022-01-04 11:06:19 +01:00
Aleksandr Khromykh
18569edbea bsim: test: fix missing warnings in bsim test build system
bsim test build system hides compile warnings.
The problem had been fixed before but due to a regression came again.
This commit adds extra cc flags to prevent this.

Signed-off-by: Aleksandr Khromykh <aleksandr.khromykh@nordicsemi.no>
2022-01-03 20:35:20 +01:00
Henrik Brix Andersen
b1b77c1774 drivers: can: change can_tx_callback_t function signature
Change the can_tx_callback_t function signature to use an "int" (not an
uint32_t) for representing transmission errors.

The "error" callback function parameter is functionally equivalent to
the return value from can_send() and thus needs to use the same data
type and needs to be able to hold negative errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-01 07:40:29 -05:00
Gerard Marull-Paretas
c0fff657c5 pinctrl: use groupN instead of pinsN for groups
The pinsN group name can be a confusing in some circumstances, so change
it to groupN. Some platforms (e.g. nrf or gd32) are already using
groupN. Documentation and API tests have been updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-01 07:39:08 -05:00