Commit graph

4999 commits

Author SHA1 Message Date
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
Tomasz Bursztyka a40e9d3762 drivers/wifi: Switch WINC1500 to new GPIO API
Use new API to configure and interact with GPIOs.  Move GPIO
initialization from sample into driver.  The existing physical/line
level control has been kept rather than converting to logical level
signals.

Also improve error messages.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 1d88f9ffd8 samples: drivers: espi: update to new GPIO API
Treat Kconfig-specific GPIOs as active-high (default) and use the
logic-level API to interact with them.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Marcio Montenegro c6df1b9395 Samples: Bluetooth: st_ble_demo: Update to new GPIO API
Convert to the new API pin and interrupt API.

Signed-off-by: Marcio Montenegro <mtuxpe@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 7e5ca867de samples: canbus: convert to new GPIO API
Use the new API to control the button and LEDS.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi d3c4b77f45 samples: nrf: onoff_level_light: Convert to new GPIO API
Convert to the new GPIO API using logical levels instead of raw ones.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 988388d2d5 samples: nrf: mesh: onoff-app: Convert to the new GPIO API
Covert to the new GPIO API, using logical levels instead of raw ones.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Erwan Gouriou 23d3d08610 samples/bluetooth: hci_spi: convert to new GPIO API
Update bluetooth hcp_spi sample to new GPIO API.
Following changes have been done:
- Use new gpio api functions
- Introduce define for dt generated gpio flags
- Update 96b_carbon_nrf51.dts according to new bindings
- Gpio IRQ pin is configured to output inactive


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-02-05 12:00:36 +01:00
Peter Bigot a748e577bd drivers: sensor: mpu6050: convert to new GPIO API
Use new configuration API, replace callback enable/disable with
interrupt enable/disable, and set active level in devicetree source.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer b33627bc81 samples: hid-cdc: convert to new GPIO API
Convert hid-cdc sample to new GPIO API

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Johann Fischer dc6a48fa29 samples: fxos8700-hid: convert to new GPIO API
Convert fxos8700-hid sample to new GPIO API

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Carles Cufi 007557a61f samples: reel_board: mesh_badge: Convert to the new GPIO API
Convert to the new GPIO API using logical levels, and remove the
duplicate implementation of LED control that existed.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 56fcf9845e samples: convert bluetooth mesh samples to new gpio API
This commit converts mesh and mesh_demo bluetooth samples to the new
GPIO API.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 6980a04e8c drivers: sensor: sx9500: convert to new GPIO API
Use the new pin and interrupt configuration API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot acb43b66da sensors: ccs811: update to new API
Update devicetree sources and bindings, switch to new GPIO API.  Use
devicetree property name to identify interrupt signal.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 121093f82e samples: lcd_hd44780: Convert to new GPIO API
Convert to the new API, using raw access since there is no Device-Tree
definitions for this particular sample.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 55e1b57076 samples: led_apa102c_bitbang: Clean conditional expression
Clean the expression so that it uses the BIT() macro and doesn't abuse
the not (!) operator.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi bc9a57d043 samples: led_apa102c_bitbang: Convert to new GPIO API
Conver to the new GPIO API, using raw access since there is no DT
definitions for this particular usage of the pins.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 50d1bb16e3 sensor: adt7420: update for new GPIO API
Update sample overlays.  Add GPIO flags to configuration state.
Refactor to split out setup/handle/process phases.  Switch to new API
replacing callback dis/enable with interrupt dis/enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi af21f80d33 samples: net: lwm2m_client: Convert to new GPIO API
Convert the sample to use the new API and its features.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 7134f76079 samples: micro:bit: Convert line_follower_robot sample to new GPIO API
Convert to the new GPIO API, untested on hardware.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi e5df55e1c1 samples: micro:bit: Convert pong sample to new GPIO API
Convert to the new GPIO API, tested on bbc:microbit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 51b9c6ed9c samples: micro:bit: Convert sound sample to new GPIO API
Convert to the new GPIO API, tested on bbc:microbit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Maureen Helm 2b5f78a88f disk: Convert sdhc spi driver to new gpio api
Converts the sdhc spi driver to the new gpio api. Updates device trees
for the olimexino_stm32 and nrf52840_blip boards to set appropriate
active high/low polarity for the spi chip select pin.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-05 12:00:36 +01:00
Peter Bigot c273b5d885 drivers: sensor: mcp9808: update to new GPIO API
Since this was converted to the setup/handle/process idiom in master
the conversion is straightforward.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot 6afbd053e4 drivers: sensor: isl29035: update to new GPIO API
Document alert pin behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Johann Fischer 664a1cf0db drivers: amg88xx: convert to new GPIO API
Convert AMG88XX sensor driver to new GPIO API.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Kevin Townsend f800c7266e drivers: hmc5883l: update to new GPIO API
This commit updates the HMC5883L driver to use the new GPIO API.

Also add a note explicitly describing the active state of the DRDY
pin in the binding file.

Tested on frdm_k64f.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 4b5393c228 sensor: adxl372: update for new GPIO API
Update sample overlay for missing chip select and to deconflict with
UART TXD.  Add GPIO flags to configuration state.  Replace callback
enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot de7e3e7693 sensor: adxl362: update for new GPIO API
Add a sample overlay.  Add GPIO flags to configuration state.  Replace
callback enable with interrupt enable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot c44290f75d drivers: sensor: dht: update to new GPIO API
Document IO signal behavior, switch to new API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung be8ca9da96 samples: up_squared/gpio_counter: update to new GPIO API
Update the gpio_counter sample app for the UP Squared board:
() Update configuration calls to use new flags.
() Separate pin configuration into setting it to input, and
   setting the pin for interrupt.
