Commit graph

4754 commits

Author SHA1 Message Date
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
Peter Bigot 726bff2353 tests: kernel: device: bypass device pm tests
The dummy driver never implemented device power management, so the
fact the not-implemented stub returned success was a false negative.
Verify the expected behavior now, leaving the test code in place for
when somebody provides a non-trivial PM control function.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-21 20:32:12 +02:00
Krzysztof Chruscinski a719b8c5e4 drivers: timer: nrf: Remove RTC1 dependency
Removed RTC1 dependencies in the code. Single define picks the instance.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-21 17:43:08 +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
Wayne Ren e0470d0f93 tests: add a workaround for arc emsdp
arc emsdp's console will use irq 108/107 which will
conflict with irqs used in tests (emsdp has 112 irqs),
so add a workaround for emsdp.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-05-21 10:59:36 +02:00
Daniel Leung 625b5f5a49 tests: timing_info: need to calibrate TSC frequency on x86
For x86, TSC is being used to gather timing information. However,
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC is not the same as TSC
frequency when HPET (or other) timer is used. So use the system
clock to calibrate the TSC frequency so we can use it to
calculate timing information.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-20 22:34:39 +02:00
Christopher Friedt ecf32b6eca tests: socket: socketpair: fix userspace thread permissions
Kernel objects were being directly accessed without previously
calling k_thread_access_grant().

This change allows each test that requires an asynchronous
event to send it to a common work queue with correct
permissions.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-20 10:34:07 +02:00
Alexandre Bourdiol 10d8fd4b47 test: lib: heap: increase timeout
On some STM32 boards : nucleo_wb55rg, nucleo_l152re
the test lasts longer than defaut 60sec timeout.
Increase timeout to 120 sec.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-20 10:32:36 +02:00
Daniel Leung ec9a413983 boards: x86: make up_squared default to x86_64
This makes the up_squared board default to x86_64.
This also adds a new board, up_squared_32, for when 32-bit
is desired.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-19 19:19:51 +02:00
Andy Ross 1af8a04fa9 tests/kernel/common: Make test_timeout_order 1cpu
This test works by starting a bunch of poll events, dropping the test
thread priority, calling k_poll(), and assuming that all the timeouts
that fired woke up high priority threads and thus ran before k_poll()
could return.  But that isn't true if you have another CPU that can
run the low priority thread while the last high priority thread
finishes up!

This just isn't SMP-correct.  Mark 1cpu.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-19 19:19:51 +02:00
Peter Bigot 4ec5ab2059 tests: cmsis_rtos_v2: adjust timer period to avoid starvation
Most boards run with 10 kHz ticks producing a period of 5 ms for 50
tick interval used in the timer periodic test.  On Nordic 50 ticks
corresponds to 1.5 ms which is too short to complete the TC_PRINT()
call within the handler, causing the periodic timer to starve the
osDelay that would turn off the timer.

Adjust the period to be at least 5 ms or 50 ticks to avoid this
problem while not breaking other platform with slower tick rates.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-19 17:18:43 +02:00
Carles Cufi c80a75d7d1 Revert "test: kernel: context: Exclude for qemu_cortex_r5 (temporary)"
This reverts commit f87bce135a.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-19 17:14:18 +02:00
Alexandre Bourdiol 9368211265 test/benchmarks/latency_measure: adapt test to 24bit Systick for STM32
Cortex-M has 24bit systick.
But this test by default set 1 TICK per seconds, which  is
achievable only if frequency is below 0x00FFFFFF (around 16MHz).
20 Ticks per secondes allows a frequency up to 335544300Hz (335MHz)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-19 17:14:01 +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
Vincent Wan 0b12a7b463 tests: timer_api: fix assertion in test_timer_remaining()
This commit fixes the assertion in test_timer_remaining() that checks
whether the remaining ticks on a timer is less than or equal to half of
the timer duration after a busy wait of that time. If the timer
duration corresponds to an odd number of ticks, 1 should be added to
the upper bound given k_timer_remaining_ticks() returns
<ticks til next deadline> - <elapsed ticks>,
and <elapsed ticks> is truncated to closest integer tick count.

For example, if
    dur_ticks = 3277
    <ticks til next deadline> = 3277
    <elapsed ticks> = 1638.5 rounded to 1638

rem_ticks would be 1639, which is 1 greater than dur_ticks/2.

Fixes #25331

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-18 11:08:21 +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
Wentong Wu 9189acba03 tests: kernel: reduce test interval to save execution time
In Qemu icount mode, busy wait will cause lots of wall time and it's
very easy to get sanitycheck timeout(this case will be successful if
given enough timeout value for sanitycheck), so reduce test interval
to save execution time.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Wentong Wu 72227574d8 timer: remove QEMU_TICKLESS_WORKAROUND
Qemu icount mode enabled, remove QEMU_TICKLESS_WORKAROUND.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Wentong Wu b8724377e8 tests: lib: heap: exclude qemu_riscv32 platform
This CPU-bound test on qemu_riscv32 platform is very slow when
QEMU icount mode enabled, taking upwards of several minutes.
There's little value here, this is a unit test of library code
and we have coverage of the RISC-V 32 bit arch via hifive1.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +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
Andrew Boie 3f00daea1e tests: userspace: check for TLS leakage
TLS data set when a thread is in supervisor mode should not
leak if it drops later to user mode.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-13 22:02:48 +02:00
Kumar Gala 9fa3048d62 tests: deprecated: dts: Test deprecated DTS functionality
This this covers two small aspects of DTS functionality: first ensuring
the legacy generation script continues to generally function and second
that FLASH_AREA id's are the same between the old and new generator.

This test will be removed when the legacy generator is removed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Kumar Gala ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Gerard Marull-Paretas b35152ed4b devicetree: add DT_INST_FOREACH_CHILD macro
The macro iterates through the list of child nodes in a DT_DRV_COMPAT
instance and invokes provided macro for each node.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-05-13 21:22:06 +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
Peter Bigot 4f16b419e8 device: avoid casting away const from config_info pointer
The driver-specific config_info structure referenced from the device
structure is marked const.  Some drivers fail to preserve that
qualifier when casting the pointer to the driver-specific structure,
violating MISRA 11.8.

Changes produced by scripts/coccinelle/const_config_info.cocci.

Some changes proposed by the script are not included because they
reveal mutation of state through the const pointer, though the
code works as long as the driver-specific object is defined without
the const qualifier.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-13 18:21:52 +02:00
Anas Nashif ad82b38b8f tests: ztest: prefix tests with test_
Tests should always start with test_, otherwise detection of subtests
will not work through sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-13 18:16:07 +02:00
Stephanos Ioannidis 28e9b145cd tests: benchmarks: latency_measure: Fix atsame54_xpro
Reduce the system timer frequency on `atsame54_xpro` to prevent timer
from ticking while measuring average context switch time between
threads.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-12 16:40:34 +02:00
Stephanos Ioannidis 2c3d0b83e3 tests: kernel: context: Fix test_busy_wait timeout
The commit b7e363661d added an additional
busy wait call in the `busy_wait_thread` function -- effectively making
the minimum time required for the thread to exit twice that of the
original implementation.

This commit updates the busy wait thread completion timeout to reflect
that change.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-11 21:34:35 +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
Christopher Friedt 3bfc765aad tests: socket: socketpair: tests for socketpair(2) syscall
Tests for issue #24366

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-10 17:46:43 +02:00
Meng xianglin 0b1ef3f6bc test: msgq: remove number of cpu restriction
Remove CONFIG_MP_NUM_CPU=1 from test cases of msgq.
For CONFIG_MP_NUM_CPU > 1, start a thread with K_NO_WAIT to get
message from message queue will run immediately on another cpu and
cause message peek failure if there is no message in queue, so put
messages in msgq before start that thread.

