Commit Graph

104 Commits

Author SHA1 Message Date
Sadik Ozer
18853d026a tests: drivers: counter: Enable counter RTC test for MAX32 MCUs
This commit enables counter RTC test for MAX32 MCUs.

Co-authored-by: Okan Sahin <okan.sahin@analog.com>
Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-11-16 15:08:43 -05:00
Sylvio Alves
5a205518a6 tests: drivers: counter: fix no_alarm use case
In the test scenario without alarms, it might
be the case that counter is already running and
it will not match the expected tick.
This adds a tick offset into the expected value
based on current counter reading.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-16 09:58:47 +02:00
Michal Smola
d04c3c1817 tests: drivers: counter_basic_api: Support mcux rtc counter
Allow counter_mcux_rtc in reliable_cancel_capable test.

Signed-off-by: Michal Smola <michal.smola@nxp.com>
2024-10-10 14:59:35 -04:00
Krystof Sadlik
6bc0970c40 tests: counter: counter_basic_api: Added testcase wihtout alarms
Some counter drivers do not support alarms, so I added testcase which
starts the counter, checks if the value is in range after certain time and
stops the counter, to check if the counter is running correctly.

Signed-off-by: Krystof Sadlik <krystof.sadlik@nxp.com>
Co-authored-by: Michal Smola <michal.smola@nxp.com>
2024-10-08 06:01:46 -04:00
Sadik Ozer
18c0013671 tests: drivers: counter: Enable counter test for MAX32655
This commit enables counter test for MAX32655 boards.

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2024-09-11 20:18:33 -04:00
Krzysztof Chruściński
dc711d721e Revert "tests: drivers: counter: basic_api: Tweak test timing"
This reverts commit 331442f059.

Change was introduced because it was failing on slow core
(nrf54h20/cpuppr) however it turned out that there was a bug in the
driver and now test passes without this tweak which make the test
last twice longer.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-09-03 14:40:10 +01:00
Hao Luo
b532a3ea7f boards: ambiq: apollo3: add connector dtsi for apollo3 boards
Added connector dtsi files for apollo3_evb and apollo3p_evb,
and ran gpio_basic_api to test, all cases pass

Signed-off-by: Hao Luo <hluo@ambiq.com>
2024-08-29 18:06:07 +02:00
Manuel Argüelles
123f99c87b tests: drivers: counter: fix skip tests check
When running this test with multiple counter instances enabled that
support different capabilities, if one of the instances does not
support the test required capabilities, the test will be
immediately skipped not giving the chance to run to the subsequent
instances.

Fix this by marking the test as skipped, only of all counter instances
under test were skipped.

Fixes #74358

Signed-off-by: Manuel Argüelles <marguelles.dev@gmail.com>
2024-06-25 06:06:19 -04:00
Mathieu Choplain
3ffa56fd7e tests: drivers: counter: support STM32 w/o RTC
This commit adds a missing #ifdef check which prevents building the
'counter_basic_api' test for boards under the following conditions:
 * RTC node is defined in device tree (compatible = "st,stm32-rtc")
 * RTC node is disabled in device tree (status = "disabled")
 * Kconfig "CONFIG_COUNTER_RTC_STM32=n" is specified

This check matches the ones done a few lines above for NXP MCUs.

Without this check, building the test under the conditions listed above
failed with the infamous `undefined reference to '__device_dts_ord_N'`
linker error, because the test attempts to obtain RTC's `struct device`
despite CONFIG_COUNTER_RTC_STM32=n, which ultimately fails because the
RTC driver is not built unless there is an enabled RTC node in DT.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-06-21 15:04:20 -04:00
Emilio Benavente
e8b500fd22 tests: drivers: counter: counter_basic_api: enabled lptmr testing
Enabled the counter_basic_api test to test lptmr.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-06-11 17:04:26 +03:00
Krzysztof Chruściński
331442f059 tests: drivers: counter: basic_api: Tweak test timing
For slow processors it is possible that setting 1 ms alarm and
then canceling it could lead to alarm expiring before it is canceled
and that was not expected in the test. Increasing timeout to 1.5ms.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2024-06-11 11:39:14 +01:00
Lucas Tamborrino
0b72ded057 tests: drivers: counter: support rtc timer
Add support for rtc timer node in the test.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2024-05-27 01:37:18 -07:00
Jiafei Pan
bd699d0d50 tests: counter_basic_api: add imx93 evk support
Add i.MX 93 EVK support for counter_basic_api test application.

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2024-04-30 08:53:59 +02:00
Richard Wheatley
e2656a24a9 tests: drivers: counter: counter_basic_api
Correctly show skips in final statistics.

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-23 15:31:20 +02:00
Richard Wheatley
0b53f7a9fd tests: drivers: counter: counter_basic_api
Enable reliable_cancel_capable feature for Ambiq counter