() Use gpio_pin_set() instead of gpio_pin_write().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Daniel Leung 2958938fb6 samples: gpio: add board overlay for up_squared
This adds a board overlay for up_squared to be used with
the GPIO sample. Using the overlay is because the pins
being used are not actually LED and switch but GPIO pins
used as such.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Peter Bigot 1cf43985e9 drivers: sensor: lsm6dsl: update to new GPIO API
Correct IRQ active level to default active-high, switch to new
interrupt configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Armando Visconti 3bb513bf2a sample/board: sensortile_box: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Armando Visconti 692996dd00 sample/board: 96b_argonkey: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski c0cf714087 samples: threads: update to use new GPIO API
Update sample application to use new GPIO API:
- GPIO flags defined by the devicetree
- replace gpio_pin_write with gpio_pin_set function

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Peter Bigot a49b364244 drivers: sensor: sht3xd: convert to new GPIO APIO
Update ALERT active level in all devicetree files.  Capture GPIO flags
in static configuration.  Add internal API to enable and disable
interrupt, to release the handlers when an alert occurs, and to
re-enable the signal when the handler completes.  Check for alerts
received during periods when the interrupt was disabled.

Extend the example to handle both above and below range triggers and
alerts that are present on startup.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Martí Bolívar 1d2a551c65 drivers: led_strip: modernize and fix up ws2812 drivers/sample
Convert the GPIO based driver to the new GPIO API. (Only the
gpio_configure() call is affected).

Move configuration to DT where appropriate for both SPI and GPIO
drivers, only leaving the SPI vs. GPIO decision in Kconfig (in
addition to the basic enable for the driver.) Move some files around
to clean up as a result of this change.

led_ws2812 sample changes:

- make the pattern easier to look at by emitting less light

- use led_strip alias from DT to get strip device, allocate
  appropriate struct led_rgb buffer, etc.

- move the pins around and remove 96b_carbon support (I have no board
  to test with)

GPIO driver specific changes:

- str is required to write OUTSET/OUTCLR, not strb. The registers
  are word-sized.

- the str[b] registers must all be in r0-r7, so "l" is the correct GCC
  inline assembly constraint for both "base" and "pin"

SPI driver specific changes:

- match the GPIO driver in not supporting the update_channels API
  method, which never made sense for this type of strip

- return -ENOMEM when the user tries to send more pixel data
  than we have buffer space for instead of -EINVAL

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Peter Bigot bcbe260009 samples: blinky: update to start with LED on
Use the new GPIO_OUTPUT_ACTIVE flag set to turn the LED on at startup.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Karsten Koenig f8988808ff samples: drivers: CAN: Switch to new GPIO API
Switched from deprecated gpio_pin_write to gpio_pin_set and also add the
LED GPIO flags to the gpio configuration.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-02-05 12:00:36 +01:00
Andrzej Głąbek 0c10d5cc1f samples/subsys/usb/hid-mouse: Convert to use the new GPIO API
Convert the sample to use the new GPIO API and additionally:
- add some error messages for unsuccessful GPIO API calls
- correct the index of `def_val` element used in the `right_button`
  callback, to match the one used when the callback is installed
- use flags defined in devicetree for the pin that drives the LED
  (for consistency, as this does not make much difference for a pin
  that is only toggled)

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Henrik Brix Andersen c7382c80a0 drivers: gpio_ht16k33: update to use new GPIO API
Implement the new GPIO driver APIs for the HT16K33 and update the
driver to use the new GPIO flags.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski 951f91071a samples: button: update to use new GPIO API
Update gpio_pin_configure() to take into account GPIO flags defined by
the devicetree. Use gpio_pin_get/gpio_pin_set to verify reading/writing
of logical pin values. Use gpio_pin_interrupt_configure() to configure
interrupts.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Piotr Mienkowski ebc5bc62b0 samples: blinky: update to use new GPIO API
Update gpio_pin_configure() to take into account GPIO flags defined by
the devicetree.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-02-05 12:00:36 +01:00
Vincent Wan 47a51d4698 samples: http_get: exclude cc32xx for sample.net.sockets.http_get.posix
Eliminates CI build warnings such as this which breaks the build:

  warning: NET_SOCKETS_POSIX_NAMES
  (defined at subsys/net/lib/sockets/Kconfig:13) was assigned the value
  'n' but got the value 'y'.

The testcase involves no offloading, which means it does not apply to
cc32xx.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Vincent Wan 801077f03e samples: http_get: fix build warnings on cc32xx
This PR eliminates the Kconfig warnings seen in build by setting the
options to the appropriate values for cc32xx platforms. They were
causing CI failures.

Fixes #22388

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-02-05 10:41:08 +02:00
Jukka Rissanen 529195e276 samples: net: modem: Remove extra DTS setting from cmake
The setting was commented anyway, so removing it for now.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Jukka Rissanen 7b22f683d0 samples: net: modem: Fix the name of the app
The name of the application was wrong.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-02-05 10:19:15 +02:00
Peter A. Bigot d715fbba63 samples: boards: nrf: add battery measurement sample
Use the voltage divider devicetree binding to demonstrate measurement
of battery voltage for two Nordic-based boards that have the necessary
circuitry.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-02-03 16:26:51 +01:00
Andy Ross 9e37e80a1d samples/userspace/shared_mem: Add volatile to interthread data
This test uses bare variables to synchronize state between threads,
but had forgotten volatile qualifiers on all the data.  So the
compiler was free to reorder and make assumptions that aren't valid
when the values are being written from other CPUs.