Signed-off-by: Meng xianglin <xianglinx.meng@intel.com>
2020-05-09 19:06:53 +02:00
Daniel Leung 21797051a9 tests: latency_measure: allow use of other timer for timestamp
Some platforms have slow system clock resulting in not very
accurate latency measurements. This updates how the timestamps
are obtained by copying the mechanism from the timing_info test.
This allows using alternate higher speed timers to measure
latency.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-09 13:09:50 +02:00
Kumar Gala db725c0ec9 drivers: Replace GPIO_CS Kconfig with devicetree detection
Use DT_INST_SPI_DEV_HAS_CS_GPIOS() in drivers to determine if we should
utilize CS_GPIO base SPI chipselect handling.  This allows us to remove
Kconfig option for this feature.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-09 13:07:05 +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
Kumar Gala c2135f8721 devicetree: DT_NODE_HAS_COMPAT_STATUS_OKAY -> DT_NODE_HAS_COMPAT_STATUS
Swap this out and make the status a parameter.
Leave a couple of cases of DT_NODE_HAS_COMPAT().

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Kumar Gala 90ffbcb9d3 tests: devicetree: Add explicit has_status checks
Add some tests for DT_NODE_HAS_STATUS

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-08 19:37:18 -05: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
Dominik Ermel 6ba69f19d4 sys/util.h: Add IS_EMPTY and LIST_DROP_EMPTY macros
IS_EMPTY macro allows to check if defined name is empty, i.e.
does not contain replacement list.
LIST_DROP_EMPTY macro may be used to process __VA_ARGS__ type lists,
e.g. a,b,,c , and remove empty elements.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-05-08 17:50:25 +02:00
Andrew Boie b7e363661d tests: context: busy-wait with interrupts locked
This is expected to work on all platforms.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-08 17:44:17 +02:00
Paul Sokolovsky b07489614f tests: posix: clock: Workaround to align clocks before querying
Before calling clock_gettime() 2 times in row, issue k_usleep(1)
to align code execution to timer interrupt to prevent (well,
minimize) possibility of getting different ticks values.

Suggested by @andyross.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-08 17:31:45 +02:00
Paul Sokolovsky 32270ae1b9 tests: posix: eventfd: Don't mix POSIX and Zephyr kernel APIs
K_MSEC() shouldn't be used with poll(), as they come from 2 different
API domains.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-08 17:31:45 +02:00
Paul Sokolovsky a61f86ea8e tests: posix: common: Switch k_sleep() -> k_msleep().
As a step in migration to new timeout API.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-08 17:31:45 +02:00
Carles Cufi b67a31e411 Bluetooth: controller: Remove legacy LL
Remove the legacy Link Layer implementation.

Closes #24187.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-08 15:07:00 +02:00
Sahaj Sarup 351f39f9cd board: arm: Add Support For 96Boards Aerocore2
Changes:

- Added all required board files in /boards/arm/96b_aerocore2
- Modified pinmux for stm32f4

Most of the changes in this PR is based on reverse-engineering of the
PCB layout and following commits in the PX4 firmware repository for
the same board. The manufacturer does not provide and or generate
schematics and pinout tables for this board.

This PR includes almost all of the interfaces connected to the STM32
MCU, the only thing not included is the J9 and J8 headers that connect
to a 96Boards baseboard.
These headers are not vital to the functionality of the Aerocore2.

Signed-off-by: Sahaj Sarup <sahaj.sarup@linaro.org>
2020-05-08 07:33:43 -05:00
Kumar Gala d20e06d08f tests: maxim_ds3231_api: Convert old DT syntax to new macros
Convert various DT_NORDIC_NRF_*LABEL to DT_LABEL(DT_NODELABEL())

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-08 05:21:58 -05:00
Kumar Gala 6693c1d8a1 tests: stream_flash: Convert old DT syntax to new macros
Convert DT_SOC_NV_FLASH_0_SIZE to DT_REG_SIZE()

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-08 05:21:58 -05:00
Stephanos Ioannidis 004039d08c tests: Rename kernel.fp_sharing
This commit renames the `kernel.fp_sharing` tests to
`kernel.fpu_sharing`, in order to align with the recent
`CONFIG_FP_SHARING` to `CONFIG_FPU_SHARING` renaming.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Stephanos Ioannidis 728ce61968 tests: Rename kernel.common.stack_protection_arm_fp_sharing
This commit renames the `kernel.common.stack_protection_arm_fp_sharing`
test to `kernel.common.stack_protection_arm_fpu_sharing`, in order to
align with the recent `CONFIG_FP_SHARING` to `CONFIG_FPU_SHARING`
renaming.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Stephanos Ioannidis 41a3d1e816 tests: Rename arch.arm.swap.common.fp_sharing
This commit renames the `arch.arm.swap.common.fp_sharing` tests to
`arch.arm.swap.common.fpu_sharing`, in order to align with the recent
`CONFIG_FP_SHARING` to `CONFIG_FPU_SHARING` renaming.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Stephanos Ioannidis 0b930a2195 kconfig: Rename x86 FPU sharing symbols
This commit renames the x86 Kconfig `CONFIG_{EAGER,LAZY}_FP_SHARING`
symbol to `CONFIG_{EAGER,LAZY}_FPU_SHARING`, in order to align with the
recent `CONFIG_FP_SHARING` to `CONFIG_FPU_SHARING` renaming.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Stephanos Ioannidis aaf93205bb kconfig: Rename CONFIG_FP_SHARING to CONFIG_FPU_SHARING
This commit renames the Kconfig `FP_SHARING` symbol to `FPU_SHARING`,
since this symbol specifically refers to the hardware FPU sharing
support by means of FPU context preservation, and the "FP" prefix is
not fully descriptive of that; leaving room for ambiguity.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-08 10:58:33 +02:00
Abhishek Shah 012472f7d5 boards: arm: Add bcm958402m2_a72 board
Add support for bcm958402m2_a72 board for booting zephyr
on Cortex-A72 core.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-05-08 10:46:23 +02:00
Krzysztof Chruscinski 2e6e818c91 tests: shell: Add test for raw argument option
Added test for commands with SHELL_OPT_ARG_RAW flag set.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-07 23:47:39 -05:00
Stephanos Ioannidis 25fe4bf9c7 tests: drivers: Add console driver test
This commit adds the initial implementation of the console driver test.

The purpose of this test is to verify the output functionality of the
various types of console drivers (UART and semihost console types are
supported for now).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 23:33:38 -05:00
Francois Ramu dbbf834605 tests: drivers: spi loopback on nucleo_wb55 board
This configures the nucleo_wb55rg board for testing
the SPI loopback with DMA MUX transfer.
This test requires pin SPI_A_MISO (D12) to be connected
to pin SPI_A_MOSI (D11) on the nucleo_wb55rg board

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-07 23:03:20 -05:00
Gerard Marull-Paretas 5c454e955c boards: arm: nucleo_h743zi: enable ADC support
Enable ADC on Nucleo H743ZI board (ADC12 channel 15).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-05-07 23:01:59 -05:00
Dominik Ermel ba8b74d801 devicetree: Add DT_FOREACH_CHILD macro
The macro iterates through the list of child nodes and invokes provided
macro for each node.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 21:42:58 -05:00
Kumar Gala 0a7d4e2135 devicetree: Change DT_FOREACH_IMPL_ to not insert semicolon
Remove semicolon between instance invocations of DT_FOREACH_IMPL_ and
thus DT_INST_FOREACH.  This provides more flexibility to the user.  This
requires we fixup in tree users to add semicolon where needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-07 20:03:56 -05:00
Andrew Boie ac9abb10b8 tests: mem_protect: cleanup
This suite was fairly messy and very unstable on how it re-used
kernel objects.

* Unnecessary ztest_test_pass() or self-aborts removed
* k_thread_join() now used to wait for child thread completion,
  instead of a strange use of a semaphore which was effectively
  a 10ms sleep
* Barriers simplified
* the number of thread objects in kobject.c is now drastically reduced
* test case function names are now descriptive and made static if
  only used in local scope in kobject.c
* SMP no longer disabled

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-07 19:21:16 -04:00
Anas Nashif 29a06975e3 tests: stream_flash: skip tests correctly
User ztest_test_skip() to skip tests, not by conditionally including the
tests in the suite.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-07 14:24:02 -04:00
Joakim Andersson 194079d5bd Bluetooth: shell: Enable extended advertising support in the shell
Enable extended advertising commands in the shell and enable the
runtime check of feature support in the controller.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Joakim Andersson 21a42f3b67 Bluetooth: shell: Add phy handling to the shell
Add phy update callback and command to the shell.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Joakim Andersson 322f70243e Bluetooth: shell: Add data length handling in the shell
Add data length callback and command to the shell.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-07 20:12:29 +02:00
Andrei Gansari 3f11f4c207 tests: LPC platforms SPI use default frequncy
After increasing SPI speeds on LPC family SoCs, the slow clock
speeds have been removed and default clock speeds are in use now.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-05-07 12:47:34 -05:00
Peter A. Bigot e6976562aa tests: drivers: counter: add rtc_ds3231_api
Cloned from counter_basic_api with modifications based on DS3231
limitations:
* Only one device tested per board;
* Counter cannot be stopped or started;
* Alarms are serviced by worker thread, so are not invoked from ISR
  and require that test thread yield to allow processing (no
  k_busy_wait());
