Commit graph

5068 commits

Author SHA1 Message Date
Kumar Gala d929e874c2 boards: dts: nrf: Remove SoC compatible in top-level compatible
The SoC node has compatibles for the specific SoC in place, having the
same compatible at the top level is technically a conflict and the
top-level one should really just be about the board.  Remove the SoC
related compatibles at the top-level.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 08:20:15 -05:00
Jose Alberto Meza 53c8bea659 samples: drivers: espi: Fix coverity issue
Update variable according to new gpio API.
Fixes #23575

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-04-29 00:11:48 +02:00
Joakim Andersson e9375a2814 Bluetooth: Remove bluetooth thread stack size analysis
Remove logging of individual threads spread out throughout the
bluetooth subsystem. The stacks can be analysed by enabling the
following options.

CONFIG_THREAD_ANALYZER=y
CONFIG_THREAD_ANALYZER_AUTO=y
CONFIG_THREAD_ANALYZER_RUN_UNLOCKED=y
Optional:
CONFIG_THREAD_NAME=y

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-28 09:11:13 -04:00
Joakim Andersson e0d38bf6a1 Bluetooth: samples: hci_uart: Add debug configuration using RTT
Add debug configuration to easily enable logging through RTT. Required
to use RTT since the UART is otherwise used for the h4 UART driver.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-28 09:11:13 -04:00
Paul Sokolovsky 0be812717d samples: posix: eventfd: Sample application for eventfd() call.
Roughly based on eventfd example code from Linux manpages. Similarly
to other POSIX-compatible sample, Makefile.posix is provided to build
the code on a POSIX system (in this case, as eventfd() is
Linux-specific, this has to be a Linux system).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-28 09:57:41 +03:00
Stephanos Ioannidis 460cb7880c samples: net: Rename local PORT definition
This commit renames all local definitions with the name `PORT` in the
net samples, 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
Antony Pavlov 3d35a8dde5 samples: conf: don't enable option twice
Remove enabling of the same option twice.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2020-04-25 13:39:17 -05:00
Kumar Gala dbeb3ba32e drivers: spi: spi_sam: rework device tree support
Reworked spi_sam driver to utilize new DT_INST macros as part of
this rework we also now get pin ctrl/mux configuration information
from the device tree instead of via Kconfig and defines in soc_pinmap.h

We remove defines from dts_fixup.h and soc_pinmap.h and associated
Kconfig symbols that are no longer needed due to getting all that
information from devicetree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05: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
Mark Olsson 6b593a51d2 samples: drivers: kscan: Add sample for touch panel drivers
Simple sample to test touch panel drivers.
Outputs a message to the console on every touch event.

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Kumar Gala 5dbfbbcfa9 samples: sensor: bq274xx: Fix platform whitelist
The sensor is on the nrf9160_innblue22 not nrf9160_innblue21.  This
causes CI build failures since there is no dts node for the sensor
on the nrf9160_innblue21 board.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 18:39:20 -05:00
Kumar Gala 22e65cb9ba gpio: mcux: Convert convert to DT_INST defines
Convert driver to use DT_INST_ defines.  As part of this conversion we
remove the Kconfig options for per GPIO controller enables and instead
get that information from device tree.  This means we now disable each
GPIO controller by default in the DTS and have each board dts enable the
GPIO controller ports it needs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 17:07:41 -05:00
Parthiban Nallathambi 25bc61de39 samples: sensor: bq274xx remove innblue overlay
board support nrf9160_innblue22 includes the sensor in
nrf9160_innblue22_common.dts, explicit overlay can be removed

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2020-04-23 16:23:26 -05:00
Kumar Gala a3ec95caef drivers: gpio: gpio_sam: Convert to DT_INST
Convert driver to use new DT_INST macros throughout.  We update one
sample app to use a nodelabel reference.  We also remove defines in
dts_fixup.h as they are no longer needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-23 05:59:50 -05:00
Lingao Meng be33f913ac Bluetooth: Mesh: Remove net_idx params when with app key
According Mesh Profile 1.0.1. A application key shall
binding single network key. And Device key shall bind all
network key, and dev key only known by cfg_cli and node self,
only used by cfg_cli & cfg_srv.

Fixes: #21088

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-04-23 11:30:41 +03:00
Jose Alberto Meza 3bb73adbea samples: drivers: espi: Showcase eSPI flash read/write API
Extend sample code to demonstrate the eSPI API to read/write flash.
Remove trailing \n
Use LOG_ERR when applicable instead of LOG_WRN
Treat warnings as errors.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-04-22 22:21:54 +02: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
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
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
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
Erwan Gouriou 81f27c2265 boards: stm32: Use dt API for serial peripheral configuration
Replace use of Kconfig UART_X symbols by calls to DT API.
Clean driver from symbols definitions

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-20 15:27:56 -05:00
Luiz Augusto von Dentz c66bb21a35 Bluetooth: hci_uart: Make use of CONFIG_BT_HCI_RAW_H4
This selects CONFIG_BT_HCI_RAW_H4 which indicates to hci_raw to handle
H:4 header automatically.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Luiz Augusto von Dentz 4b622afbb3 Bluetooth: hci_raw: Move buffer management to common place
This makes hci_raw to manage RX and TX buffers so its logic don't have
to be replicated on each an every driver/application, it also makes it
simpler to deal with extra headers for H:4 mode since that then can be
done at earlier at buffer allocation.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Luiz Augusto von Dentz b4e71014f2 Bluetooth: hci_usb: Add implementation of Read/Set USB Transport Mode
This implements Read/Set USB Transport Mode in the Bluetooth class.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Luiz Augusto von Dentz 33cb1cc399 Bluetooth: hci_usb_h4: Add sample for USB_PID_BLE_HCI_H4_SAMPLE
This sample select CONFIG_USB_PID_BLE_HCI_H4_SAMPLE to use H4 over bulk
endpoints.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Luiz Augusto von Dentz 2534ab11c0 USB: Add driver and PID for Bluetooth H4
This adds USB_PID_BLE_HCI_H4_SAMPLE along with it driver which uses H4
over bulk endpoints.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Kumar Gala adf3c236fc drivers: video: mcux_csi: Convert driver to DT_INST macro
Convert from using dts_fixup.h based macros to DT_INST macro.  This lets
us remove the dependancy on dts_fixup.h for this driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-20 11:08:46 -05:00
Martin Jäger 8870a699dc samples: drivers: dac: Add API example
This example generates a sawtooth signal to show how to use the DAC.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-04-20 17:41:48 +02:00
Andrzej Puzdrowski 8579d9f371 samples/susbys/mgmt/mcumgr/smp_svr: add nrf5 configs
Added default configuration files for nrf5 boards so the sample
is building with expected features for these boards.

Would be greater to use OVERLAY_CONFIG instead of files addition,
but that doesn't work from CMakeLists.txt scope.

fixes #24442

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-04-20 15:57:52 +02:00
Wayne Ren 470a48484f arch: arc: move ARC normal related configurations out of board dir
Now the ARC SecureShield related features are experimental. The ARC
normal application cannot run alone, need the secure service example to
initialize the context and boot.

