This PR introduces a backend API to be implemented by sensor emulators
that creates a standardized mechanism for setting expected sensor
readings in tests. This unlocks the ability to create a generic sensor
test that can automatically set expected values in supported sensor
emulators and verify them through the existing sensor API. An
implementation of this API is provided for the AKM09918C magnetometer.
A generic sensor test is also created to exercise this implementation.
Observe that this test knows nothing about the AKM09918C; info about
supported channels and sample ranges is discovered through the backend
API. The test iterates over all devices attached to the virtual I2C and
SPI buses in the test binary's device tree, which (theoretically) covers
all sensors. Sensors whose emulator does not exist yet or does not
support the backend API are skipped.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
The sensor driver uses the value 500 to convert bit counts to microgauss
values, but it should actually be 1500. Edit the driver unit test to use
the macro instead of a magic number.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Nordic Semiconductor has been testing the feature extensively on its CI.
The tests includes the sample data and the PTS tests.
Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
DMA only works with non-cached memory regions in H7. Check them
and return an error if they don't match this condition.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Enable all channels that available connector on board.
ADC0 channel 6 on precision group with normal end chain
callback.
ADC1 channel 2 on precision group with normal end of
conversion callback.
ADC2 channels 3, 4, 5 on precision group with normal end
of conversion callback.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
Enable adc0 with 2 channels 22, 23 on standard group with
normal end of conversion callback. Channels correspond to
VREFL(0V), VREFH(3.3V).
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
Add support ADC SAR for NXP S32. ADC SAR diver
support 3 group channels (precision, standard
and external), run normal trigger in oneshot
conversion mode with 2 callbacks normal end
of conversion and normal end chain callbacks.
An instance only run on 1 group channel and
1 kind of callback at the same time.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
We have been dealing with missing and multiple binaries the same way and
both would result in a build error, which is not accurate. multiple
binaries in the build directory are fine, we just need to pick the right
one for parsing.
If we get no binaries, raise an exception and report failure, however,
if we have multiple binaries, filter intermediate artifacts out and
parse what remains.
qemu binaries generated after a run are also being filtered here. Those
are not build artificats and appear only after running in qemu. However
they have been causing issues on retries.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add an option to control whether or not hpsram banks should
be switched off during the power down. This is particular useful
when running tests because we don't want to lose the contents
of the memory window before we capture it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
...and removed the copied macros. This allows xt-clang to
inherit macros from llvm.h to align with any LLVM related
additions.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The device tree file for up_squared includes the base dts file
for Apollo Lake which only defines 1 CPU. UP Squared have
different SKUs with different CPUs, and overall has a minimal
of 2 CPUs. So amend the up_squared device tree overlay to have
2 CPU nodes.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
When no/too many elf files are detected after a build a BuildError
exception is raised. However, it was not being counted as an issue
with a test. With the patch satuses of tests' with such exception
are reported as errors. Whithout it, twister finished without
reported errors and was getting green CI checks.
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Currently, mr_canhubk3 is enabling GPIO by default.
GPIO will be built even if it is not necessary.
Update to enable it for supporting CAN transceiver
when CAN is enabled.
Signed-off-by: Cong Nguyen Huu <cong.nguyenhuu@nxp.com>
1. change explicit type cast of essential character type, complying with
required [misra-c2012-10.2] rule which states; Expressions of
essentially character type shall not be used inappropriately in addition
and subtraction operations, and
2. add explicit boolean type to 'if' statement controlling expression,
consolidating it with 'buflen' type, thus improving code readability and
maintainability , complying with required [misra-c2012-14.4] rule which
states; ; The controlling expression of an if statement and the
controlling expression of an iteration-statement shall have essentially
boolean type, and
3. add enclosing parentheses enforcing and clarifying precedence of
operators, improving code readability and maintainability, complying
with *advisory* [misra-c2012-12.1] rule which states; The precedence of
operators within expressions should be made explicit.
Found as a coding guideline violation (Rules 10.2, 14.4), and coding
guideline recommendation (Rule 12.1) by static code scanning tool.
Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).
Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
change explicit type cast of essential character type, complying with
required [misra-c2012-10.2] rule which states; Expressions of
essentially character type shall not be used inappropriately in addition
and subtraction operations.
Found as a coding guideline violation (Rule 10.2) by static code
scanning tool.
Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).
Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
add explicit unsigned suffices to various immediate numbers, matching
them to size_t, complying with required [misra-c2012-10.4] rule which
states; Both operands of an operator in which the usual arithmetic
conversions are performed shall have the same essential type category.
Found as a coding guideline violation (Rule 10.4) by static code
scanning tool.
Note: Tested on STM32L5 Nucleo-144 board (stm32l552xx).
Signed-off-by: ferar alashkar <ferar.alashkar@gmail.com>
The tests now properly validate frames under all padding configurations.
Part of test_sender_fc_errors was testing a receive FC error, this sub-test
is moved to test_receiver_fc_errors
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
It would be strange to enforce padding for other bus participants but not
use it yourself. This default suggests the likely proper usage, although
it is not a hard dependency
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
ISOTP_ENABLE_TX_PADDING makes the device transmit frames with TX padding.
ISOTP_REQUIRE_RX_PADDING ensures other devices on the bus use TX padding,
by rejecting non-padded RX frames
Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
Enable SPI SDHC driver to manage card power via pwr-gpios property.
Control for this property was previously partially implemented. When
this property is present, the SPI SDHC driver will use it to control
power to the SD card.
Power is toggled during SD init, so this power control can make SD init
more reliable as the power toggle will insure the SD card state is reset.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The IEEE 802.15.4 API and networking subsystem were using several
inconsistent timestamp resolutions and types. This change defines all
timestamps with nanosecond resolution and reduces the number of
available types to represent timestamps to two:
* `struct net_ptp_time` for PTP timestamps
* `net_time_t` for all other high resolution timestamps
All timestamps (including PTP timestamps) are now referred to a
"virtual" local network subsystem clock source based on the well-defined
types above. It is the responsibility of network subsystem L2/driver
implementations (notably Ethernet and IEEE 802.15.4 L2 stacks) to ensure
consistency of all timestamps and radio timer values exposed by the
driver API to such a network subsystem uptime reference clock
independent of internal implementation details.
The "virtual" network clock source may be implemented based on arbitrary
hardware peripherals (e.g. a coarse low power RTC counter during sleep
time plus a high resolution/high precision radio timer while receiving
or sending). Such implementation details must be hidden from API
clients, as if the driver used a single high resolution clock source
instead.
For IEEE 802.15.4, whenever timestamps refer to packet send or receive
times, they are measured when the end of the IEEE 802.15.4 SFD (message
timestamp point) is present at the local antenna (reference plane).
Due to its limited range of ~290 years, net_time_t timestamps (and
therefore net_pkt timestamps and times) must not be used to represent
absolute points in time referred to an external epoch independent of
system uptime (e.g. UTC, TAI, PTP, NTP, ...).
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces coverage for OpenThread CSL platform API as far as channel
samples are concerned.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Adapts a return type to the API specification. The changed return type
is not referenced anywhere so it can be changed without breaking
backwards compatibility.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Improves documentation of PTP structs and explains basic underlying
concepts to increase the probability that these structs will be used
correctly and consistently.
Also introduces references to the underlying specifications.
Note: We currently (ab)use the PTP structs for timestamps in the IEEE
802.15.4 context for which they are undefined. It is also not ideal that
the generic `struct net_pkt` depends directly on PTP. Future changes
will therefore have to remove the reference to PTP structs in net_pkt
and replace them by net_time_t. Clients will then have to convert these
to PTP structures if required.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Introduces a well-defined intermediate concept of syntonized scalar
nanosecond resolution time with overflow protection above low-level
counters/cycles/ticks and below higher level time abstractions
(timescales, calenders, etc.).
The rationale of this type has been extensively documented and
contrasted to already existing time representations to ensure that it
fills a well defined gap without overlap.
This change prepares for later changes in this change set that will
unify the usage of time across the network subsystem (RX/TX timestamps,
timed TX, CSL, scheduled reception windows, (g)PTP integration, etc.).
The type is EXPERIMENTAL and named net_time_t while it is not used in a
larger clock subsystems, the details of which are still being discussed
(see #60400 for details).
See
https://github.com/zephyrproject-rtos/zephyr/issues/19030#issuecomment-1597226731
for its embedding in a larger clock subsystem architecture relevant to
the network stack, IEEE 802.15.4 and the POSIX roadmap.
Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
Add rk055hdmipi4ma0 shield, which uses an HX8394 TFT LCD controller and
GT911 touch IC. This shield is enabled on the RT595 and RT1170 EVK,
which have 40 pin FFC interfaces capable of connecting to the display.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Add driver for HX8394 TFT LCD controller. This controller is driven via
MIPI DSI, and is configured for a 720x1280 display
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Most implementations have the same logic, with only a different write
block size. Now that we are using write-block-size from the device tree,
it is possible to use a default implementation that can be overridden if
necessary.
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
STM32L5 have a write block size of 8, but STM32U5 and STM32H5 have a
write block size of 16. Convert write_dword() and
flash_stm32_write_range() to write write-block-size data at a time.
Fixes#60724
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
STM32L5 have a write block size of 8, but STM32U5 and STM32H5 have a
write block size of 16. Use write-block-size from the device tree
instead of hardcoding this value when validating the range of write
operations.
Fixes#60724
Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
Nucleo-144 boards have up to 72 pins (there are boards with only 70) on
each ST Morpho header. Extend pin identifiers to support that number.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
So far pin identifiers were named after CN7 and CN10 connector names on
Nucleo-64 boards. In case of Nucleo-144 there are ST Morpho connectors on
both sides, but bigger (up to 72 instead of 38 pins on each side). First 38
pins out of 72 on each side usually map to the same pins (e.g. PA5 being
13th pin on right ST Morpho connector). This means that single ST Morpho
connector definition will suffice.
Leaving CN7 and CN10 (name of pin headers on Nucleo-64 boards) is confusing
in context of Nucleo-144 boards, since corresponding pin headers are named
CN11 and CN12.
Rename:
* s/ST_MORPHO_CN7_/ST_MORPHO_L_/
* s/ST_MORPHO_CN10_/ST_MORPHO_R_/
so that pin identifiers make more sense in context of Nucleo-144 boards.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
The 'west flash' command allows specifying the port where the target is
attached via the '--serial' option, allowing users to set the USB serial
port for flashing. However, the 'stm32f746g_disco' script file currently
ignores the _ZEPHYR_BOARD_SERIAL variable set by this option, preventing
effective port specification.
This commit fixes it by correctly setting the openocd adapter serial
when _ZEPHYR_BOARD_SERIAL variable is set, enabling proper USB serial
port specification during flashing.
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Previously, the binary protocol variant of ThriftTest would fail
consistently in CI for `qemu_x86_64` with the message below.
```
E: failed to poll fds -1, -1: 1
```
Note: 1 corresponds to EPERM
The root cause of this is that we do not yet have support for
standard synchronization primitives in C++, and there is
slightly racey behaviour in thrift until we do have support
for standard synchronization primitives.
With the addition of dynamic thread stacks, conforming pthreads,
and some additional work in the toolchain area
(re gthr-posix.h), we should soon be able to enable proper
synchronization primitives.
This change is a temporary workaround but solves the
test failure (which would occur even when tests all passed).
Signed-off-by: Christopher Friedt <cfriedt@meta.com>