* Multiple Alarms test is disabled as documented in test.

Additional tests were added for DS3231-specific API.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-07 19:45:06 +02:00
Christopher Friedt 967f7a8bcb tests: kernel: pipe: tests for read_avail write_avail
Tests for issue #25036

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-07 19:39:53 +02:00
Stephanos Ioannidis 30e8aac754 tests: subsys: canbus: frame: Remove redundant logging configurations
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.

This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 14:47:35 +02:00
Stephanos Ioannidis ff2cba56a9 tests: net: websocket: Remove redundant logging configurations
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.

This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 14:47:35 +02:00
Stephanos Ioannidis 9fe2ead995 tests: drivers: spi: Remove redundant logging configurations
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.

This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 14:47:35 +02:00
Stephanos Ioannidis 8df851a971 tests: drivers: adc: Remove redundant logging configurations
This commit removes the redundant `LOG` and `LOG_IMMEDIATE` selections
in `prj.conf`, since the `TEST_LOGGING_DEFAULTS`, which is enabled by
default for all tests, selects `LOG` and `LOG_MINIMAL`.

This effectively allows the test to run with the default test logging
policy, set by the testing subsystem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-07 14:47:35 +02:00
Carles Cufi 9b04a99243 timeouts: Port BBC micro:bit to the new timeout API
Port the BBC micro:bit display driver to the new timeout API exposed by
the kernel.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Simon Glass fc0e10d064 shell: Support output using a va_list
At present it is not possible to write a printf()-like function in
board code which outputs to the shell. Add shell_vfprintf() to permit
this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-05-07 10:04:28 +02:00
Luiz Augusto von Dentz f3116842f1 Bluetooth: EDTT: Use bt_buf_tx_get to allocate buffers
Instead of using its own buffer pool use one already available by
HCI_RAW which are accessible with bt_buf_tx_get.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-07 10:31:36 +03:00
Martí Bolívar 87e1743ae0 devicetree: replace DT_HAS_DRV_INST with DT_INST_FOREACH
Make drivers multi-instance wherever possible using DT_INST_FOREACH.
This allows removing DT_HAS_DRV_INST in favor of making drivers just
do the right thing regardless of how many instances there are.

There are a few exceptions:

- SoC drivers which use CMake input files (like i2c_dw.c) or otherwise
  would require more time to convert than I have at the moment. For the
  sake of expediency, just inline the DT_HAS_DRV_INST expansion for
  now in these cases.

- SoC drivers which are explicitly single-instance (like the nRF SAADC
  driver). Again for the sake of expediency, drop a BUILD_ASSERT in
  those cases to make sure the assumption that all supported SoCs have
  at most one available instance is valid, failing fast otherwise.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-06 17:35:08 -05:00
Stephanos Ioannidis 4622cecc15 tests: drivers: spi_loopback: Add internal loopback for atsamr21_xpro
This commit adds the SPI testing support with an internal MOSI to MISO
loopback for the Atmel SAM R21 Xplained Pro board.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-06 12:41:56 -05:00
Stephanos Ioannidis c328040f2b tests: drivers: spi_loopback: Add internal loopback for atsame54_xpro
This commit adds the SPI testing support with an internal MOSI to MISO
loopback for the Atmel SAM E54 Xplained Pro board.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-06 12:41:56 -05:00
Stephanos Ioannidis ac3c6d5573 tests: drivers: spi_loopback: Add SAM D21 Xplained Pro support
This commit adds the SPI loopback test support for the Atmel SAM D21
Xplained Pro board.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-06 12:41:56 -05:00
Kumar Gala cbd9c86b5c tests: uart_basic_api: Don't FAIL non-implemented APIs
A number of uart drivers may not implement the uart_configure and
uart_config_get APIs, if we get -ENOTSUP treat that as a skip.

Fixes #24355

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 12:21:25 -05:00
Krzysztof Chruscinski 8fcabf6032 tests: unit: util: Add test for FOR_EACH_FIXED_ARG macro
Added test for FOR_EACH_FIXED_ARG macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-06 14:30:18 +02:00
Krzysztof Chruscinski 8ab4a60471 tests: unit: util: Add tests for FOR_EACH and FOR_EACH_IDX macros
Extended suite to test macros.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-05-06 14:30:18 +02:00
Jukka Rissanen f95c349c36 tests: net: dns: Increase stack size for coverage support
Increase stack size so that coverage information can be generated.

Fixes #17323

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-06 13:43:17 +03:00
Kumar Gala fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Andy Ross 7e3d43b558 lib/cmsis_rtos_v2: Update to newer timeout API
Mostly simple.  Note that the CMSIS RTOS2 API specifies timeout values
in system ticks instead of milliseconds, so the conversions here are
able to elide a conversion that the original code had to do.  That's a
good thing, but does mean that in practice runtime behavior will not
be 1:1 identical.

Also note that the switch away from legacy timeouts involved a change
to 64 bit timeouts by default, which pushed
tests/portability/cmsis_rtos_v2 over the limit on qemu_xtensa.
Unfortunately CMSIS stacks have a fixed limit we can't increase, so I
turned off 64 bit timeouts (CMSIS apps won't need them by definition
anyway -- their API is 32 bit).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-06 06:05:03 -04:00
Håkon Øye Amundsen a9676831cb storage: add stream flash library
This library supports stream writes to flash with
optinal progressive erase.

This module is a direct copy of the functionality found in
subsys/dfu/img_util/flash_img.c

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-05-06 11:14:00 +02:00
Alexander Wachter 464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Kumar Gala 183ddabef2 tests: spi_loopback: Remove unneeded setting of Kconfig symbol
The STM32 and CC13xx/CC26xx SPI drivers don't utilize the Kconfig
symbols for per instance SPI anymore so we don't need to set them on the
conf files for this test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 19:10:54 -05:00
Henrik Brix Andersen f89defea51 tests: drivers: spi: loopback: add lpcxpresso55s16_ns configuration
Add configuration for the NXP LPCxpresso55S16 board to the SPI driver
loopback test.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-05 17:03:29 -05:00
Stephanos Ioannidis 974b44e9e5 tests: uart_async_api: Support atsame54_xpro board
This commit adds the asynchronous UART API testing support on the SAM
E54 Xplained Pro board.

The SERCOM1 module is used as the secondary loop-back UART, which is
required to run this test.

Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM1 UART TX and RX pads are configured to be
internally connected; it is, however, still necessary to configure the
pinmux because the module pads are not connected until the pinmux is
configured.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-05 13:53:49 -05:00
Andrew Boie f1b5d9db8e kernel: fix issue with k_thread_join() timeouts
If k_thread_join() was passed with an actual timeout value,
and not K_FOREVER, the blocking thread was not being properly
woken up when the target thread exits. The timeout itself
was never aborted, causing the joining thread to remain
un-scheduled until the timeout expires.

Amend the k_thread_join() test cases to check that the join
completed before the provided timeout period expired.

Fixes: #24744

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-05 11:43:08 -07:00
Kumar Gala 1f0b5c659d tests: boards: altera_max10: Remove unneeded setting of Kconfig symbol
The NIOS2 I2C driver does not utilize Kconfig symbols for per instance
I2C anymore so we don't need to set them in the conf files for this
test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 11:44:34 -05:00
Kumar Gala ac7ff178c8 tests: i2c_slave_api: Remove unneeded setting of Kconfig symbols
The STM32 I2C drivers don't utilize the Kconfig symbols for per
instance I2C anymore so we don't need to set them in the
conf files for this test.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 11:44:34 -05:00
Henrik Brix Andersen b07f9b064f tests: lib: devicetree: add test for bus controller node without regs
Add a test for parsing devicetree with an (I2C) bus controller node
without a regs property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-05 10:17:23 -05:00
Jukka Rissanen 65a1bebe85 net: Replace NET_WAIT_FOREVER by SYS_FOREVER_MS
As we now have SYS_FOREVER_MS, use that instead of network
specific NET_WAIT_FOREVER.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 16:29:23 +03:00
Jukka Rissanen 8160385b57 net: pkt: Fix removal of empty buffers in net_pkt_pull()
If we have removed first net_buf, then we must not restore the
original cursor as that will point to wrong head net_buf.
Add also unit test to check that the packets are removed
properly.
Clarify the documentation that we are removing data from
beginning of the function, also document that the cursor
is reset after this call.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 13:39:45 +03:00
Anas Nashif 5677eb0a35 tests: gpio: remove unused harness
harness being set without actual use of harness (via harness_config)
makes the test behave differently.