Here move ARC normal related configurations out of board dir to
avoid the impact of CI test and the confusion to users.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-04-20 15:42:26 +02:00
Martí Bolívar aea96bca25 samples: watchdog: 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
Flavio Ceolin b41583d7d5 samples: espi: Follow API changes
Change the sample to follow espi API changes to pass structs by
reference.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-04-17 10:33:02 -07:00
Mikkel Jakobsen 90f005bc2f samples: subsys: mgmt: smp_svr: enable FS commands
During the last refactoring of the sample, CONFIG_MCUMGR_CMD_FS_MGMT
was mistakenly set to n instead of y for the bluetooth transport.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 17:45:52 +02:00
Mikkel Jakobsen a518516d5d samples: subsys: mgmt: smp_svr: add udp sample
This sample now supports SMP UDP transport.
Two config overlays have been added for ipv4 and ipv6, respectively.

The sample documentation has been completely revamped to be less
bluetooth focused and more general.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 10:16:25 +03:00
Mikkel Jakobsen 6113bc6282 samples: subsys: mgmt: smp_svr: refactor sample
To prepare this sample supporting future SMP transports, the sample
code is now split into a main and bluetooth file. A common config
has been identified and application specific config is put into
overlay config files.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 10:16:25 +03:00
Bjarne Steinsbo 4034ef0633 boards: arm: black_f407ve: Add support for on-board SPI flash
This board contains an on-board Winbond W25Q16.
The chip is connected to spi1 using PB3-PB5 and PB0 as CS.

Signed-off-by: Bjarne Steinsbo <bjarne@gmail.com>
2020-04-15 13:15:29 -05: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
Erwan Gouriou 9985713fd0 samples/drivers/led_*: Remove usage of CONFIG_I2C_X on stm32 boards
Remove usage of Kconfig symbols I2C_X and rely on overlay
to enable i2c instances in samples for stm32 boards

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-04-15 08:21:30 -05:00
Joakim Andersson 18bee9178f Bluetooth: host: Add non-connectable directed advertising support
This patch introduces two major changes to the directed advertising
feature of the bluetooth host.

Deprecating the bt_conn_create_slave_le, and removing
bt_conn_le_create_slave which has never been released. This behaviour
has now been moved by to providing the peer direct address into the
advertising parameters.

Introducing directed advertising support for nonconnectable
directed extended advertising, both scannable and non-scannable.

A bug was also fixed in the the directed-adv command in the shell
when the argument "low" was given. The advertiseng parameter pointer
declared with BT_LE_ADV_CONN_DIR_LOW_DUTY was declared in a scope that
was no longer valid when it was used to start the advertiser.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-15 10:57:38 +03:00
Kumar Gala 5a149dfca6 drivers: serial: uart_mcux: Convert to DT_INST
Convert driver to use new DT_INST macros throughout.  Removed per
instance Kconfig symbols and replaced with DT_NODELABEL references where
needed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-14 17:52:31 -05:00
Martí Bolívar 24260e6c3a samples: bme280: enable the appropriate bus by default
I personally don't find it very useful to have to maintain prj.conf
and prj_spi.conf for this sample. The information we need to make
this application "just work" with regards to the bus is available in
the devicetree, and Kconfig can now access it using
dt_compat_on_bus().

Do so, enabling I2C and SPI appropriately when a sensor of the right
type is on either of those buses.

If no sensors are enabled, the user gets the build-time error message
in main.c about no devices being found.

This approach is prone to the "stuck symbol" Kconfig problem covered
in our documentation, so a pristine build is necessary to change the
default settings from a previous build.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-14 10:38:10 -05:00
Martí Bolívar 1d1ed154da samples: bme280: update to new DT API
Use instance zero of the compatible to get the device instead of
fixing a label. Print the used label for help debugging, and the
results of finding the device (or not), with a hint about what might
have gone wrong in case of failure.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-14 10:38:10 -05:00
Martí Bolívar 06d50c673d samples: bme280: nrf52840 DK: set LSB in i2c addr
The nrf52840-DK doesn't have this sensor built-in, so it's likely
users will be getting this sensor from a breakout board. The ones that
Sparkfun and Adafruit sell pull up the LSB address pin, so the default
address is 0x77 on those boards.

Let's follow along with them instead of using 0x76, because those are
the boards that come up first in the results when you google "BME280
breakout board" from where I'm sitting.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-14 10:38:10 -05:00
Martí Bolívar 18ba133dcb samples: bme280: enable sensor logging
This helps debug issues with the device. Samples should try to be
helpful to first-time users. Send printk() to logging so it doesn't
fight over the UART.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-14 10:38:10 -05:00
Andrei Emeltchenko 4215968b74 samples: philosophers: Fix extra_args not used
Fixed extra_args parameter DEBUG_PRINTF in sample.yaml not used.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2020-04-14 08:00:12 -04:00
Richard Osterloh 3f8c83a591 boards: adafruit_feather_stm32f405: Add SPI flash
Added SPI flash definition on SPI1.

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-04-13 11:53:59 -05:00
Parthiban Nallathambi 25d58193d0 samples: sensor: bq274xx: Add BQ27421 sample application
Add bq274xx sample with reading and showing all
possible values from the 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
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
Anas Nashif acc0e9025d samples: philosophers: evaluate variables coming from command line
The variables passed by sanitycheck and west were being ignored because
cmake knows nothing about them.

Fixes #24178

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 09:53:36 -04:00
Jose Alberto Meza aad8ad915d samples: drivers: espi: Enable OOB channel explicitly
Sample showcase OOB transaction, enable OOB channel explicitly.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-04-11 15:30:27 -04:00
Daniel Leung 2e7831562a samples: mec15xxevb_assy6853/pm: shorten wait after deep sleep
The origin for sleeping for 3ms after coming out of deep sleep
was to wait for PLL to lock so that UART would not send
garbage characters due to incorrect clock. In the deep sleep
code, it spins to wait for the PLL to lock so there is no need
to wait for 3ms in the app. So shorten it like other busy wait.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-10 07:48:33 -04:00
Daniel Leung fd1d93e552 samples: mec15xxevb_assy6853/pm: abort threads before reuse
Threads are being re-used for multiple runs, so it is better to
stop the threads before reusing the variables for new threads.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-10 07:48:33 -04: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
Paul Sokolovsky 8eac618cba samples: big_http_download: Add automated-CI friendly sanitycheck config
This application was initially intended to be a manual, interactive
sample, run by a user. However, it's also a useful real-world
integration test, to be run in automated CI systems. So, provide
a config suitable for such a usage: use local host machine as a
server (to not depend on availability and characteristics of an
Internet connection), and have a concrete completion criteria
(by limiting number of iterations; given that performance of TCP
is not to be not too high, limit it to just 1 for now).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Paul Sokolovsky 761aa6c52b samples: big_http_download: Allow to configure number of iterations
Initially, this was intended to be a sample for manual "burnout"
testing, e.g. see if a device with it can run for 24hrs, or download
1GB of data, or similar.

It's however also useful for automated CI testing, but then we need
to have more specific completion criteria. So, allow to specify
number of download iterations via local Kconfig.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Paul Sokolovsky 2dd38a7e88 samples: big_http_download: Allow to configure URL via Kconfig
To streamline management of multiple test configurations (which
now can go into separate config/overlay files instead of patching
source).