Signed-off-by: Richard Wheatley <richard.wheatley@ambiq.com>
2024-04-02 10:37:02 +03:00
Emilio Benavente
8bb95d33be drivers: counter: Adding Mutli Channel PIT Support
Updating the nxp,pit driver to support mutliple
channels. Updating the dts and board overlays
to account for the changes.

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Emilio Benavente
04b240c830 dts: bindings: renamed binding used for pit
Renamed pit binding from nxp,kinetis-pit
to nxp,pit

Signed-off-by: Emilio Benavente <emilio.benavente@nxp.com>
2024-03-07 13:23:58 -06:00
Mahesh Mahadevan
37158ebf15 tests: counter: Add LPC RTC 1KHZ counter
Add counter test support for the RTC 1KHz counter

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-01-12 13:34:19 +01:00
Bryan Zhu
6f84f34647 tests: counter: counter_basic_api: Add support for ambiq_counter device
Update counter test to test ambiq_counter devices

Signed-off-by: Bryan Zhu <bzhu@ambiq.com>
2024-01-08 14:16:13 +01:00
Declan Snyder
8257ff8f6a tests: counter: Update for NXP MRT
Update counter test to test NXP MRT devices

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2023-11-10 10:40:54 +01:00
TOKITA Hiroshi
5119af0422 tests: counter: counter_basic_api: Add support for rpi_pico boards
Add support for rpi_pico board.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2023-09-13 16:18:44 +02:00
Daniel Leung
121b4d2d62 tests: drivers: rename shadow variables
Renames shadow variables found by -Wshadow.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-08-10 08:14:12 +00:00
Pavlo Havrylyuk
f4a1d40924 drivers: counter: Add Infineon CAT1 counter driver
Add initial version of Infineon CAT1 counter driver
Add initial version of binding file for Infineon
Add counters to psco6 dtsi
Add external trigger pin that runs counter

Signed-off-by: Pavlo Havrylyuk <pavlo.havrylyuk@infineon.com>
2023-07-26 09:10:31 +02:00
Jerzy Kasenberg
d58b315165 tests: drivers: counter: basic_api: add overlay for da1469x_dk_pro
Overlay adds 4 timers for testing and selects various frequencies
to select high speed (DIVN) and low-speed (LP-CLK) as sources.
Different  prescalers are applied for different timers to
test wider range of conditions.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2023-07-05 13:00:50 +02:00
Krzysztof Chruscinski
fc4606da02 tests: drivers: counter: nrf_rtc: Add delay in the test
Some Nordic platforms start counter with the delay and
test_short_relative_alarm test expects very early alarm,
just after starting the counter. Adding the delay which
is applicable only for counter based on Nordic RTC peripheral.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-04-03 11:28:59 +02:00
Krzysztof Chruscinski
3b5c059cf4 Revert "tests: drivers: counter: Relax timing requirement"
This reverts commit 51f452bbf0.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-04-03 11:28:59 +02:00
Krzysztof Chruscinski
656b0e6426 drivers: counter: Adapt to use device tree
Modifying counter drivers (rtc and timer) to rely completely on
device tree and not on Kconfig of MDK flags.