Fixes #24661

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-05 06:16:50 -04:00
Mariusz Skamra f51557d0f2 tester: Adjust to recent changes in BTP API
This patch adjusts L2CAP CoC related command and responses to the
recent BTP API changes.
BTP has been extended with Enhanced CoC support, thus few L2CAP
CoC related commands have been changed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2020-05-05 11:05:54 +03:00
Kumar Gala 4dc3a99fff tests: counter_basic_api: Convert to use new dts macros
Convert DT_RTC_0_NAME to DT_LABEL() references based on the compat being
defined in the build.

Introduce a set of macros that will generate a list of labels based on
compatible matches.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 17:26:33 -05:00
Stephanos Ioannidis 79d1b188c9 tests: lib: cmsis_dsp: transform: Provide RIFFT bug workaround
This commit provides the workarounds for the CMSIS-DSP RIFFT input
buffer access bug reported in #24701.

The upstream issue for this bug is ARM-software/CMSIS_5#906.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-04 16:55:55 -05:00
Francois Ramu 280baaecbf tests: drivers: spi loopback on nucleo_f411 board
This configures the nucleo_f411re board for testing the SPI loopback
with DMA V1 transfer. DMA instance 2 is used.
This test requires pin SPI_A_MISO (D12) to be connected
to pin SPI_A_MOSI (D11) on the nucleo_wb55rg boardtest dma_V1

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu 3ae853797f tests: drivers: spi loopback on nucleo_l476 board
This configures the nucleo_l476rg board for testing the SPI loopback
when with DMA transfer.
It requires pin MOSI to be connected to pin MISO of the SPI1
SPI tx/rx are assigned to the request ID 1 of dma1 channels 3 and 2

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu 18f5a83475 tests: drivers: spi loopback testcase to reload dma on stm32
This adds a new testcase in the spi_loopback test application
to use several buffers for the DMA transfer.
It requires the MOSI to be connected to the MISO of the SPI1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu 9f497bf154 tests: drivers: spi loopback test application for dma on stm32
This changes the spi_loopback test application to use the DMA transfer.
In case of DMA, some testcases are useless.
It requires the MOSI to be connected to the MISO of the SPI1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Francois Ramu 1bd195e654 tests: drivers: spi loopback test application
This adds some commments to the spi_loopback test application

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-04 09:46:07 -05:00
Kumar Gala 59d3cc213e tests: Convert DT_ALItAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:11:38 -05:00
Kumar Gala 42a2d99a1a tests: uart_async_api: Convert to use new dts macros
Convert DT_UART_{0,1}_NAME to DT_NODELABEL() references as the cases are
board specific and this allows us to remove DT_UART_{0,1}_NAME defines
in dts_fixup.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:08:59 -05:00
Kumar Gala 024ea0e44e adc: Kconfig: Remove per instance ADC_{0..2} Kconfig symbols
No code utilizes CONFIG_ADC_{0..2} so we can now remove the Kconfig
sybmols for them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 09:04:16 -05:00
Kumar Gala 8101a0f661 flash: dts: replace DT_FLASH_{ERASE,WRITE}_BLOCK_SIZE with new macros
Replace:
	DT_FLASH_ERASE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)

	DT_FLASH_WRITE_BLOCK_SIZE ->
	DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)

As this allows us to phase out the old generator.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 13:26:04 +02:00
Marek Porwisz 673b1da46d tests: subsys: openthread: OpenThread radio interface tests
Currently there are no test for openthread on zephyr.
Created tests for OpenThread platform radio interface.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-05-04 12:00:02 +02:00
Luiz Augusto von Dentz 70271435dd Bluetooth: shell: Enable BT_EATT
This enables BT_EATT for shell samples so it can be build test by CI and
gives user the ability of test it using shell commands.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-05-02 15:59:14 +03:00
Joakim Andersson 45e6921517 Bluetooth: test: Fix redefinition of BT_BUF_ACL_SIZE
Fix BT_BUF_ACL_SIZE in hci_test_app after declaration was moved to
hci_raw.h

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-02 13:08:59 +03:00
Henrik Brix Andersen 7ede80be46 tests: boards: board_shell: enable DAC commands
Enable DAC commands in the board_shell test application.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Henrik Brix Andersen 666beb2430 tests: drivers: dac_loopback: add frdm_k64f board support
Add support for running the DAC loopback test case on the NXP
FRDM-K64F development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Henrik Brix Andersen 20f941e556 tests: drivers: dac_api: add frdm_k64f board support
Add support for running the DAC API test case on the NXP FRDM-K64F
development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Henrik Brix Andersen e53ae4d41a tests: drivers: dac_loopback: add twr_ke18f board support
Add support for running the DAC loopback test case on the NXP
TWR-KE18F development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Henrik Brix Andersen 6fecee6229 tests: drivers: dac_api: add twr_ke18f board support
Add support for running the DAC API test case on the NXP TWR-KE18F
development board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Kumar Gala e13544c4aa tests: drivers: counter: nrf: Convert to new dts macros
Convert to use DT_LABEL() to get the timer and rtc device name.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:44:24 -04:00
Kumar Gala f31a73bb23 tests: kernel: context: Convert to new dts macros
Set the TICK_IRQ on litex and rv32m1 based on DT_IRQN().  For litex we
use DT_NODELABEL(timer0) and on rv32m1 we use DT_ALIAS(system_lptmr) to
determine the timer device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:39:27 -04:00
Peter Bigot 52885d0576 coccinelle: run ms_timeout conversion semantic patch
Substitute integral constants where call sites passed named constants
that have timeout values as arguments to parameters that expect
millisecond durations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-30 18:26:26 +02:00
Joakim Andersson 68ce16cf86 Bluetooth: tests: Update EDTT configuration for easier debugging
Update EDTT default configuration to make it easier to debug. The
use of maximum log level to restrict default output caused some
confusion. Instead remove debug options to reduce the default log
output. Enabling debug logs is now similar to other samples and tests.

Remove options commented out, no need to keep them.
Move comment to the matching CONFIG.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:33:16 +02:00
Joakim Andersson e1479a406f Bluetooth: test: Convert EDTT test to using k_timeout_t struct
Convert the EDTT test to use k_timeout_t struct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:46:48 +03:00
Ravi kumar Veeramally d9c505c745 tests: net: tcp2: Add flags checks
Verify TCP header flags.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-04-30 12:52:11 +03:00
Kumar Gala 50345848b4 drivers: flash: flash_simulator: Convert to new DT macros
Convert flash_simulator to use new DT macros and remove associated
defines in dts_fixup.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 04:47:44 -05:00
Jukka Rissanen 3d3801ab27 tests: net: pkt: Add more tests for net_pkt_pull()
Add test that pulls more than one net_buf amount of data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-30 09:27:16 +03:00
Anas Nashif eaba71738e samples: move tracing sample from tests/
This is more a sample than a test, so put it under samples with the goal
of having dedicated tracing tests in the future under tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Kumar Gala 3f236f2183 can: dts: Convert can-primary alias to zephyr,can-primary chosen prop
Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

chosen {
	zephyr,can-primary = &can1;
};

Replace various macro/define references with either
DT_CHOSEN(zephyr_can_primary) or replace DT_ALIAS_CAN_PRIMARY_LABEL
with DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 14:27:31 -05:00
Kumar Gala 689f93bc33 devicetree.h: pwms: Add DT_PWMS_ macros
Add DT_PWMS macros to be used in pwm clients drivers.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 13:11:22 -05:00
Stephanos Ioannidis 6829323036 tests: drivers: hwinfo: Remove unnecessary filter
The hwinfo driver test currently filters for `CONFIG_HWINFO`, but this
symbol is set to `y` by the `prj.conf` and therefore will always be
selected.

This commit removes the unnecessary `CONFIG_HWINFO` filter.