Note that now that this option is introduced, it must be set to
a correct value for any Zephyr config, thus we set it in
overlay-tls.conf. But the sample also supports building under a
POSIX environment (using Makefile.posix), which doesn't use
Zephyr's config system, so suitable defaults still should be
present in the C source file.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-09 18:40:03 +03:00
Torsten Rasmussen 0e31656e67 cmake: fixed issue with invalid usage of APPLICATION_SOURCE_DIR
Fixes: #24158

The shell/fs sample was using APPLICATION_SOURCE_DIR before it has been
defined.

This has now been fixed to use the proper way of overlaying board
specific settings using boards folder.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-09 16:57:30 +02: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
Maureen Helm 4219b63949 samples: sensor: Add lpcxpresso55s69 to fxos8700 accel-only test
The lpcxpresso55s69 board has an mma8652 accelerometer which is
compatible with the fxos8700 driver in accel-only mode. Now that this
board has an i2c driver, include it in the platform whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-09 08:52:13 -05:00
Jukka Rissanen 88d1d43842 samples: net: zperf: 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 92e8422a40 samples: net: big_http_download: Fix to use proper data type for sleep
Needed because of k_timeout_t conversion

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen a85d1e0e74 samples: net: syslog: Fix to use proper data type for sleep
Needed because of k_timeout_t conversion

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen da2488d96e samples: net: net_mgmt: Fix compile issues from timeout overhaul
Feed proper time delay parameter to K_THREAD_DEFINE()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 36b151c566 samples: net: echo_client: Fix compile issues from timeout overhaul
Use proper timeout value for poll()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen bfa3e80ca0 samples: net: echo_server: Fix compile issues from timeout overhaul
Feed proper time delay parameter to K_THREAD_DEFINE()

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 8c67575a08 samples: net: coap: Fix the timeout data type
Converting timeout to k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 0a8991773b samples: net: dumb_http_server_mt: Fix K_THREAD_DEFINE() call
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 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 1b04d44247 net: http: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.
Clarify the documentation of the timeout parameter that it is
in milliseconds.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen 8a9153678a net: sntp: Refactor because of timeout overhaul
Use 64-bit time in order to avoid overlaps, and do not use K_MSEC()
as that will convert to k_timeout_t which we do not want in this
case.

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
Torsten Rasmussen b5af13cbe8 samples/sensor/sensor_shell: removed deprecated set_conf_file
The samples/sensor/sensor_shell sample was introduced after deprecation
of set_conf_file and thus was not adopted to the new recommended board
conf file overlay.

This commit align this sample with the rest of Zephyr's samples.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-09 07:54:21 -05:00
Maciej Fabia ae285ef4e6 drivers: crypto: add driver for nRF ECB
add driver for nRF AES Electronic CodeBook (ECB) peripheral

Signed-off-by: Maciej Fabia <maciej.fabia@nordicsemi.no>
2020-04-08 16:20:53 +02:00
Peter Bigot 95435a546d samples: drivers: fix ps2 sample for timer api change
Sleep duration is given in integral milliseconds so use k_msleep()
instead of k_sleep().

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-07 16:39:08 -05:00
Loic Poulain f3c7329f8f sample: video: capture: video software generator fallback
Always try to fallback to video software pattern generator, allowing
to run the sample, even when there is no real sensor connected.
(e.g. mimxrt1064 without mt9m114).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-04-07 09:44:14 -05:00
Ioannis Glaropoulos 88bf06bb01 boards: arm: nrf5340_dk_nrf5340: rename target to nrf5340pdk_nrf5340
We rename the nRF53 Dev Kit board target (nrf5340_dk_nrf5340)
to nrf5340pdk_nrf5340. We update all associated references
in the supportive documentation and all nRF5340-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-04-06 15:21:45 +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 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
Gerard Marull-Paretas cf2131d7f9 boards: nucleo_h743zi: add pwm support
Enables PWM support using the built-in red LED. Tested with:

- samples/basic/blink_led
- samples/basic/fade_led

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-04-04 15:00:11 +02:00
Maureen Helm 98ec73b2c0 samples: sensor: Add a delay to the fxos8700 sample loop
The fxos8700 sample application configures the sensor driver to sample
data at 6.25 Hz. Most configurations use the sensor data ready interrupt
to throttle the loop, but it's possible to configure the sample not to
use the data ready interrupt. In this case, throttle the loop with a
delay so it doesn't outpace the sensor data.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-03 12:52:06 -05:00
Maureen Helm c2a6e23d37 samples: sensor: Refactor fxos8700 tests for accel-only boards
The frdm-kl25z, bbc_microbit, and reel_board have an mma8xxx
accelerometer and therefore must use the fxos8700 driver in
accelerometer-only mode instead of hybrid mode. Refactor these boards
into a separate test that uses the prj_accel.conf configuration as
described in README.rst.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-03 12:52:06 -05: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
Andrzej Głąbek cb0cb3f2e8 drivers/spi/Kconfig.nrfx: Choose driver type basing on DT compatible
Remove prompts from Kconfig options `SPI_x_NRF_SPI*` that select the
type of nrfx driver (for SPI, SPIM, or SPIS peripheral) to be used
for a given instance. This prevents the options from being modified
in configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding SPI 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 SPI, SPIM, and SPIS for a given instance.

Since all `SPI_x_NRF_SPI*` 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
Christian Taedcke 1bf5d24638 samples: drivers/entropy yaml regex fix
The last regex in the yaml file did not match when executing the test on
an embedded target. The expected two spaces are not present at the
beginning of the line.

