Commit graph

41120 commits

Author SHA1 Message Date
Anas Nashif
6915adf899 sanitycheck: add option for report suffix
Add option --report-suffix to append custom string to all generated
files. This is going to be useful for generating results for a specific
version, i.e. --report-suffix zephyr-v2.2.0-1814-ge737761d23

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-22 14:21:05 -04:00
Andy Ross
12bd187003 kernel/timeout: Check for K_FOREVER in z_add_timeout()
The "forever" token has always been interpreted above z_add_timeout()
(because it's always taken ticks, but K_FOREVER used to be in ms).
But it was discovered that k_delayed_work_submit_to_queue() was never
testing for this and passing a raw K_FOREVER down, where it got
interpreted as a negative timeout and caused it to fire at the next
tick.

Now that we actually see the original k_timeout_t here, we might as
well check it locally and do the correct thing (that is, nothing) if
asked to schedule a timeout that will never fire.

Fixes #24409

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-04-22 11:10:17 -07:00
Jukka Rissanen
291a4b2bd1 net: tcp2: Parse TCP options only once
Make sure we only parse the received TCP options only once. Store
the options to tcp conn struct for later use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-22 20:40:02 +03:00
Kamil Rakoczy
415065a5f3 Sensor: ADXL345: Fix ADXL345 driver
Fixes problems with ADXL345 3-axis I2C accelerometer
reported in #23577, #23581 and #23584.

Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
2020-04-22 19:28:47 +02:00
Kamil Rakoczy
f0ffe33dfe Sensor: ADXL345: Fix ADXL345 device address
Fixes bad device address passed to i2c_reg_write_byte/i2c_reg_read_byte.

Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
2020-04-22 19:28:47 +02: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
Stephanos Ioannidis
b0041fc58c modules: cmsis: Add CMSIS-DSP configurations
This commit introduces the Kconfig configurations for the CMSIS-DSP
digital signal processing library.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Stephanos Ioannidis
d687836d6c west.yml: Update CMSIS module for CMSIS-DSP 1.8.0
This commit updates the west.yml to pull in the newly added CMSIS-DSP
1.8.0 library.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 12:08:28 -05:00
Kumar Gala
6784558b22 arch: xtensa: replace DT_CPU_CLOCK_FREQUENCY with new dt macros
Replace DT_CPU_CLOCK_FREQUENCY with a PATH based reference to cpu@0
(DT_PATH(cpus, cpu_0)) and than getting the clock_frequency property:

DT_CPU_CLOCK_FREQUENCY -> DT_PROP(DT_PATH(cpus, cpu_0), clock_frequency)

This lets us remove DT_CPU_CLOCK_FREQUENCY from dts_fixup.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-22 11:38:33 -05:00
Henrik Brix Andersen
b29c15ed09 drivers: gpio: mcux_igpio: fix infinite loop
Avoid entering an infinite loop when configuring the the IGPIO IRQ.

Fixes 50129f8dd7
Fixes #24579

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-04-22 12:27:11 -04:00
Peter Bigot
cc3ccef40d samples: nrf: battery: add documentation
Provide a description of the sample and how it works with different
power supply source configurations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 17:46:07 +02:00
Peter Bigot
628bd00168 samples: nrf: battery: extend to support measuring Vdd directly
When the system is powered directly a measurement of Vdd provides the
battery voltage.  This requires a different ADC configuration and
level curve.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 17:46:07 +02:00
Krzysztof Chruscinski
10d15d185b drivers: timer: nrf_rtc: Refactor alarm setting
User reported a flaw in the current algorithm which fails when Zero
Latency Interrupts (ZLI) are used. Ported algorithm from
counter_nrfx_rtc.c which covers all cases. Algorithm is lockless so
no distinction for ZLI is needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-04-22 17:45:07 +02:00
Bilal Wasim
b18b1d4350 boards/arm: Adding support for nRF9160 InnBlue22 Board.
Adding support for nRF9160 based InnBlue board V2.2. Supports both
Secure and Non-Secure configurations along with various sensors
(lis2dh12 / hts221) and devices(i2c / pwm).

Signed-off-by: Bilal Wasim <bilalwasim676@gmail.com>
2020-04-22 17:44:25 +02:00
Stephanos Ioannidis
497979f422 west.yml: Update hal_atmel to fix SAMV71 GMAC headers
This commit updates `west.yml` to point to the `hal_atmel` commit that
fixes the incorrect GMAC priority queue register offsets for SAMV71.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-22 17:42:07 +02:00
Peter Bigot
9f68178fe1 doc: reference: terminology: refine API attributes
The original description for isr-ok allowed the function to return an
error if called from an interrupt context, rather than doing its job.
This led to complex descriptions like "isr-ok but not sleep" to
indicate that the function could be called from thread or interrupt
context without visible behavior changes, including returning an
error based on calling context.

Remove the special terminology for cases where a function returns an
error (rather than causing undefined behavior) when invoked from an
interrupt or pre-kernel.  Redefine isr-ok to indicate that the call
does what it's supposed to do regardless of interrupt or thread
context, delegating the description of allowed behaviors to the API
documentation (which should explicitly note when it's allowed to fail
to perform in non-thread context).

This also makes more clear that isr-ok applies to functions regardless
of whether they can cause an invoking thread to context switch.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 17:39:56 +02:00
Vincent Wan
eb78c3ff6c samples: system_off: turn off external flash
To obtain lower power measurements in general, we should turn off the
external flash which is on by default at boot.

Code is modeled based on examples shipped in the TI SimpleLink SDK.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-22 17:39:47 +02:00
Vincent Wan
d751d5674a samples: cc13x2_cc26x2: add system off power example
Adding an example that exercises the sleep modes, then powers off the
system by going into deep sleep.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-22 17:39:47 +02:00
Vincent Wan
5c9e51e402 Kconfig: override min default residency values for cc13xx/cc26xx
Set the default value of SYS_PM_MIN_RESIDENCY_SLEEP_1 and
SYS_PM_MIN_RESIDENCY_SLEEP_2 to something more reasonable for these
platforms, as the latency of entering/exiting these sleep modes
is low.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-22 17:39:47 +02:00
Vincent Wan
5d1b3613d9 soc: cc13x2_cc26x2: unlatch IO pins after waking up from shutdown mode
In order for IO pins to work correctly after waking up from shutdown
mode, we need to unlatch them given they were automatically latched
when Power_shutdown() was invoked.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-22 17:39:47 +02:00
Vincent Wan
e075ff3a38 soc: cc13x2_cc26x2: add support for deep sleep mode #1
Implement deep sleep mode #1 using the shutdown state on the
CC13x2/CC26x2.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-04-22 17:39:47 +02:00
Sven Herrmann
c0989718e7 sample: sensor: mpr: Add MPR sample application
The sample reads pressure data from an MPR sensor and prints it to the
console.

Signed-off-by: Sven Herrmann <sven.herrmann@posteo.de>
2020-04-22 17:39:31 +02: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
Aurelien Jarno
298df51c0c drivers: pinmux: stm32l4: Add extra pins for I2C1
Add I2C1 SDA/SCL configuration on pins PA9 and PA10, as they are
currently only available on other pins.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2020-04-22 17:39:12 +02:00
Christian Taedcke
e6071b4bbb boards: efm32/efr32: Enlarge storage_partition for nvs sample
The nvs sample requires a storage_partition of 3 flash pages, but these
boards only provided 2 flash pages. Because of this the nvs sample
failed.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-04-22 17:38:42 +02:00
Johann Fischer
c15d27fb6d samples: wpan_serial: relax wait-for-dtr loop
Relax wait-for-dtr loop and give CPU resources to
low priority threads like logging.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-04-22 17:37:27 +02:00
Johann Fischer
8220f61eaf samples: wpan_serial: enable USB during sample initialization
Application is reponsible to enable USB.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-04-22 17:37:27 +02:00
Immo Birnbaum
f88923a2ff drivers: serial: Xilinx UART run-time config, interrupt functionality
The driver was extended so that the tests/drivers/uart/uart_basic_api
test case now passes. The following modifications were made for the
following items of the test case:

* test_uart_configure
* test_uart_config_get

The driver was missing the support to re-configure the UART at run-time
as well as to obtain the current configuration at run-time via the
.configure and .config_get hooks provided within the UART driver API.
For the flow control setting, bit (mask) definitions were added for the
Modem Control Register. Both the configuration get and set functions
come with auxiliary functions that convert configuration register bit
masks to the UART driver API's enumeration types and vice versa.

For run-time configurability, the device's data struct is required un-
conditionally, previously, it was only available whenever interrupt-
driven mode was enabled. Consequently, the device initialization was
simplified to a single call of the DEVICE_AND_API_INIT macro, as the
existance of the device's data struct is now no longer conditional.

* test_uart_fifo_fill

For the user callback function of the test case to receive the initial
'Ready to TX' indication upon which the TX FIFO is filled, it is
necessary that uart_xlnx_ps_irq_tx_enable also sets the TX FIFO empty
bit in the Interrupt Enable Register. Consequently, the same modifi-
cation applies to the irq_tx_disable function.

* test_uart_fifo_read

During inital device configuration, the RX FIFO interrupt trigger
level has to be set to 1 byte for now, as the test case doesn't poll
the incoming data in a while()-loop, therefore, it misses the CR/LF
if more than one character is in the RX FIFO at the time of the
interrupt and neither CR nor LF is the first character.

Whenever the state of an interrupt is checked by the user callback
function (uart_xlnx_ps_irq_tx_ready, uart_xlnx_ps_irq_rx_ready),
the corresponding bits are cleared in the Interrupt Status Register,
re-enabling interrupts generated by the corresponding source.

Tested on QEMU (R5, A9) and actual Zynq7000 hardware.

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2020-04-22 17:36:58 +02:00
Immo Birnbaum
80647b583f drivers: serial: Xilinx UART driver interrupt support feature flag
Added the SERIAL_SUPPORT_INTERRUPT feature flag to the driver's
configuration file. This flag was missing, although the driver
supports interrupt-driven operation.

Interrupt support is required for testcases using the UART_PIPE
feature on the upcoming Cortex-A9 targets (QEMU/Zynq-7000).

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2020-04-22 17:36:58 +02:00
Immo Birnbaum
24f3bce4f3 drivers: serial: Xilinx UART driver IRQ connect macro fix
Fix for the UART_XLNX_PS_IRQ_CONF_FUNC macro, which wraps IRQ_CONNECT
into a function for each device instance. This macro had device
instance #0 hardcoded at one point.

Interrupt support is required for test cases using the UART_PIPE
feature on the upcoming Cortex-A9 targets (QEMU/Zynq-7000).

Signed-off-by: Immo Birnbaum <Immo.Birnbaum@weidmueller.com>
2020-04-22 17:36:58 +02:00
Andrei Emeltchenko
80f295a9dd boards: up_squared_adsp: Add flasher script
Add script signing and flashing up_squared_adsp board. Can be used:

$ west flash \
<zephyr>/boards/xtensa/up_squared_adsp/tools/up_squared_adsp_flash.sh

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-04-22 17:36:30 +02:00
Artur Lipowski
e934914dcc api: Fix internal log macros to allow use of U suffix in LOG_LEVEL_N.
Internal macros like _LOG_XXXX0 use preprocessor ## and LOG_LEVEL_N
to conditionally generate code.
After addition of U suffixes to LOG_LEVEL_N macros the internal macros
also need update to versions with suffix i.e. _LOG_XXXX0U

Signed-off-by: Artur Lipowski <artur.lipowski@hidglobal.com>
2020-04-22 17:36:07 +02:00
Artur Lipowski
d66758dca3 api: Fix warinings about signed integer usage in LOG_XYZ macros.
Static analyzer (clang-tidy) complains about using  signed integer
operand with a binary bitwise operator in LOG_XYZ macros.

Signed-off-by: Artur Lipowski <artur.lipowski@hidglobal.com>
2020-04-22 17:36:07 +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
736860ac90 drivers: hwinfo: update mcux-sim implementation byte order
Following the practice for i.MX decoding assume the 32-bit identifier
values need to be converted to big-endian representation for
device-independent interpretation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 17:31:56 +02:00
Peter Bigot
1668c21e17 drivers: hwinfo: update i.MX implementation byte order
Resources indicate that CFG2 holds the upper 32 bits, and CFG1 the
lower 32 bits, of a 64-bit unique identifier.  Store it in big-endian
format so it reads correctly when accessed as a byte sequence.

https://community.nxp.com/docs/DOC-94459

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-22 17:31:56 +02:00
Martí Bolívar
a95e7c5424 drivers: uart: nordic: move to new DT API
Keep existing Kconfig in place.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-22 17:27:42 +02:00