Note that the hwinfo driver test `ifdef`s `CONFIG_HWINFO_HAS_DRIVER`,
and having an actual hwinfo driver implementation is not a requirement
(if no hwinfo driver is available, the test validates that -ENOTSUP is
returned by `hwinfo_get_device_id`).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-29 11:07:37 +02:00
Kumar Gala b810b4d452 Revert "tests: no need long busy_wait to waste cycles"
This reverts commit 315cba1c40 as it was
causing CI failures for qemu_cortex_m0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-28 20:34:57 -04:00
Peter Bigot a09f6ad54c json: fix buffer overrun in encoding helper
The bounds check failed to account for the additional space required
for the terminating NUL after the encoded value was written.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-28 15:06:45 -04:00
Wayne Ren 315cba1c40 tests: no need long busy_wait to waste cycles
* no need long busy_wait to waste cycles, especially in
 CI.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-04-28 10:48:01 -07:00
Christopher Friedt d650f4b494 kernel: pipe: fix !K_NO_WAIT and >= min_xfer bytes transferred
If timeout != K_NO_WAIT, then return immediately when not all
bytes_to_read or bytes_to_write have been transfered, but >=
min_xfer have been transferred.

Fixes #24485

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-04-28 16:14:55 +02:00
Daniel Leung 13ef99831a drivers: gpio: mchp_xec: Convert to using new device tree macros
Convert driver to use the new device tree macro's instead of
dts_fixup.h based macros. This moves us closer to removing both
dts_fixup.h and per instance Kconfig symbols.

The pinmux_mchp_xec is also being updated since it's using DT
from GPIO.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-28 07:43:31 -05:00
Tobias Svehagen ca872a44c1 lib: posix: Add support for eventfd
This implements a file descriptor used for event notification that
behaves like the eventfd in Linux.

The eventfd supports nonblocking operation by setting the EFD_NONBLOCK
flag and semaphore operation by settings the EFD_SEMAPHORE flag.

The major use case for this is when using poll() and the sockets that
you poll are dynamic. When a new socket needs to be added to the poll,
there must be some way to wake the thread and update the pollfds before
calling poll again. One way to solve it is to have a timeout set in the
poll call and only update the pollfds during a timeout but that is not
a very nice solution. By instead including an eventfd in the pollfds,
it is possible to wake the polling thread by simply writing to the
eventfd.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-04-28 09:57:41 +03:00
Stephanos Ioannidis 773de88db0 tests: net: Rename local PORT definition
This commit renames all local definitions with the name `PORT` in the
net tests, in order to prevent name conflict with certain HALs
(notably, Atmel SAM E5x HAL).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-28 09:57:04 +03:00
Kumar Gala 7a15afc1d4 drivers: flash: replace DT_FLASH_DEV_NAME with DT macro
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.

NOTE: For a SoCs with on die flash, this points to the controller and
      not the 'soc-nv-flash' node.  Typically the controller is the
      parent of the 'soc-nv-flash' node).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-27 18:43:20 -05:00
Stephanos Ioannidis 0e6ede8929 kconfig: Rename CONFIG_FLOAT to CONFIG_FPU
This commit renames the Kconfig `FLOAT` symbol to `FPU`, since this
symbol only indicates that the hardware Floating Point Unit (FPU) is
used and does not imply and/or indicate the general availability of
toolchain-level floating point support (i.e. this symbol is not
selected when building for an FPU-less platform that supports floating
point operations through the toolchain-provided software floating point
library).

Moreover, given that the symbol that indicates the availability of FPU
is named `CPU_HAS_FPU`, it only makes sense to use "FPU" in the name of
the symbol that enables the FPU.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02:00
Jukka Rissanen ba9f20a6eb tests: net: mgmt: Change timeout back to u32_t
No point to change the throw_sleep to k_timeout_t because we
are calculating the timeout beforehand which can lead to
unexpected results if using k_timeout_t.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-27 10:35:17 +03:00
Mark Olsson 1ca4aedc35 tests: drivers: fixes for failing tests
Tests were failing as they were looking for an alias which didn't exist
Also, because some code in kscan_handlers.c wasn't compilable

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Krzysztof Chruscinski 2c54ea49f7 tests: drivers: counter: Add nrf9160_pca10090 board
Add board with nrf9160 to counter tests.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-24 10:17:48 +02:00
Stephanos Ioannidis 547a5e9eb0 tests: uart_async_api: Support atsamr21_xpro board
This commit adds the asynchronous UART API testing support on the SAM
R21 Xplained Pro board.

The SERCOM3 module is used as the secondary loop-back UART, which is
required to run this test.

Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM3 UART TX and RX pads are configured to be
internally connected; it is, however, still necessary to configure the
pinmux because the module pads are not connected until the pinmux is
configured.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-23 16:19:35 -05:00
Kumar Gala 0cfbd9af90 tests: adc_api: Use new DT_LABEL macro for getting device name
Replace dts_fixup.h based DT_ADC_0_NAME defines with DT_LABEL as we
phase out dts_fixup.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 18:25:00 +02:00
Krzysztof Chruscinski 1a4cd7180b tests: drivers: counter: Fix validation of the alarm value
Test is checking if alarm handler is executed at request time or later.
However, validation did not take into account wrapping of the counter.
Fixed by taking into account case where counter wraps.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-23 17:21:07 +02:00
Krzysztof Chruscinski 1ad9b9e354 tests: drivers: counter: Fix test for nrf51
Fixes test which did not take into account that counter may
wrap (nrf51 has 16bit timers) and was setting alarm to wrong
value. Error was not seen on platforms with higher top value.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-23 17:21:07 +02:00
Stephanos Ioannidis efa0e4b17b tests: uart_async_api: Support atsamd21_xpro board
This commit adds the asynchronous UART API testing support on the SAM
D21 Xplained Pro board.

The SERCOM1 module is used as the secondary loop-back UART, which is
required to run this test.

Note that no external UART loop-back connection is necessary to run
this test, because the SERCOM1 UART TX and RX pads are configured to be
internally connected.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-23 08:50:18 -05:00
Corey Wharton d873573f76 tests: fp_sharing: Enable build-only tests for RISC-V QEMU platform
Enables build-only tests for the qemu_riscv32 platform.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Corey Wharton c8f7cd5462 kconfig: Make the CPU_HAS_FPU_DOUBLE_PRECISION option global.
This option now applies to the RISC-V architecture and is no longer
a ARM only configuration.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Corey Wharton a4a334d3f7 tests: fp_sharing: Enable tests for RISC-V architectures
Enable generic and float_disable tests for RISC-V targets that have
CONFIG_CPU_HAS_FPU enabled.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Corey Wharton 58232d58e0 riscv: Add support for floating point
This change adds full shared floating point support for the RISCV
architecture with minimal impact on threads with floating point
support not enabled.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-04-22 16:39:48 -07:00
Stephanos Ioannidis 30a5aefb54 tests: lib: cmsis_dsp: Restrict testing platforms
In order to reduce CI overhead, this commit restricts the CMSIS-DSP
tests to only run on the following ARM platforms:

* `frdm_k64f`: Cortex-M4 (to be replaced by `qemu_cortex_m4`)
* `sam_e70_xplained`: Cortex-M7
* `mps2_an521`: Cortex-M33

The following platforms should be added to the platform whitelist in
the future when adequate support is available:

* `qemu_cortex_m4`: Replace `frdm_k64f` when available
* `qemu_cortex_r5`: Add when Cortex-R VFP support is available
* `qemu_cortex_a53`: Add when AArch64 VFP support is available
(and other VFP-equipped ARM testing platforms added in the future)

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis a3859a3873 tests: lib: cmsis_dsp: Add 'filtering' test application
This commit adds the test application for the CMSIS-DSP 'filtering'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 7b65df74e6 tests: lib: cmsis_dsp: Add 'svm' test application
This commit adds the test application for the CMSIS-DSP 'svm'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 69dcc5f8ed tests: lib: cmsis_dsp: Add 'bayes' test application
This commit adds the test application for the CMSIS-DSP 'bayes'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 2de8252ac4 tests: lib: cmsis_dsp: Add 'distance' test application
This commit adds the test application for the CMSIS-DSP 'distance'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis d7b882147d tests: lib: cmsis_dsp: Add 'transform' test application
This commit adds the test application for the CMSIS-DSP 'transform'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis c70dfb5c06 tests: lib: cmsis_dsp: Add 'matrix' test application
This commit adds the test application for the CMSIS-DSP 'matrix'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 5c22f9d8ea tests: lib: cmsis_dsp: Add 'statistics' test application
This commit adds the test application for the CMSIS-DSP 'statistics'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis a2189d92d6 tests: lib: cmsis_dsp: Add 'support' test application
This commit adds the test application for the CMSIS-DSP 'support'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 133ca57a69 tests: lib: cmsis_dsp: Add 'fast math' test application
This commit adds the test application for the CMSIS-DSP 'fast math'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 8a3b204635 tests: lib: cmsis_dsp: Add 'complex math' test application
This commit adds the test application for the CMSIS-DSP 'complex math'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis fce58bafdc tests: benchmarks: cmsis_dsp: Add 'basic math' benchmark application
This commit adds the benchmark application for the CMSIS-DSP 'basic
math' functions.