Fixes #23919

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-04-03 08:00:38 -04: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
Peter Bigot ecf3bdb5b3 coccinelle: re-run timeout conversion semantic patch
Run the int_literal_to_timeout Coccinelle script to fix places where
it is clear that an integer duration is being passed where a timeout
value is required.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-02 19:47:51 +03:00
Andrzej Głąbek f57ec57ce5 samples/drivers/led_apa102c_bitbang: Wrap sleep time value in K_MSEC()
Align the parameter passed to `k_sleep` with the recent changes done
to timeout API.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-02 11:00:35 -05:00
Maciej Perkowski 2e879fae48 samples: drivers: soc_flash_nrf: enable 8-bit write block emulation
Updated sample config to allow  emulation of  8-bit write block.
(because the nRF Flash driver has changed its default write block size
 to  32-bit  aligned)

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-04-02 11:32:10 +02:00
Tomasz Bursztyka a497bfa455 samples/net: Enable power management statistics for frdm k64f
On echo server app only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-04-02 11:07:45 +03:00
Johan Hedberg a03a54f00c net: samples: 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
Johan Hedberg 7d4682e302 Bluetooth: samples: 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
Kumar Gala a44f4cf484 samples: sensor: sht3xd: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 666c39a3cb samples: basic: servo_motor: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 77450c950a samples: bluetooth: hci_uart: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala a027c94613 samples: net: wifi: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 0cd03a6ebe samples: net: gsm_modem: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 14903e49f0 samples: sensor: ti_hdc: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 1605c312a0 samples: sensor: tmp116: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala d270a07d1e samples: sensor: bme280: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 7908daf5ef samples: sensor: adxl372: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 9c688bb5cb samples: sensor: ms5837: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 9898c51641 samples: sensor: bme680: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala b8a36f665b samples: drivers: ht16k33: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 2d7cc8f774 samples: subsys: canbus: canopen: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala ce41833a10 samples: subsys: fs: fat_fs: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala a21afb83b1 samples: bluetooth: central: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala caa6c06f73 samples: bluetooth: peripheral_ht: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala cb98936b83 samples: bluetooth: scan_adv: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 1252388c6d samples: bluetooth: peripheral_hr: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 2dfd21b2e8 samples: bluetooth: beacon: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala e51b896cfb samples: bluetooth: peripheral_dis: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala d1b934d068 samples: bluetooth: peripheral_sc_only: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala a92be467cc samples: bluetooth: mesh_demo: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 43b74049de samples: bluetooth: mesh: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 9b76cb113f samples: bluetooth: ipsp: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 4921f2a292 samples: bluetooth: peripheral_hids: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 7712f5d025 samples: bluetooth: peripheral_esp: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 3f76fa958b samples: bluetooth: hci_spi: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 5b74caa808 samples: bluetooth: peripheral: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala a5f718214c samples: bluetooth: central_hr: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 9b897eab70 samples: bluetooth: eddystone: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 77b8bb9c57 samples: bluetooth: peripheral_csc: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala dd7a4d93ef samples: bluetooth: ibeacon: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala 5cd4ce3b79 samples: subsys: ipc: openamp: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Arnaud Pouliquen f6800aa1c4 samples: add openamp sample relying on resource table
This sample is designed to respond to the Linux
rpmsg sample client.
It should be platform independent and based on the
the integration of a resource table in the elf file.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2020-04-01 09:21:15 -05:00
Anas Nashif 175b8a7393 samples: use K_MSEC with k_sleep()
Couple of samples missing the conversion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-01 09:25:42 -04:00
Andy Ross 7832738ae9 kernel/timeout: Make timeout arguments an opaque type
Add a k_timeout_t type, and use it everywhere that kernel API
functions were accepting a millisecond timeout argument.  Instead of
forcing milliseconds everywhere (which are often not integrally
representable as system ticks), do the conversion to ticks at the
point where the timeout is created.  This avoids an extra unit
conversion in some application code, and allows us to express the
timeout in units other than milliseconds to achieve greater precision.

The existing K_MSEC() et. al. macros now return initializers for a
k_timeout_t.

The K_NO_WAIT and K_FOREVER constants have now become k_timeout_t
values, which means they cannot be operated on as integers.
Applications which have their own APIs that need to inspect these
vs. user-provided timeouts can now use a K_TIMEOUT_EQ() predicate to
test for equality.

Timer drivers, which receive an integer tick count in ther
z_clock_set_timeout() functions, now use the integer-valued
K_TICKS_FOREVER constant instead of K_FOREVER.

For the initial release, to preserve source compatibility, a
CONFIG_LEGACY_TIMEOUT_API kconfig is provided.  When true, the
k_timeout_t will remain a compatible 32 bit value that will work with
any legacy Zephyr application.

Some subsystems present timeout (or timeout-like) values to their own
users as APIs that would re-use the kernel's own constants and
conventions.  These will require some minor design work to adapt to
the new scheme (in most cases just using k_timeout_t directly in their
own API), and they have not been changed in this patch, instead
selecting CONFIG_LEGACY_TIMEOUT_API via kconfig.  These subsystems
include: CAN Bus, the Microbit display driver, I2S, LoRa modem
drivers, the UART Async API, Video hardware drivers, the console
subsystem, and the network buffer abstraction.

k_sleep() now takes a k_timeout_t argument, with a k_msleep() variant
provided that works identically to the original API.

Most of the changes here are just type/configuration management and
documentation, but there are logic changes in mempool, where a loop
that used a timeout numerically has been reworked using a new
z_timeout_end_calc() predicate.  Also in queue.c, a (when POLL was
enabled) a similar loop was needlessly used to try to retry the
k_poll() call after a spurious failure.  But k_poll() does not fail
spuriously, so the loop was removed.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Andy Ross 32bb2395c2 timeout: Fix up API usage
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them.  Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:

+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
  values for equality (e.g. with K_FOREVER or K_NO_WAIT).

+ Adding a k_msleep() synonym for k_sleep() which can continue to take
  integral arguments as k_sleep() moves away to timeout arguments.

+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
  generate timeout arguments.

+ Removing the usage of K_NO_WAIT as the final argument to
  K_THREAD_DEFINE().  This is just a count of milliseconds and we need
  to use a zero.

This patch include no logic changes and should not affect generated
code at all.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-03-31 19:40:47 -04:00
Ioannis Glaropoulos 1ce222bf02 boards: arm: nrf52840_pca10090: rename board to nrf9160dk_nrf52840
We rename the nRF91 Dev Kit board target for the NRF52840
controller (nrf52840_pca10090) to nrf9160dk_nrf52840. We
update all associated references in the supportive
documentation and all nRF9160-related cofigurations and
overlay files in the samples and tests in the tree. We
also remove an un-referenced board image file that had
erroneously been part of the documentation of this platform.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-31 15:16:08 +02:00
Ioannis Glaropoulos e0b8158ca1 boards: arm: nrf9160_pca10090: rename board to nrf9160dk_nrf9160
We rename the nRF91 Dev Kit board target (nrf9160_pca10090)
to nrf9160dk_nrf9160. We update all associated references
in the supportive documentation and all nRF9160-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-31 15:16:08 +02:00
Stephanos Ioannidis 14573bdb3a samples: net: gptp: Remove Kconfig MAC address for sam_e70_xplained
This commit removes the Kconfig MAC address configurations for the
`sam_e70_xplained` board, as these have been migrated to use the device
tree configurations.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-31 08:08:29 -05:00
Kumar Gala f8f044249c samples: boards: 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 07:14:21 -05:00
Kumar Gala d8432ce8da samples: drivers: 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 07:12:30 -05:00
Kumar Gala d711e7b7d8 samples: sensor: 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 07:09:33 -05:00
Kumar Gala 7e10e6dd3d samples: ipc: 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-30 17:05:56 -05:00
Kumar Gala 91656efa4b samples: shields: 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-30 17:05:30 -05:00
Kumar Gala 7a0ee9d3cb samples: bluetooth: 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-30 17:03:35 -05:00
Kumar Gala 3d2eb34e8e samples: lwm2m_client: 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-30 16:40:01 -05:00
Gerson Fernando Budke 5f5919a900 lib: updatehub: Fix buffer sizes
The MAX_PAYLOAD_SIZE must reflect the size of COAP_BLOCK_x. This is
necessary becase BLOCK size represents max payload size. The current
value create inconsistencies for coap lib. The same way,
MAX_DOWNLOAD_DATA must allocate sufficient space for MAX_PAYLOAD_SIZE
plus all space for coap header etc.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2020-03-30 16:54:29 +03:00
Andrzej Głąbek 386e5ba81c samples: echo_server: Fix missed renaming of nrf52840_pca10056
This is a follow-up to commit 4253eae005.

