Commit graph

5007 commits

Author SHA1 Message Date
Martí Bolívar
aab2252817 samples: blink_led: cleanups and fixups
Align this sample's source code and documentation with other basic
samples.

Adjust the logging configuration and output some additional printk()s
at startup to make it more obvious that initial errors are device
specific and related to calibration.

Fix the period calculation logic so the sample does not stick at the
maximum and minimum periods for two consecutive four-second periods.
That is, instead of setting the pin period to MIN_PERIOD_USEC twice in
a row, do it only once before doubling again, and similarly for
max_period.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
dff93ae00f samples: button: cleanups
Clean up the code and fix the documentation, which is out of date and
still refers to information from the days of board.h.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
63b74f0ec7 doc: samples: tweak blinky readme
The led0 alias doesn't have to be in BOARD.dts, though that is
customary.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
6e8775ff84 devicetree: remove DT_HAS_NODE_STATUS_OKAY
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:

- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
  for macros which are equivalent to
  DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name

Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.

This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 18:24:42 +02:00
Peter A. Bigot
5748369f78 samples: subsys: mgmt: smp_svr: add separate fs support
File system support is built into the Bluetooth overlay, but can now
also be enabled independently for other transports.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-13 18:21:08 +02:00
Peter A. Bigot
860ef6a9a1 samples: subsys: mgmt: smp_svr: add serial transport overlay
This can be more convenient than Bluetooth or UDP.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-13 18:21:08 +02:00
Armando Visconti
7201c1d6e9 samples/shields: x-nucleo-iks02a1: Fix doc for microphone
Fix documentation for microphone sample code.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-05-11 17:12:02 +02:00
Jukka Rissanen
5c62afdaaa samples: net: lldp: Check VLAN and LLDP support for interface
Make sure that we have proper network interface which support
VLAN and LLDP in this sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-11 17:11:23 +02:00
Anas Nashif
f7a6c7d154 samples: clean test identifiers
Use a complete identifier, first two parts are section.subsection, then
at least another part for the specifics being tested.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-11 17:00:26 +02:00
Anas Nashif
db99287f53 samples: tracing: run openocd sample with 1 cpu
openocd thread awareness support does not work with multiple CPUs
enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-10 17:52:06 +02:00
Peter A. Bigot
c26b7c8d5c samples: littlefs: fix reg error in particle_xenon overlay
Eliminate "unit address and first address in 'reg'" diagnostic for the
storage partition redefinition.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-09 21:21:16 +02:00
Kevin Townsend
1fed229f6e samples: tfm_integration: Add PSA level 1 sample app
This commit adds a `tfm_level_1` samples app that shows how
to use the PSA APIs in IPC mode in a real-world example.

It makes use of the crypto, initial attestation and secure
storage modules.

Signed-off-by: Kevin Townsend <kevin@ktownsend.com>
2020-05-09 16:21:51 +02:00
Karl Zhang
b3e7867214 samples: tfm_integration: Add TFM IPC sample app
This commit adds a minimal sample application showing how
TF-M can be used in IPC mode, with Zephyr providing the
non-secure processing environment image, and linking against
the PSA APIs implemented in TF-M.

This commit also include work from the commit quoted below,
which is included here for attribution purposes:

    tfm_ipc: cmake: now using tfm_ipc library created by TF-M module

    This commit removes the need for local knowledge of the TF-M
    repository structure and files.

    Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-05-09 16:21:51 +02:00