This benchmark application is loosely based on the C++ test suite
included in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis 6723f5e9f3 tests: lib: cmsis_dsp: Add 'basic math' test application
This commit adds the test application for the CMSIS-DSP 'basic math'
functions.

This test application is loosely based on the C++ test suite included
in the upstream CMSIS-DSP distribution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Sven Herrmann bded58cee5 Sensor: mpr: Add Honeywell MPR driver
The Honeywell MPR sensor is a piezoresistive silicon pressure sensor,
which can be accessed via i2c.

https://sensing.honeywell.com/micropressure-mpr-series

Signed-off-by: Sven Herrmann <sven.herrmann@posteo.de>
2020-04-22 17:39:31 +02:00
Andy Ross 00e2cce1fc tests/kernel/timer/timer_api: Fix static double-conversion goof
The test of the absolute timeout feature was a simple whitebox test
that inspected the generated ticks field of different constructors for
identity.  But it wasn't simple enough, because it was doing a
ticks->ms->ticks conversion (at compile time, sigh) on the input data,
which is obviously lossy on platforms where ticks are shorter than
milliseconds by non-integral factors.

Fix to do the conversion in just one direction.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-22 17:35:10 +02:00
Andy Ross cc0db43426 tests/kernel/timer/timer_api: Correct tick math for odd freq timers
This test sets a timer, busy waits for half the duration, and then
checks the remaining time is correct.  And it correctly does all its
math in tick precision and aligns to a timer interrupt to eliminate
aliasing due to the tick stride.

But it's waiting using k_busy_wait(), not a timer: "half the duration"
in MICROSECONDS (for k_busy_wait()) is not necessarily representable
as an integer number of TICKS on all platforms.  Because k_busy_wait()
always rounds up, we need one extra tick of buffer on those platforms.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-22 17:35:10 +02:00
Peter Bigot 14e2ca4f16 sys: onoff: redesign to meet changed needs
The previous architecture proved unable to support user expectations,
so the API has been rebuilt from first principles.  Backward
compatibility cannot be maintained for this change.

Key changes include:

* Formerly the service-provided transition functions were allowed to
  sleep, and the manager took care to not invoke them from ISR
  context, instead returning an error if unable to initiate a
  transition.  In the new architecture transition functions are
  required to work regardless of calling context: it is the service's
  responsibility to guarantee the transition will proceed even if it
  needs to be transferred to a thread.  This eliminates state machine
  complexities related to calling context.
* Constants identifying the visible state of the manager are exposed
  to clients through both notification callbacks and a new monitor API
  that allows clients to be notified of all state changes.
* Formerly the release operation was async, and would be delayed for the
  last release to ensure a client would exist to be notified of any
  failures.  It is now synchronous.
* Formerly the cancel operation would fail on the last client associated
  with a transition.  The cancel operation is now synchronous.
* A helper function is provided to safely synchronously release a
  request regardless of whether it has completed or is in progress,
  satisfying the use case underlying #22974.
* The user-data parameter to asynchronous notification callbacks has
  been removed as user data can be retrieved from the CONTAINER_OF
  the client data.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 16:52:47 +02:00
Ravi kumar Veeramally 4c8ad3b0c6 test: net: tcp2: Tests for connection close
Added tests for FIN_WAIT_1, FIN_WAIT_2 and CLOSING
states.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-04-22 12:41:39 +03:00
Kumar Gala fc6aa9214c devicetree.h: clocks: Add support for _BY_NAME macros
Add the following macro's to get clock info by name:
	DT_CLOCKS_LABEL_BY_NAME
	DT_CLOCKS_CELL_BY_NAME
	DT_INST_CLOCKS_LABEL_BY_NAME
	DT_INST_CLOCKS_CELL_BY_NAME

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Co-Authored-By: Marti Bolivar <marti.bolivar@nordicsemi.no>
2020-04-21 15:39:36 -05:00
Kumar Gala 5419a196b1 include/devicetree: dma: rename DMAS CELL macros
The macros should have been DMAS_CELL_ not DMAS_CELLS_ as this matches
the other devicetree macro naming convention.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-21 06:37:28 -05:00
Peter Bigot 6c674300fc tests: drivers: gpio: add SX1509B interrupt-supporting configs
No in-tree boards support the NINT signal on an SX1509B IO extender,
so test using custom overlays/configurations for the Particle Xenon
board using an SX1509B breakout board.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-20 18:51:59 +02:00
Martin Jäger 5c9e414a83 tests: drivers: dac: Add loopback test with ADC
The loopback test reads back the DAC output with the ADC and checks
that it is in a narrow range.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-04-20 17:41:48 +02:00
Martin Jäger de04d33def tests: drivers: dac: Add write_value API test
Test runs with nucleo_l073rz board.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-04-20 17:41:48 +02:00
Torsten Rasmussen f7d6ffd8fa cmake: Updating test samples to use find_package(Zephyr)
The following PR's #23941 #23601 was merged using old boilerplate
inclusion.
This commit updates those tests to use find_package(Zephyr)

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-20 15:46:43 +02:00
Peter Bigot 033cb11db2 tests/drivers/gpio: fix nrf52840dk_nrf52840 overlay
Changes to Kconfig vs devicetree resulted in uart1 being enabled,
which steals the test pins away from the test.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-20 15:33:14 +02:00
Jukka Rissanen cb4c09d702 tests: net: tcp2: Add more debugging info
It is useful to know which test fails to semaphore timeout so
add line number of the failing test to assert print.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-19 11:10:37 +03:00
Martí Bolívar 1de7602c7d tests: wdt_basic_api: devicetree updates
Move to the new devicetree API and stop using DT_WDT_0_NAME fixup
macros. All existing in-tree SoCs with fixup names are still supported
here via compatible. The watchdog0 alias is also still supported.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-17 16:09:07 -05:00
Kumar Gala 4f434b3bf2 dts: arm: nxp: nxp_lpc55s6x: Fix high speed SPI node
The flexcomm at 0x9f000 is a high speed SPI interface only.  Tweak the
device tree to reflect that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-17 10:16:40 -05:00
Ravi kumar Veeramally 3b3c7e71a0 tests: net: tcp2: Add minimal unit tests
Minimal tests for TCP2 functionality added.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-04-17 14:49:18 +03:00
Sean Nyekjaer a588538c3a tests: drivers: build_all: add MCP23S17 build configuration
Add Microchip MCP23S17 driver to build_all build configuration.

Signed-off-by: Sean Nyekjaer <sean@geanix.com>
2020-04-17 05:56:05 -05:00
Krzysztof Chruscinski 450c6b44f9 shell: Add shell_set_root_cmd function
New function allows to set from the code the root command. It is
an equivalent of calling 'select <rootcmd>' except it sets command
for all shell instances.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-17 11:34:01 +02:00
Dominik Ermel c8e3b1f68b tests/subsys/fs/fcb: Fix flash_area_write failure on NRF
The commit fixes problem with test attempting to perform 1 byte writes
to flash, which are not emulated by default.

GH issue: #24207

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-04-17 10:23:47 +02:00
Stephanos Ioannidis cdbfbe396f tests: benchmarks: Fix incorrect ARM arch variant check
Currently, the Cortex-M SysTick-based timing info implementation is
incorrectly specified for all 32-bit ARM architectures.