The board known earlier as nrf52840_pca10056 is now named
nrf52840dk_nrf52840.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-30 13:27:37 +02:00
Joakim Andersson 88a6234ff2 Bluetooth: host: Use bluetooth defines instead of hci defines
Use the scan types defined in bluetooth.h instead of the hci defined
ones. Although they have the same value it is best to avoid using the
hci.h header in applications.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Joakim Andersson f2d7b77e96 Bluetooth: host: Deprecate BT_LE_ADV defines in hci.h in favour of gap.h
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Joakim Andersson be57dfbe2a Bluetooth: host: Rename and deprecate scan filter for more scan options
Rename filter_dup parameters used for scanning filter options to the
more generic name options, and make scan filter options follow same
naming patters as advertising and initiator scan options.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Joakim Andersson 405ce842ab Bluetooth: host: Add new argument and return code to bt_create_conn_le
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.

Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-30 00:38:23 +03:00
Henrik Brix Andersen 0ff2bcf915 samples: shields: lmp90100_evb: rtd: retry readings on failure
Retry ADC readings on failure instead of exiting the main loop.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-03-28 10:22:23 -05:00
Kumar Gala 12ca04b31f ipc: openamp: Expose config options for MASTER/SLAVE builds
We can build the openamp library configured with VirtIO master
support, VirtIO slave support, or both.  By default both master
and slave code is enabled.  We can reduce code footprint by only
build master or slave as needed.

Expose Kconfig options for Master & Slave and set them accordingly in
the sample.

Here's the code reduction we see:

For the total image we see as 1260 byte reduction:
Memory region         Used Size  Region Size  %age Used
 FLASH [Master & Slave]:       30308 B       256 KB     11.56%
 FLASH [Master only]   :       29048 B       256 KB     11.08%

On the remote side we see a 828 byte reduction:

Memory region         Used Size  Region Size  %age Used
 FLASH [Master & Slave]:       11564 B        64 KB     17.65%
 FLASH [Slave only]    :       10736 B        64 KB     16.38%

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-27 15:20:25 -05:00
Peter Bigot 090088d015 samples: boards: nrf: battery: Convert to new DT macros
Reference properties through the path to vbatt.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-27 11:41:04 -05:00
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
Tomasz Bursztyka df368e8094 samples/net: Adding relevant parts to test PM on echo server
Just to get something to test for PM, via frdm_k64f board. So only this
board will get PM enabled.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Andrzej Głąbek 4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_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: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Kumar Gala 91ab377716 samples: openamp: Fix cmake warning
Fix the following CMake Warning:
  implicitly converting 'string' to 'STRING' type.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 08:34:51 -05:00
Karl Zhang fbd8cff090 samples: openamp: Add support for Musca B1
Musca B1 is a dual core SoC with both cores are CM33. Add
openAMP to support on it.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-03-26 06:10:07 -05:00
Karl Zhang 0e770c652a samples: openamp: Add support for Musca A
Musca A is a dual core SoC with both cores are CM33. Add
openAMP to support on it.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-03-26 06:10:07 -05:00
Karl Zhang 88c3679933 samples: openamp: Add support for mps2_an521
AN521 is a dual core FPGA on MPS2+ with both cores are CM33. Add openAMP
to support on it.

Core 0 is primary core, it runs as master, core 1 is remote, it runs
as slave.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-03-26 06:10:07 -05:00
Karl Zhang 2914ad40a6 samples: openamp: Keep document up to date
Update serial output for both master and remote.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-03-26 06:10:07 -05:00
Karl Zhang 742f55a998 samples: openamp: Remove exclusive compile of openAMP
Add configuable shared memory address for openAMP samples. There is a
plan to add more platforms supported for openAMP in zephyr.

Each platform can specify the shared memory address and device by
device tree and add it's support in openAMP samples.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 06:10:07 -05:00
Kumar Gala ccba01f372 samples: openamp: prep for additional board support
Move board specific conf info boards/<BOARD>.conf to support other
board/SoCs with this sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-26 06:10:07 -05:00
Flavio Ceolin a7b327310d samples: fxos8700-hid: Fix possible underflow
gpio_pin_get() returns a negative value in case of error and
callbacks_configure was assigning this value to an unsigned variable.

Fixes: #22643
Coverity CID :208206

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-03-25 16:25:45 +01:00
Patrik Flykt c99392f2d6 scripts: net: Add TLS test for mqtt_publisher
In addition to the existing plain TCP MQTT test, add the same test
with TLS applied. Robert Lubos provided the updated test_cert.h, which
contains the same certificate as in the echo samples.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-25 08:39:39 +02:00
Markus Becker 63e592f8f6 net: openthread: Add NCP sample
OpenThread NCP sample application.

Tested on FRDM-K64 with RF2XX connected via USB to a Linux machine
running wpantund.

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-03-25 08:37:16 +02:00
Martí Bolívar 0d1d441aec samples: convert blinky to new DT API
This doesn't sacrifice any readability when compiled for boards that
don't support this alias.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar 6e57b42758 doc: dts: revisit documentation
This is joint work with Kumar Gala (see signed-off-by).

Document the changes to the generated node macros in macros.bnf,
moving the old file to legacy-macros.bnf and putting it in its own
section.

The actual generated macros are now a low-level detail, so rewrite the
foregoing sections as examples in terms of the new <devicetree.h> APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Ioannis Glaropoulos f3807f19dc boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Peter Bigot 42f9d14a3f kernel: deprecate k_uptime_delta_32
The documentation motivates this function by saying it is more
efficient than the core 64-bit version.  This was untrue when
originally added, and is untrue now.  Mark the function deprecated and
replace its sole in-tree use with the trivial equivalent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-23 10:26:05 -04:00
Trond Einar Snekvik 824c2ebc58 Bluetooth: Mesh: Slab based segmentation handling
Allocates segmented message buffers as slabs in a common pool for RX and
TX. This reduces memory requirements for both TX and RX, as TX messages
can be stored without the network and advertising buffer overhead, and
RX can use only the slabs it needs, instead of allocating a full size
segmented message. This approach also removes the need for decrypting
the segments for each retransmission, reducing overall processing load.

Slab based segmentation for tx also introduces queuing of segmented
messages, which allows the application layer to send multiple messages
to the same destination without violating Bluetooth Mesh specification
v1.0.1, section 3.6.4.1. This mechanism is provided through a flag that
blocks segmented messages to a destination which a message is already
being sent to until the previous message finishes.