Single-cpu operation was fine because the code would always hit an
external function call like k_sleep() that would force it to re-read
from memory every time there was a context switch (timeslicing isn't
enabled on this test and the threads are cooperative), but on SMP the
volatiles can change at any time and we could see spurious state
mixups and hangs.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-02-03 09:31:56 -05:00
Patrik Flykt dbd3439cf9 samples: net: echo_client: Add Kconfig option to run a number of times
Add Kconfig option NET_SAMPLE_SEND_ITERATIONS that sets the number of
times the Zephyr echo client sample sends its data. By default the
value is zero, which means indefinite, and demonstrates the same
behavior as before.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-02-03 09:04:12 -05:00
Maureen Helm 06d17aa68d samples: display: Enhance lvgl sample to support touch input
Enhances the lvgl sample to support an optional touch panel input on
mimxrt10{50,60,64}_evk boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-01 08:50:16 -05:00
Maureen Helm 5a330f9b36 drivers: kscan: Extend callback arguments to 32-bits
Extends the keyboard scan callback row and column arguments from 8-bits
to 32-bits to support a touch panel driver implementation.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-02-01 08:50:16 -05:00
Anas Nashif e3acaa10e4 samples: net: set CONFIG_NET_BUF_RX_COUNT to 64
This count is assigned to CONFIG_BT_ACL_RX_COUNT which expects a number
in the range of 1-64, otherwise kconfig fails.

Fixes #22259

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-31 15:03:28 -05:00
Johann Fischer cf6fd8482b samples: lvgl: write initial content before blanking_off
Write initial content of the display before blanking_off.
This allow faster update of the electronic ink displays as
the controller do not update the pannel when the banking
is enabled (currently this behaviour is only implemented
in gd7965 driver).

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-31 11:37:35 -05:00
Robert Lubos ece552c644 drivers: wifi: simplelink: Rework offloading mechanism
Switch to `NET_SOCKET_REGISTER` mechanism over the offloaded API
registration.

Including the following fixes from the review:

* The fd returned by the socket accept call needs to be finalized,
  similar to how it is done for socket creation.

* sl_RecvFrom() in TI SimpleLink Host driver does not support NULL
  pointers for 'from' address and address length, and sl_SendTo() does
  not ignore the destination address when in connection mode, so passing
  NULL would cause a failure. These issues have been reported to TI
  (CC3X20SDK-1970, CC3X20SDK-1971).

  Let's use sl_Recv and sl_Send to implement recvfrom/sendto in the case
  of NULL addresses.

* simplelink_poll() should not process negative file descriptors in the
  fds array after sl_Selecti() returns. A negative fd value indicates
  that the entry is invalid and should be ignored.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-31 11:36:02 -05:00
Andrzej Puzdrowski 0113b08baa samples/subsys/settings: add nrf targets supports
added nrf52 basic boards support.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-31 07:45:52 -05:00
Andrzej Puzdrowski 8fa5b44389 samples/subsys/settings: FS and native_posix support
Added support for native_posix targets.
Added setting FS back-end initialization which is used by
native_posix targets.

The test harness was adapted to the fact that key-value pairs
read-out order might be different for each back-end when call
settings_load().

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-31 07:45:52 -05:00
Andrzej Puzdrowski d518f6a784 samples/subsys/settings: add test harness
Added Harness in sample.yaml

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-31 07:45:52 -05:00
Andrzej Puzdrowski 42c09c99e9 samples/subsys/settings: add the readme doc
Added readme file for the sample

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-31 07:45:52 -05:00
Andrzej Puzdrowski 580b0a9155 samples/subsys: add sample for the settings
Added sample for the settings subsystem.

The sample shows how to:
-initialize and register handler
-implement handles
-save and load data using registered handlers
-load subtree
-save or delete a certain value
-load subtree values or a value directly
- example on how to write data to the
setting destination and how to read data
from the setting destination using runtime API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-31 07:45:52 -05:00
Magne Værnes e02eb4e511 samples: net: echo_client/_server: Fix bug in socket close
Fixed bug in udp.c in echo_client and echo_server samples.
The bug causes UDP sockets to not close if socket id is 0.

Signed-off-by: Magne Værnes <magne.varnes@nordicsemi.no>
2020-01-30 12:33:30 +02:00
Jukka Rissanen 1d324a1b20 samples: net: echo-server: Fix compile error for missing IP proto
Make sure that the echo-server compiles ok if IPv6 or IPv4 is
disabled when VLAN is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-30 09:42:07 +02:00
Peter A. Bigot 046bae60b6 samples: drivers: spi_flash: switch nrf52840_pca10056 to Nordic QSPI
Adjust the configuration file, disable the SPI
driver and enable the QSPI driver and flash node.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Peter Bigot 240a57a6f2 samples: littlefs: correct to use SPI NOR flash memory on nrf52840_pca10056
A configuration file attempted to select the external flash memory for
this platform, but there was no overlay that redefined the storage
partition to be on that device rather than the SOC flash.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-29 15:15:49 +01:00
Kwon Tae-young c88816cb6e samples: lora/receive: Added support for RSSI, SNR
Change to display RSSI and SNR values of the received data.
This change helps to test LoRa's communication distance and
communication quality.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2020-01-28 17:28:26 -05:00
Erwan Gouriou 480bf4c73b samples: bluetooth/peripheral: Fix test variant name
Replace ..peripheral_hr.. by ..peripheral..


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-28 15:10:45 -06:00
Erwan Gouriou 4b8e05a1d8 samples: bluetooth: Add nucleo_wb55rg as test target for peripheral
Aim is to ensure build of stm32 hci_ipm driver.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-28 15:10:45 -06:00
Michael Scott 5476e0b365 samples: net: mqtt_publisher: add return value to wait()
In order to better handle incoming data, wait() should return
the # of sockets with data returned by poll().