This commit fixes that by restricting the SysTick-based implementation
to the ARM Cortex-M architectures only; in addition, it removes the
ARM64 timing info implementation as it is identical to the default
generic implementation and was previously added only as a workaround
for the aforementioned problem.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-15 15:49:27 +02:00
Stephanos Ioannidis 819fe00071 tests: benchmarks: Fix Kconfig symbol checks
This commit fixes the incorrect (or un-conventional, at least) Kconfig
boolean symbol checks.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-15 15:49:27 +02:00
Peter Bigot 45f126f871 coccinelle: re-run timeout conversion semantic patch
This fixes a variety of K_THREAD_DEFINE issues that were missed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-15 08:28:57 -05:00
Martí Bolívar 6e27343e7b devicetree: add DT_PARENT()
This macro takes a node identifier, and returns the parent node's
identifier.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-15 08:27:18 -05:00
Martí Bolívar 1ed5751bcf tests: counter_nrf_rtc: fix platform whitelist
The board rename was missed. That's the only remaining case of a
missed rename I could find in tree, but I may have missed something.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-15 12:50:00 +02:00
Andy Ross 1f3c014a1a tests/lib/heap: More workarounds for platform memory sizing
Some of the ARC platforms aren't consistent between kconfig and their
linker scripts as to the size of memory, add a special case.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross f1e4a71751 tests/lib/heap: Disable renode emulator platform
The renode emulator is REALLY slow on this test, what completes in 20
seconds on qemu takes 4-10 minutes on renode.  That's causing trouble
in CI.

And this is a CPU-bound unit test of library code, where we have
coverage for riscv32 via qemu anyway.  There's no value to having
better platform emulation here.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross a4379d1308 tests/lib/heap: Correct typing in platform size detection
CONFIG_SRAM_SIZE is a kconfig value, which is an int (units of kb),
but when doing math on it to produce a memory buffer size needs to be
done in size_t precision otherwise we could overflow on 64 bit
platforms with >4G memory.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross 987658dcee tests/kernel: Fill allocation robustly for mpool heap backend
These five tests (mbox_api, mheap_api_concept, msgq_api, pipe_api and
queue) all had test cases where they needed a mem_pool allocation to
FAIL.  And they are all written to assume the behavior of the original
allocator and not the more general k_heap code, which actually
succeeds in a bunch of these cases.

* Even a very small heap saves enough metadata memory for the very
  small minimum block size, and this can be re-used as an allocation.
  So you can't assume a small heap is full.

* Calculating the number of blocks based on "num_blocks * max size /
  minimum size" and allocating them does not fill the heap, because
  the conservative metadata reservation leaves some space left over.

So these have all been modified to "fill" a heap by iteratively
allocating until failure.

Also, this fixes a benign overrun bug in mbox.  The test code would
insert a "big" message by reading past the end of the small message
buffer.  This didn't fail because it happened to be part of an array
of messages and the other ones defined contained the memory read.  But
still.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross 91cf6651d8 tests/kernel/mem_pool: Split out tests for legacy mem_pool config
The k_heap backend is now the default for mem_pool, so duplicate these
tests across that config so we continue to have coverage for the older
code.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross e582bc128a tests/kernel/mem_pool: Adjust tests to work with k_heap backend
The original k_mem_pool tests were a mix of code that tests routine
allocator behavior, the synchronization layer above that, and a
significant amount of code that made low-level assumptions about the
specific memory layout of the original allocator, which doesn't run
out of memory in exactly the same way.

Adjust the expectations as needed for the backend.  A few test cases
were skipped if they were too specific.  Most have been generalized
(for example, iteratively allocating to use up all memory instead of
assuming that it will be empty after N allocations).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Andy Ross 15c52ed12a tests/lib: Add sys_heap test
Use the white box validation and test rig added as part of the
sys_heap work.  Add a layer that puts hashed cookies into the blocks
to detect corruption, check the validity state after every operation,
and enumerate a few different usage patterns:

+ Small heap, "real world" allocation where the heap is about half
full and most allocations succeed.

+ Small heap, "fragmentation runaway" scenario where most allocations
start failing, but the heap must remain consistent.

+ Big heap.  We can't test this with the same exhaustive coverage
(many re/allocations for every byte of storage) for performance
reasons, but we do what we can.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-14 10:05:55 -07:00
Parthiban Nallathambi e65b14c2b6 sensor: bq274xx: Add BQ27421 driver
Add support for TI BQ27421 fuel gauge sensor

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-04-13 11:50:41 -05:00
Kumar Gala 43a7d26603 drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro
Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL.  We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.

This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h.  Also
remove any other stale ENTROPY related defines in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-13 09:14:21 -05:00
Erwan Gouriou f4e832d9e9 tests/lib: device tree: Add dma binding tests
Add dma nodes and dma clients tests.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-13 07:37:11 -05:00
Anas Nashif 9be6847cc6 tests: critical: change doxygen group
Rename doxygen group to kernel_workqueue_tests

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Anas Nashif a3ddaf8dbc tests: move critical test under workqueue
This is a workqueue test, so move it where it belongs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Anas Nashif 1825c6f562 tests: put all workqueue test in 1 group
Pun all workqueue tests under 1 doxygen group.

This removes kernel_workqueue_triggered_tests and
kernel_workqueue_delayed_tests doxygen groups.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Anas Nashif 6c8dda4e68 tests: critical: rework test
Cleanup test layout and documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Anas Nashif b90fafd6a0 kernel: remove unused offload workqueue option
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Daniel Leung 67d220d5cd tests: latency_measure: disable pm for MEC1501 based boards
Disable power management for boards mec15xxevb_assy6853 and
mec1501modular_assy6885 on latency_measure test. This prevents
the SoC from sleeping which may skew the results. Also this
prevents stopping mid-test due to SoC being in sleep state,
and there are no external interrupts to wake up the SoC.

Fixes #24136

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-11 15:32:49 -04:00
Daniel Leung e3d9c282d2 tests: latency_measure: disable power management
Disable power management by setting CONFIG_SYS_POWER_MANAGEMENT=n
for this test. This is to prevent power management from
interfering with latency measurement.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-11 15:32:49 -04:00
Kumar Gala 8f0018663f drivers: pinmux: rv32m1: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Updated the openisa,rv32m1_vega-pinmux binding to require the label
property and updated the rv32m1.dtsi to add label properties for the
pinmux nodes.

Also update gpio_basic_api test to use DT_NODELABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-10 14:38:04 -05:00
Maureen Helm 9baf1760df boards: dts: Configure lpc flexcomm nodes as spi at the board level
Don't assume in the soc level device trees that flexcomm nodes will
always be configured as spi. Instead, configure flexcomm nodes at the
board level for lpcxpresso55s69 and lpcxpresso54114 boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-10 07:21:41 -05:00
Stephanos Ioannidis b73622dff0 tests: kernel: fp_sharing: Use ztest
This commit converts the `fp_sharing` tests to use the ztest framework.

In addition, this commit also introduces a behavioural change to run
the `pi` unit test separately from the `load_store` unit test, in order
to allow more manageable and diagnosable test execution.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-10 11:43:05 +02:00
Stephanos Ioannidis 74e43a3103 tests: kernel: fp_sharing: Reorganise tests
The `fp_sharing` testsuite consists of two tests: `load_store` and
`pi`.

This commit reorganises the two tests into separate files and refactors
the common parameters into the `test_common.h` header file.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-10 11:43:05 +02:00
Robert Lubos 073ec8d4aa net: mqtt: Refactor because of timeout overhaul
Align MQTT with timeout API changes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-09 21:58:42 +03:00
Kumar Gala 35cad0884a dts: soc: atmel: sam: cleanup node labels to match SoC docs
Update dts files to use node labels that match Atmel SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 09:02:19 -05:00
Jukka Rissanen 7e56d90ccd tests: net: route: Fix timeout data type
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 19d7031d15 tests: net: udp: Fix timeout value type
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 66d394d97a net: getaddrinfo: Fix timeout data type
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 38dd9bc299 net: mgmt: Refactor because of timeout overhaul
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 005ee2f768 net: ipv6: nbr: Refactor because of timeout overhaul
Convert minimal parts to support k_timeout_t values.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 63a7b92fd8 net: if: Refactor because of timeout overhaul
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen e56fa75ade net: context: Refactor because of timeout overhaul
The net_context API will change, the s32_t timeout parameter
will be changed to k_timeout_t. All the Zephyr users of this API will
be changed in subsequent commits. This is internal Zephyr API only,
so the API is not deprecated etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 9f17c33b60 net: sockets: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 5cf75fe091 net: websocket: Refactor because of timeout overhaul
Mention in websocket API documentation that the timeout value
is in milliseconds. Check timeout values properly using K_TIMEOUT_EQ()
macro.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen a49741ff66 net: dns: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Martí Bolívar 63d5529a0d devicetree: re-work DT_INST_FOREACH()
Due to the use of UTIL_EVAL*() macros, the UTIL_LISTIFY() macro used
by DT_INST_FOREACH(foo) can cause long build errors when there is a
build error in the expansion for "foo". More than a thousand lines of
build error output have been observed for an error in a single line of
faulty C.