This changes the SDU size configuration to a symmetrical
RX_SEG_MAX/TX_SEG_MAX pair of configurations, plus a new segment pool
side configuration. It also removes the binding between the TX_SEG_MAX
config and the advertising buffers, reducing the minimum advertising
buffer count from 6 to 3.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-03-19 15:54:26 +02:00
Ravi kumar Veeramally cd679452b2 samples: net: azure: Add support for subscribe
Cloud to device communication supported with simple
subscribe topic details. Details are added for how to send
messages from cloud.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-03-19 11:09:44 +02:00
Carles Cufi bf41dd943b doc: reference: Clean up and restructure a bit
Name all subsystem reference consistently with an '_api' postfix and
clean up naming and folder structure in some cases.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-18 11:47:24 +01:00
Erwan Gouriou e13bb7e999 samples/drivers: led_apa102: Clean board specific Kconfig file
Various kconfig symbols where defined specifically for board
nucleo_l432kc. Though, most are generic to the sample so should moved
directly to sample prj.conf
Some others parts of boards default configuration so could be removed
as well.
Last remove CONFIG_OPENOCD_SUPPORT as sample has no dependency with
this symbol.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-03-17 11:03:10 -06:00
Kumar Gala c44a4d84e0 drivers: watchdog: wwdg_stm32: convert to DT_INST defines
Convert driver to use DT_INST_ defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-03-17 11:03:10 -06:00
Jukka Rissanen cf720f9882 samples: net: echo-server: Wait network interface before starting
No use starting the application if the network interface is down.
So start to listen connection management events and start the
TCP and UDP handlers only after network is up and ready.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 17:17:20 +02:00
Jukka Rissanen 7b8aca3de2 samples: net: cloud: Fix the mqtt_azure sample location
The path to the mqtt_azure sample was not correct.
Original patch by Benjamin Cabé.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-03-17 10:25:48 -04:00
Patrik Flykt 984e8ac6bc samples: net: mqtt_publisher: Add exit code and Kconfig options
Modify the mqtt_publisher sample app to return an exit code after
its tests have been run. Add Kconfig options to set the number of
test iterations per TCP connection as well as the number of TCP
connections to make to the server while keeping the default values
intact. Further add a config overlay file to lower the number of
TCP connections and test iterations used.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-03-17 13:14:41 +02:00
Paul Sokolovsky bbb4355cf7 samples: sockets: big_http_download: Increase stack size by 128 bytes
Without it, the sample crashes for qemu_x86 with:

[00:00:03.080,000] <err> os: Page fault at address 0x7275632f
  (error code 0x10)
[00:00:03.080,000] <err> os: Linear address not present in page tables
[00:00:03.080,000] <err> os: PDPTE: Non-present
...

Increase by reasonable, but small amount, to keep watching stack usage
growth trends in Zephyr.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-03-16 18:23:57 +02:00
Andrew Boie f60563bbeb samples: pong: use log_stack_usage()
Don't use deprecated APIs.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-14 13:10:19 -04:00
Andrew Boie 9897054e12 samples: shell: enable stack info
Enable configs necessary for "kernel stacks" command.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-14 13:10:19 -04:00
Jose Alberto Meza fc3293ed1f samples: drivers: peci: Add PECI driver sample app
Sample code that showcase PECI API get device CPU information
then monitors temperature.
Verified in Modular MEC1501 connected to computer (PECI host).

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-13 18:53:04 +02:00
Joakim Andersson 5726a26dd7 Bluetooth: samples: hci_uart: Remove unneeded config options
Remove data length and phy update set to 'n' on board that does not
support these features anyway. BT_CTLR_DATA_LEN_SUPPORTED and
BT_CTLR_PHY_UPDATE_SUPPORTED are both set to 'n'.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-13 18:12:47 +02:00
Joakim Andersson 69a7278bad Bluetooth: samples: hci_uart: Remove unsupported configuration
Remove BT_CTLR_DTM_HCI=y config which is not supported for this board.
This produced the following warning:

warning: BT_CTLR_DTM_HCI was assigned the value
'y' but got the value 'n'. Check these unsatisfied dependencies:
BT_CTLR_DTM_HCI_SUPPORT (=n).

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-13 18:12:47 +02:00
Joakim Andersson 49391249ee Bluetooth: samples: hci_uart: Refactor conf files
Refactor conf files to use prj.conf + board/<board>.conf configuration.
This allows us to have put common configurations into the prj.conf and
have board specific configs in each board file.
This also respects adding additional prj.conf files such as
-DCONF_FILE='nrf5.conf debug.conf' to add debug configuration.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-13 18:12:47 +02:00
Joakim Andersson abafd8eb22 Bluetooth: samples: hci_uart: Update main stack size nrf5 boards
Update main stack size for nrf5 boards. This is to support an
alternative hci_driver that has a higher stack size usage in hci driver
open. Measured stack usage in this case to 808/1024.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-03-13 18:12:47 +02:00
Jose Alberto Meza c06d7cee85 samples: drivers: espi: Showcase eSPI host warnings handling
Add sample of how to handle eSPI host warnings when these are
intercepted by app code.
Replace printk with logging macros to standardize the sample.
Log additional details about peripheral channel notifications.
Remove unnecessary trailing \n from logging messages.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-13 10:34:49 -04:00
Jose Alberto Meza 7a237649c7 samples: drivers: espi: Check response for OOB transaction
Check OOB response data after OOB transaction over eSPI.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-13 01:45:18 +02:00
Jose Alberto Meza 8b14807e55 samples: boards: mec15xxevb: Power management tests
Sample code that demonstrates power management features on
MEC15xx-based boards.
It showcases how an app can  enter into light and deep sleep.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-12 23:24:30 +02:00
Andrzej Głąbek ff01e2a553 samples/bluetooth/hci_spi: Add configuration for nrf51_pca10028
This sample has nrf51_pca10028 on its platform_whitelist but lacks
configuration and overlay files that would make it possible to build
this sample for that board. This commit provides such files.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-12 15:08:53 -05:00
PK Chan ba8bb44661 samples: net: mqtt_publisher: demo for ping request and response
Once the MQTT ping response has been received from the server, the
application is then notified with the MQTT_EVT_PINGRESP event.

Signed-off-by: PK Chan <pak.kee.chan@nordicsemi.no>
2020-03-12 11:07:14 +02:00
Pavlo Hamov 44b43710f2 samples: display: lvgl use posix input, remove defaults
Add support of SDL mouse events as input for the LVGL
platforms: native_posix(_64)

Signed-off-by: Pavlo Hamov <pasha.gamov@gmail.com>
2020-03-11 13:23:19 -05:00
Corey Wharton 86bfc489f4 scripts: Replace hard-coded subsystem list with __subsystem annotations.
This change removes the hardcoded subsystem list in gen_kobject_list.py
favor of marking the relevant driver API structs with the _subsystem
sentinel.

Signed-off-by: Corey Wharton <coreyw7@fb.com>
2020-03-11 17:13:39 +02:00
Oleg Zhurakivskyy d11c92b60b samples: echo_client: Add overlays for debugging
Add overlays that might be useful for debugging:

- overlay-log.conf
   Enable debug log for socket, context, connection, TCP/TCP2.
- overlay-debug.conf
   Disable optimization and compile with debug information.
- overlay-max-stacks.conf
   Overlay to quickly sort out insufficient stack problems.
- overlay-e1000.conf

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Oleg Zhurakivskyy 71a225d76f samples: echo_server: Add overlays for debugging
Add overlays that might be useful for debugging:

- overlay-log.conf
   Enable debug log for socket, context, connection, TCP/TCP2.
- overlay-debug.conf
   Disable optimization and compile with debug information.
- overlay-max-stacks.conf
   Overlay to quickly sort out insufficient stack problems.
