Commit graph

794 commits

Author SHA1 Message Date
Josep Puigdemont 7cafe7e74b boards: arm: olimex stm32-h103: Add board
The Olimex STM32-h103 is a development board based on the STM32F103RB,
very similar to the stm32_mini, which was used as a reference for the
pinmux configuration.

Signed-off-by: Josep Puigdemont <josep.puigdemont@gmail.com>
2020-07-24 14:48:07 +02:00
Simon Glass ee34aced6a sensor: max17055: Add MAX17055 driver
Add support for the Maxim MAX17055 fueld-gauge sensor.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-23 12:12:09 -04:00
Hake Huang 30ce64d543 test: dma: avoid useing flash as dma source address
avoid to use the flash address as dma source,
to avoid flash cache issue
this is fix to issue #26812

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-07-20 18:01:04 -05:00
Krzysztof Chruscinski c0169f985f tests: drivers: clock_control: nrf: Add suite for bluetooth API
Nordic platforms exposes API for controlling HF clock along
onoff API. This API is dedicated to be used by the bluetooth
controller and must not be used elsewhere.

Test suite is validating stability of HF clock control using
onoff API and specialized API.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Krzysztof Chruscinski cd9bb3221c tests: drivers: clock_control: Add suite for onoff with clock
Added suite to test clock control with onoff.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Krzysztof Chruscinski 6f01c0bc79 drivers: clock_control: nrf: Add onoff service support
Updated nrf clock control driver to use onoff service for managing
multiple users.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-20 16:22:21 +02:00
Mateusz Syc 47bb6a3fdf tests: drivers: flash: added flash tests
Test include non-aligned read in nrf_qspi_nor flash and
SoC flash memory to buffer with variable size.
It checks all possible variants of alignment and size.

Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
2020-07-20 12:46:38 +02:00
Saravanan Sekar 9ac3c9d42a drivers: sensors: itds: Add support for WSEN-ITDS 3-axis accel sensor
Add support for wsen-itds 3-axis accel sensor, provides acceleration,
temperature data reading and supports configuring of output data rate,
operating mode and scale.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Brian Bradley 8ec1cbc95d boards: arm: stm32: Add WeAct Black Pill V2.0 definitions
Includes support for spi, usb, i2c, uart, pwm, adc, dfu,
and onboard led and switch.

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-07-17 16:54:22 +02:00
Karsten Koenig 4ef29b34e3 tests: drivers: spi: spi_loopback: remove workaround
Due to issue #20589 DEBUG_OPTIMIZATIONS were enabled for the rv32m1 vega
ri5cy vega config. This is now resolved after making sure the spi tx
buffer is always initialized and the rv32m1 ri5cy core stack properly
initialized, so this workaround can be removed.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-07-13 15:00:19 -05:00
Maureen Helm 6dc38b570c tests: pwm_api: Use smaller pwm period cycles on kw41z-based boards
The mcux pwm drivers use period cycles as a divisor to calculate the pwm
frequency in hertz. This operation can underflow easily with large
values of period cycles relative to the pwm clock source, causing the
driver to return an error code and the pwm_api test to fail.

Updates the test to use the smaller set of period and pulse cycles on
kw41z-based boards, fixing the test for the frdm_kw41z board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-13 13:11:37 +02:00
Armando Visconti 485f2d410c drivers/sensors: Add iis2dh accelerometer sensor support
Add support to STM IIS2DH the ultra-low-power highperformance
three-axis linear accelerometer.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-07-10 11:49:40 -05:00
Peter Bigot ca76a5be7c tests: drivers: spi_loopback: set CS GPIO flags
Hard-code the active level as there's no reason to make this
configurable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Simon Glass b15bec5a2a drivers: flash: flash_simulator: Erase flash first
With native_posix, a flash.bin file is created when running the tests.
If the tests are re-run, they fail since the flash is no-longer erased.

Before running the tests, erase the flash so that the 'read' test can
work regardless of the previous state.

Fixes: 25171
Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-07 17:19:26 -04:00
Simon Glass fecdb93c49 drivers: flash: flash_simulator: Fix 'succedd' typo
Fix the 'succedd' typo which is in lots of places in this file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-07 17:19:26 -04:00
Henrik Brix Andersen ce426f69f0 tests: drivers: dac: loopback: use internal loopback on the twr_ke18f
Enable internal DAC to ADC loopback on the NXP TWR-KE18F
board.