To improve the situation, re-work the implementation details so the
errors are a bit shorter and easier to read. The use of COND_CODE_1
still makes the error messages quite long, due to GCC generating notes
for various intermediate expansions (__DEBRACKET,
__GET_ARG_2_DEBRACKET, __COND_CODE, Z_COND_CODE_1, COND_CODE1), but
it's better than the long list of UTIL_EVAL notes.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-08 09:00:38 -05:00
Song Qiang b74cad5a5d test: dma: Fix k_sleep() parameter error
Sleeping milliseconds should use k_sleep(K_MSEC(x)) rather than
k_sleep(x).

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2020-04-08 08:43:23 -04:00
Ioannis Glaropoulos 56a09428e1 tests: arch: arm: interrupt: add test-case for spurious exception
We add a simple test case to verify the behavior
of z_arm_exc_spurious handler. We use the SysTick
interrupt for that so the test is enabled for
platforms that have but do not use the SysTick.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-04-07 09:57:12 -05:00
Peter Bigot 8bd676ed38 sys: onoff: generalize and shorten API
The original API was misnamed, as the intent was to provide a manager
that decoupled state management from the service that needed to be
turned on or off.  Update all the names, shortening them where
appropriate removing unncessary internal components like _service.

Also remove some API that misled developers into believing that onoff
managers are normally expected to be exposed directly to consumers.
While this is a use case, in most situations there are service or
client-specific actions that need to be coupled to transition events.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-06 16:41:41 +02:00
Peter Bigot fadd98aad2 sys: add generic asynchronous notification infrastructure
k_poll() for a signal is often desired for notification of completion
of asynchronous operations, but there are APIs where it may be
necessary to invoke "asynchronous" operations from contexts where
sleep is disallowed, or before the kernel has been initialized.
Extract the general notification solution from the on-off service into
a utility that can be used for other APIs.

Also move documentation out to a resource management section.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-06 16:41:41 +02:00
Krzysztof Chruscinski e2ca46c329 sys: onoff: Move transition functions out of service struct
Extracted transition functions from onoff structure to external one
which allows to keep them in flash.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-06 16:41:41 +02:00
Carles Cufi 0f9b3626c1 boards: nrf52_pca20020: Rename to thingy52_nrf52832
The board name for the Thingy:52, so far known as nrf52_pca20020, is
renamed to thingy52_nrf52832.  Its documentation and all references to
its name in the tree are updated accordingly. Overlay and configuration
files specific to this board are also renamed, to match the new board
name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi 233d6c87e6 boards: nrf52840_pca10059: Rename to nrf52840dongle_nrf52840
The board name for the nRF52840 Dongle, so far known as
nrf52840_pca10059, is renamed to nrf52840dongle_nrf52840. Its
documentation and all references to its name in the tree are updated
accordingly. Overlay and configuration files specific to this board are
also renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi fe3d74cd50 boards: nrf52833_pca10100: Rename to nrf52833dk_nrf52833
The board name for the nRF52833 DK, so far known as nrf52833_pca10100,
is renamed to nrf52833dk_nrf52833. Its documentation and all
references to its name in the tree are updated accordingly.
Overlay and configuration files specific to this board are also
renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi 205cf1595e boards: nrf52810_pca10040: Rename to nrf52dk_nrf52810
The board target for emulation of nRF52810 on nRF5DK, so far
known as nrf52810_pca10040, is renamed to nrf52dk_nrf52810.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi 6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Kumar Gala 6c6c1010bb drivers: counter: imx_epit: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Also update counter_basic_api test to use DT_INST and remove the
udoo_neo_full_m4.conf as its not longer needed since the per instance
Kconfig sybmols don't exist anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-04 09:34:00 -05:00
Kumar Gala f4b61c5505 drivers: gpio: gpio_imx: Convert driver to new DT_INST macros
Convert driver to use DT_INST macros and remove related board per
instance Kconfig symbol usage.

Additionally remove udoo_neo_full_m4.conf from gpio_basic_api test since
the Kconfig symbols don't need to be set anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-04 09:34:00 -05:00
Johan Hedberg 71eb56a34c net: buf: Move LEGACY_TIMEOUT_API selection to specific subsystems
The net_buf subsystem is now fully compatible with the new timeout
API, so move the selection of the legacy API to those specific
subsystems that use net_buf and still need converting.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-03 23:17:53 +03:00
Joakim Andersson 3baccee472 Bluetooth: tests: Add additional build configurations
Add additional build configurations to the shell to catch build errors
when enabling extended advertising.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-03 21:13:14 +03:00
Andrzej Głąbek 0b300da221 tree-wide: Remove assignments to Kconfig options unused in nRF drivers
Kconfig options that enable I2C and SPI instances are no longer used
in nRF drivers. Remove all assignments done to these options in related
board definitions, samples, and tests.

For nrf52_pca20020, also no longer needed setting of default values
for GPIO_SX1509B* options is removed (now the gpio_sx1509b driver is
enabled by default when a corresponding devicetree node is enabled).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Andrzej Głąbek 97b07b943a drivers/serial/Kconfig.nrfx: Choose driver type basing on DT compatible
Remove prompts from Kconfig options `UART_x_NRF_UART*` that select
the type of nrfx driver (for UART or UARTE peripheral) to be used
for a given instance. This prevents the options from being modified
from configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding UART node in devicetree.

This eliminates the need of changing both the "compatible" property in
devicetree and the Kconfig option selecting the driver type when a user
wants to switch between UART and UARTE for a given instance.

Since all `UART_x_NRF_UART*` options are made "hidden" by this commit,
all their occurrences in configuration files are removed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Robert Lubos 1fb418df4c net: ieee802154_radio: Allow to specify TX mode
Even though radio driver can report in its capabilities that it does
support CSMA CA, there's no way in the driver to select how the frame
should be transmitted (with CSMA or without). As layers above radio
driver (Thread, Zigbee) can expect that both TX modes are available, we
need to extend the API to allow either of these modes.

This commits extends the API `tx` function with an extra parameter,
`ieee802154_tx_mode`, which informs the driver how the packet should be
transmitted. Currently, the following modes are specified:
* direct (regular tx, no cca, just how it worked so far),
* CCA before transmission,
* CSMA CA before transmission,
* delayed TX,
* delayed TX with CCA

Assume that radios that reported CSMA CA capability transmit in CSMA CA
mode by default, all others will support direct mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-03 14:07:41 +03:00
Kumar Gala 2535f81b76 devicetree: add DT_CHILD()
Helper macro to get a node_id for a child node of a given node_id.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-02 06:41:58 -05:00
Markus Becker e5912b074a boards: arm: Align YAML files nrf52840_pca10059 and nrf52840dk_nrf52840
PWM and other flags were missing for PCA10059.
Aligned also RAM and Flash while comparing the files.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-04-02 09:32:27 +02:00
Stephanos Ioannidis 3a405409c5 tests: kernel: interrupt: Enable nested interrupt test for Cortex-R
This commit enables nested interrupt test for the Cortex-R platforms
that use the ARM Generic Interrupt Controller (GIC).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-02 09:22:38 +02:00
Johan Hedberg b3f39226ec net: tests: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() or K_MSEC() macros to pass a timeout to
k_sleep() and other kernel APIs.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Johan Hedberg 31ad7b455b Bluetooth: tests: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Martí Bolívar a3fae2f153 devicetree: add DT_COMPAT_ON_BUS()
And implement DT_ANY_INST_ON_BUS() in terms of it.

This makes some error messages quite a bit shorter by avoiding
UTIL_LISTIFY(), which has a nasty temper and tends to explode if not
treated gently.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-31 21:11:13 -05:00
Kumar Gala a5375ead0c tests: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 19:31:20 -05:00
Daniel Leung 7bb5015ced tests: benchmarks: use high-res counter for MEC1501 SoC
The timer counter for ticks on MEC1501 SoC is based on the RTOS
timer which runs at 32kHz. This is too slow for timing benchmarks
as most cases can be finished within one or two ticks. Since
the SoC has higher frequency timers running at 48MHz, add
the necessary bits to use these for timing benchmarks.

Fix #23414

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-03-31 19:52:21 -04:00