- overlay-e1000.conf

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Oleg Zhurakivskyy e0c151b9cf samples: net: sockets: tcp: Add a TCP sample and instructions
In order to run the TTCN-3 based sanity check, add a TCP
sample app and instructions for running the sanity check.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-03-11 16:24:52 +02:00
Kumar Gala 76e0cf63b3 drivers: ps2: mchp_xec: convert to DT_INST defines
Convert driver to use DT_INST_ defines.  The preferred defines for
drivers are DT_INST_.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-11 07:59:38 -06:00
Peter Bigot bd56c2ecf2 samples: drivers: spi_flash: use printf argument consistent with format
Coverity thinks this is a long because FLASH_TEST_REGION_OFFSET is a
signed value.  Zephyr doesn't use standard types so make it a u32_t.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-10 19:06:38 -04:00
Jan Van Winkel e242f020f4 samples: display: doc: Corrected build commands
Corrected build command paths in the documentation of the display
driver sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-03-10 21:10:27 +02:00
Andrew Boie e23102f5dc samples: pi: fix stack overflow
This was silently corrupting memory on x86-64.
Enable CONFIG_TEST so that this is detected properly,
and increase the stack size appropriately.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-03-10 09:57:58 -04:00
Nick Ward ad7350ed6c samples: shell_module: Add date commands
Add date command to set and display date.

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2020-03-10 15:04:12 +02:00
Robert Lubos 2e80185b59 samples: lwm2m_client: Add support for queue mode
Add support for the queue mode in the lwm2m_client sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-03-10 14:57:29 +02:00
Martí Bolívar 748c7757ea samples: blinky: clean up error on unsupported board
This sample requires led0 in the board devicetree's /aliases.
Improve the error message when that is not available.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-04 21:50:43 +02:00
Carles Cufi f80164525f samples: blinky: Improve documentation
Improve the documentation of the blinky sample, fixing typos, adding
links to the relevant DT documentation and cleaning up a bit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-04 21:50:43 +02:00
Carles Cufi 6147bd3168 samples: sensor: bme680: Add an overlay
Add an overlay for the nRF52840 to be able to build the sample.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-04 20:29:00 +02:00
Carles Cufi 340ead4239 samples: sensor: bme280: Add overlay
And an overlay for the nRF52840 DK to be able to build the sample after
the transition to Device Tree.

Fixes #23148.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-04 20:29:00 +02:00
Piotr Mienkowski 7e0f31e3e7 samples: tests: don't disable watchdog when it is used
To ease maintenance of samples and tests some SoCs define
CONFIG_WDT_DISABLE_AT_BOOT=y to disable the watchdog. Ensure the option
is set to n for samples and tests that require watchdog module not to be
disabled during boot.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-03-04 18:25:04 +02:00
Jennifer Williams d6373a38af samples: subsys: nvs: unchecked return values CID#203537
The sample contained calls that were not using the return
value, which was detected by Covery Scan as an issue. This
commit fixes it by changing to (void).

Fixes #18378
CID#203537

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-02-27 11:38:01 +02:00
Joakim Andersson 09b89ef585 Bluetooth: samples: Unref conn object on create connection timeout
Handle connected callback with error status not releasing the default
conn object in central samples. This can happen when the initiator fails
to create the connection within 3 seconds and is canceled by the host.

Also restart the scan role in this case.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-25 14:12:04 +02:00
Joakim Andersson ce99a5b8fc Bluetooth: samples: central_hr: Move connected callback
Move the connected callback down together with the disconnected
callback.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-25 14:12:04 +02:00
Andrew Boie 8dec1beffe samples: pi: fix sample.yaml
Whitelists are bad; configuration filters scale much better.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-02-21 07:45:04 +02:00
Martí Bolívar 51b885019e doc: split devicetree docs into multiple pages
The one page on devicetree is too long. Split it into multiple pages
to make it easier to digest and more squintable. This is basically
just moving content around; minimal changes have been made apart from
redoing some transitions and adding a couple of introductory paragraphs.

Rename the 'device-tree' Sphinx :ref: target while we are here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-20 12:15:27 +02:00
Jukka Rissanen 48a1a2ef81 samples: net: gsm_modem: Add README file
Add documentation to the GSM modem sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-18 18:52:43 +02:00
Maksim Masalski c25262c829 tests: remove duplicate names for tests
After running command  --list-test-duplicates
I found out that some test cases have same names (duplicated).
To get rid of it, I decided to change names in .yaml files

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-02-13 14:45:56 -06:00
Andrew Boie c6d37eba7b samples: arc_secure_services: fix sample.yaml
This test can't be evaluated with sanitycheck, it
requires special set-up on multiple AMP cores to
function properly. Add build_only tag.

Fixes: #19643
Fixes: #22317

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-02-13 12:59:47 +02:00
Peter Bigot a8d15c1279 sensors: grove_light: convert to devicetree bindings
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels.  Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 10:31:26 -06:00
Peter Bigot bc60245787 sensors: grove_temperature: convert to devicetree bindings
Replace Kconfig configuration data with devicetree bindings using
(ADC) io channels.  Rework the sample to document expectations about
the relationship between the reference voltage and the divider input
voltage, and update the sensor configuration to support Nordic SAADC.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-12 10:31:26 -06:00
Robert Lubos da98c88cdb samples: net: telnet: Add BLE IPSP overlay config
Add `overlay-bt.conf` file to enable easy builds for boards supporting
BLE IPSP.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-02-12 10:22:49 +02:00
Andrzej Głąbek aa544d678e samples: fade_led: Fix definition of PWM_FLAGS
As it incorrectly uses DT_ALIAS_PWM_LED0_PWMS_CHANNEL macro instead of
the *_FLAGS one.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-02-11 17:50:50 +02:00
Henrik Brix Andersen 855ef90f6d samples: canbus: canopen: fix python package install instructions
Fix the Python3 CANopen module installation instructions to refer to
the 'python-can' package instead of the nonexistent 'can' package.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-11 17:49:20 +02:00
Gerson Fernando Budke 19e6497d32 samples: net: sockets: echo_server: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke cc91a734d9 samples: net: sockets: echo_server: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 2d960aeeb7 samples: net: sockets: echo_server: Add sam4e_xpro config
Add necessary configuration to run demo on the sam4s_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 97f210bce0 samples: net: sockets: echo_server: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 9d9b248965 samples: net: sockets: echo_client: Update README.rst
Add information about how to build and test atsamr21_xpro board with
IEEE 802.15.4 RF2xx driver.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 850a200b41 samples: net: sockets: echo_client: Add sam_v71_xult config
Add necessary configuration to run demo on the sam_v71_xult board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke 3f6029dd80 samples: net: sockets: echo_client: Add sam4s_xplained config
Add necessary configuration to run demo on the sam4s_xplained board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Gerson Fernando Budke cfe1ce967c samples: net: sockets: echo_client: Add atsamr21_xpro config
Add special configuration for SAMR21 SoC. Since it have only 32k SRAM,
all possible application buffers need to be shrinked. This
configuration was tested with two boards for more than 2H with success.