Karl Zhang
fec5ed6077 trusted-firmware-m: Add initial plumbing for TFM
This commits adds a config option to build a PSA trusted-firmware-m
(TF-M) application image for the secure processing environment, and
configures the Zephyr application image for the non-secure processing
environment. The secure and non-secure environment images will be
linked together via the veneer function table that is produced as an
artifact of the TF-M build process.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2020-05-09 16:21:51 +02:00
Kumar Gala
db725c0ec9 drivers: Replace GPIO_CS Kconfig with devicetree detection
Use DT_INST_SPI_DEV_HAS_CS_GPIOS() in drivers to determine if we should
utilize CS_GPIO base SPI chipselect handling.  This allows us to remove
Kconfig option for this feature.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-09 13:07:05 +02:00
Martí Bolívar
7e0eed9235 devicetree: allow access to all nodes
Usually, we want to operate only on "available" device
nodes ("available" means "status is okay and a matching binding is
found"), but that's not true in all cases.

Sometimes we want to operate on special nodes without matching
bindings, such as those describing memory.

To handle the distinction, change various additional devicetree APIs
making it clear that they operate only on available device nodes,
adjusting gen_defines and devicetree.h implementation details
accordingly:

- emit macros for all existing nodes in gen_defines.py, regardless
  of status or matching binding
- rename DT_NUM_INST to DT_NUM_INST_STATUS_OKAY
- rename DT_NODE_HAS_COMPAT to DT_NODE_HAS_COMPAT_STATUS_OKAY
- rename DT_INST_FOREACH to DT_INST_FOREACH_STATUS_OKAY
- rename DT_ANY_INST_ON_BUS to DT_ANY_INST_ON_BUS_STATUS_OKAY
- rewrite DT_HAS_NODE_STATUS_OKAY in terms of a new DT_NODE_HAS_STATUS
- resurrect DT_HAS_NODE in the form of DT_NODE_EXISTS
- remove DT_COMPAT_ON_BUS as a public API
- use the new default_prop_types edtlib parameter

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-08 19:37:18 -05:00
Tomasz Bursztyka
97326c0445 device: Fix structure attributes access
Since struct devconfig was merged earlier into struct device, let's fix
accessing config_info, name, ... attributes everywhere via:

grep -rlZ 'dev->config->' | xargs -0 sed -i 's/dev->config->/dev->/g'

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-08 23:07:44 +02:00
David Brown
a7d35b7984 samples: net: google_iot: Clarify key type docs
Clarify in the docs the importance of generating a key type that matches
the configuration used to sign JWT tokens.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown
fb137098c9 samples: net: google_iot: Add config template to prj.conf
Add the template config values to the prj.conf.  These will need to be
changed according to the instructions in the README.rts.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
David Brown
961e7e707e samples: net: google_iot: Fix unclear documentation
The instructions on setting the necessary Kconfig values is unclear.
Add a description based on values that can be found in the Google IoT
Core console.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-05-08 22:23:37 +02:00
Jose Alberto Meza
98ce11676e samples: boards: mec15xxevb: Update power management test cases
Add indication when sleep entry/exit counter do not match the test
expectations.
Measure deep sleep entry latency.
Add sleep entry/exit indication via gpios to debug.
Remove unnecessary trailing \n when using logging.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-05-08 17:46:45 +02:00
Emil Obalski
6789ecbd5e usb: samples: Add USB Audio Headset sample
This commit adds USB audio sample to the Zephyr project.

The sample configures one I/O device:
- Headset (2 channels, Fs=48kHz, PCM format)

Input data sstream is passed to output data stream.

For more details refer to README.rst.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-08 15:12:27 +02:00
Emil Obalski
8eefca2674 usb: samples: Add USB audio Headphones + Microphone sample
This commit adds USB audio sample for Zephyr project.

The sample configures two devices:
- Microphone (2 channels, Fs=48kHz, PCM format)
- Headphones (2 channels, Fs=48kHz, PCM format)

Input data stream is passed to output data stream.

For more details refer to README.rst.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-08 15:12:27 +02:00
Jukka Rissanen
ae7da57cf4 samples: net: cloud: google: Convert to allow new timeouts
Fix timeout handling in the code so that we do not need to
enable legacy timeout.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-08 15:10:42 +02:00
Carles Cufi
b67a31e411 Bluetooth: controller: Remove legacy LL
Remove the legacy Link Layer implementation.

Closes #24187.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-08 15:07:00 +02:00
Henrik Brix Andersen
4aeea753b2 samples: canbus: canopen: add program download support
Add optional program download support to the CANopen sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-08 10:53:42 +02:00
Henrik Brix Andersen
ed9f2fc28a samples: canbus: canopen: use python-can configuration file
Recommend setting up the python-can configuration file before running
the sample Python snippets and remove the GNU/Linux specific comment
from each snippet.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-08 10:53:42 +02:00
Paul Sokolovsky
44e2a0343d samples: sockets: echo_async_select: Add CONFIG_POSIX_API config
Build a sample variant with CONFIG_POSIX_API enabled, to check that
we have select() call available to applications.

Also, bump stack size, as the app crashes now with the default size.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-08 11:16:31 +03:00
Robert Lubos
2c2771970e modules: mbedtls: Update mbedTLS commit and apply fixes
Update mbedTLS commit along with the following fixes:

* Fix naming inconsistencies in some cipher modes, to match core mbedTLS
  configs
* Add Kconfig to enable CTR cipher mode

Fixes #22421

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 23:46:08 -05:00
Robert Lubos
fc7b142961 net: openthread: Use newlib in samples
OpenThread throws a warning when minimal libc is used, as some of its
new files use stdlib functions not available in the minimal
implementation. It's not critical failure, as those new functions are
not linked anyway in default configuration, but the warnings do not
look well. Therefore, use newlib by default in the sample to prevent
warnings.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-05-07 23:27:49 -05:00
Anas Nashif
5622ee4c59 samples: x_nucleo_iks02a1: fix test identifier
Use a more complete test identifier instead of just test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-07 14:23:45 -04:00
Peter A. Bigot
e444274e95 drivers: counter: add Maxim DS3231 support
The DS3231 is an I2C real-time clock with internal temperature
compensated oscillator, maintaining civil time to 1 s precision with
nominal 2 ppm accuracy from 0-40 Cel.

The basic functionality is exposed as a counter that is always running
at 1 Hz.  Much more functionality is exposed as driver-specific API,
including the ability to translate between the time scale of the DS3231
and the time scale of the Zephyr uptime clock.  This allows correlation
of events in the system clock to UTC, TAI, or whatever time scale is
used to maintain the DS3231.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-07 19:45:06 +02:00
Andrzej Głąbek
e92ba8f362 samples: drivers: Add sample that shows how to use AT45 flash driver
This commit adds a sample application intended to present capabilities
of the flash driver for AT45 family chips and to serve as a reference
of how to make use of that driver.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-05-07 14:51:10 +02:00
Andreas Sandberg
7663be01f1 samples: lora: Use the new DT alias to discover radio
The LoRa shell requires the alias 'lora0' for the default radio. Use
the same alias for the samples to make them portable across different
radios and devices.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-05-07 14:49:06 +02:00
Maureen Helm
cda8cf265e samples: subsys: fs: Add new board configurations to fat_fs sample
Adds new configurations for mimxrt10{60,64}_evk boards to the fat_fs
sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-07 14:47:43 +02:00
Maureen Helm
b21f4cb677 samples: subsys: fs: Update fat_fs sample documentation
Updates the fat_fs sample documentation to reflect that it can run on
multiple boards, not just the nrf52840_blip.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-07 14:47:43 +02:00
Maureen Helm
389ff5d6d4 samples: subsys: fs: Refactor fat_fs sample yaml to reduce whitelist
Refactors the fat_fs sample yaml to depend on a feature rather than
whitelisting specific boards. This implicitly extends the sample to
mimxrt10{60,64}_evk boards, since they already support the feature.

The only whitelist board remaining is the nrf52840_blip, which requires
a device tree overlay for this sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-07 14:47:43 +02:00
Maureen Helm
ec56fa9967 samples: subsys: fs: Refactor fat_fs board configurations
Refactors the fat_fs sample to move board-specific configurations to
separate files and support a shared prj.conf file.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-05-07 14:47:43 +02:00
Emil Obalski
45bdb23005 usb: Special return values for custom_handler
This commit introduces dedicated return type for custom_handler.
Relevant code is updated to fulfill the API documentation.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-07 11:20:27 +02:00
Carles Cufi
9ba20dd48e drivers: audio: Port to the new timeout API
Port the I2S and DMIC drivers to the new timeout API so that they do
not need to enable legacy timeouts.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Carles Cufi
9b04a99243 timeouts: Port BBC micro:bit to the new timeout API
Port the BBC micro:bit display driver to the new timeout API exposed by
the kernel.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-07 11:01:55 +02:00
Ioannis Glaropoulos
9b09f136f7 bluetooth: hci_rpmsg: check SHM_SIZE against shared mem size using DT
Add a build-time assert to check that the configured SHM_SIZE
does not exceed the memory allocated as shared memory. USe DT
to extract the shared memory size.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-05-07 10:07:00 +02:00
Armando Visconti
9f52bfd12b samples/shields: add samples to test x-nucleo-iks02a1 shield
Provide three basic examples to test the x-nucleo-iks02a1 shield:

    - Test shield standard mode
        Acquire sensor data from shield configured in mode 1.

    - Test shield sensorhub mode
        Acquire sensor data from shield configured in mode 2.

    - Test on-shield microphone
        Acquire microphone PDM audio and output it in 16-bit
        PCM format to console.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-05-06 10:33:07 -05:00
Martí Bolívar
a6b86446d4 doc: hello_world: touch up README
Since this is such a basic sample, it's worth nitpicking the wording a
bit:

- Add a link to the supported boards, since many first time users
  will not know where it is and may start near here.

- Remove the single and multi threaded note. There's no information on
  how to build it in either of these two modes or what the default is,
  so it feels like a distraction for such a basic sample.

- Give a clue about how to build for another board.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-06 17:25:49 +02:00
Martí Bolívar
3b7918360a doc: blinky: touch up README
The devicetree link is rendering as "Devicetree Guide" instead of
"devicetree". Fix that.

My guess is that most users won't care about the details of the
requirements, and rather just want to know if their board is supported
or not. So move the error you'll see on unsupported boards before the
details about how to add support (which involve a pretty significant
learning curve).

Also mention overlays as a way to get this working.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-06 17:25:49 +02:00
Andreas Sandberg
ff26eebb7e samples: lora: Remove unnecessary config option
LoRa drivers no longer depend on CONFIG_COUNTER. Remove this
configuration option from the samples.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-05-06 07:29:52 -05:00
Kumar Gala
fdd85d5ad7 dts: Rename DT_HAS_NODE macro to DT_HAS_NODE_STATUS_OKAY
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear.  As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-06 05:25:41 -05:00
Vinayak Kariappa Chettimada
93c5e253a4 samples: Bluetooth: Restart scanning on connection failure
Restart scanning if connection creation fails; could happen
when devices with low RSSI are discovered but not available
thereafter to establish a connection.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-05-06 13:05:18 +03:00
Charan Pudiyaneravana Venkatesh
afcf01d7dc samples: Bluetooth: Added central health thermometer
Added central sample to read die temperature value from peripheral
device.

Signed-off-by: Charan Pudiyaneravana Venkatesh <charan.pv@sixoctets.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-05-06 13:05:18 +03:00
Charan Pudiyaneravana Venkatesh
6ec8349875 samples: Bluetooth: Integrate temperature sensor sample fetch
Integrated temperature sensor sample fetch and use of the value
in the GATT indications.

Signed-off-by: Charan Pudiyaneravana Venkatesh <charan.pv@sixoctets.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-05-06 13:05:18 +03:00
Peter A. Bigot
88c0545ea4 samples: usb: mass: add support for littlefs file systems
This allows mass storage exposure of a littlefs file system,
specifically one on the SPI NOR flash of the nrf52840dk_nrf52840.  In
combination with littlefs-fuse this allows a host system to examine
and change the local storage of a Zephyr application.

Note that it is critical that all parameters of the file system match
between what Zephyr is using and what littlefs-fuse is using.
Inconsistencies can produce confusing results where each system sees
different content.  The README has been updated with a detailed
example.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Peter A. Bigot
f128cbe80f samples: usb: mass: update nrf52840dk board configuration
Drop the old redefine-everything-in-a-special-conf approach and put
the customization appropriate for this board into the board directory
where it's handled automatically.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Peter A. Bigot
f5e31c4d5d samples: fs: littlefs: fix lost flash area reference
The API call to close the flash area was only invoked when the flash
area was erased.  It should be closed in all paths.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Alexander Wachter
464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Marcin Niestroj
6f643cd2b7 samples: shell: shell_module: add demo hexdump command
Demonstrate hexdump command by dumping all command parameters.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-05-06 09:42:02 +02:00
Andrew Boie
8edf99bdf1 samples: prod_consumer: run faster
The whole sample now completes in about 2 seconds.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-05 18:28:59 -07:00
Henrik Brix Andersen
bd4c7bdc92 samples: sensor: fxos8700: enable testing on lpcxpresso55s16_ns
Enable testing of the FXOS8700 present on the NXP LPCXpresso55S16
board.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-05 17:03:29 -05:00
Kumar Gala
bdb07c668c samples: sensor: ms5837: Remove unneeded setting of Kconfig
The NRF driver doesn't utilize the Kconfig symbol for per instance I2C
so we can remove setting that in the conf file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 11:44:34 -05:00
Ioannis Glaropoulos
4cf4be4373 samples: subsys: openamp: use new-style DT macros for shared memory
Adapt to using new-style device tree macros
for shared memory base address and size.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-05-05 10:08:28 -05:00
Ioannis Glaropoulos
2840a9954a samples: bluetooth: hci_rpmsg: use new-style DT for shared mem macro
Adapt to use new-style Device Tree macros for the
shared memory defines.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-05-05 10:08:28 -05:00
Kumar Gala
31d5caa0a8 samples: counter: alarm: Convert to use new dts macros
Convert DT_RTC_0_NAME to DT_LABEL() references based on which driver is
enabled for the platforms the test is supported on (NRF & STM32).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-05 15:46:50 +02:00
Jukka Rissanen
65a1bebe85 net: Replace NET_WAIT_FOREVER by SYS_FOREVER_MS
As we now have SYS_FOREVER_MS, use that instead of network
specific NET_WAIT_FOREVER.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-05 16:29:23 +03:00
Ravi kumar Veeramally
b78c9dca52 samples: net: cloud: Fix polling incoming messages
Topic subscribe() will allow cloud to send messages to
device. There will be a bit of network delay. But mqtt_input
was called only after publish() which will trigger every
10-15 seconds. Which is causing more delay to read published
messages from cloud even though messages are already available
at socket level.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2020-05-05 14:10:44 +03:00
Anas Nashif
0bac2f35cc samples: remove unused harness definition
remove console harness without a config.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-05-05 06:16:50 -04:00
Kumar Gala
4e93b77552 samples: Convert DT_ALIAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Kumar Gala
cdd629cda2 samples: basic: threads: Rework to not define generated macros
Rather than redefining a macro which might be generated we should create
a new define name that should get used in the code.  Replace redefining
DT_ALIAS_LED0_GPIOS_FLAGS with LED0_FLAGS and DT_ALIAS_LED1_GPIOS_FLAGS
with LED1_FLAGS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Kumar Gala
88a0f441da samples: basic: button: Rework to not define generated macros
Rather than redefining a macro which might be generated we should create
a new define name that should get used in the code.  Replace redefining
DT_ALIAS_SW0_GPIOS_FLAGS with SW0_FLAGS and DT_ALIAS_LED0_GPIOS_FLAGS
with LED0_FLAGS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Kumar Gala
188cf2331b samples: lwm2m_client: Rework to not define generated macros
Rather than redefining a macro which might be generated we should create
a new define name that should get used in the code.  Replace redefining
DT_ALIAS_LED0_GPIOS_* and just use the LED_GPIO_* defines that already
exist.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Manivannan Sadhasivam
7be8debaab lora: Switch to new timeout API
Get rid of legacy timeout API and move to new timeout API for LoRa.
This involves changes to API, SX1276 driver and sample application.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-05-04 19:01:09 +02:00
Stephanos Ioannidis
0eaa495ccb samples: drivers: can: Rename directory for consistency
This commit renames the CAN sample directory name from `CAN` to `can`
to be consistent with others.

Noting that the CAN driver test directory is named `tests/drivers/can`,
we have no excuse for naming the CAN driver sample directory
`samples/drivers/CAN`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-02 09:54:06 -04:00
Henrik Brix Andersen
ae2b3587e6 samples: drivers: dac: add support for frdm_k64f board
Add support for the NXP FRDM-K64F development board to the DAC driver
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Henrik Brix Andersen
280e3fa999 samples: drivers: dac: add support for twr_ke18f board
Add support for the NXP TWR-KE18F development board to the DAC driver
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-05-01 12:35:50 -05:00
Paolo Teti
a17770e702 samples: canbus: isotp: fix a typo
Fixed 'erreor' in 'error'

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2020-05-01 12:32:22 -05:00
Jukka Rissanen
15c162016e Bluetooth: samples: ipsp: Convert to use k_timeout_t
IPSP sample was not using k_timeout_t value in net_context_recv()
call.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-01 10:50:03 +03:00
Kumar Gala
009ca36bb7 samples: cc13x2_cc26x2: system_off: Convert to use new dts macros
Convert DT_TI_CC13XX_CC26XX_GPIO_40022000_LABEL to
DT_LABEL(DT_NODELABEL(gpio0))

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:44:50 -05:00
Kumar Gala
45242422c4 samples: sensor: mpr: Convert to use new dts macros
Convert DT_INST_0_HONEYWELL_MPR_LABEL to
DT_LABEL(DT_INST(0, honeywell_mpr))

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:44:50 -05:00
Kumar Gala
50750bfa31 samples: nrf: battery: Convert to new dts macros
Change #ifdef DT_VOLTAGE_DIVIDER_VBATT_IO_CHANNELS to
 #if DT_NODE_HAS_PROP(DT_INST(0, voltage_divider), io_channels)

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:44:24 -04:00
Kumar Gala
aea994455a sample: boards: nrf: system_off: Convert to use new dts macros
Convert to use DT_GPIO_PIN(DT_NODELABEL(button0), gpios) to get the gpio
pin number.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 17:44:24 -04:00
Kumar Gala
c678f9c132 samples: boards: nrfx: Convert to new dts macros
Convert to use DT_IRQN() and DT_IRQ() to get the irq number and priority
for the DT_NODELABEL(gpiote) device.

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

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-30 18:26:26 +02:00
Joakim Andersson
ab706b28d5 Bluetooth: samples: Convert to using k_timeout_t struct
Convert bluetooth samples or board samples using bluetooth to use the
new k_timeout_t struct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-04-30 13:46:48 +03:00
Anas Nashif
50a9184787 samples: fix configuration for systemview/cpu stats
need to enable tracing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Anas Nashif
eaba71738e samples: move tracing sample from tests/
This is more a sample than a test, so put it under samples with the goal
of having dedicated tracing tests in the future under tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Anas Nashif
5f9b05265a samples: philosophers: remove systemview section from sample
This configuration is non-functional and repeated in a sample dedicated
to tracing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Paul Sokolovsky
215253910e samples: posix: gettimeofday: Make networking requirements explicit
Standard "Requirements" section copied from other networking samples,
making clear the network connection requirements and linking to
instructions for QEMU networking.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky
76861d008b samples: posix: gettimeofday: Add sample.yaml
To make sure this sample is built in CI.

Also includes fixing prototype of main() to make it build without
warnings (which would be errors in CI).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Paul Sokolovsky
4221642b28 samples: gettimeofday: Increase stack size by 64 bytes.
Otherwise the sample started to fail on qemu_x86.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-29 23:15:12 +03:00
Kumar Gala
3f236f2183 can: dts: Convert can-primary alias to zephyr,can-primary chosen prop
Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

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

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

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 14:27:31 -05:00
Gerson Fernando Budke
5321c42882 samples: drivers: counter: alarm: Add samd20_xpro
Add samd20_xpro board support to show how to use sam0 TC32.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-04-29 10:43:21 -05:00
Kumar Gala
d929e874c2 boards: dts: nrf: Remove SoC compatible in top-level compatible
The SoC node has compatibles for the specific SoC in place, having the
same compatible at the top level is technically a conflict and the
top-level one should really just be about the board.  Remove the SoC
related compatibles at the top-level.

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

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

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

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

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

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-04-28 09:57:41 +03:00
Stephanos Ioannidis
460cb7880c samples: net: Rename local PORT definition
This commit renames all local definitions with the name `PORT` in the
net samples, in order to prevent name conflict with certain HALs
(notably, Atmel SAM E5x HAL).

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

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

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

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

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-04-27 19:03:44 +02:00
Antony Pavlov
3d35a8dde5 samples: conf: don't enable option twice
Remove enabling of the same option twice.

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

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

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-25 09:29:54 -05:00
Mark Olsson
1ca4aedc35 tests: drivers: fixes for failing tests
Tests were failing as they were looking for an alias which didn't exist
Also, because some code in kscan_handlers.c wasn't compilable

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00