Increase the ADC sample time to 5 microseconds since there is no
buffer between the DAC and ADC.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-07-03 08:05:25 -04:00
Stefano Manni 92f142c535 tests: adc: configure adc_api test for waveshare_open103z
Configures the adc api test to use the board waveshare_open103z.

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
2020-07-02 08:35:48 -04:00
Dominik Ermel 03df4d3fb0 tests/drivers/flash_simulator: Add tests for non-0xff erase
Modify and add tests to support simulation of non-0xff erased flash
devices.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-02 08:24:19 -04:00
Andrzej Głąbek 4f1156d186 boards: nrf9160dk_nrf9160: Add "spi" as supported feature
Plus corresponding configuration file for the spi_loopback test that
will be activated for that board by this added capability.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Marcin Niestroj f08ef736a0 drivers: lora: sx1276: select PA output by dts property
PA selection mainly depends on board design. So it looks like
device-tree is a better mechanism than Kconfig in this case. Use string
property with two possible values: "rfo" and "pa-boost".

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-23 13:08:06 +02:00
Dominik Ermel 6ea6321586 drivers/flash: Add support for flash_get_parameters to drivers
With addition of flash_get_parameters API call, it is needed to provide
support for the API to flash drivers.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-06-22 14:35:03 +02:00
Henrik Brix Andersen 0997265111 tests: drivers: sensor: add test case for getting a sensor attribute
Add test case for getting the value of a sensor attribute.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-06-17 17:13:14 +02:00
the BASTION 3f5a32a7d4 boards: arm: add ruuvi_ruuvitag
Adds ARM based Ruuvtag baord. This board is based on the nRF52832.

Signed-off-by: the BASTION <thebasti0ncode@gmail.com>
2020-06-17 12:29:41 +02:00
Piotr Mienkowski 4b194eb4fc gpio: remove deprecated API functions/macros
This commit removes API functions and macros which were deprecated in
2.2 release. GPIO drivers are updated accordingly.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-06-16 19:13:05 +02:00
Krzysztof Chruscinski 34baec32ce tests: drivers: uart: Update uart_async read_abort test
Updated test to reflect API change.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-16 19:11:57 +02:00
Hake Huang abce94bb98 dma: add EDMA test support for MCUX
for RT series CONFIG_NOCACHE_MEMORY need enabled
for Kinetis series CONFIG_DMA_TEST_SLOT_START for test
modify the target and dest alignment

frdmk64f need replace strlen to sizeof in irq callback
clean the unused receive buffer, so output is tidy

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2020-06-12 13:03:28 -05:00
Ilya Tagunov 3dc6ee048d boards: nucleo_l073rz/l152re: use node labels in DAC samples and tests
Use node labels instead of aliases to select ADC and DAC instance
in samples and tests.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Ilya Tagunov 02d673c564 tests: drivers: dac: Add Nucleo-L152RE board
Enable DAC tests for Nucleo-L152RE board.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Krzysztof Chruscinski 77bc550746 tests: drivers: clock_control: nrf: increased LFCLK startup time
Fixed occasional test failures when clock was not ready after
specified time.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:57:04 +02:00
Reto Schneider 0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
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 multiple projects
"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, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
YouhuaX Zhu 0b2fa63191 Tests: create new test cases to verify sensor APIs.
1. Create a dummy sensor driver and implement the sensor interfaces:
    .sample_fetch = &dummy_sensor_sample_fetch,
    .channel_get = &dummy_sensor_channel_get,
    .attr_set = dummy_sensor_attr_set,
    .trigger_set = dummy_sensor_trigger_set.

2. Create below two test cases to verify the sensor subsys APIs:
    test_sensor_get_channels() for verifying sensor channel APIs,
    test_sensor_handle_triggers for verifying sensor trigger APIs.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2020-06-09 08:14:17 -04:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Krzysztof Chruscinski c61dfdc680 tests: drivers: clock_control: nrf: Disable calibration in LFRC test
When test is performed, it assumes that no other entity is changing
the state of the clock. That was not true because calibration was
turning on/off high frequency clock.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-04 11:20:01 +02:00
Peter Bigot 394ff7a28b tests: drivers: gpio_basic_api: silence Coverity warning
The tests normally verify that pin configuration succeeded by checking
the return value.  That's not necessary on the cleanup path, so
expressly ignore the result.

Also lift the common code to before the exit branching.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-01 21:59:17 +02:00
Marc Herbert debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Anas Nashif 0c908e124e tests: gpio_basic: this test requires a fixture
This test requires a fixture to be installed, in this case a wire
connecting two GPIO pins.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-24 20:25:51 +02:00
Anas Nashif 8067663671 tests: maxim_ds3231_api: use fixture
This test depends on additional hardware being connected to the board,
add a fixture and cleanup whitelist.