[02:18:57.635,00] net_echo_server_sample: IPv6 UDP: Sent 333000 packets

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-02-11 17:46:05 +02:00
Jukka Rissanen ed7dd4412c sample: net: gsm_modem: Add sample.yaml file
sample.yaml is needed so that we can do some sanity checks
for the GSM modem code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-11 13:49:22 +02:00
Markus Fuchs 29630cc7fc samples: crypto: Add AES-GCM sample
Add sample for AES Galois/Counter Mode (GCM) of operation with a MACsec
GCM-AES test vector.
Also improve existing code by declaring expected ciphertext arrays as
constant.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-02-08 13:40:33 +02:00
Alex Porosanu 55eb4a11cd samples: bluetooth: add missing VEGABoard overlays
The default DTS of VEGABoard does not enable the necessary nodes
for the SW LL to function; as such an overlay is needed for
each sample that is intended to be run on the VEGABoard. Some
of the samples miss this overlay so this patch adds them.

Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
2020-02-08 10:23:49 +02:00
Andrew Boie efc5fe07a2 kernel: overhaul unused stack measurement
The existing stack_analyze APIs had some problems:

1. Not properly namespaced
2. Accepted the stack object as a parameter, yet the stack object
   does not contain the necessary information to get the associated
   buffer region, the thread object is needed for this
3. Caused a crash on certain platforms that do not allow inspection
   of unused stack space for the currently running thread
4. No user mode access
5. Separately passed in thread name

We deprecate these functions and add a new API
k_thread_stack_space_get() which addresses all of these issues.

A helper API log_stack_usage() also added which resembles
STACK_ANALYZE() in functionality.

Fixes: #17852

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-02-08 10:02:35 +02:00
Ulf Magnusson c5839f834b kconfig: Remove assignments to CONFIG_<arch> syms and hide them
All board defconfig files currently set the architecture in addition to
the board and the SoC, by setting e.g. CONFIG_ARM=y. This spams up
defconfig files.

CONFIG_<arch> symbols currently being set in configuration files also
means that they are configurable (can be changed in menuconfig and in
configuration files), even though changing the architecture won't work,
since other things get set from -DBOARD=<board>. Many boards also allow
changing the architecture symbols independently from the SoC symbols,
which doesn't make sense.

Get rid of all assignments to CONFIG_<arch> symbols and clean up the
relationships between symbols and the configuration interface, like
this:

1. Remove the choice with the CONFIG_<arch> symbols in arch/Kconfig and
   turn the CONFIG_<arch> symbols into invisible
   (promptless/nonconfigurable) symbols instead.

   Getting rid of the choice allows the symbols to be 'select'ed (choice
   symbols don't support 'select').

2. Select the right CONFIG_<arch> symbol from the SOC_SERIES_* symbols.
   This makes sense since you know the architecture if you know the SoC.

   Put the select on the SOC_* symbol instead for boards that don't have
   a SOC_SERIES_*.

3. Remove all assignments to CONFIG_<arch> symbols. The assignments
   would generate errors now, since the symbols are promptless.

The change was done by grepping for assignments to CONFIG_<arch>
symbols, finding the SOC_SERIES_* (or SOC_*) symbol being set in the
same defconfig file, and putting a 'select' on it instead.

See
https://github.com/ulfalizer/zephyr/commits/hide-arch-syms-unsquashed
for a split-up version of this commit, which will make it easier to see
how stuff was done. This needs to go in as one commit though.

This change is safer than it might seem re. outstanding PRs, because any
assignment to CONFIG_<arch> symbols generates an error now, making
outdated stuff easy to catch.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-02-08 00:50:08 -06:00
Alexander Wachter f590d4fadb drivers: lora: build with newlib
The loramac-node library uses math functions from math.h that
are not included in the minimal lib.
This commit changes the samples project config to always build
with newlib and adds a dependency to newlib.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-07 16:00:47 -06:00
Alex Porosanu 1a7a0dd494 samples: bluetooth: hci_uart: add VEGABoard configuration
VEGABoard BLE controller implementation supports HCI over UART;
as such enable this configuration when building the hci_uart
sample.

Signed-off-by: Alex Porosanu <alexandru.porosanu@nxp.com>
2020-02-07 15:49:35 -06:00
Markus Fuchs 20960911ca samples: drivers: crypto: Add STM32 driver support
Add STM32 CRYP driver support and a corresponding build-only test to
the crypto sample project.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2020-02-07 10:45:51 -06:00
Andrzej Puzdrowski 9b024eba54 samples/subsys/settings: corrected doc on how to build and run
Corrected `building and running` console snippet.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-02-07 11:48:13 +01:00
Andy Ross 7defd09b97 samples: Add MetaIRQ dispatch sample
MetaIRQs are described in docs and exercised in tests, but there's no
sample explaining how they are intended to be used to perform
interrupt bottom half processing.

This simple tool spawns a set of worker threads at different
priorities (some cooperative) which process "messages" (which require
CPU time to handle) received from a fake "device" implemented with
timer interrupts.  The device hands off the events directly to a
MetaIRQ thread which is expected to parse and dispatch them to the
worker threads.

The test demonstrates that no matter the state of the system, the
MetaIRQ thread always runs synchronously when woken by the ISR and is
able to preempt all worker threads to do its job.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-06 23:06:28 -05:00
Kumar Gala c58ca61a66 samples: flash_shell: Enable on all platforms with a flash driver
Try and build the flash_shell on all platforms that have a flash driver
rather than a limited set of know platforms.  This hopefully acts as a
build coverage test for all the flash drivers.

The flash shell requires around 10K of memory so limit it to systems
with 12K or more.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-02-06 19:18:51 -05:00
Jukka Rissanen fe6ebd5b75 samples: net: modem: Add net and modem shells
Enabling modem and net shells which is useful for debugging
things.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-06 10:19:25 +02:00
Alexander Wachter 7c3a4e6baa samples: canbus: isotp: Add sample code for the ISO-TP lib
This commit adds sample-code for the ISO-TP library

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-02-06 10:16:29 +02:00
Carles Cufi 07ecb817ff samples: net: google_iot: Fix logging warnings
Clean up the logging warnings due to invalid formatting.

Fixes #22510.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-06 10:00:49 +02:00
Henrik Brix Andersen 6881da0afa samples: canbus: canopen: reduce default timeout in main thread
Reduce the default timeout in the CANopen sample from 50 milliseconds
to 1 millisecond. This vastly improves performance of the sample and
matches the example code present in the CANopenNode stack.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-02-05 14:37:27 -06:00
Joakim Andersson 1e80efaa1b Bluetooth: samples: peripheral_dis: Sample requires BT_SETTINGS
The DIS service requires BT_SETTINGS otherwise it will not have a
settings handler. Instead DIS will only use Kconfig to set it's
values.

Fixes: #22478

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-02-05 20:11:03 +02:00
Tobias Svehagen d1f15724aa Bluetooth: samples: Add mesh_provisioner sample
Add sample for how to use provisioner and Configuration Database (CDB)
APIs.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-02-05 18:47:41 +02:00
Michael Scott 2c7e420a8e samples: net: echo_client: handle net if mtu
UDP portion of the echo_client sends 1 packet with the sample data.
(TCP can send chunks of it depending on the response of the send()
function.)  Not every network interface can send a UDP packet large
enough to handle the size of the sample data.

Let's make sure to account for the network interface MTU when deciding
the amount of sample data to send.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/22447

Signed-off-by: Michael Scott <mike@foundries.io>
2020-02-05 15:54:57 +02:00
Peter Bigot 86d1b7d2c8 samples: boards: nrf: update battery sample for new GPIO API
Replace legacy API and configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer 4046de5cae samples: wifi: add config to test winc1500 driver
Add reel board config to test winc1500 driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00