Adapting dtsi for all SoCs and adapting test configuration.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-03-20 16:59:40 +01:00
Krzysztof Chruscinski
51f452bbf0 tests: drivers: counter: Relax timing requirement
In short_relative_capable test it is possible that short alarm
setting is repeated few times and it is possible that alarm
does not expire shortely after setting. Increase the delay after
expiration is checked.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2023-03-20 16:49:50 +01:00
Guillaume Gautier
45b0804550 tests: drivers: counter: counter_basic_api: src: Fix STM32 RTC device
Commit fd65800 introduced a regression for the counter_basic_api test for
STM32 by using a Silabs Gecko Kconfig to enable the STM32 RTC.
This commit uses the proper STM32 Kconfig for the RTC instead.

Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
2023-01-09 10:14:06 +01:00
Mateusz Sierszulski
fd658004d7 tests: drivers: counter: counter_basic_api support in counter_gecko_stimer
This commit adds test support for the counter_gecko_stimer
driver.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2022-12-20 22:50:19 +01:00
TOKITA Hiroshi
fb02624eda tests: counter: counter_basic_api: add support for GD32 boards
Add support for boards that implements the GD32 SoCs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-12 10:08:12 +01:00
Manuel Arguelles
0ba7505bc8 tests: counter: support System Timer on s32z270dc2_r52
Enable counter_basic_api test for s32z270dc2_r52 boards, using
System Timer counter instances with different prescaler values.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-11-30 11:29:39 +01:00
Sylvio Alves
7891bed6e7 tests: counter: add esp32 test case
Adds only ESP32 board test case.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-19 18:37:28 +02:00
Hu Zhenyu
0d0f2e94a2 tests: counter_basic_api will return pass even if no counter is found
In test_all_instances(), if ARRAY_SIZE(devices) is 0, the test is not
performed. At this time, the test result should be TC_FAIL, instead of
TC_PASS. A zassert is needed to filter this case.
Fixes: #45647

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-09 16:32:07 -04:00
Enjia Mai
0051a3abaa tests: drivers: move the counter basic test to new ztest API
Migrate the testsuite tests/drivers/counter/counter_basic_api
to the new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-05 10:13:43 +00:00
Gerard Marull-Paretas
e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Kumar Gala
16eb5a026f tests: counter: counter_basic_api: Rework test to use struct device
Move to pass 'struct device *' instead of a 'char *'.  This lets us move
from device_get_binding to DEVICE_DT_GET.

Reworked get_counter_period_us() to not be name based, but instead
we keep a list of devices that need a different period value to check
against.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-20 08:32:04 -05:00
Kumar Gala
d8dca94144 tests: counter_basic_api: refactor period handling
We do the same check for determining the period in a number of the
tests.  Refactor that code into get_counter_period_us().

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-20 08:32:04 -05:00
Mahesh Mahadevan
a8c7f82510 tests: counter: Fix test_multiple_alarms in counter_basic_api
Skip the test_multiple_alarms() test when the settop value is
not supported. This is to avoid the case where wrap around
take a long time thereby causing test failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-23 08:38:59 -05:00
Gerard Marull-Paretas
ade7ccb918 tests: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 20:02:14 +02:00
Jan Peters
88ca4fb533 tests: drivers: counter: add mimxrt QTMR to counter_basic_api test
to test basic functionality of the new mcux_qtmr counter driver.

Signed-off-by: Jan Peters <peters@kt-elektronik.de>
2022-05-03 20:41:23 -05:00
Mahesh Mahadevan
6a66493703 tests: counter: Update test_multiple_alarms test
Set the top value relative to the current time. This is
so that we avoid the case of setting the top value that
is prior to the current value.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-04-28 10:26:54 +02:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Krzysztof Chruscinski
47ae656cc1 all: Deprecate UTIL_LISTIFY and replace with LISTIFY
UTIL_LISTIFY is deprecated. Replacing it with LISTIFY.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-03-08 11:03:30 +01:00
Kent Hall
ce95e033fb tests: drivers: counter: Update tests for STM32F4 timer counter driver
Updates counter driver test suite to support STM32F4 timers.

Signed-off-by: Kent Hall <kjh2166@columbia.edu>
2021-12-11 14:20:17 -05:00
Toby Firth
893bfc0fc1 drivers: counter: added ctimer driver for lpcexpresso55s69
Added shim driver for the CTIMERs for the lpcexpresso55s69 board.

Fixes: #22705

Signed-off-by: Toby Firth <tobyjfirth@gmail.com>
2021-08-24 17:13:22 -04:00
Krzysztof Chruscinski
f923779e4d tests: drivers: counter: Extend basic api test with ZLI support
Modified test to handle case when counter handlers are called in
ZLI interrupt context where kernel primitives cannot be used. In
that case volatile counters are used to track number of handlers
calls.

Added configuration for nrf52840dk board where zli feature is enabled
for all counters.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-08-05 16:17:23 +02:00
Mahesh Mahadevan
6ca1ffa6fe tests: Update counter test for LPC RTC counter
Update the counter test for LPC RTC counter

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-07-16 18:56:15 -04:00
Henrik Brix Andersen
6ad1f411c3 tests: drivers: counter: basic_api: add support for Xilinx AXI Timer IP
Add support for testing the Xilinx AXI Timer IP.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-11-17 19:30:20 -05:00