Commit graph

63 commits

Author SHA1 Message Date
Lukasz Majewski
f3a246c8cb test: pwm: Remove range check when PWM signal has inverted polarity
There shall be no special case for inverted PWM pulse when checking
if the captured value is correct.

The output signal inversion is done in HW (at least for stm32h7xx)
SoC. The measured value of the pulse shall be the same - no matter
if we invert the signal or not (as measuring also takes into account
the inversion of the output/input signal).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-12-09 11:07:45 -06:00
Lukasz Majewski
a3ead3c565 test: pwm: Pass information regarding polarity to PWM setup functions
Without this change the information about PWM polarity is lost when
flags are passed, as the out.flags is set according to PWM description
in the DTS.

For example in: pwms = <&pwm2 2 0 PWM_POLARITY_NORMAL>  the out.flags
is always set to PWM_POLARITY_NORMAL.

However, some tests - like 'test_pulse_capture_inverted' require testing
if PWM driver is able to invert the generated signal.

After this change, the generated waveform (from the TIMx pin) is
inverted.

Tested on: Nucleo 'nucleo_h743zi' board (TIM2 ch2 -> out, TIM5 ch1 <- in)

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-12-09 11:07:45 -06:00
Lukasz Majewski
22ad6af5e6 test: pwm: Add nucleo_h743zi (stm32h7xx) board to loopback test
This commit allows testing the PWM (timers) on the
nucleo_h743zi development board.

The HW setup for testing:
Timer2 (channel 2) as PWM signal generator -> CN11 connector
(PIN 30)

Timer5 (channel1) in Capture mode to measure the pulse
duration -> CN11 connector (PIN28)

Such setup allows easy HW loopback connection (just short cut two
consecutive pins/soldering vias on the devel board's PCB).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-12-09 11:07:45 -06:00
Erwan Gouriou
1d14517ede boards: arm: stm32: add pinctrl state name for PWM peripheral
Add the pinctrl state name (default) for the PWM peripherals.
Changes performed based on the script proposed in
"boards: arm: stm32: add pinctrl state name for UART peripheral"

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Tilmann Unte
a9ba637ac9 tests: drivers: pwm: stm32 board for loopback test
Add overlay file for disco_l475_iot1 board to pwm_loopback test.

The file is based on the existing overlays for twr_ke18f and frdm_k64f.

The new configuration uses both a 16-Bit timer with active prescaler
as well as a 32-Bit timer with deactivated prescaler for coverage.

It is assumed that other STM32 boards will behave like the
disco_l475_iot1. Only this board was available for testing.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-22 22:24:45 -05:00
Tilmann Unte
471622a9c2 test: drivers: pwm: extends pwm_loopback test
Adds a new zassert to check whether PWM capture has previously been
enabled and correctly returns -EBUSY on a second call.
While working on #39694 this was found to be a missing test case.
The new test case has been verified against the suggested changes of
that PR.

Signed-off-by: Tilmann Unte <unte@es-augsburg.de>
2021-11-04 07:20:10 -04:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Martí Bolívar
682aea8b3b dts: don't use 'test' vendor prefix
This is now failing an edtlib check for unknown vendor prefixes.

I can't find a reason to use a vendor prefix in application-local
bindings like this, so just remove it wherever it appears by
normalizing to test-foo-compat instead of test,foo_compat or
test,foo-compat.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 08:05:04 -05:00
Henrik Brix Andersen
d6318075b7 boards: arm: twr_ke18f: Add pinctrl dts properties
Add pinctrl-0 properties for configuration of UART, I2C, SPI, FTM,
DAC, ADC, ACMP, and PWT peripherals. These settings are based on what
is defined in the board/pinmux.c file.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-04-27 08:43:23 -05:00
Guðni Már Gilbert
c746a5419b tests: drivers: pwm: fix order of parameters
Fix #32918 [Coverity CID :219528] "Arguments in wrong order
in tests/drivers/pwm/pwm_loopback/src/main.c"

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-06 09:09:08 -06:00
Kumar Gala
a4b78f5755 tests: pwm_loopback: Convert to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the pwm controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-24 13:45:46 -06:00
Henrik Brix Andersen
3860551196 tests: drivers: pwm: loopback: add support for twr_ke18f board
Add support for testing the NXP Kinetis Pulse Width Timer (PWT) on the
NXP TWR-KE18F development board using PWM loopback.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen
90825a8812 tests: drivers: pwm: add PWM loopback test
Add test cases for the PWM capture API using PWM signal loopback.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 19:43:06 +01:00