RTC drivers should validate the `struct rtc_time`'s contents against the
provided `mask`. Promote this common code to a new rtc_utils file and
modify existing drivers to use this functionality. Extend the test
coverage to include verifying this behaviour.
This is groundwork ahead of adding support for the RP2040's (as used in
the Raspberry Pi Pico) RTC and alarm.
Signed-off-by: Andrew Featherstone <andrew.featherstone@gmail.com>
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Some RTCs don't support the tm_yday and/or tm_wday fields
of the struct rtc_time structure. These RTCs must set the
values of the fields to -1 if they are not supported, and
the test must be able to handle this correctly. This commit
adds an exception to the tm_yday and tm_wday fields allowing
them to be set to -1.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit adds overlay and conf for the qemu_x86_64 board
to the RTC API test suite, and adds support for the RTC
subsystem to the qemu_x86_64's yaml file.
The commit also specifies integration platforms for the
RTC API test suite, since the qemu_x86_64 board runs in
real-time, causing it to time out if the test suite runs
for it.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
The update callback test had a bug which prevented it from
running on 64-bit architectures. This patch makes the test
agnostic to 64-bit and 32-bit architectures.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit updates the qemu_x86 board's yaml file to
indicate its support for the RTC subsystem. Board overlay
and conf for the qemu_x86 has been added to the RTC test
suite to enable the MC146818 and its dependencies.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
Without this, test is run on any target, even if no RTC driver is
supported, leading to unexpected issues.
Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
STM32 RTC driver for the new RTC API.
Can't coexist with old COUNTER based RTC
Though supported by HW, RTC_ALARM still to be supported by driver
Signed-off-by: Kim Bøndergaard <kim.bondergaard@prevas.dk>
Several duplicates were found with
scripts/twister -T samples/ -T tests/ --dry-run --list-test-duplicates
This is an issue since duplicated names causes overwriting of
results. Most duplicates looked like obvious copy-pase errors.
New names where addopted looking at other tests in the same yaml
or looking at the directory/descriptio.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Twister now supports using YAML lists for all fields that were written
as space-separated lists. Used twister_to_list.py script. Some artifacts
on string length are due to how ruamel dumps content.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The test suite was limited to the native_posix board,
now it is built and run for any board supported by CI.
The native_posix yaml files for both 32 and 64 bit
boards have been expanded to support rtc, allowing CI
to build and test the rtc_api test suite against the
native_posix and native_posix_64 boards.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
This test suite validates the RTC API helper
functions, like currently, and exclusively, the
rtc_time_to_tm() helper function.
It also validates that the struct rtc_time is
member to member compatible with the struct tm
from the tm_sec to and including the tm_isdts
member.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
The emulated RTC device driver is used to emulate a real
RTC device. Note that it is not a replacement for the
native_rtc module, which is used to control simulated time,
get time from the host system, etc.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
This test suite adds tests for the following:
- Setting and getting time
- Validating time is incrementing correctly
- Validating behavior of alarms with callback disabled
- Validating behavior of alarms with callback enabled
- Validating update callback
The test suite uses the devicetree alias rtc to find
the device to test.
Signed-off-by: Bjarki Arge Andreasen <baa@trackunit.com>
move rtc.h to drivers/rtc.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.
Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.
To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.
This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.
The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This patch adjusts some of the timeouts for the RTC sample test. The
NXP RTC varies a little bit from the QMSI due to the way the timer
count and alarm count work. The NXP will trigger an alarm when the
timer count and alarm count are the same, but only when it increments
to the next value.
If you set the alarm to be 1 second past the current time, it may take
up to 2 seconds. Setting the alarm equal to the current time will
result in an alarm occurring in less than 1 elapsed second.
Signed-off-by: Andy Gross <agross@kernel.org>
This patch adds a prescaler configuration option that denotes the
number of RTC ticks per second. This is used to calculate the value
for 1 second.
Signed-off-by: Andy Gross <agross@kernel.org>
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.
Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.
This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.
For users that just want to continue their work with minimal
disruption the following should suffice:
Install CMake 3.8.2+
Port any out-of-tree Makefiles to CMake.
Learn the absolute minimum about the new command line interface:
$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..
$ cd build
$ make
PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
When the header file is located in the same directory as the source
file it is better to use a relative quote-include, e.g.
than a system include like
Avoiding the use of system includes in these cases is beneficial
because;
* The source code will be easier to build because there will be fewer
system include paths.
* It is easier for a user to determine where a quote-include header
file is located than where a system include is located.
* You are less likely to encounter aliasing issues if the list of
system include paths is minimized.
Authors:
Anas Nashif
Sebastian Bøe
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.
Jira: ZEP-2051
Change-Id: I6c676bc6c5e850a8725785554cd535e32067f33e
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
ztest has a number of assert style macros and used a baseline assert()
that varies from the system definition of assert() so lets rename
everything as zassert to be clear.
Change-Id: I7f176b3bae94d1045054d665be8b5bda947e5bb0
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.
Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.
Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file. Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.
Jira: ZEP-1457
Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>