Based on this new return value, we can call mqtt_input() in a
smarter way.

Signed-off-by: Michael Scott <mike@foundries.io>
2020-01-28 15:45:08 -05:00
Michael Scott 3e24eb8af1 samples: net: mqtt_publisher: handle EAGAIN from mqtt_live()
Now that mqtt_live() can send an EAGAIN message meaning: no ping
was generated, let's handle that in process_mqtt_and_sleep() by
skipping the call to mqtt_input() since no data will be expected.

Signed-off-by: Michael Scott <mike@foundries.io>
2020-01-28 15:45:08 -05:00
Henrik Brix Andersen c894a6db4d drivers: counter: add counter_get_value(), deprecate counter_read()
Introduce a new counter API function for reading the current counter
value (counter_get_value()) and deprecate the former counter_read() in
favor of this.

Update all drivers and calling code to match the new counter API.

The previous counter driver API function for reading the current value
of the counter (counter_read()) did not support indicating whether the
read suceeded. This is fine for counters internal to the SoC where the
read always succeeds but insufficient for external counters (e.g. I2C
or SPI slaves).

Fixes #21846.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-01-28 12:52:46 -05:00
Jukka Rissanen 748eb99646 samples: net: websocket: Verify the received data properly
Make sure that we do not calculate terminating \n when comparing
the received data to sent data because the \n is not part of
the lorem_ipsum buffer.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-28 19:49:16 +02:00
Anas Nashif d55a09ff05 samples: shared_mem: exclude qemu_x86_64
This sample keeps failing in CI due to some SMP issues currently being
addressed. Exclude until we have a fix.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-28 10:38:10 -05:00
Anas Nashif 132fcd0eaa samples: remove extra colon from test identifier
Fix bad yaml syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-28 10:38:10 -05:00
Flavio Ceolin d337f3bab3 tests: tags: Add entropy and random tags
Add these new two tags to tests that exercise these features.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-01-28 09:37:51 -05:00
Patrik Flykt 10fb64f4dc samples: net: Create sample app for GSM modems
Sample app compiled with the GSM modem driver enabling PPP.

This sample was tested with a Reel Board UART_1 connected via the
external board/connector and a FONA 808 modem. Reel board specific
suppor is found in boards/.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2020-01-28 12:44:17 +02:00
Ulf Magnusson cf89ba33ea global: Fix up leading/trailing blank lines in files
To make the updated test in
https://github.com/zephyrproject-rtos/ci-tools/pull/121 clean, though it
only checks modified files.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-27 17:41:55 -06:00
Alexander Wachter 2f44990e9b can: Introduce can-primary alias
This commit introduces the can-primary alias to identify
the primary CAN interface.
This alias is used for all samples and tests, so they don't
need to probe the right interface.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-01-27 10:25:00 -06:00
Peter Bigot 344c109f02 treewide: use full path to wifi/winc1500.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 02ae343100 treewide: use full path to uart.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 165fe48229 treewide: use full path to sensor.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot e423639c41 treewide: use full path to ps2.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot b314857099 treewide: use full path to kscan.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 5e486b98b1 treewide: use full path to ipm.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 81ca8888db treewide: use full path to hwinfo.h header
The build infrastructure should not be adding the drivers subdirectory
to the include path.  Fix the legacy uses that depended on that
addition.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Peter Bigot 44806ba74a samples/drivers/display: remove redundant include
drivers/display.h was being included both as a double-quote direct
include and an angle-quote in the drivers parent directory.  Both
resolve to the same file.  Remove the unqualified reference.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-26 17:52:12 +01:00
Armando Visconti 8dbe9806ff drivers/i2c: Kconfig.stm32: Enable interrupts usage by default
I2C interrupts usage should be the preferred way. This commit
enables them by default in the STM32 I2C driver itself.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-01-24 21:34:45 -05:00
Jukka Rissanen 16805018bb samples: net: dns: Small refactoring
Moving the code around and enhancing debug prints. No changes in
functionality.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-01-24 16:22:18 +02:00
Anas Nashif c9171be27e samples: drivers: fix build of spi_fujitsu_fram sample
Use DTS filtering and get binding based on DTS variable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-23 14:18:40 -05:00
Ravi kumar Veeramally 326302eda0 samples: net: echo_server: Do not bail out on Accept errors
Echo-server sample should not bail out on failed
accept() calls. This sample should close socket
in case of any errors and keep listening on socket
for further incoming connections.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Ravi kumar Veeramally d228dd0c85 samples: net: echo_server: Add signed certs and keys
Current sample certs and keys are not signed. Adding
signed certificates and keys. CA file also added.
This helps users to test with different kind of
configurations.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-01-23 21:07:18 +02:00
Jose Alberto Meza d23c570644 samples: drivers: espi: Showcase eSPI OOB channel APIs
Add sample usage for eSPI OOB driver transactions

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-01-23 12:17:48 -05:00
Joakim Andersson 751868a806 samples: smp_svr: Handle advertise start in disconnected callback.
With a recent change introduced a connectable advertiser will reserve
a connection object when started. In the disconnected callback the
disconnected connection object is not yet released, so the application
is not able to allocate this connection object for a new connectable
advertiser until after the disconnected callback.