Fixes #25177

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-24 20:25:51 +02:00
Maureen Helm 164434a01e tests: adc: Configure adc_api test for frdm_k82f board
Configures the adc api test to use the arduino header A2 pin on the
frdm_k82f board. This follows frdm_k64f and frdm_kw41z boards, which
also use the arduino header A2 pin for the test.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-21 11:01:18 +02:00
Jennifer Williams d2c74eb987 drivers: serial: uart: ns16550 add missing isr locking
The existing uart driver ns16550 did not have ISR locking that
effected IO APIC working in fixed delivery mode in SMP system
x86_64. This commit adds ISR locking mechanism using spinlock
for the interrupt related services.

The CONFIG_IPM_CONSOLE_STACK_SIZE is increased to lift
limitation of stack size experienced in IPM driver test with
this spinlock impelentation.

Fixes #23026

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-05-18 19:35:37 -04:00
Alexandre Bourdiol b2a7397a17 tests: drivers: counter: counter_basic_api: allow equality in assert
Since introduction of #24374 this test fails on STM32 boards.
Due to 1Hz frequency of RTC used, the 'diff' could be 0.
But then 'counter_us_to_ticks(dev, processing_limit_us)' is also 0.
We should allow the equality in the assert.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-18 19:13:04 +02:00
Alexandre Bourdiol 2f8167fc08 test: drivers: gpio: gpio_basic_api: disable interrupt at end of test
When switching from rising edge to falling edge of test:
test_gpio_deprecated(),
because exti callback is already configured (from rising edge test),
the pin configuration abort for EBUSY reason.
It is necessary to disable interrupt,
so that next test will start with clean configuration.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-18 19:12:46 +02:00
Daniel Leung 01445ef873 tests: gpio_basic_api: change GPIOs for mec15xxevb_assy6853
GPIO 050/051 are being used for tachometer sensor as
CONFIG_TACH_XEC is enabled by default. So for the gpio_basic_api
test, another set of GPIOs are needed. GPIO 156/157 are chosen
as they are (more or less) dedicated for two LEDs on board and
not being used for other functions (pinmux-wise).

Fixes #25272

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-15 17:18:41 +02:00
Christoph Reiter d49e7da7da sensor: add sensor driver for Infineon DPS310
Add driver for Infineon DPS310 temperature and pressure sensor.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-14 11:02:29 +02:00
Martí Bolívar 6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Henrik Brix Andersen 6f5af9efa5 tests: i2s: api: fix compilation with new timeout api
Fix compilation of the I2S API tests with the new timeout API.

Remove the defines for sleep periods and embed them directly into the
code to improve consistency.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-11 21:34:18 +02:00
Stephanos Ioannidis 4b37e6cd36 tests: drivers: console: Skip semihosting console device testing
The semihosting console test (`drivers.console.semihost`) is currently
only supported on the ARM Cortex-M QEMU targets.

While running this test on real hardware targets is possible, there is
no standardised way for sanitycheck to validate its output, so we
filter by `CONFIG_QEMU_TARGET` to skip running it on non-QEMU targets
(including physical hardware targets with `--device-testing`).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-11 17:11:35 +02:00
Jan Van Winkel 57671d9716 tests: flash_simulator: Add native posix support
Added support for native posix boards to flash_simulator tests by
making sure that flash layout lines up with layout expected by
tests.

Resolves #25109

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-05-08 22:37:21 -04:00
Martí Bolívar 7e0eed9235 devicetree: allow access to all nodes
Usually, we want to operate only on "available" device
nodes ("available" means "status is okay and a matching binding is
found"), but that's not true in all cases.

Sometimes we want to operate on special nodes without matching
bindings, such as those describing memory.

To handle the distinction, change various additional devicetree APIs
making it clear that they operate only on available device nodes,
adjusting gen_defines and devicetree.h implementation details
accordingly:

- emit macros for all existing nodes in gen_defines.py, regardless
  of status or matching binding
- rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY
- rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY
- rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY
- rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY
- rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS
- resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS
- remove DT_COMPAT_ON_BUS as a public API
- use the new default_prop_types edtlib parameter

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Tomasz Bursztyka 97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
Ioannis Konstantelias 3f0797488c boards: arm: stm32_min_dev: Add ADC_1
Added ADC_1 support.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2020-05-08 15:56:33 -05:00