reserve conn commit: 46bf20036a

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-23 14:13:17 +02:00
Andrew Boie 8eecb3717a samples: shared_mem: fix exception printouts
Enable CONFIG_TEST so that we get the necessary defines for
console output when a fatal error happens, as well as assertion
checking.

Remove an unnecessary self-abort in main(), this causes an
assert to fail. Letting main() return does the same thing, more
gracefully.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-22 22:41:50 -05:00
Anas Nashif 91920268e0 net: remove sample implementing NATS
A sample implementing NATS protocol that is not part of the Zephyr
networking subsystem. The implementation is not maintained and only
served as a proof of concept.

Related to #20017

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-22 13:55:52 -05:00
Sebastian Bøe 011da8c1b0 samples: Add sample 'application_development/out_of_tree_driver'
Add a sample that demonstrates (and tests) that custom drivers can be
maintained outside of Zephyr.

The sample is fairly minimal with few dependencies and should
therefore be very portable. It also includes a sample.yaml that should
ensure that it does not regress.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2020-01-22 09:26:12 -05:00
Andy Ross 86ac7dc10a samples/userspace/shared_mem: Fix SMP race
There was some unlocked initialization code in the "enc" thread that
would race with the "pt" and "ct" threads if another CPU was available
to run them (it was safe on UP because "enc" entered the queue first
and was cooperative, the others wouldn't run until it blocked).

Move it to main() and remove the enc_state guard variable which is no
longer doing anything.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-01-21 14:47:52 -08:00
Andrzej Puzdrowski 5f89145d6b boards: remove NFFS mentions from comments/doc
Replaced NFFS mentions by LittleFS in all <board>.dts comments
to storage partitions.
Replaced NFFS by LittleFS in a few boards documentation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski 7331a9ea26 samples/subsys/shell/fs: remove nffs configuration
NFFS configuration was removed.
Added working configuration for nRF boards.
Documentation aligned to fact that littlefs is supported.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Andrzej Puzdrowski e104741b7c samples/subsys/mgmt/mcumgr/smp_svr: use LitleFS as FS back-end
This patch addapt the sample to using LittleFS as the FS back-end.
After NFFS will be removed this ensures mcumgr FS command functionality.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>

smp_svr cleanu
2020-01-21 15:32:47 +01:00
Carlo Caione 25769e3fff samples: cmsis_rtos_v1: Grow stack size to the maximum allowed
Some architectures require more space on the stack when running samples
and tests while the philosopher test (cmsis_rtos_v1) is still using a
fixed-size stack size.

Since the test is going to use CMSIS v1 we cannot directly use
CONFIG_TEST_EXTRA_STACKSIZE to grow the stack size because the extra
space allocated can excess the maximum size allowed by CMSIS and defined
by CONFIG_CMSIS_THREAD_MAX_STACK_SIZE, causing the sample to halt on the
assertion (thread_def->stacksize <= CONFIG_CMSIS_THREAD_MAX_STACK_SIZE).

To avoid this problem (and align the test to what has been already done
on the philosopher test using CMSISv2) we set the stack size to the
maximum allowed size of CONFIG_CMSIS_THREAD_MAX_STACK_SIZE.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-01-20 18:33:34 -05:00
Henrik Brix Andersen 5ecc6698b9 samples: canbus: add CANopen sample
Add sample demonstrating the integration of CANopenNode in Zephyr to
support the CANopen protocol.

This fixes #15278.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-20 17:17:23 +01:00
Jan Van Winkel 6ebd0e3f02 samples: display: Added support for BGR565
Added support for BGR565 to display sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-20 09:21:04 -06:00
Ruslan Mstoi aa53024fdc net: tcp2: Double main stack size to fix QEMU crash
QEMU running TCP2 echo crashes upon start. This patch doubles main stack
size to fix the crash.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2020-01-20 10:01:08 +02:00
Robert Lubos 665d195f3a net: sockets: tls: Add missing symbols for a few options
`TLS_PEER_VERIFY` and `TLS_DTLS_ROLE` options accept specific values,
yet no symbols were defined for them. In result, magic numbers were used
in several places, making the code less readable.

Fix this issue, by adding the missing symbols to the `socket.h` header,
and using them in places where related socket options are set.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-20 09:58:23 +02:00
Peter Bigot 02911c9f3a samples/subsys/fs/fat_fs: increase main stack size
The sample overruns the stack while mounting the disk with a default
1024-byte stack.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-18 13:28:45 -05:00
Gerson Fernando Budke e393a26270 samples: wpan_serial: Update doc with build instructions
This add details how build and flash the application. This diferentiate
between SoC and transceivers to help understand what user need to do to
build and flash successfully.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Gerson Fernando Budke 38b5aed2ad samples: wpan_serial: Fix device binding error msg
This drop CC25xx reference on debug messages.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Gerson Fernando Budke 0618659a19 samples: wpan_serial: Add rf2xx transceiver overlay
Create overlay-rf2xx.conf overlay file to enable Atmel rf2xx
transceivers on this application.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-18 12:28:24 +02:00
Ulf Magnusson 4e85006ba4 dts: Rename generated_dts_board*.{h,conf} to devicetree*.{h,conf}
generated_dts_board.h is pretty redundant and confusing as a name. Call
it devicetree.h instead.

dts.h would be another option, but DTS stands for "devicetree source"
and is the source code format, so it's a bit confusing too.

The replacement was done by grepping for 'generated_dts_board' and
'GENERATED_DTS_BOARD'.

Two build diagram and input-output SVG files were updated as well, along
with misc. documentation.

hal_ti, mcuboot, and ci-tools updates are included too, in the west.yml
update.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-17 17:57:59 +01:00
Robert Lubos bb32e9e3fb samples: net: mqtt_publisher: Remove mqtt_input after mqtt_disconnect
This function call is no longer needed for a proper disconnect.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-16 21:02:28 -05:00
Jan Van Winkel b6beec9e68 samples: display: Move LVGL sample
Move LVGL sample from samples/gui/lvgl to samples/display/lvgl to have
a unified location for display related samples.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-16 21:01:41 -05:00
Jan Van Winkel 6d0deba1d0 samples: display: Remove ST7789V sample
Remove ST7789V display sample as there is a unified display sample
in samples/drivers/display.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-16 19:19:45 -05:00
Jan Van Winkel b912df91cf samples: display: Remove ILI9340 sample
Remove ILI9340 display sample as there is a unified display sample
in samples/drivers/display.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-16 19:19:45 -05:00
Robert Lubos b3a1ede830 net: openthread: Use settings subsystem
OpenThread settings implementation built on top of Zepyhr settings
submodule.

With this solution, OpenThread settings are identified with keys of
the following format: `ot/id/instance`, where `id` is assigned by
OpenThread stack, and `instance` is a 32-bit random number, both in
hex. The implementation makes use of `settings_load_subtree_direct`
function to iterate over settings instances. This allows the
OpenThread settings layer to be a fully transparent shim layer between
OpenThread/Zephyr APIs.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-01-16 17:12:47 -06:00
Ulf Magnusson ecb20669b3 samples: sht3xd: kconfig: Do not assign promptless SHT3XD_TRIGGER
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

SHT3XD_TRIGGER is already being selected by
SHT3XD_TRIGGER_GLOBAL_THREAD, which is enabled in the same configuration
file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-16 07:50:05 -06:00
Gerson Fernando Budke 7e4216a6c9 samples: wpanusb: Add atsamr21_xpro board support
Define CONFIG_NET_CONFIG_IEEE802154_DEV_NAME value necessary to enable
atsamr21_xpro board on wpanusb sample.

The documentation was updated referencing the atsamr21_xpro board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-01-16 10:47:10 +02:00
Łukasz Hejnak 09933fbdca samples: drivers: soc_flash_nrf: Tagged sample with nrf9160
Extended the tags section to also match this sample for nrf9160.

Signed-off-by: Łukasz Hejnak <lukasz.hejnak@nordicsemi.no>
2020-01-15 07:39:53 -06:00
Łukasz Hejnak 35fc0bea46 samples: drivers: soc_flash_nrf: add test harness
Added harness config to sample in order for the sanitycheck tool
to run and understand whether the samples output is as expected.

Signed-off-by: Łukasz Hejnak <lukasz.hejnak@nordicsemi.no>
2020-01-15 07:39:53 -06:00
Peter A. Bigot 45f9efe02f samples: sensor: ccs811: update for new capabilities
Use nrf52_pca20020 and nrf51_ble400 to demonstrate the new functionality
of the CCS811 driver.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot ff7269013e samples: sensor: ccs811: add Linaro copyright statements
Add missing information to existing files in anticipation of whinage
from recently modified CI License checks.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Peter A. Bigot 6c15968322 drivers: sensor: ccs811: uncrustify
Run the code formatter over the source files for the CCS811.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-14 15:44:09 -06:00
Ulf Magnusson 56901f3ae3 samples: minimal: kconfig: Do not assign promptless MEMORY_PROTECTION
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

This symbol is select'ed automatically by the X86_MMU, ARM_MPU, and
ARC_MPU symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 11:06:24 -05:00
Ulf Magnusson 6608beaaaa console: kconfig: Do not assign promptless CONSOLE_HAS_DRIVER
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

These configuration files all enable UART_CONSOLE, which selects
CONSOLE_HAS_DRIVER.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 15:42:33 +01:00
Ulf Magnusson 1b451e0bed bluetooth: kconfig: Do not assign promptless BT_DEBUG
BT_DEBUG is a promptless helper symbol, defined in
subsys/bluetooth/common/Kconfig. It is selected by BT_DEBUG_LOG, which
these configuration files also enable.

Flagged by https://github.com/zephyrproject-rtos/zephyr/pull/20742.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 13:41:29 +01:00
Andrew Boie 777213c0fb samples: drivers: crypto: fix test failure
The regular expressions used by this test to determine
success or failure get confounded if the log subsystem
drops the wrong messages due to buffers being full.

Just use minimal logging which synchronously logs
everything.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-13 16:35:10 -05:00
Jan Van Winkel 7e3f9ebf3f samples: display: Added generic display shield sample
Added a generic display shield sample.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-10 09:18:20 -06:00
Anas Nashif 7c9a87aea2 samples: remove i2c scanner
Now part of the I2C shell and works for all boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-10 08:55:47 -05:00
Henrik Brix Andersen 105dc72dff samples: shields: lmp90100_evb: add rtd sample
Add sample for reading the temperature of a 3-wire PT100 sensor using
the Texas Instruments LMP90100 Sensor Analog Frontend (AFE) Evaluation
Board (EVB) shield.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Peter A. Bigot f05cbb421d drivers: sensor: mcp9808: fix various problems and improve test
Correct handling of device encoded temperature values, which combine a
12-bit 2s complement signed value with a separate sign bit.  Rework
conversion between device and sensor temperature representations to
support negative temperatures in both domains.

Use a much simpler trigger configuration where the alert is driven by
comparator output, rather than as an interrupt that requires a pair of
I2C transactions to read and clear the flag.

Refactor the trigger infrastructure to use the setup/handle/process
idiom, which reduces duplicated code and to correctly detect alerts
present when the triggers are set.

Completely replace the sample with something that demonstrates
updating upper and lower threshold values to track moving
temperatures.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-01-08 20:33:51 -05:00
Peter Bigot 649500aeca samples: sensor: mpu6050: convert to devicetree
Add a sample for the MPU6050 that demonstrates on-demand and triggered
display of all sensor data.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:40:04 +01:00
Peter Bigot ff5cadc52c samples: sensor: adt7420: rework for trigger testing
When a trigger was enabled the original implementation would do
nothing more than print "Waiting for a threshold event", without
describing what such an event would look like.

Rework to maintain a window of +/- 0.5 Cel around the most recent
in-window temperature, and reset that window whenever a trigger occurs
or a non-trigger reading is outside the window.  Time-out and display
the temperature if no event occurs in a reasonable time.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Peter Bigot 6ecc0c53c0 samples: sensor: adt7420: add nrf52_pca10040 devicetree overlay
Expand the set of hardware this can be tested with.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Peter Bigot be904bc289 samples: sensor: adt7420: fix frdm_k64f devicetree overlay
The device address can only be 0x48 through 0x1B.  C6 is connected to
the FXOS870 and is not exposed on a header: switch to Arduino D0.

Move this to a boards subdirectory so we can add other overlays
without cluttering the root.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-01-08 16:38:43 +01:00
Henrik Brix Andersen 3407eaeeca samples: rgb_led: add support for PWM flags
Pass PWM flags set in the device tree, if any, to the
pwm_pin_set_usec() functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen edd891adfd samples: blink_led: add support for PWM flags
Pass PWM flags set in the device tree, if any, to the
pwm_pin_set_usec() functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen 3124cf8bff samples: fade_led: add support for PWM flags
Pass PWM flags set in the device tree, if any, to the
pwm_pin_set_usec() function.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Henrik Brix Andersen db611e6781 drivers: pwm: add support for inverted PWM signals
Add support for requesting an inverted PWM pulse (active-low) when
setting up the period and pulse width of a PWM pin. This is useful
when driving external, active-low circuitry (e.g. an LED) with a PWM
signal.

All in-tree PWM drivers is updated to match the new API signature, but
no driver support for inverted PWM signals is added yet.

All in-tree PWM consumers are updated to pass a flags value of 0
(0 meaning default, which is normal PWM polarity).

Fixes #21384.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Daniel Leung e78704251b samples: intel_s1000_crb/audio: fix return for non-void function
The usb_transport_init() does not return a value when it fails to
initialize the USB device. So add a return value there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-07 17:09:38 +01:00
Jan Van Winkel 78c6241ee2 samples: display: Build for st7789v_waveshare_240x240
Update sample.yaml file for ST7789v sample to also build with
st7789v_waveshare_240x240 shield.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-06 14:25:00 -05:00
Jan Van Winkel a781d1267f samples: display: Enable display support in ST7789V sample
Enable display support for ST7789V sample by setting CONFIG_DISPLAY in
prj.conf.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-06 14:25:00 -05:00
Ulf Magnusson 7e0af9e0b8 kconfig: Remove redundant $ZEPHYR_BASE from 'source's
The $srctree environment variable is already set to point to the Zephyr
root, so no need to do

    source "$(ZEPHYR_BASE)/Kconfig.zephyr"

in samples. Just

    source "Kconfig.zephyr"

works.

(Things would break if $srctree was set to anything else, because every
'source' in the Kconfig files will be relative to it.)

Also add a 'mainmenu' title to the littlefs sample. It shows up at the
top of menuconfig/guiconfig. Source Kconfig.zephyr instead of Kconfig to
avoid overriding it.

As a sidenote, $(FOO) is better $FOO in Kconfig. $FOO is legacy syntax
that Kconfiglib only supports to be compatible with old Linux kernels.
$(FOO) uses the Kconfig preprocessor.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-06 09:48:53 -05:00
Paul Sokolovsky b3ef46ed63 samples: sockets: big_http_download: Increase stack size.
x86-mmu now crashes with default 1K, bump to 2K, which hopefully might
work even for 64-bit archs.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-01-04 09:19:16 -05:00
Erwan Gouriou 4faf6546b1 boards/shields: ssd1306: Factorize and move to conditional Kconfig
Factorize definitions for ssd1306_128x32 and sd1306_128x64 shields
and move to conditional Kconfig.
As part of this change, direct drivers Kconfig symbols enabling
(I2C, SSD1306) are removed as they are application responsibility.
Also disabling SSD16XX is removed as SSD16XX should not be enabled
by default.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-02 17:02:41 -05:00
Johann Fischer 04db2dcea7 shields: st7789v_generic: rename shield to TL019FQV01
Rename shield to TL019FQV01.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-01-02 17:00:06 -05:00
Jan Van Winkel 3e63d6a088 samples: display: Use ST7789V generic shield
Use the ST7789V generic shield in ST7789V display sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-02 17:00:06 -05:00
Oleg Zhurakivskyy f4ebf53cfb samples: sockets: echo: Include stdlib.h
Include stdlib.h to suppress a missing declaration
warning for exit() when compiled as a Linux target.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-01-02 13:07:19 -08:00
Joakim Andersson 0f717058a0 Bluetooth: samples: peripheral_esp: Use common 24-bit functions
Use the newly introduced byteorder 24 bit variant functions.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-02 19:05:27 +01:00
Ulf Magnusson 9c9eb3452b kconfig: Fix some formatting nits
Same deal as in commit bd6e04411e ("kconfig: Clean up header comments
and make them consistent") and commit 1f38ea77ba ("kconfig: Clean up
'config  FOO' (two spaces) definitions"), for some newly-introduced
stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-21 10:30:02 -05:00
Manivannan Sadhasivam e43fdb0428 samples: drivers: Add LoRa receiver sample
Add sample application for receiving data packets over LoRa.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-12-21 12:20:24 +01:00
Manivannan Sadhasivam 72f5806cec samples: drivers: Add LoRa sender sample
Add sample application for sending data packets over LoRa.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2019-12-21 12:20:24 +01:00
Andrei Emeltchenko cd7fdd7d58 samples: wpanusb: Allow to build for general boards also
This enables build for boards with usb and ieee802154 like reel_board,
etc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko c87384875c samples: wpan_serial: Allow to build for more boards
Allow to build also for general boards with supported ieee802154 and
usb, like reel_board, etc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko d78a06428a samples: wpan_serial: Refactor wpan_serial
Refactor code simplifying packet processing, removing unneeded
semaphore, etc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko 292efefaf3 samples: wpan_serial: Use logger hexdump helper
Remove hexdump() based on printk and use standard logger helper.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko 8315420df0 samples: wpan_serial: Take into account bytes written
uart_fifo_fill() returns number of bytes written, use helper to write
all bytes.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko f4f9dc6005 samples: wpan_serial: Update README
Update README and reformat it to rst.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko 80e4321a5b samples: wpan_serial: Create cc2520 overlay
Create cc2520 overlay file. Can be used with:

cmake -DBOARD=quark_se_c1000_devboard \
  -DOVERLAY_CONFIG=overlay-cc2520.conf ..

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko 095d8070db samples: wpan_serial: Allow to use other 15.4 devices
This allows to select different IEEE802.15.4 chips instead of
hardcoded cc2520.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Nick Ward b5f335b11b mcumgr: BT SMP transport config for authenticated requirement
This commit introduces a new Kconfig symbol MCUMGR_SMP_BT_AUTHEN.
When selected it configures the Bluetooth mcumgr transport to require
an authenticated connection.

If the Bluetooth mcumgr transport is selected then this new symbol is
selected by default.  Bluetooth SMP is also selected to ensure Zephyr
is configured with Bluetooth security features enabled to provide
Bluetooth authentication APIs to the user's app.  Users can choose to
disable this level of security for the Bluetooth mcumgr transport if
they do not require it.

Fixes #16482

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-12-20 20:28:39 -05:00
Peter Bigot c2723054f6 samples: sensor: lps22hh: add standalone sample
Although this sensor is demonstrated by the X-NUCLEO-IKS01A3 sample,
maintenance of the driver is simplified if it can be tested in
isolation.  Provide a sample modeled on hts221.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-20 20:25:11 -05:00
Carlo Caione aec9a8c4be arch: arm: Move ARM code to AArch32 sub-directory
Before introducing the code for ARM64 (AArch64) we need to relocate the
current ARM code to a new AArch32 sub-directory. For now we can assume
that no code is shared between ARM and ARM64.

There are no functional changes. The code is moved to the new location
and the file paths are fixed to reflect this change.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Anas Nashif 6b01656c4b samples: sensor: fix test identifier
use sample.sensor.shell instead of test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-20 10:35:13 -05:00
Jukka Rissanen 56101c3c9a samples: bluetooth: ipsp: Mark accepted socket correctly in accept()
The TCP code expects that we know when the socket has called accept()
in order to continue connection attempt.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-20 16:45:06 +02:00
Diego Sueiro e924879ef7 samples/subsys/shell: Introduce Sensor Shell module
Adds the Sensor Shell module sample app.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-19 15:54:04 -05:00
Peter Bigot 816d2c47a4 samples: sensor: dht: add sample
Add a sample to test the Aosong temperature/humidity sensor.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 06:43:37 -06:00
Emil Obalski 2128750138 usb: api: Add user device status callback
By this commit user gets possibility to register USB
device satutus callback. This callback represents device state
and is added so user could know what happend to USB device.

Callback is registered by providing it to usb_enable()
USB api is extended by this callback handler.

Samples using using USB are by default provide no callback
and the usb_enable() is called with NULL parameter.

Status callback registered by hid class is deleted as now
USB device has global callback for all classes within device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski d65027d8c0 usb: samples: Application calling usb_enable by itself
User app is reponsible for issuing usb_enable and
making USB hardware operative.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Peter Bigot bc2ecad363 samples: drivers: spi_flash: increase test data length
Some drivers may be unable to write less than 4 bytes.  Increase the
test to use at least 4 bytes and refactor so the logic is no longer
explicitly size-dependent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 12:37:31 +01:00