Commit graph

5007 commits

Author SHA1 Message Date
Henrik Brix Andersen
506256c7cc samples: sensors: fxos8700: add polling support
Add support for polling the sensor values of the FXOS8700 device when
no trigger (interrupt) is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-07-01 11:41:25 -05:00
Johan Hedberg
0d9dab300e Bluetooth: Introduce separate pool for discardable events
Introduce a separate buffer pool for events which the HCI driver
considers discardable. Examples of such events could be e.g.
Advertising Reports. The benefit of having such a pool means that the
if there is a heavy inflow of such events it will not cause the
allocation for other critical events to block and may even eliminate
deadlocks in some cases.

Also update all mesh samples not to specify explicit RX buffer counts
anymore. Instead, create appropriate defaults in Kconfig so that we
only need to override this in the app for cases like the bbc:microbit
with limited memory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Kumar Gala
284bc9d964 dts: Rename SW._GPIO_* -> DT_ALIAS_SW._GPIOS_*
We use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l SW._GPIO_CONTROLLER | xargs sed -i 's/SW\(.\)_GPIO_CONTROLLER/DT_ALIAS_SW\1_GPIOS_CONTROLLER/g'
git grep -l SW._GPIO_PIN | xargs sed -i 's/SW\(.\)_GPIO_PIN/DT_ALIAS_SW\1_GPIOS_PIN/g'
git grep -l SW._GPIO_FLAGS | xargs sed -i 's/SW\(.\)_GPIO_FLAGS/DT_ALIAS_SW\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-01 07:14:36 -05:00
Kumar Gala
24b2b594dc dts: Rename PWM to PWMS
We use the following commands to rename any _PWM_{CONTROLLER,CHANNEL}
to *_PWMS_{CONTROLLER,CHANNEL}

Used the following commands to make these changes:

git grep -l '[A-Z_0-9]*_PWM_CONTROLLER' | xargs sed -i 's/\([A-Z_0-9]*\)_PWM_CONTROLLER/DT_ALIAS_\1_PWMS_CONTROLLER/g'
git grep -l '[A-Z_0-9]*_PWM_CHANNEL' | xargs sed -i 's/\([A-Z_0-9]*\)_PWM_CHANNEL/DT_ALIAS_\1_PWMS_CHANNEL/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-28 06:53:48 -05:00
Anas Nashif
5b0aa794b2 cleanup: include/: move misc/reboot.h to power/reboot.h
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
efb8df5366 cleanup: include/: move misc/stack.h to debug/stack.h
move misc/stack.h to debug/stack.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5eb90ec169 cleanup: include/: move misc/__assert.h to sys/__assert.h
move misc/__assert.h to sys/__assert.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
7435e5e089 cleanup: include/: move ring_buffer.h to sys/ring_buffer.h
move ring_buffer.h to sys/ring_buffer.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
9e35d53d1f cleanup: include/: move display.h to drivers/display.h
move display.h to drivers/display.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
bd70f6f1ed cleanup: include/: move spi.h to drivers/spi.h
move spi.h to drivers/spi.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
8c1f89fa99 cleanup: include/: move sensor.h to drivers/sensor.h
move sensor.h to drivers/sensor.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
fd359c21e9 cleanup: include/: move rtc.h to drivers/rtc.h
move rtc.h to drivers/rtc.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
afa85cdc0f cleanup: include/: move led_strip.h to drivers/led_strip.h
move led_strip.h to drivers/led_strip.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
a14ef3bf01 cleanup: include/: move led.h to drivers/led.h
move led.h to drivers/led.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
6524925753 cleanup: include/: move ipm.h to drivers/ipm.h
move ipm.h to drivers/ipm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f2e35134b0 cleanup: include/: move i2s.h to drivers/i2s.h
move i2s.h to drivers/i2s.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
8f692c7d38 cleanup: include/: move i2c.h to drivers/i2c.h
move i2c.h to drivers/i2c.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
969f8f1c68 cleanup: include/: move entropy.h to drivers/entropy.h
move entropy.h to drivers/entropy.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
7e7a9bdf88 cleanup: include/: move counter.h to drivers/counter.h
move counter.h to drivers/counter.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
c0c9396d44 cleanup: include/: move can.h to drivers/can.h
move can.h to drivers/can.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
d4d20677ac cleanup: include/: move watchdog.h to drivers/watchdog.h
move watchdog.h to drivers/watchdog.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
4be2e9ebb6 cleanup: include/: move zephyr/jwt.h to data/jwt.h
move zephyr/jwt.h to data/jwt.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
0abdacf3a4 cleanup: include/: move json.h to data/json.h
move json.h to data/json.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
190e368275 cleanup: include/: move power.h to power/power.h
move power.h to power/power.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f641d099cc cleanup: include/: move disk_access.h to disk/disk_access.h
move disk_access.h to disk/disk_access.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
52e0efac97 cleanup: include/: move stats.h to stats/stats.h
move stats.h to stats/stats.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
f048792888 cleanup: include/: move nvs/nvs.h to fs/nvs.h
move nvs/nvs.h to fs/nvs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
656f4dfdac cleanup: include/: move fs.h to fs/fs.h
move fs.h to fs/fs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif
169589221d cleanup: include/: move console.h to console/console.h
move console.h to console/console.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Kumar Gala
a614a026b7 dts: Rename DT_.*_GPIO_* to DT_.*_GPIOS_*
Convert DT_.*_GPIO_{CONTROLLER,PIN,FLAGS} ->
	DT_.*_GPIOS_{CONTROLLER,PIN,FLAGS)

Used the following commands to make these conversions:

git grep -l DT_.*_GPIO_CONTROLLER | xargs sed -i 's/DT_\(.*\)_GPIO_CONTROLLER/DT_\1_GPIOS_CONTROLLER/g'
git grep -l DT_.*_GPIO_PIN | xargs sed -i 's/DT_\(.*\)_GPIO_PIN/DT_\1_GPIOS_PIN/g'
git grep -l DT_.*_GPIO_FLAGS | xargs sed -i 's/DT_\(.*\)_GPIO_FLAGS/DT_\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-27 13:02:34 -05:00
Johann Fischer
abaeaed2af usb: sort usb config data by section
USBD_CFG_DATA_DEFINE macro has not consider that a class
could have more than one set of usb_cfg_data struct.
If a class has more than one set of usb_cfg_data
then they should be sorted the same way like by
USBD_DEVICE_DESCR_DEFINE macro.

Fixes: #16240

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-27 12:18:05 +02:00
Andrzej Głąbek
036791364c usb: kconfig: nrf52840: Enable REMOTE_WAKEUP option only when needed
This patch removes the "hard" selection of the USB_DEVICE_REMOTE_WAKEUP
Kconfig option for USB devices made on the nRF52840 SoC. Now it's up to
the application to decide if it wants to enable the option. This change
makes it possible to pass the USB3CV Chapter 9 Tests for applications
that don't use the remote wakeup feature, since when a USB device only
reports that it supports this feature, and the mentioned option makes
it to do so, one of the test cases expects the USB device to actually
perform the remote wakeup. And when the feature is not reported as
supported, the test case is skipped.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-06-27 12:17:45 +02:00
Alexander Wachter
7a73bb7efe samples: CAN: Add FRDM-K64F defconfig
This commit adds a board defconfig for the FRDM-K64F board.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-06-26 16:05:51 -05:00
Kumar Gala
8226aa128b samples: out_of_tree_board: remove board.h
We don't use board.h in general so lets remove it from this sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-26 09:11:07 -04:00
Carles Cufi
d4083b6638 Bluetooth: hci_uart: Assert if device is NULL
Assert if the UART device is NULL to help with debugging whenever
there's an issue locating the correct UART instance.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-26 12:37:04 +02:00
Carles Cufi
3b3bbc1ee0 Bluetooth: hci_uart: Use DT for the hci_uart UART
Use Device Tree,and in particular a new 'bt-c2h-uart' to select which
UART is being used to communicate with an external BLE Host when acting
as a Controller.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-26 12:37:04 +02:00
Peter A. Bigot
42d335982f Bluetooth: central_hr: use new API to get value handle
The assumption that the value handle is one past the attribute handle
works for Zephyr servers but may not be true for others.  Avoid the
hard-coded system-specific assumption.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-06-25 18:24:32 +02:00
Krzysztof Chruscinski
4fabc07ce5 samples: drivers: counter: alarm: add nordic boards to the whitelist
Add nordic boards to the whitelist to ensure that compilation is
checked by the CI.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-25 15:00:55 +02:00
Charles E. Youse
57b46bbc85 soc/x86/intel_quark: remove support for Quark D2000 SoC
Removed Quark D2000 SoC files and first-order related DT bindings.

A few config options have been moved from the CONFIG_* space to
the DT_* space, as they were defined in the D2000 Kconfig files
and "leaked" into the other Quark trees.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Charles E. Youse
ca4910827b boards/x86/quark_d2000_crb: drop support for Quark D2000 dev board
Remove the board directory as well as references in tests and samples.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-25 08:06:43 -04:00
Henrik Brix Andersen
a361d7caad samples: drivers: CAN: add support for twr_ke18f board
Add support for the NXP TWR-KE18F developement board to CAN sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-24 14:33:46 -05:00
Anas Nashif
f2cb20c772 docs: fix misspelling across the tree
Found a few annoying typos and figured I better run script and
fix anything it can find, here are the results...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-19 15:34:13 -05:00
Andy Ross
42d8936f4d samples/subsys/usb/dfu: Set sanitycheck test to build_only
This sample has to be operated manually (it's a USB DFU implementation
that needs to be plugged into a host to validate).  Sanitycheck is
failing right now becuase it tries to flash and run it, and doesn't
see a harness declaration.

Set it to build_only when run under sanitycheck.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-19 14:37:20 -04:00
Andy Ross
3cea065954 samples/subsys/power/device_pm: Add test harness integration
Right now this fails needlessly under sanitycheck for lack of a
harness declaration.  It's short, just stuff in a simple regex check.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-19 14:37:20 -04:00
Andy Ross
b56cc058ef samples/boards/nrf52/power_mgr: Correct test integration
The regexes for the power states entered were in the wrong order, and
this tests takes 2 minutes to get to that point, blowing past the
default sanitycheck timeout.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-19 14:37:20 -04:00
Ulf Magnusson
eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
David B. Kinder
6b2cd29223 doc: fix misspellings in documentation
Fix misspellings and doc issues missed during regular reviews (including
some files without a trailing newline)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-18 15:08:19 -04:00
Laczen JMS
8ca8708224 subsys/settings: Update client modules
This updates all client modules to const char processing of
setting names.

Update of peripheral_dis sample

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-06-18 17:57:08 +02:00
Jukka Rissanen
404ac51055 samples: net: socket: can: Close the socket periodically
This is done only for testing purposes, in real life the socket
would be closed if it is not used or needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
ae89c2239b samples: net: can: Add second RX socket receiver
This is done so that we can test socket CAN dispatcher.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Bernard Lee
b14f4f67a8 samples: display: ili9340: Document 2 Arduino TFT shield configurations.
Update README.rst with Arduino TFT shields setup details for nRF52 DK
and nRF52840 DK.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-06-17 17:06:06 -04:00
Erwan Gouriou
dbad99ec92 soc: stm32: STM32L4: Remove useless package digit
Fixes #16733, applied to STM32L4 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-17 16:14:45 -04:00
Carles Cufi
b476643695 doc: Cleanup references to cmake
Clean up some stray references to cmake in doc, boards and
samples that don't make explicit use of the zephyr app extension,
as well as other minor doc fixes.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-06-17 10:09:57 -07:00
Kumar Gala
d4a0c3a2aa dts: Convert new/missed DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-15 07:14:12 -04:00
Ulf Magnusson
a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Kumar Gala
a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Krzysztof Chruscinski
ea44b056bc samples: drivers: counter: alarm: Fix compilation for nrf boards
Sample was not compiling for nordic boards because RTC_0
instance was not enabled by default and RTC_0 device is using
different DT define.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-06-14 05:44:39 -04:00
Anas Nashif
c95b97db2e samples: spi_fujitsu_fram: remove whitelisting
Remove restrictive whitelisting and adapt board configuration causing
issues.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif
51cc6a4ffa samples: grove_light: remove whitelisting
Remove unnecessary whitelisting and fix boards to enable ADC instance
when ADC is configured in.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Anas Nashif
efb47ace39 doc: samples: cleanup board reference and layout
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Nicolas Pitre
6311766d9a pointer-type args: cast appropriately to be 64-bit compatible
Using void pointers as universal arguments is widely used. However, when
compiling a 64-bit target, the compiler doesn't like when an int is
converted to a pointer and vice versa despite the presence of a cast.
This is due to a width mismatch between ints (32 bits) and pointers
(64 bits). The trick is to cast to a widening integer type such as
intptr_t and then cast to
void*.

When appropriate, the INT_TO_POINTER macro is used instead of this
double cast to make things clearer. The converse with POINTER_TO_INT
is also done which also serves as good code annotations.

While at it, remove unneeded casts to specific pointer types from void*
in the vicinity, and move to typed variable upon function entry to make
the code cleaner.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-12 08:20:52 -07:00
Sathish Kuttan
9d5a63b9c1 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the 2-way audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Sathish Kuttan
32b89b9841 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the I2S audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Sathish Kuttan
1cba619e87 samples: intel_s1000: audio buffers in lpsram
Place audio buffers in LPSRAM using linker section attribute
for the digital mic audio sample application

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-06-11 16:36:30 -04:00
Johann Fischer
808075f53f sample: ti_hdc: whitelist reel_board and nucleo_l496zg
Whitelist reel_board and nucleo_l496zg boards.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou
3ae5b65503 samples: added sample for ti_hdc
Added a new sample for TI_HDC driver, tested with nucleo and hdc1080.

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Nikos Oikonomou
4a38cae2af sensors: renamed hdc1008 driver into ti_hdc
Hdc1008 driver is renamed into ti_hdc to prepare it to support all
available Texas Instruments HDC sensors (e.g. hdc1080, hdc2080).

Signed-off-by: Nikos Oikonomou <nikoikonomou92@gmail.com>
2019-06-11 10:17:11 -05:00
Jan Van Winkel
265b195369 samples: fs: Added FS shell sample
Added file system shell sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-06-11 08:31:54 -04:00
Alexandre Bourdiol
b0f40cf475 samples: basic minimal: add nucleo_f429zi, disco_l475_iot1 to whitelist
Useful to test fix for #16177

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2019-06-10 12:42:49 +02:00
Jukka Rissanen
104014154e samples: net: echo-server: Ignore the return value of close()
We are not interested in whether the close() call succeeds or
not when the connection is terminated.

Coverity-CID: 198878
Fixes #16569

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-09 10:23:57 +03:00
Andrew Boie
4d4cc4ddc3 samples: philosophers: pause before main() exit
On some systems the sample was failing validation because
the coverage data would be emitted before the sample had
a chance to print anything else.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Andrew Boie
930a5f8fb7 samples: cmsis philosophers: adjust stack size
Fixes crashes when running with code coverage
enabled.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-06 09:29:12 -07:00
Anas Nashif
2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
David B. Kinder
b9ce0e70f0 doc: fix malformed label in shields doc
Doc label at the top was malformed and couldn't be referenced.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-05 19:46:36 -04:00
Andrei Emeltchenko
df2bb46497 usb: console: Initialize USB console after USB Device stack
It does make sense to initialize USB console after USB Device stack.
Note that the value is selected only if we specify USB_UART_CONSOLE
in prj.conf, not in menuconfig afterwards.

Fixes #16518

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-05 11:44:17 +02:00
Christian Tavares
543de09357 lib: updatehub: add support ipv6
This extends the UpdateHub library code to allow the
use of IPV6 for communication.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares
c5d74eccda lib: updatehub: add suport a CoAPS/DTLS
This extends the UpdateHub library code to allow the
use of CoAPS/DTLS for communication.

Refs: #13039.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Christian Tavares
297ac3765f lib: updatehub: Add UpdateHub.io support
UpdateHub is an enterprise-grade solution which makes simple to
remotely update all your embedded devices in the field. It
handles all aspects related to sending Firmware Over-the-Air(FOTA)
updates with maximum security and efficiency, while you focus in
adding value to your product.

Signed-off-by: Christian Tavares <christian.tavares@ossystems.com.br>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2019-06-05 00:20:37 +02:00
Bosch Sensortec
992819bc84 samples: sensor: bme680 added sample code
Sample code for the BME680 environmental sensor

Signed-off-by: Bosch Sensortec <github@bosch-sensortec.com>
2019-05-31 10:27:13 -05:00
Bernard Lee
591ed2677d samples: display: ili9340: Add 2 Arduino shield sample configurations.
Add 2 Arduino shield sample configurations.
1. nRF52 DK (PCA10040) with Seeed 2.8" TFT Touch Shield v2.0.
2. nRF52840 DK (PCA10056) with Adafruit 2.8" TFT Touch Shield (1947).

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-05-30 09:39:07 -04:00
Bernard Lee
3d2b994633 samples: display: ili9340: Add support of RGB565 pixel format.
ILI9340 display demo supports RGB565 as well as RGB888 pixel format.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-05-30 09:39:07 -04:00
Bernard Lee
72fa9d9556 samples: display: ili9340: ST NUCLEO-L476RG config file.
Put ST NUCLEO-L476RG specific parameters to own configuration file.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-05-30 09:39:07 -04:00
Bernard Lee
1b3b461265 samples: display: ili9340: Get ILI9340 device by DT label.
Get ILI9340 device by DT label instead of a fixed name.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-05-30 09:39:07 -04:00
Benjamin Valentin
3702d1a0d3 samples: nrf52: power_mgr: Fix build with prj_tickless.conf config
prj_tickless.conf lacks the CONFIG_PM_CONTROL_OS=y option which
results in the sample failing to build with this config as it leaves
sys_pm_ctrl_disable_state() and sys_pm_ctrl_enable_state()
undefined.

Add the relevant options from prj.conf to fix the build.

Tested on nrf52840_pca10056.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-05-30 08:45:23 -04:00
Luiz Augusto von Dentz
b65fe62719 Bluetooth: Add possibility to pass a user_data to conn_tx_cb_t
This allows setting a custom pointer to be passed back to the complete
callback at expense of increasing the buffers in 4 bytes.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-29 16:31:03 +03:00
Krzysztof Chruscinski
d6176f8697 samples: drivers: led_lp3943: Rename log module
main.c in the sample was registered to the logger as 'log'. Changed
to 'app'.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-29 13:52:31 +02:00
Daniel Egger
280daa3941 samples: net: lwm2m: use real temperature values instead of dummy
This changes the use of a static and fixed temperature value to using a
read_callback which will either return the previous dummy value or
gather real temperature data from a supported sensor (for now only
FXOS8700 which is available e.g. on a FRDM-K64F).

Signed-off-by: Daniel Egger <daniel@eggers-club.de>
2019-05-28 21:11:05 -04:00
Aaron Tsui
6ae2457491 samples: servo_motor: add HW PWM choice for NRF52 family
Hardware PWM make sense for servo control even in a sample,  add HW PWM
choice for NRF52 family, which support it.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-27 15:22:04 -04:00
Andrei Emeltchenko
3f13079a7c samples: usb: hid: Fix harness configuration
Fix configuration indicating changes in USB device.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
953728b241 samples: usb: wpanusb: Refactor sample using new API
Refactor wpanusb sample using new descriptor API, use endpoint index
instead of hardcoded endpoint address.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
1b64e53aeb samples: usb: webusb: Use Automatic endpoint assignments
Use endpoint index since addresses are automatically assigned.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
3d58abf68b samples: usb: webusb: Use new descriptor placement API
Simplify code using new descriptor API and remove old composite
initialization.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
3880a42375 usb: Align legacy and composite interface
Remove duplicated execution path for composite configuration, USB
device stack initialization is done inside stack for both cases.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko
de26f76ef2 samples: net: echo_server: Fix usbnet configuration
This patch enables USB tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Aurelien Jarno
819e749ccd usb: move the request handler buffer to the USB device code
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Erwan Gouriou
bddb343b09 stm32: Remove redundant I2C variant Kconfig symbols definitions
I2C_STM32_V1 and I2C_STM32_V2 are Kconfig symbols used to
select STM32 I2C driver variant based on I2C IP available on a
given STM32 SoC.
Being SoC dependent, they are automatically selected in soc/
if CONFIG_I2C is set. Then there is no need to define them at board
level, nor for a specific application like this is done in
some sample or test applications. Remove these definitions when
this is the case.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-05-24 22:29:51 -04:00
Jukka Rissanen
4bd654d8c1 samples: net: gptp: Fix compilation instructions
As the prj_base.conf was renamed to prj.conf by commit
4e5300ba7f, the documentation
needs some fixing too.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-23 22:13:11 +03:00
Andrei Emeltchenko
9f2ddc9f8e usb: webusb: Trivial syntax fix
Fix supended -> suspended.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Joao Cordeiro
74f01067e7 samples: bluetooth: peripheral: Fix RX buffer size
GATT long messages require buffers to store multiple packets. The actual
configuration for the bluetooth peripheral sample defines only two
buffers to store these messages. As the default ATT payload size is
18 bytes, the maximum payload size for a long ATT message is 36 bytes.
As the variable `vnd_long_value[]` has a defined size of 74 bytes, it
cannot be fully modified due to the 36 bytes limitation.

Set CONFIG_BT_ATT_PREPARE_COUNT=5 so all the maximum payload size goes
to 90 bytes and all the 74 bytes can be written to `vnd_long_value[]`.

Signed-off-by: Joao Cordeiro <jvcc@cesar.org.br>
2019-05-21 16:15:44 -04:00
Wentong Wu
743a184b2d scripts: mpu align for ro section of new memory region on non-XIP system
on non-XIP system, SRAM is the default region, and relocated .data
section and .bss section of SRAM shouldn't be inserted between
_image_rom_start and _image_rom_end, because the memory region between
_image_rom_start and _image_rom_end will construct the mpu ro region.
Also for the newly added memory region on non-XIP system, the
relocated .text secition and .rodata section should also be mpu aligned.

Fixes: #16090.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-21 15:28:59 -04:00
Michael Scott
3fce0f214e samples: lwm2m_client: re-add sanity check for WNC-M14A2A build
Instead of using the now removed overlay files, use the SHIELD=
command-line option for testing the WNC-M14A2A modem.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 08:17:20 -04:00
Michael Scott
21e9b0f510 samples: lwm2m_client: cleanup shield overlay files
Let's remove the sample-specific overlay files dealing with the
WNC-M14A2A modem.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 08:17:20 -04:00
Øyvind Rønningstad
901c0a1cfd linker: Port usage of custom-sections to use Cmake
Mark custom-sections as deprecated

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-05-20 22:28:28 -04:00
Andrei Emeltchenko
b364b841cc usb: webusb: Fix callback not called
Until PR #15818 is applied we need to use this solution to get
callback called.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-16 07:17:50 -05:00
Karl Zhang
d75f3cede8 sample: mhu: IPM MHU dual core on V2M Musca
Sample walk through:
    1. CPU 0 will wake up CPU 1 after initialization
    2. CPU 1 will send to CPU 0 an interrupt over MHU0
    3. CPU 0 return the same to CPU 1 when received MHU0 interrupt
    4. Test done when CPU 1 received MHU0 interrupt

The wake up second core and private core ID are soc specific.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-05-15 15:37:50 -05:00
Brett Witherspoon
07d21bef0d samples: add ADXL362 sensor sample application
Add a sample application that demonstrates how to use the ADXL362 with
data ready and threshold triggers.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-15 13:38:27 -05:00
Carles Cufi
fc3c2c0abb samples: basic: Add a minimal sample
Add a minimal sample that showcases minimal ROM sizes. It can be built
in several configurations, all very restrictive when it comes to
features enabled in order to verify the fact that we can fit in small
devices and to be able to accurately measure the sizes of the kernel's
basic features.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 10:44:59 +02:00
Aaron Tsui
b8285a580e samples: sensor: bme280: add arduino_101_sss.overlay
Add an overlay file, build out of the box for arduino_101 board.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Aaron Tsui
0b46eb26b4 samples: sensor: bme280: add README.rst
Added BME280 (humidity and pressure sensor) sample documentation for
guiding beginners.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-13 08:40:18 -05:00
Alexander Wachter
b3b43b8921 drivers: can: Extend can_send with void *arg and pass it to the isr cb
This commit extends the CAN api can_send function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between sent masseges
when they use the same callback.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Alexander Wachter
1b93522304 drivers: can: Extend attach_isr with void *arg and pass to the isr cb
This commit extends the CAN api attach_isr function by an argument
that is passed to the isr callback.
With this extension it is possible to distinguish between filter matches
when they use the same callback.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-12 16:54:49 -04:00
Antony Pavlov
bfcfe14764 samples/drivers/watchdog: make it work on STM32
IWDG driver for STM32 doesn't support the callback parameter.
The patch adds necessary workaround for STM32.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-12 15:13:21 -04:00
Paul Sokolovsky
6f6b46971a samples: google_iot_mqtt: Explicitly cast socklen_t to int in printf
Otherwise, it can lead to warning like:

main.c:80:10: warning: format '%d' expects argument of type 'int',
but argument 2 has type 'socklen_t' {aka 'long unsigned int'}
[-Wformat=]

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Paul Sokolovsky
220fba3b5d samples: google_iot_mqtt: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Paul Sokolovsky
08be81d949 samples: sntp_client: Switch from sntp_request() to sntp_query()
sntp_request() was deprecated and superceded by sntp_query(), which
provides better time resolution.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-11 13:25:58 +03:00
Jukka Rissanen
59eb48329e samples: net: can: Add missing tag to SocketCAN sample
We should have "net" tag as this is a networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-05-10 22:43:27 +03:00
Vikrant More
f78599fbca samples: mesh: sync the init procedure to initialise the mesh
Synchronising the init procedure to initialise the mesh
state only after the settings have been loaded.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
35f14bc3ae samples: mesh: replaced magic numbers with values defined in stdint.h
Replaced magic numbers with constant defined in stdint.h

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
0cf1991508 samples: mesh: corrected implemenation of gen. move message handlers
After receiving Generic Level Move set/set_unack message, generic
level state should move towards positive or negative extreme end
(which is depend upon sign of delta value) till it not get interruped.
This commit has introduced this feature.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
36a6adafd9 samples: mesh: removed redundant code
Remove redundant code from implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
4835c0f201 samples: mesh: removed bugs in on-off transition
If Node Lightness is in downward transition & received Generic
onoff message to set state equal to 1 then Node transaction get
stopped in between. Ideally it should reach to default lightness
value if it is non-zero. This commit has solved this bug.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
243044361b samples: mesh: single timer to handle all transitions
This commit upgrade the implementation to reduce complexity in
algorithm. Previously there was different timers for lightness
as well as temperature transitions. But at time only single
transition is remain activated & hence there is no need
of multiple timer for each entiity.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Marcin Szymczyk
a30950c64b usb: cdc: add .inf file
Added .inf driver file for Windows.
CDC examples will now work on Windows.

Note:
This .inf is not signed and may cause problems during installation.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04:00
Marcin Szymczyk
e5cbe6a9e7 usb: cdc: Add unique PIDs for each sample
Unique PID is required for each sample in order
to be recognized by host.

When creating a new sample:
- Add USB_PID_<SAMPLE_NAME>_SAMPLE
  in samples/subsys/usb/usb_pid.Kconfig
- Create Kconfig file in your sample's subdirectory, containing:
  config USB_DEVICE_PID
	default USB_PID_<SAMPLE_NAME>_SAMPLE

  source "Kconfig.zephyr"

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04:00
Peter Herager
95e1eb960b Bluetooth: Add additional attributes to DIS
Add SW, HW, FW & serial attributes to DIS
Add support for reading attributes from settings during boot

Signed-off-by: Peter Herager <pehe@oticon.com>
2019-05-08 20:17:07 +03:00
Andrei Emeltchenko
88145db607 samples: usb: cdc_acm_composite: Refactor sample
Use ring buffer and logger.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-07 23:11:44 -04:00
Andrei Emeltchenko
0e57e4fb78 samples: usb: cdc_acm: Update CDC ACM echo sample
Update CDC ACM sample using ring buffer and fifo_fill / fifo_read
functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-07 23:11:44 -04:00
Henrik Brix Andersen
d481fa8cce samples: drivers: ht16k33: add sample application for the HT16K33
Add a sample application for showcasing the functionality of the
Holtek HT16K33 LED driver with keyscan functionality.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-05-07 22:33:06 -04:00
David B. Kinder
c5112327a7 doc: fix mentions of Wi-Fi trademark name
The approved trademark name is Wi-Fi so update references to WiFi and
other spellings to Wi-Fi in documentation and Kconfig help strings.
(Note that use of spelling variatios of "wifi" in module names, CONFIG
names, link names and such are untouched.)

https://www.wi-fi.org/

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-06 20:10:59 -04:00
Andrei Emeltchenko
f4ff72bbd3 usb: webusb: Add more log output
Add log prints for special requests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko
b0373fbd07 usb: webusb: Fix payload for vendor requests
Fixes payload and simplifies code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko
87b3c63114 usb: webusb: Remove unneeded headers
Remove unneeded headers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko
bc05efacbf usb: webusb: Fix logging for webusb
Replace LOG_MODULE_DECLARE with LOG_MODULE_REGISTER and update default
log level.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko
34a2b4011d usb: webusb: Update license header
Update license header to standard Zephyr.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko
dac83213f4 usb: webusb: Strip 'serial' from names
Since we have remove CDC ACM logic from webusb strip also serial from
function names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Marcin Szymczyk
be1ec7822c usb: samples: mass: add configuration and fs for FLASH
Adds required Kconfig options for flash driver.
Adds FatFS filesystem for flash disk.
Fixes #14459.

Note: As USB MSC does not support multiple disks (see #14937),
only one (flash by default, modify CONFIG_MASS_STORAGE_DISK_NAME
to "RAM" for RAM disk) will appear to host.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-06 11:05:04 +02:00
Maksim Masalski
888f4dd096 samples: LSM6DSL accel fix unchecked return value sensor_trigger_set()
Inside void main(void) result of function sensor_trigger_set() is not
checked which might result that function can't set sensor type
and that error can't be handled.

Coverity-CID: 186196
Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-05-03 09:22:40 -05:00
Aaron Tsui
631cd007bd samples: bluetooth: ibeacon: change to ADV_NONCONN_IND type
According to the Apple iBeacon spec chapter "2.1 Advertising Packet",
"beacons must use a non connectable undirected Advertising PDU,
ADV_NONCONN_IND". Refer to https://developer.apple.com/ibeacon/

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-05-03 14:27:34 +03:00
Johan Hedberg
e69b4be2af Bluetooth: Fix return type for settings read callback
settings_read_cb is defined to return ssize_t and not size_t. This
also eliminates several Coverity warnings.

Fixes #15765
Fixes #15768
Fixes #15771
Fixes #15774
Fixes #15778

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-05-02 11:18:30 +03:00
Luiz Augusto von Dentz
c42707c2d3 Bluetooth: Use BT_GATT_SERVICE_DEFINE whenever possible
This makes use of BT_GATT_SERVICE_DEFINE to statically define services
for services that are not required to be dynamically registered.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-02 08:29:23 +03:00
Andrei Emeltchenko
da701f9d55 samples: hid-cdc: Update USB device names and project conf
Update project configuration and USB HID and CDC ACM device names for
sample hid-cdc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko
995b568b14 samples: cdc_acm: Update CDC ACM Device name
Update device name for USB CDC ACM.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko
1b3227fd99 samples: usb: Correct USB HID device name
Use "HID_0" as a device name since we have only device count now.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
François Delawarde
94451b22fc subsys/settings: Allow to register custom backends in settings subsystem
Major changes are:
- Expose settings backend API to enable custom backend support.
- Add a new CONFIG_SETTINGS_CUSTOM backend to allow registering a custom
backend.
- Change api of the handlers h_set() routines to allow for
backend-specific read callbacks.
- Provide a customizable settings_backend_init() routine for custom
backends.
- Move runtime settings support to be its own backend.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-04-26 11:24:31 +03:00
Benjamin Valentin
7c09695344 net/icmpv6: Allow for arbitrary payload data in ICMP echo
Allow for including arbitrary data in net_icmpv6_send_echo_request()
that will be echoed verbatim by the receiver.

This allows to use ICMP echo for diagnostic use cases, e.g. by testing
packet framentation (large payload) or measuring round-trip-time.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-04-26 09:05:14 +03:00
Bub Wei
57e7ddb7b0 samples: net: zperf: Remove unnecessary main
main function is not necessary.
And without main here, it is possible to import these
samples zperf files in another project.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-25 16:18:49 +03:00
Paul Sokolovsky
901d85bde0 samples: sntp_client: Elaborate sample to workable state
1. Output what steps the app performs, so it doesn't look to user
that it simply hanged.
2. Don't use infinite timeouts, because that will hang.
3. Clearly note which requests are for IPv4 vs IPv6 server.
4. Define IPv4 gateway. This sample is configured to run against
SNTP on local Linux host, but standard distros (e.g. Ubuntu) don't
run SNTP server by default, so usual outcome for running this sample
will be timeout. A realistic way to get successful output would be
to run it against a server on the Internet, for what a gateway is
required.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-04-24 12:50:12 +03:00
Bub Wei
ee442c2b66 samples: net: zperf: Add __packed for zperf_udp_datagram
UDP packet from net is not 4-byte aligned.
So we have to add __packed for zperf_udp_datagram.

Fixes #15605.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-04-23 13:14:35 +03:00
Jukka Rissanen
a9395157a3 samples: net: dumb_http_server: Check EOF while skipping headers
If recv() returns 0 bytes, then terminate the connection.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-23 13:13:35 +03:00
Jukka Rissanen
3d6ce30f29 samples: net: dumb_http_server: Add net_pkt.h file inclusion
The function net_pkt_get_info() is found in net_pkt.h and not
in buf.h. This caused
"implicit declaration of function ‘net_pkt_get_info’"
warning if CONFIG_NET_BUF_POOL_USAGE was enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-04-23 13:13:35 +03:00
Charles Youse
8e307a3ad9 ethernet/eth_e1000.c: change to new PCI(e) functions
Migrate from "legacy" PCI support (drivers/pci) to new PCI(e) support.

The e1000 driver is merely for testing with QEMU and so should not be
a model for the use of PCI(e) functions. Consult instead "real-world"
PCI(e) drivers like the NS16550 UART (drivers/serial/uart_ns16550.c).

Signed-off-by: Charles Youse <charles.youse@intel.com>
2019-04-22 09:34:00 -07:00
Henrik Brix Andersen
ae218d2950 samples: sensors: fxos8700: whitelist rv32m1_vega board
Add the RISCV RV32M1 Vega board to the whitelist in the FXOS8700
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-04-22 08:40:03 -05:00
Vincent Wan
751025957a samples: sockets: sntp_client: Add support for cc3220sf_launchxl
This commits adds a configuration file for cc3220sf_launchxl
suitable for the example.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-04-19 13:54:21 -05:00
Vincent Wan
be5bfb6169 samples: sockets: sntp_client: make IPv6 & NET_CONFIG_SETTINGS optional
In this commit, a config.h header file is added to support the case
when the NET_CONFIG_SETTINGS is not used. main.c is also modified to
enable platforms that do not support IPv6. These changes are necessary
in order to allow cc3220sf_launchxl support.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-04-19 13:54:21 -05:00
Alexander Wachter
f0090825be samples: sensor: ens210: Implement sample for ens210
Sample code for AMS (Austria Micro Systems) ENS210 temperature and
relative humidity sensor.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-04-19 08:37:17 -05:00
Alexander Wachter
f989f2d0f9 samples: sensor: ams_iAQcore: Implement sample for AMS iAQ-core
Sample code for AMS (Austria Micro Systems) Indoor Air Quality Sensor
reading VOC and equivalent CO2 values.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-04-19 08:37:17 -05:00
Carles Cufi
bca3deb1e7 drivers: Bluetooth: Generalize IC-specific setup hook
In order to generalize the currently specialized nRF51 IC setup hook,
make the following changes:

- Generalize the hook to bt_ic_setup()
- Use a weak NOP version by default
- Move the currently existing one to the board folder

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-19 12:21:21 +02:00
Emanuele Di Santo
43b00eff1f samples: bluetooth: hci_uart: update nrf52840_pca10090 config
Enable the GPIO reset pin feature of nrf52840_pca10090
on pin P1.02 and the wait NOP feature of the controller.
These are used to let nrf9160_pca10090 synchronize the
HCI communication with nrf52840_pca10090 controllers.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-04-19 12:21:21 +02:00
Andrzej Puzdrowski
d422d56633 samples/drivers/soc_flash_nrf: enable nrf9160_pca10090 targets
The patch provides flash offsets appropriate for running
this sample on nrf9160_pac10090 targets.
As that sample is small one, it is done with assumption that image_1
flash partition is empty.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-19 11:50:46 +02:00
Andrzej Puzdrowski
2d24ce8565 tests/drivers/soc_flash_nrf: fix lack of disabled protection
Write protection was not disabled prior erase call.
It used to work before only because nrf driver had not check
the protection before erase execution. This behavior was changed in
order to align to zephyr - which implied requirement for this test fix.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-19 11:50:46 +02:00
Aaron Tsui
18b51587b3 doc: sample: mpu Update documentation
Update documentation to new shell commands.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-18 12:24:16 -04:00
Andrei Emeltchenko
e952033559 samples: usb: mass: Add whitelist mass storage on ram
To support mass storage over USB in RAM we need a board with
sufficient RAM. Fix failing tests for boards with low memory.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
4f2674f164 samples: usb: Add depends_on gpio
Add gpio dependence, fixing build for native_posix.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
69726bbccb usb: tests: Enable other boards for test
Enable other boards with USB device supported

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko
35a81562e8 samples: usb: hid: Enable harness for the sample
Enable harness so we can execute smoke tests on the hardware with
command line:
sanitycheck --device-testing --device-serial /dev/ttyACM0 -p <BOARD>
  -T samples/subsys/usb/hid

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Kumar Gala
6b4007e5ed samples: sensor: bme280: Convert code to use printk
There isn't any specific need to use printf here, convert to use printk
instead.

Fixes #14997

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-04-17 19:49:01 -05:00
Karsten Koenig
c9090caad7 drivers: can: mcp2515: Fixes for DT SPI cs
Fixed using chipselect with seperate chipselect GPIOs and how they were
referenced from/in DeviceTree.
Also configure the device during initialization so it's ready to go
after init.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Karsten Koenig
bf52bfea90 samples: can: Added project configuration for MCP2515
Project configuration to run the CAN sample with the MCP2515 attached
via SPI as the CAN controller.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2019-04-17 16:12:30 -04:00
Vikrant More
47b7c79e39 samples: mesh: enable SMP service for DFU
This commit enable Bluetooth SMP Service which will help
us to do Device Firmware Upgrade over thr air. By default
it is not enable.

Reference: $zephyr/samples/subsys/mgmt/mcumgr/smp_svr

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-04-17 10:19:16 +03:00
Johann Fischer
bf71aee8e4 samples: cdc_acm: add config overlay for cdc_acm+dfu
Add config overlay for cdc_acm+dfu composite configuration.
Manual configuration over menuconfig may be error-prone for
the user because then FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE
should also to be set to appropriate values.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-16 08:55:51 -04:00
Johann Fischer
c13e201b18 usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-11 13:35:24 -04:00
Carles Cufi
14c75705cb samples: hci_uart: Reduce MAX_CONN to 16 for the micro:bit
In order to fit in SRAM, reduce the CONFIG_BT_MAX_CONN from 20 to 16 in
the configuration used for the BBC micro:bit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
Carles Cufi
bae9f1967b samples: Bluetooth: hci_uart: Implement NOP Command Complete
Implement the Controller counterpart to CONFIG_BT_WAIT_NOP so that it
issues a NOP Command Complete event after booting up, to signal to the
Host that it is ready to receive HCI traffic.

Fixes #15333

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
Aaron Tsui
5922be2ed6 samples: subsys: logging Remove repetitive code.
Remove repetitive code

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Aaron Tsui
1c742a9756 doc: subsys: logging Update documentation
Update documentation.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Adithya Baglody
d39e68d6b2 samples: code_relocation: Disable code coverage.
Currently coverage is enabled only in platforms which dont have
multiple memory regions. This sample was designed to emulate
different memory regions. This in conjunction with gcov which
might instrument data in different memory regions will not work
as expected. Therefore disabling gcov for this sample.

Fixes: GH-15107

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-04-09 12:46:24 -04:00
Andrew Boie
9f2188706c samples: remove mem_domain_apis_test
We have actual tests now under tests/kernel/mem_protect/userspace
and tests/kernel/mem_protect/mem_protect that exercise all the
memory domain APIs. This old test is superfluous.

Fixes: #15178

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-09 11:47:28 -04:00
Cinly Ooi
f874ac72e4 doc: Remove prj_single.conf from README.rst
Removed documentation about prj_single.conf from README.rst
as it is no longer needed and was removed.

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-04-08 10:45:52 -04:00
Anas Nashif
3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrew Boie
7b1ee5cf13 tests: CONFIG_TEST_USERSPACE now off by default
Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-06 14:30:42 -04:00
Ravi kumar Veeramally
06159d3bcf net: samples: ipv4_autoconf: Need more buffers for same_70
More buffers are need to build for sam_e70_xplained board
to work out of the box. Added board specific conf file.

Fixes #15096

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-04-05 16:11:37 -04:00
Andrei Emeltchenko
0f03730882 usb: wpanusb: Simplify and cleanup sample
Remove old unused code blocks and simplify initialization.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko
ed97cb7601 usb: wpanusb: Use usb_transfer mechanism
Refactor wpanusb to use usb_transfer().

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko
08da6b261a usb: wpanusb: Fix crash in the sample
Patch 8af3df3519 changed logic and did not take into account 2 extra
bytes.

...
  Precise data bus error
  BFAR Address: 0x766e4900
***** Hardware exception *****
Current thread ID = 0x200004e8
Faulting instruction address = 0xddf4
Fatal fault in thread 0x200004e8! Aborting.
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrei Emeltchenko
721f3d1cd0 usb: Refactor USB status callback
Merge cb_usb_status_composite and cb_usb_status and use common
forward_status_cb for both composite and normal devices.

Fixes #14882

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Andrew Boie
9a8f7451fe samples: remove mpu_stack_guard_test
This old "test" has been superseded by test cases in
tests/kernel/mem_protect.

Fixes: #14870

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-02 09:00:25 -04:00
Jacob Siverskog
50c2a735e2 doc: Fix typos in MQTT sample documentation
Fix typos and file reference.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-04-01 18:38:42 -04:00
Anas Nashif
6e6f13c18a samples: fix identifiers for samples
Fix identifiers for tests in samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-01 12:23:09 -04:00
Robert Lubos
16d2b11041 samples: net: Update TELNET sample to use shell TELNET backend
telnet_console driver is not compatible with new shell module, hence is
not working. Switch the telnet sample to use new TELNET shell backend.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-04-01 10:26:13 -04:00
Anas Nashif
8f474020b6 samples: move mbedtls benchmark under benchmarks
This should be alongside other benchmarks under tests/benchmarks

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Anas Nashif
da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Luiz Augusto von Dentz
58baad7c5e Bluetooth: ipsp: Fix not checking return of build_reply
net_pkt_sendto uses size_t as parameter for len so the value would be
treat as unsigned which may cause and invalid memory to be read.

Fixes #14950 #14955

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-29 10:39:53 +01:00
Patrik Flykt
21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt
24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Andrzej Głąbek
32223bd2ae boards: Enable GPIO by default on boards with nRF SoCs
This patch enables the GPIO driver by default on all boards equipped
with an nRF SoC (all boards having `CONFIG_SOC_FAMILY_NRF=y` in their
`_defconfig` file).
In vast majority of cases the driver is needed, so it is more
convenient to enable it at board level than in particular
applications.
And if the driver is undesired for some reason, it can be still
disabled in the application config.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-28 16:46:39 -05:00
Aaron Tsui
3c45eb45d6 samples: sensor: fix hardware fault when no sensor connected
There are two sensor samples be modified for a more explicit log when
no sensor connected or not connected correctly. Rather than a horrible
hardware fault, which may misleading beginner.

1. bme280
2. sx9500

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-28 14:32:17 -05:00
Ulf Magnusson
d5b0bd14e3 scripts: Remove unused imports in all Python scripts
Discovered with pylint3.

Upstream open-amp PR: https://github.com/OpenAMP/open-amp/pull/168

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:20 -05:00
Cinly Ooi
097a71cbfe samples: watchdog: Confirm that reset occured
Updated test harness to check for a second instance of
"Watchdog sample application". This is to confirm the
board did reset itself.

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-03-28 09:35:30 -05:00
Johan Hedberg
672607c68a samples: reel_board/mesh_badge: Fix IV Index type
The IV Index is always a 32-bit value, so using u16_t for it was
confusing. Create a define for it, similar to other constant values,
to get rid of this confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:29:54 +01:00
Krzysztof Chruscinski
fdc1ee59d8 sample: subsys: logging: Ensure that logger RTT backend is tested
Logger RTT backend should be compiled on the boards that have RTT.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-28 08:41:28 -05:00
Krzysztof Chruscinski
8dd015f49e sample: subsys: shell: Ensure that shell RTT backend is tested
Shell RTT backend should be compiled on the boards that have RTT.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-28 08:41:28 -05:00
Ulf Magnusson
7ccc7889fa logging: Remove SYS_LOG implementation
Replaced by the new CONFIG_LOG system.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 09:30:29 -04:00
David B. Kinder
5d8e367efe doc: fix misspelling in docs and API comments
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-27 15:59:09 -04:00
Tedd Ho-Jeong An
b43ef2f4d9 samples: net: nats: Check null before dereferrencing the variable
This patch checks null before deferencing the variable.

Fix Bug: #14815
Coverity CID: 196641

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-26 14:13:24 -05:00
Vincent Wan
11739f72df samples: net: mqtt_publisher: Add section on connecting with TLS
Adding a section to the sample's documentation to give some specific
instructions on how to try it with TLS enabled. This should be helpful
for users who are not knowledgeable with regards to creating/setting up
TLS certificates.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-26 14:22:57 -04:00
Piotr Mienkowski
155e11ca2d power: rename residency policy Kconfig options
Rename power managment subsystem Kconfig options describing minimum
residency to make them easier to identify with respective policy.

Following is a detailed list of string replacements used:
s/SYS_PM_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_SLEEP_$1/
s/SYS_PM_DEEP_SLEEP_(\d)_MIN_RES/SYS_PM_MIN_RESIDENCY_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Piotr Mienkowski
a3082e49a1 power: modify HAS_STATE_SLEEP_ Kconfig options
Add SYS_POWER_ prefix to HAS_STATE_SLEEP_, HAS_STATE_DEEP_SLEEP_
options to align them with names of power states they control.
Following is a detailed list of string replacements used:
s/HAS_STATE_SLEEP_(\d)/HAS_SYS_POWER_STATE_SLEEP_$1/
s/HAS_STATE_DEEP_SLEEP_(\d)/HAS_SYS_POWER_STATE_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Piotr Mienkowski
17b08ceca5 power: clean up system power managment function names
This commit cleans up names of system power management functions by
assuring that:
- all functions start with 'sys_pm_' prefix
- API functions which should not be exposed to the user start with '_'
- name of the function hints at its purpose

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Piotr Mienkowski
204311d004 power: rename Low Power States to Sleep States
There exists SoCs, e.g. STM32L4, where one of the low power modes
reduces CPU frequency and supply voltage but does not stop the CPU. Such
power modes are currently not supported by Zephyr.

To facilitate adding support for such class of power modes in the future
and to ensure the naming convention makes it clear that the currently
supported power modes stop the CPU this commit renames Low Power States
to Slep States and updates the documentation.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-03-26 13:27:55 -04:00
Aaron Tsui
38dadb5fc5 samples: basic: disco_led without gpio driver
This sample did not enable gpio driver, so nothing happens after flash
firmware into a board.
By enabling gpio driver to fix it.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-26 09:00:44 -05:00
Ulf Magnusson
d83141535c scripts: Remove accidental semicolons in Python scripts
Making a clean slate for some pylint CI tests. Only enabling relatively
uncontroversial stuff.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-26 07:57:52 -05:00
Paul Sokolovsky
946836577b samples: sockets: Add e1000 and stellaris ethernet drivers overlays
Add qemu ethernet driver overlays for big_http_download and
dumb_http_server samples, which are default integration samples/
tests for TCP stack. This change follows up after similar addition
of such overlays to other samples (and smsc911x overlay addition
to these samples).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-26 07:29:40 -05:00
Erwan Gouriou
25d04049ce samples/drivers/counter: alarm: fix printk usage
When displaying int and u32_t, use %u instead of %d.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-26 07:29:08 -05:00
Jukka Rissanen
059a14e166 samples: net: zperf: Update the README file
Clarify what iPerf version was used when testing this sample
application. It was iPerf 2.0.9 which worked ok, for example
iPerf 2.0.13 did not work properly with UDP uploader (client)
mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen
24de2f7e01 samples: net: zperf: Fix TCP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is needed
or correct as there is no proper documentation for the iPerf2
protocol.

Fixes #14665

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Jukka Rissanen
cbeeb510c0 samples: net: zperf: Fix UDP uploader
Try to construct a proper iperf client header to the payload
as the server expects that. It is not sure if this is proper
way to do the iperf header as there is no documentation about
iPerf protocol anyway (except the iPerf source code).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-25 22:48:32 -04:00
Andrei Emeltchenko
972221423c samples: usb: console: Select console device name
Instead of relying on overlays which requires to write overlay for
every board (100+) define console device name.

Fixes #14698

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-25 12:03:15 +01:00
Andrei Emeltchenko
7ecd8d2ff3 samples: usb: cdc_acm_composite: Fix missing irq handling
If there are several queued interrupts we can miss some of them. Use
while() loop to catch them all.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-25 12:03:15 +01:00
Tedd Ho-Jeong An
5d35b66327 Samples: net: can: initialize the variables
Initialize the variables.

Fix Bug: #14819
Coverity CID: 196637

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-24 10:55:06 -05:00
Andy Ross
61065b3235 tests: samples: Re-enable SMP on a few tests
The 14 individual cases that use these four config files are now
passing reliably when SMP is enabled, after the "Mark sleeping threads
suspended" scheduler fix.  Turn it back on.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-03-23 19:28:15 -04:00
Flavio Ceolin
8945426026 samples: 96_argonkey: sensors: Check function return
Checking the return of sensor_trigger_set and if it fails log the
problem and exits.

Coverity CID: 186196

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-23 09:52:51 -05:00
Flavio Ceolin
ef0417fa6d samples: ipc: openamp: Avoid dead code
Checking the return of metal_init to avoid having dead code.

Coverity CID: 190932

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-23 09:52:51 -05:00
Luiz Augusto von Dentz
ef9c7a4b5d Bluetooth: samples: IPSP: Fix not checking return of net_pkt_read
net_pkt_read may fail in which case the error shall be reported back
instead of always assuming the whole packet was read.

Fixes #14817

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-22 12:13:42 +02:00
Jukka Rissanen
cda61d2a63 samples: net: dhcpv4: Add net-shell and e1000 driver support
The dhcpv4-client is more usable if it has net-shell. For testing
with qemu_x86, the e1000 overlay config is very useful.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-21 09:03:26 -05:00
Vincent Wan
111dab4a25 samples: sockets: echo_async: Add support for cc3220sf_launchxl
Adding support for cc3220sf_launchxl by introducing a board-specific
Kconfig file.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-20 11:36:18 -05:00
Vincent Wan
734e247d02 samples: sockets: echo_async: Make IPV6 optional
Changing the example to not use IPv6 when it is not configured,
given IPv6 is not enabled on some platforms such as cc3220sf_launchxl.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-03-20 11:36:18 -05:00
Andy Ross
4f04f6486d tests: More SMP disablement
A few more test cases that are measurably unreliable when run in SMP.
For the most part these work most of the time (though the semaphore
one was pretty borderline -- I measured about 25% failures), but are
measurably unstable against the backdrop of known qemu instability.
Something is clearly going on and we need to come back to these to fix
threadsafety issues.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-03-20 11:33:29 -05:00
Robert Lubos
e39aed53a2 samples: net: Update overlay-bt.conf in various samples
`CONFIG_NET_L2_BT` no longer forces required BT configuration, but
depends on a user to set a valid configuration instead. Hence, we
need to select a proper configuration in the overlay config file.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-03-20 11:32:40 -05:00
Tedd Ho-Jeong An
980cf393f0 Samples: echo-client: Add overlay when echo-server is running on Linux
This patch adds the overlay when the echo-server is running on Linux and
echo-client is running on Qemu.

Fix: #14654

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-20 11:31:57 -05:00
Tomasz Bursztyka
03bfc5dd0f net/context: Remove token parameter from net_context_send/sendto
And also to the relevant callbacks.

That parameter is not used anywhere so it is useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka
d6d52ce9e5 net/pkt: Remove _new suffix to net_pkt_write functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka
a25f054cbd net/pkt: Remove _new suffix to net_pkt_read functions
Suffix is now useless, as these functions are now the only ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka
f8a091104e net/pkt: Remove _new suffix to net_pkt_get_data_new function
Now that legacy - and unrelated - function named net_pkt_get_data has
been removed, we can rename net_pkt_get_data_new relevantly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Tomasz Bursztyka
172fe5a87b net/context: Remove _new suffix on net_context_send/sendto functions
Now that legacy functions are removew, let's rename the new functions by
removing the _new suffix.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-20 10:27:14 -05:00
Johan Hedberg
8c294995e0 samples: bluetooth/mesh: Fix configuration
This sample is often the first one used as reference for Bluetooth
Mesh, so it should have a good configuration as a starting point.
Comment out the LPN options to eliminate Kconfig warnings, since the
LOW_POWER option they depend on is not enabled. Also disable
INIT_STACKS since that's only needed for fine-tuning the app
configuration, and otherwise only causes unnecessary spam in the
console.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-19 15:24:09 +02:00
Marcio Montenegro
69613cad6a samples: net: sockets: echo_client : Fix tcp_stop() error
Check for an open socket, 0 is a valid file descriptor.

Signed-off-by: Marcio Montenegro <msam@cesar.org.br>
2019-03-18 11:34:47 -05:00
Jukka Rissanen
ebce5601c0 samples: net: promisc: Fix compile error
The sample was bitrotted because sample.yaml was missing and no
build checks were done, so we missed the case when TCP header
API function was removed. This is now fixed by using still available
UDP header API (to get the port numbers). Also fixing debug print
as it were giving compile warnings.

Fixes #14608

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-18 11:31:01 -05:00
Jukka Rissanen
c5d3cfa93a samples: net: promisc: Add sample.yaml file for build time checks
The sanitychecker needs sample.yaml in order to compile test
the promiscuous mode sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-18 11:31:01 -05:00
Andrew Boie
435c1a3fe2 samples: bmg169: don't enable CONFIG_LOG
It's not necessary for this sample to output to the user
(it uses printf) and saves over 5K of ROM size, eliminating
some build failures on Quark D2000.

Fixes: #14476

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-03-18 09:22:50 -07:00
Johan Hedberg
dffe78b332 samples: bluetooth/mesh_demo: Fix using internal API
Use K_SEM_DEFINE() instead of the internal _K_SEM_INITIALIZER() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-15 20:40:51 +01:00
Michael Scott
83aa7cecd4 boards: arm: nrf52840-based: Free up flash room for sample apps
The current flash configurations for all nRF52840's in Zephyr is
VERY constrained when it comes to allowing samples any space for
storage or custom areas.  It only leaves the last 4 pages of flash
for "storage".

The nRF52840 is also capable of using OpenThread which defaults
to using the last 4 pages of flash for storing OpenThread-related
network data.

This means that while using OpenThread under any configuration
designed to use mcuboot partition slots, there is no space left
over for storage of any kind.

Let's adjust the partition table to set storage at 8 pages of
flash (32k).  This fixes the conflict with OpenThread and leaves
room for future use cases that may arise.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-15 08:52:06 -05:00
Johan Hedberg
96a754554e samples: reel_board/mesh_badge: Add protection for fast key presses
It was possible to freeze the application by pressing the user button
too frequently. This was likely due to the stack not keeping up with
the send requests and running out of buffers.

Add rate-limiting to the app, so that at most one message per 500ms
can be sent. Also add a user message if the user presses the button
too many times in rapid succession, and inform the other badges of
this misbehaving user.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-15 14:05:29 +01:00
Johann Fischer
5ed4b6a334 samples: usb_dfu: update application signing in README.rst
Update application signing example in README.rst.

resolves: #14510

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-03-15 05:58:07 +01:00
David B. Kinder
6000a6205a doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how
doxygen, sphinx, and breathe work. In an attempt to hide some of this
we're preparing the current docs to allow use of configuration defaults
that will let us more simply use a default role that will hunt for a
reference target in the various domains that are available by using a
default "role" of "all".  This will let us use the simple notation
`functionname` or `typename` without fully specifying the reference as
:c:func:`functionname`.

This patch cleans up exising docs that were (incorrectly) using single
backtics where double backtics should have been used, and also found
some typos (such as a space between the role name and the reference,
such as :file: `filename`, and a missing colon such as
c:func:`functionname`)

This is a start to address issue #14313

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-15 05:47:19 +01:00
Flavio Ceolin
11abc64315 samples: can: Check return of can_attach_isr
Problem spotted by coverity, CID 195786

Fixes #14417

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-14 19:15:03 -05:00
Ramakrishna Pallala
d910aa6029 samples: power: Add test for device Idle PM
Added test for Device Idle Power Management to invoke
device_pm_get/put API's.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Ramakrishna Pallala
e1639b5345 device: Extend device_set_power_state API to support async requests
The existing device_set_power_state() API works only in synchronous
mode and this is not desirable for devices(ex: Gyro) which take
longer time (few 100 mSec) to suspend/resume.

To support async mode, a new callback argument is added to the API.
The device drivers can asynchronously suspend/resume and call the
callback function upon completion of the async request.

This commit adds the missing callback parameter to all the drivers
to make it compliant with the new API.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Tomasz Bursztyka
078be776ee samples/bluetooth: Switch ipsp sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
fa58d1e6ce samples/net: Switch zperf sample to new net_context API
No need to build the net_pkt, just send the buffer directly.

Let's reuse already parsed ip/proto headers as well.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
4ab0e5a3b7 samples/net: Switch lldp sample to new net_pkt API
Use new net_pkt r/w API functions.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
b517247835 samples/net: Switch wpan_serial to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
8af3df3519 samples/net: Switch wpanusb sample to new net_pkt API
Minor changes, as wpan is low level and make use of the bare minimum
API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Tomasz Bursztyka
3b1c91732d samples/net: Switch nats samples to new net_pkt/net_context API
Using new net_pkt r/w API and so on.

This sample would still need to be using socket API instead.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-03-14 08:41:08 +01:00
Jukka Rissanen
e7107ba562 samples: net: can: Readme file was missing
The socket CAN application was missing a README.rst file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 15:57:48 -05:00
Maureen Helm
f8c4808d96 boards: mimxrt10{50,60}_evk: Set lvgl defaults in board defconfigs
Configure lvgl defaults for imx rt boards in their respective board
defconfigs rather than the lvgl sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-03-13 06:02:42 -05:00
Jukka Rissanen
e7ce08a2ac samples: net: can: Send and receive can_frame type of data
The CANBUS sockets require "struct can_frame" to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Jukka Rissanen
d2ce588441 samples: net: can: setsockopt() requires can_filter
The CANBUS sockets require can_filter to be used in order to be
compatible with Linux code.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 05:58:30 -05:00
Marcin Szymczyk
c8dfdb63f9 usb: samples: mass: add warning for no conf and nrf52840 conf
Added a warning that will abort build without disks.
Added a default configuration for nrf52840_pca10056.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-13 05:48:35 -05:00
Paul Sokolovsky
7e81aca961 samples: sockets: echo: Better error checks
Check socket fd return results.

Fixes: #11086, #11087
Coverity-CID: 189519, 189520

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-03-13 05:38:10 -05:00
Tedd Ho-Jeong An
19ed83c723 samples: sockets: echo_async: Check return value of setsockopt
This patch checks the return values of setsockopt.

Fixes: #14392, #14402
Coverity-CID: 195897, 195848

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-13 05:37:28 -05:00
Carles Cufi
8f05a4c6d5 doc: Bluetooth: Documentation overhaul
Overhaul the Bluetooth documentation to split it into manageable units
and include additional information, such as architecture and tooling.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-03-13 10:40:05 +01:00
Jukka Rissanen
6368ed4edf samples: net: zperf: Fix the readme file
As there is no shell submodules any more, the "zperf" command
needs to be written in every command.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen
b9f6bdfe08 samples: net: zperf: Fix TCP download command
The TCP download command was not handling TCP session and
connection closing properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Jukka Rissanen
0cd9b3e267 samples: net: zperf: Make client work in native_posix
As the clock does not run same way in native_posix, do some
tricks here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-13 01:52:09 +01:00
Thomas Stenersen
7516476386 kconfig: Use depend on instead of select to avoid kconfig loop
Remove use of select to "force" enabling other configs in subsys/fs
and subsys/net/l2. The forcing will cause infinite kconfig recursion.

Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
2019-03-12 19:42:40 +01:00
Gaute Gamnes
baa1a62310 samples: servo_motor: Fix servo_motor sample to use new DT options
1. Remove microbit Kconfig conf file.
2. Include microbit DT overlay with prescaler setting.
3. Set codeowner of servo_motor bbc_microbit to @jhe

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
2019-03-12 13:34:01 +01:00
Ravi kumar Veeramally
718dd56d38 net: samples: Fix packet socket sample iface index
Patch (3206568e43) changed network
interface numbering starts from 1. The index 0 is reserved.
So use api to get default interface index for packet socket sample.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-11 20:56:11 -07:00
Tomasz Gorochowik
9115386e4d samples: net: mqtt: update readme with SOCKS5 info
This commits adds an overlay file with the SOCKS5 symbol that is needed
to run MQTT with a proxy, and extends README with instructions on how to
use it with the default and custom settings.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-03-11 20:36:39 -07:00
Patrik Flykt
4344e27c26 all: Update reserved function names
Update reserved function names starting with one underscore, replacing
them as follows:
   '_k_' with 'z_'
   '_K_' with 'Z_'
   '_handler_' with 'z_handl_'
   '_Cstart' with 'z_cstart'
   '_Swap' with 'z_swap'

This renaming is done on both global and those static function names
in kernel/include and include/. Other static function names in kernel/
are renamed by removing the leading underscore. Other function names
not starting with any prefix listed above are renamed starting with
a 'z_' or 'Z_' prefix.

Function names starting with two or three leading underscores are not
automatcally renamed since these names will collide with the variants
with two or three leading underscores.

Various generator scripts have also been updated as well as perf,
linker and usb files. These are
   drivers/serial/uart_handlers.c
   include/linker/kobject-text.ld
   kernel/include/syscall_handler.h
   scripts/gen_kobject_list.py
   scripts/gen_syscall_header.py

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-11 13:48:42 -04:00
Andrei Emeltchenko
c2dbbf77c1 samples: net: lldp: Set optional TLV system_name
Add optional TLV to LLDP DU.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-09 16:02:11 -05:00
David B. Kinder
505cc2bb0e doc: use :zephyr_file: where appropriate
A new role :zephyr_file: is available that renders to a link to the file
or folder in GitHub.  Find appropriate references using :file: and
convert to :zephyr_file: to take advantage of its linking capability.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-09 09:50:27 -05:00
Tedd Ho-Jeong An
4063b3b149 sample: sockets: can: Update error handle flow
This patch updates error handle flows for socket apis.

Fix: #13859
Coverity-CID: 190956

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-08 08:43:29 -05:00
Jukka Rissanen
9a0cf4b48f doc: net: Fix VLAN documentation in doc and in sample
The VLAN documentation had double wording and proper links to files
in github was missing, which did not look good in the rendered HTML
page.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-07 20:31:04 -05:00
Kumar Gala
a2d61fedf6 kconfig: remove stale CONFIG_IEEE802154_CC2520_AUTO_ACK
CONFIG_IEEE802154_CC2520_AUTO_ACK seems to creep back in, but has long
since be removed.  We remove old references a few times.

Commit 2facf33f28 - "net: ieee802154: Remove old cc2520 AUTO_ACK
assignments".

Remove them again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 13:04:29 -06:00
Kumar Gala
6833ea718f kconfig: Remove dead references to CONFIG_PCI_DEBUG
CONFIG_PCI_DEBUG isn't a Kconfig option we support anymore so remove
some dead references to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 13:04:29 -06:00
Tedd Ho-Jeong An
32caf24cb4 samples: sockets: echo_async: Add more error checking
This patch adds more error checking and handling for socket APIs.

Fixes: #13885
Coverity-CID: 190928

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 10:15:59 -05:00
Kumar Gala
eba74fa809 samples: net: nets: Remove references to CONFIG_NET_DHCPV6
CONFIG_NET_DHCPV6 doesn't exist so remove references to it in the
sample, leave comments about TODO if/when this might exist.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:27 -05:00
Kumar Gala
9740078d6c samples: net: wpan_serial: Remove dead code related to CONFIG_DCD_DSR
CONFIG_DCD_DSR does not exist so the code block associated with it would
never be built, so remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-07 10:13:10 -05:00
Tedd Ho-Jeong An
2df4652077 samples: sockets: echo_async_select: Add error check
This patch adds error checking routine for socket APIs.

Fixes: #13852
Coverity-CID: 190966

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-03-07 09:40:13 -05:00
Ioannis Glaropoulos
e0b369a63c samples: mpu: correct Kconfig setting in project configuration
We need to set CONFIG_HW_STACK_PROTECTION=y, instead of the
internal symbol CONFIG_MPU_STACK_GUARD, in order for fatal.c
to be able to parse the error code. MPU_STACK_GUARD is,
anyway selected if HW_STACK_PROTECTION is set.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-05 11:34:06 -05:00
Marcin Szymczyk
6983645552 usb: add hid-cdc example
This example combines 2 HID classes and 2 CDC ACM classes to create
a composite, multi-instance device.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-05 09:35:26 +01:00
Maksim Masalski
b324f35e61 macros: deleted macros SECONDS(), MSEC(), USEC()
Changed everywhere these macros to the K_MSEC(), K_SECONDS()

Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-03-04 19:04:21 -05:00
Anas Nashif
5cf49956e7 logging: add backend for xtensa simulator
Add backend for the xtensa simulator.

Fixes #10164

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-04 10:35:07 -05:00
Anas Nashif
dc96f16bcd samples: define harness for samples
Most of the basic tests trigger LEDs or expect button press and would
hang in device testing because we can't parse success or failure from
the console. Define harness for this with the intent to skip those in
sanitycheck device testing and until we have a better way to test those.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-04 08:14:29 -05:00
Aaron Tsui
92f5cd147b samples: threads: Fix ASSERTION FAIL without gpio driver
Some boards' configuration does not enable GPIO by default,
like nrf52_pca10056, it causes ASSERTION FAIL when running
this application. This fix is to enable GPIO by default for
the basic threads sample, like basic blinky sample does.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-03 23:48:11 -05:00
Kumar Gala
9fa8674239 samples: fs: Fix possible integer overflow
We are doing math of two 32-bit numbers and assigning into a 64-bit
result.  Add explicit cast of one of the values being multipled to get
explicit promotion.

Fixes: #13883
Coverity CID: 190930

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-02 17:38:23 +01:00
Kumar Gala
11b3dce674 samples: ipc: openamp: Fix missed return error check
The return from ipm_set_enabled wasn't assigned to 'status' so the check
right after the call to ipm_set_enabled() wasn't doing the right thing.

Fixes: #13881
Coverity CID: 190932

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-02 17:38:23 +01:00
Ravi kumar Veeramally
f860d31465 samples: net: coap_client: Fix coverity issue
Fix uninitialized variable.

Coverity-CID: 190969
Fixes: #13850

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-03-01 19:44:11 +01:00
Sebastian Bøe
4e5300ba7f cmake: Drop all in-tree usage 'set_conf_file'
Port all users of 'set_conf_file' to use the built-in rules
instead. This follows the convention-over-configuration principle to
make the system as a whole simpler and more consistent.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-01 09:44:09 +01:00
Andy Ross
a334ac2045 tests: Mass SMP disablement on non-SMP-safe tests
(Chunk 1 of 3 - this patch was split across pull requests to address
CI build time limitations)

Zephyr has always been a uniprocessor system, and its kernel tests are
rife with assumptions and outright dependence on single-CPU operation
(for example: "low priority threads will never run until this high
priority thread blocks" -- not true if there's another processor to
run it!)

About 1/3 of our tests fail right now on x86_64 when dual processor
operation is made default.  Most of those can probably be recovered on
a case-by-case basis with simple changes (and a few of them might
represent real bugs in SMP!), but for now let's make sure the full
test suite passes by turning the second CPU off.  There's still plenty
of SMP coverage in the remaining cases.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-28 13:02:20 -06:00
Jukka Rissanen
2db03ce277 samples: net: socket: can: Do cleanup if failure
If bind() fails or TX thread cannot start, then cleanup the
socket by calling close()

Coverity-CID: 191003
Fixes #13824

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-28 08:46:52 -06:00
Michael Scott
d318da1db9 samples: basic: fix nRF52 PWM name in blink_led/fade_led samples
commit ddf744deee ("drivers: pwm_nrfx: Use Device Tree label as
instance name") removed the config setting for PWM names and replaced
it with DT_NORDIC_NRF_PWM_PWM_*_LABEL.

This change is causing the blink_led and fade_led samples to break
when compiled for nRF52 boards.

Let's update the samples to use the DT setting.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-27 12:22:42 -06:00
Armando Visconti
16dc36bb61 samples/96b_argonkey: microphone: Fix coverity bug 190958
Fix coverity CID 190958: Logically dead code (DEADCODE)
(bug: #13857)

Condition (ret < 0) was tested, but 'ret' variable was not
assigned.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-27 10:02:49 -06:00
Paul Sokolovsky
fff2011fb5 samples: sockets: echo_server: Print port number to connect to
We have a great number of samples now, using different port numbers,
etc. Let them be self-documenting and print out port number used.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-27 08:32:58 -06:00
Paweł Zadrożniak
aa4c30c3e9 samples: usb: hid: remote wakeup in HID mouse example
Added support for remote wakeup in hid_mouse example.
If rempote wakeup support is enabled, wakeup request
is performed on every button click when the bus in suspended state.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2019-02-27 10:37:16 +01:00
Andrew Boie
feab37096b libc: fix CONFIG_STDOUT_CONSOLE semantics
The intent of this Kconfig is to allow libc stdout
functions like printf() to send their output to the
active console driver instead of discarding it.

This somehow evolved into preferring to use
printf() instead of printk() for all test case output
if enabled. Libc printf() implementation for both
minimal libc and newlib use considerably more stack
space than printk(), with nothing gained by using
them.

Remove all instances where we are conditionally
sending test case output based on this config, enable
it by default, and adjust a few tests that disabled
this because they were blowing stack.

printk() and vprintk() now work as expected for
unit_testing targets, they are just wrappers for
host printf().

Fixes: #13701

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-26 08:00:33 -06:00
Piotr Mienkowski
f04a4c9deb power: rename CPU_LPS_n power states
CPU_LPS_n name used to indicate a low power state is cryptic and
incorrect. The low power states act on the whole SoC and not exclusively
on the CPU. This patch renames CPU_LPS_n states to LOW_POWER_n. Also
HAS_ pattern for Kconfig options is used in favor of a non standard
_SUPPORTED. Naming of deep sleep states was adjusted accordingly.

Following is a detailed list of string replacements used:
s/SYS_POWER_STATE_CPU_LPS_(\d)_SUPPORTED/HAS_STATE_LOW_POWER_$1/
s/SYS_POWER_STATE_CPU_LPS_(\d)/SYS_POWER_STATE_LOW_POWER_$1/
s/SYS_POWER_STATE_DEEP_SLEEP_(\d)_SUPPORTED/HAS_STATE_DEEP_SLEEP_$1/

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-26 02:30:13 +01:00
Piotr Mienkowski
c75187587b power: simplify SYS_POWER_*_SUPPORTED Kconfig options
This commit removes dependency on SYS_POWER_LOW_POWER_STATES_SUPPORTED,
SYS_POWER_DEEP_SLEEP_STATES_SUPPORTED Kconfig options. Power management
SYS_POWER_LOW_POWER_STATES, SYS_POWER_DEEP_SLEEP_STATES options depend
now directly on specific power states supported by the given SoC. This
simplifies maintenance of SoC Kconfig files.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-26 02:30:13 +01:00
Kumar Gala
bb6b1918b2 drivers: can: stm32: Cleanup Kconfig enablement
Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32).  Also have the STM32 CAN driver depend on being on a STM32
SoC.

Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-25 10:05:21 -06:00
Henrik Brix Andersen
17cc291d68 samples: nrf52: mesh: onoff-app: add missing CONFIG_GPIO
Add missing CONFIG_GPIO required by the nRF52 board-specific Bluetooth
Mesh On/Off application sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-02-24 12:55:54 -05:00
Andrew Boie
4ce652e4b2 userspace: remove APP_SHARED_MEM Kconfig
This is an integral part of userspace and cannot be used
on its own. Fold into the main userspace configuration.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-23 07:43:55 -05:00
Robert Lubos
756043c2b3 samples: net: lwm2m: Fix system workqueue stack size
System workqueue stack was not large enough to handle DTLS handshake,
which lead to system crash.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-02-23 07:42:38 -05:00
Jukka Rissanen
c478b5bb6e can: Rename can_msg and can_msg_filter structs
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen
58f3ae5334 can: Add Linux compatible frame and filter structs
Add new "struct can_frame" which is compatible with Linux so that it
is easier to port socket-can applications from Linux.
Rename existing can_filter to can_msg_filter so that the name will
not conflict with Linux compatible can_filter struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen
8b7057c918 samples: net: promiscuous_mode: Add missing README.rst file
The promiscuous mode sample was missing documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-21 16:38:13 -05:00
Laczen JMS
68ea30c123 fs/nvs: Improve init speed and remove fs->locked
This patch removes the free space calculation from nvs initialization.
The available space can be calculated if required using the routine
nvs_calc_free_space.

This patch also removes the locked state of nvs, it is not possible to
get in a locked state.

This patch adds an extra check on the sector_size configuration and only
allows operation on nvs when nvs has been initialized.

This patch also solves issue #13369, the usage of FLASH_ERASE_BLOCK_SIZE
has been replaced with the flash page api.

Changes:

Removed locked state and free_space from the nvs structure.

nvs_reinit(): has been replaced with by an internal only function
_nvs_startup().

nvs_write(): removed the possibility to place the file system in a
locked state, if to many gc operations are required it will return
-ENOSPC.

ssize_t nvs_calc_free_space(): introduced, calculates the free space
that is available in the nvs file system.

Removed define LOG_LEVEL.

Rebased to current master.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-02-21 09:32:52 -05:00
Carles Cufi
997ef85ea9 doc: Clean up build instructions and use of variables
Remove most unnecessary instances of `export` and `cmake` use that can
instead be replaced with `zephyr-app-commands` or similar. This is to
avoid documentation using different mechanisms to describe the same
actions and in preparation for documenting `west build` everywhere.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-02-21 11:46:45 +01:00
Andrzej Puzdrowski
662b44e357 sample/subsys/usb/dfu: correction to documentation
Reverted unwanted documentation change on usb dfu sample.
Changes was introduce accidentally within PR #13475

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-20 19:43:43 -05:00
Jukka Rissanen
c17d302321 doc: net: Enhance DNS resolver documentation
Add more information about DNS resolver to documentation. Move
generic DNS information from the sample application into DNS
resolver documentation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-20 19:41:47 -05:00
Sathish Kuttan
12c98eceb1 samples: intel_s1000: remove DCACHE_WRITEBACK
Remove DCACHE_WRITEBACK Kconfig variable from DMIC sample app project
Cache configuration is fixed and the cache operation routines
internally take appropriate action based on the cache configuration.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-20 07:33:11 -05:00
Jukka Rissanen
41d17433f0 doc: net: Add more info for network connectivity with host
Added more detailed information how to connect Zephyr instance
to host system like Linux desktop.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-20 07:32:42 -05:00
Krzysztof Chruscinski
a64b0fe1e3 shell: Deprecate macros for subcommands creation
Macros are replaced by C++ friendly versions:
- SHELL_CREATE_STATIC_SUBCMD_SET by SHELL_STATIC_SUBCMD_SET_CREATE
- SHELL_CREATE_DYNAMIC_CMD by SHELL_DYNAMIC_CMD_CREATE

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Krzysztof Chruscinski
3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
David B. Kinder
882702e688 doc: fix misspellings in docs
Fix misspelling in boards, samples, and doc missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-19 21:35:45 -05:00
Jukka Rissanen
8bf1dfc97b samples: syslog_net: Fix link to RFC 5426
The RFC link pointed to wrong document.

Fixes #13005

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-19 15:08:05 -05:00
Armando Visconti
303c8a7234 samples/96b_argonkey: change log configurations
Enable debug logging for sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-19 12:29:09 -06:00
Piotr Zięcik
4558c5c4f4 power: policy_residency: Update Kconfig options description
This commit adds better description to the Kconfig options
configuring residency-based power policy.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-19 13:25:36 -05:00
Piotr Zięcik
63b0df645e power: Clean up power state names
Some of power states used numerical suffix while otthers not.
This commit adds proper suffix to all power state names.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>

f
2019-02-19 13:25:36 -05:00
Piotr Zięcik
c45961daae power: Rework OS <-> Application interface
This commit simplifies OS <-> Application interface controlling power
management. In the previous approach application-based PM required
overriding sys_suspend() and sys_resume() functions. As these functions
actually implemented power state change, in such case application
basically had to provide own implementation of all PM-related stuff,
which was not portable and hard to maintain.

This commit changes this scheme: The sys_suspend() and sys_resume()
are now system functions while the application could either use
built-in power management policies or provide its own. All details
of power mode switching are now handled by the OS.

Also, this commit cleans up the Kconfig options related to system-level
power management grouping them under common CONFIG_SYS_PM_ prefix.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-19 13:25:36 -05:00
Sathish Kuttan
31ab23fce8 doc: intel_s1000: 2-Way audio sample documentation
Documentation for a sample application to demonstrate audio
capture and playback on an Intel S1000 CRB connected to a
host over I2S.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-19 10:43:52 -05:00
Sathish Kuttan
acd2ff70dc samples: intel_s1000: 2-Way Audio Sample Application
Sample application to demonstrate 2-way audio capture/playback from a
host connected over I2S to S1000

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-19 10:43:52 -05:00
Erwan Gouriou
1b7b384639 samples/subsys/nvs: Fix typo in samples description.
Typo fix.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-19 07:45:50 -06:00
Anas Nashif
996c252e51 dfu: mcuboot: rename boot_swap_type> mcuboot_swap_type
This function conflicts with a function of the same name in mcuboot.
This happens when building USB DFU support into mcuboot.

DFU over USB uses image manager and mcuboot internals to manage images
downloaded to the device.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-19 09:32:02 +01:00
Bub Wei
55a0e7001d samples: net: zperf: Refactor udp_received
Use the state machine states to determine if the session has ended.
This way zperf will properly reply stat packet to remote client even if
duration of the session is non zero.

Also we don't need to update counter (received packet number) at end of
the session.

Note: if id < 0, it means session end, otherwise it's session ongoing.
(id is the first feild of application data from remote client).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2019-02-18 15:12:27 -05:00
Jukka Rissanen
f626c3ccbe samples: net: sockets: Add smoke testing support
The net-app based echo-server/client applications were used for
various smoke testing purposes. As those two apps are now removed
we need to introduce the same support into sockets based echo-client
and echo-server applications.

Fixes #13300 #13481

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-18 15:10:01 -05:00
Paul Sokolovsky
89dfa5bb5b samples: dumb_http_server: Fix typos and improve wording in docs
Both actual typos and just less word repetition.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-18 15:08:37 -05:00
Sathish Kuttan
d079ce05c7 doc: intel_s1000: update I2S sample app doc
Added documentation on loopback of audio to host

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-18 08:23:53 -05:00
Sathish Kuttan
1ef423e2bb samples: intel_s1000: loopback audio to I2S host
Updated I2S sample app for Intel S1000 CRB to loopback
the audio from host in addition to playing audio out to codec

When AUDIO_PLAY_FROM_HOST=Y, audio from host is both looped back
and played out to codec

When AUDIO_PLAY_FROM_HOST=N, audio from host is looped back and
app generated ones are played out to codec.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-18 08:23:53 -05:00
Carlos Stuart
75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
There are issues using lowercase min and max macros when compiling a C++
application with a third-party toolchain such as GNU ARM Embedded when
using some STL headers i.e. <chrono>.

This is because there are actual C++ functions called min and max
defined in some of the STL headers and these macros interfere with them.
By changing the macros to UPPERCASE, which is consistent with almost all
other pre-processor macros this naming conflict is avoided.

All files that use these macros have been updated.

Signed-off-by: Carlos Stuart <carlosstuart1970@gmail.com>
2019-02-14 22:16:03 -05:00
Kumar Gala
1f68831197 samples: Use DT_ prefix define for DT filters
Update the filters that are extracting info from DT to use a define that
has a DT_ prefix so its clear that its coming from DT_.  Also this lets
us remove any non-DT prefixed defines in the conf db.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 10:45:25 -06:00
Erwan Gouriou
1227b2feda samples/bluetooth: Add note about Long term key clearance
It could happen that bluetooth samples fail because of stored LTK
on device used to test the sample (eg smartphone).

Add a note in bluetooth sample doc to inform users of this trick.

Fixes #13034

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-13 19:51:39 +02:00
Sathish Kuttan
acf0e24c6e doc: intel_s1000: I2S sample app documentation
Documentation for the I2S audio sample application for the
Intel S1000 board.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-12 21:20:17 -05:00
Sathish Kuttan
53dcc07889 samples: intel_s1000: App for I2S audio playback
Added a sample app to play audio over I2S through an onboard
Audio DAC on an Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-02-12 21:20:17 -05:00
Michael Scott
a10610eb9f samples: net: lwm2m: add timer object to lwm2m client
Let's provide example usage of the IPSO Timer object in our LwM2M
sample.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-12 21:19:49 -05:00
Michael Scott
e50ad09325 samples: net: lwm2m: Add decimal value to dummy temp sensor
Now that float handling is fixed, let's display a decimal value
in our dummy temperature sensor.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-02-12 21:19:49 -05:00
Erwan Gouriou
50eff0bf33 samples/drivers/flash_shell: Add nucleo_f746zg to platform_whitelist
In order to enable build of stm32f7 flash driver in sanitytests,
add nucleo_f746zg to flash_shell platform whitelist.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-12 20:16:22 -05:00
Erwan Gouriou
70e223a5b9 samples/subsys/nvs: Add a clean test termination
If nvs sample is run once until max reboot value, the next time it is is
ran on the same board, it will not behave as expected as code will
read reboot counter set to max value and will stop there.
In order to avoid the operation to wipe the flash manually between
2 runs of the test, add a clean termination to the test by resetting
the reboot counter before exiting.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-12 20:16:22 -05:00
Andy Ross
453ce6afb8 samples/drivers/counter/alarm: Fix YAML schema failure
On my build host (where apparently the Python has a different version
of yaml than CI) this test is producing schema faiulres from the YAML:

    E: samples/drivers/counter/alarm/sample.yaml: can't load (skipping):
       <SchemaError: error code 2: Schema validation failed:
     - Value 'None' is not of type 'str'.
       Path: '/tests/test/harness_config/regex/1'.: Path: '/'>

The bug seems to be that the regex must be a list of strings, and the
empty list element is being parsed as a python None.  Just remove,
presumably the intent was an empty string, which is a noop in a regex
anyway.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-12 20:15:32 -05:00
Piotr Zięcik
9cc63e07e4 power: Fix naming of Kconfig options controlling deep sleep states
This commit changes the names of SYS_POWER_DEEP_SLEEP* Kconfig
options in order to match SYS_POWER_LOW_POWER_STATE* naming
scheme.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-12 07:46:32 -05:00
Piotr Zięcik
7a49356c77 power: Fix naming of Kconfig options controlling low power states
The SYS_POWER_LOW_POWER_STATE_SUPPORTED and SYS_POWER_LOW_POWER_STATE
suggests one low power state but these options control multiple
low power state. This commit uses plural in the names to indicate
that.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-12 07:46:32 -05:00
Kumar Gala
861c82d05f samples: net: zperf: rename WLAN to WIFI
We refer to it as WIFI and not WLAN, so use that CONFIG symbol and
string.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-11 22:29:58 -05:00
Piotr Zięcik
ff5070472b samples: nrf52: power_mgr: Demonstrate power state forcing
This commit extends the power_mgr sample in order to demonstrate
power state forcing using the sys_pm_force_power_state() API.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-11 07:52:12 -05:00
Kumar Gala
b813ae2b54 samples: subsys: nvs: Convert FLASH_ERASE_BLOCK_SIZE to DT_
Use DT_FLASH_ERASE_BLOCK_SIZE prefixed defined instead of
FLASH_ERASE_BLOCK_SIZE as the non-DT version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala
dc0ad52320 samples: nvs: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala
2a14a28d19 boards: reel_board: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala
4433041da4 samples: subsys: ipm_mcux: Convert to use DT_ prefixed defines
The code has been using non DT_ prefixed defines for DT generated
defines.  Switch to use DT_ prefixed ones as we want to deprecated
the non DT_ prefixed defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 16:03:17 -06:00
Andy Gross
d0fc82c02d samples: net: Add Google IOT Cloud full stack application
This application provides a full stack implementation for
communicating with the Google IOT Cloud.  It leverages the
a JWT library to create JSON tokens which are then signed using
a RSA or ECDSA private key.  The signed token is used to
authenticate with the Google IOT cloud servers.  Once that is
accomplished, the application can subscribe, or publish data at
will.

Included in the application is a python script that can be used to
create RSA/ECDSA certificates and keys.  The user will load the
certificate for the appropriate device on the Google IOT Cloud.  The
private key is created by the script and stored in a C structure format
that is then consumed by the application.  It is important to note that
any keys generated from the scripts SHOULD NOT BE STORED publicly.

Please refer to the README for more information.

Signed-off-by: David Brown <david.brown@linaro.org>
Signed-off-by: Andy Gross <andy.gross@linaro.org>
2019-02-08 15:32:58 -06:00
Jakub Rzeszutko
090ef041e8 shell: improved shell_prompt_change function
Shell will store only pointer to the prompt string instead of
copying it to the RAM buffer. It will save RAM memory and
it will simplify implementation of a  new feature: "select"
command. When a command will be selected than shell will
display command syntax as a prompt.

Removed obsolete ASSERT check in a static function.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-02-08 14:51:52 -05:00
Andy Ross
9ff319dc52 samples/portability/cmsis_rtos_v2/philosophers: Exclude qemu_x86_64
This is hitting a stack overflow (probably the same reason xtensa is
also excluded -- both are stack-hungry platforms), but with CMSIS
there is a fixed cap of 512 bytes that can't be extended.  So
whitelist this sample.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-08 14:49:39 -05:00
Jukka Rissanen
62c75107a3 samples: net: can: Add socket CAN sample
Simple socket CAN application that sends data periodically and
receives the data back.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-08 12:03:34 -05:00
Andrei Emeltchenko
1e9235259a samples: cdc_acm_composite: Add README documentation
Add README describing the sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
d1f84ea781 samples: cdc_acm: Add composite CDC ACM sample
Add sample creating 2 serial USB ports and establishing communication
between those 2 ports.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
bf0a4a8cfb samples: usb: Update samples for new port name
Use new multi instance interface and new port names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
1b5227ebc9 samples: fxos8700-hid: Use HID Device interface
Refactor sample using new HID Device interface.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
0ccc28c4a8 samples: hid-mouse: Refactor and use new HID Device interface
Refactor of hid-mouse and using new HID Device interface.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
6cf619f549 samples: hid: Use HID Device interface for samples
Use new HID Device interface for HID sample

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko
6aefb16964 usb: cdc_acm: Add menuconfig option for multiple instances
Add menuconfig option to select another instance of CDC ACM device.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Nathaniel Graff
0ebb98ff1f samples/basic/fade_led: Add support for HiFive 1
Blinks the blue channel of the RGB LED

Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
2019-02-08 09:09:35 -06:00
Tomasz Gorochowik
d0808216f5 samples: net: mqtt_publisher: Add proxy support
If appropriate configuration is enabled, assume (with the default
configuration) that the proxy server uses the same address as the broker
and the default 1080 port.

The default settings can be changed in the configuration header.

Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2019-02-08 14:20:44 +02:00
Andrew Boie
41f6011c36 userspace: remove APPLICATION_MEMORY feature
This was never a long-term solution, more of a gross hack
to get test cases working until we could figure out a good
end-to-end solution for memory domains that generated
appropriate linker sections. Now that we have this with
the app shared memory feature, and have converted all tests
to remove it, delete this feature.

To date all userspace APIs have been tagged as 'experimental'
which sidesteps deprecation policies.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Andrew Boie
525065dd8b tests: convert to use app shared memory
CONFIG_APPLICATION_MEMORY was a stopgap feature that is
being removed from the kernel. Convert tests and samples
to use the application shared memory feature instead,
in most cases using the domain set up by ztest.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-02-08 07:04:30 -05:00
Andrei Gansari
0ceab99865 samples: net: removed unused common cmake
CONFIG_NET_TESTING never used, removed in this commit.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-02-08 13:57:55 +02:00
Ravi kumar Veeramally
2c3ecd8c51 net: samples: Disable IPv4 from packet socket sample
IPv4 is not needed for packet socket sample. Previous commit
helps to remove dependencies.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-08 12:35:03 +02:00
Anas Nashif
74c573635f samples/tests: filter based on toolchain features
Do not run with toolchains that do not support newlib.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 22:46:10 -06:00
David B. Kinder
c1dce2f799 doc: fix misspellings in docs
Fix misspellings missed in regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-07 22:06:14 -05:00
Peter A. Bigot
aa684363f0 drivers: sht3xd: update to new I2C API
Use the new i2c_write_read() wrapper to simplify the code.

Also add several overlays used to test the sensor on a variety of
boards, and conf file support for trigger testing.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-02-07 22:04:28 -05:00
Anas Nashif
f164b056b0 samples: fix alarm sample doc and inclusion
Fix reference for alarm sample and how it is included in the
documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 16:14:00 -05:00
Erwan Gouriou
da744314ca samples/drivers: Provides basic sample for counter alarm
Provide basic sample to exercise counter alarm API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Maureen Helm
dedc82d005 samples: gui: Add support for imx rt boards to lvgl sample
Adds board configurations to support the mimxrt1050_evk and
mimxrt1060_evk boards in the lvgl sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 14:28:55 -06:00
Maureen Helm
606f8316dd samples: gui: Fix lvgl sample to use configured display device name
Fixes the lvgl sample to use the same display device name as the lvgl
library rather than a hardcoded string.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-02-07 14:28:55 -06:00
Vikrant More
49aeb1ffe3 samples: mesh: taking care of interrupted transition
With this commit, it is now possible that if (for e.g.) lightness
transition is interrupted by temperature transition (which could
be instantaneous or non-instanstaneous) then as soon as temperature
transition get over, then algorithm would achieve target value
of lightness.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-02-07 21:01:37 +02:00
Marc Pignat
8b6204b7ae samples/drivers/led_apa102: add a sample for using APA102 LEDs strip
Add a sample demonstrating usage of the APA102 driver, heavily based
on led_ws2812. Tested on nucleo_l432kc with an Adafruit DotStar strip.

Signed-off-by: Marc Pignat <marc@absintheaudio.com>
2019-02-07 11:19:00 -06:00
Marc Pignat
9dba1feaf1 samples: rename led_apa102c sample to led_apa102c_bitbang
There is a apa102 driver, and an upcomming patch will provide a sample
for using it, but let's keep the bitbang version which is intersting.

Signed-off-by: Marc Pignat <marc@absintheaudio.com>
2019-02-07 11:19:00 -06:00
Ravi kumar Veeramally
7e8ded911d samples: sockets: Add packet socket sample application
Sample application which opens a packet socket and receives
every packet on the wire and send some dummy packet over
socket. Simple demo of how to use packet sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-07 14:43:30 +02:00
Tavish Naruka
0f3bd0f43b samples: subsys: Filesystem API sample with SDHC
Added sample to show disk access and FS api with
Fat filesystem and SDHC driver. Tested working with
nrf52840 (blip).

Signed-off-by: Tavish Naruka <docuser@docs.electronut.in>
2019-02-06 21:42:37 -05:00
Spoorthi K
8c1eecbada samples: cmsis_rtos_v2: Resolve control flow issue
Resolve control flow issue in cmsis_rtos_v2 sample.

Fixes: #12295

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-02-06 21:34:20 -05:00
Spoorthi K
cd1af7333e samples: cmsis_rtos_v1: Resolve control flow issue
Resolve control flow issue in cmsis_rtos_v1 sample.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-02-06 21:34:20 -05:00
Piotr Zięcik
461c81dc38 samples: nrf52: power_mgr: Show effect of power state locking
This commit enhances the power_mgr sample by adding code
presenting power state locking API as well as its effect
on the decisions made by the Power Management Policy.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-02-06 14:24:01 +01:00
Andrzej Głąbek
df901f4d9c boards: nrf: Indicate pwm as supported on Nordic DK boards
Indicate that PWM is supported on several Nordic DK boards so that
the pwm_nrf5_sw and pwm_nrfx drivers are covered by CI builds.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Andrzej Głąbek
e2b38e02bf drivers: pwm: nrf: Use HW PWM by default when available
Enable HW PWM driver instead of the SW one on nRF SoCs where the PWM
peripheral is present.
Default PWM instances are also enabled on Nordic DK boards so that it
is possible to build the basic fade_led sample for them without extra
adjustments.

After the above changes are applied, some configuration alterations
in basic samples blink_led and fade_led become no longer needed.
These are removed. And the blink_led sample is corrected so that it
works with the nRF HW PWM driver as well.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-06 07:19:07 -05:00
Daniel Leung
f7a42a70f8 gpio: intel_apl: rework driver for pin_mask callback
To avoid confusion, callbacks using ordinal pin numbers
is going to be reverted. So the driver has to be re-worked
to expose multiple devices so each device has 32 pins.

Also fixes #12765

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-02-06 07:18:15 -05:00
Andrei Emeltchenko
ebc79e429e samples: cdc_acm: Add composite test configuration
Add section for build sanity check configuration with
CONFIG_USB_COMPOSITE_DEVICE enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-05 11:08:24 -05:00
Andrei Emeltchenko
95df9ffdfd sample: cdc_acm: Add overlay configuration for composite device
Add configuration for creating composite USB device with CDC ACM and
Mass Storage functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-05 11:08:24 -05:00
Andrei Emeltchenko
0f419f3c3f samples: cdc_acm: Remove unneeded config options
Cleanup prj.conf

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-05 11:08:24 -05:00
Andrei Emeltchenko
ea98034aab samples: fxos8700-hid: Use HID_MOUSE_REPORT_DESC macro
Use API macro for mouse description.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-05 11:08:24 -05:00
Johann Fischer
6e885cfd97 samples: cfb: remove unused variable and fix style
Remove unused variable and fix style.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-02-05 11:05:47 -05:00
Jakub Rzeszutko
fe497cc4ca shell: update shell_uart backend test condition
New shell does not need either CONFIG_UART_CONSOLE
or interrupts support to be working. Only CONFIG_SERIAL
in combination with CONFIG_UART_SHELL_ON_DEV_NAME are required.
Updated sample yaml file accordingly.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-02-05 16:23:33 +01:00
Jakub Rzeszutko
70a6d7850d shell: add RTT backend to CI tests
Adding shell_rtt.c to sanity check - related to issue #12860.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-02-05 16:23:33 +01:00
Anas Nashif
2b9458c378 doc: restructure and create index pages
Move all lead pages to be index pages and create redirect rules from the
old pointers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00
Anas Nashif
58632f8da7 doc: change board dts documentation with new URLs
flash-partitions page has moved...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00
Anas Nashif
4d93a9797f doc: changed structure and layout
Move to the new structure with both:

 - API Reference
 - User and Developer Guides

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-05 07:04:40 -05:00
Anas Nashif
63260bf6cf drivers: gpio: enable gpio_shell in board_shell
Enable the GPIO shell in board_shell rathe the shell sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-04 17:55:40 -05:00
Ravi kumar Veeramally
1e47f26d1c net: coap: Remove legacy CoAP implementation
As we are removing net_app and net_pkt based libraries and
applications, CoAP legacy based libraries and apps are moved
to socket based implementations. So removing legacy CoAP.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-02-04 16:49:59 -05:00
qianfan Zhao
634e482fe1 samples: watchdog: Remove stm32 iwdg sample
STM32 iwdg driver are convented to new API now, the old sample
are doesn't need again.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2019-02-01 19:16:59 -05:00
Andrzej Głąbek
9856554751 samples: bluetooth: Fix hci_spi sample
This commit fixes the following issues introduced when switching to
the new SPI API in commit e7de85b534:
- the SPI slave operating mode (and support for it) was not properly
  selected (the setting was missing in the sample probably because
  the old nRF SPI slave driver used in this sample was not checking
  the requested mode at all)
- the `txmsg` buffer filled with 0xFF values in the `bt_tx_thread`
  function was improperly used afterwards in `spi_send` to transmit
  the slave header frame
- the common structures defining buffers for SPI transactions (`tx`
  and `rx`) were modified in `spi_send` before the corresponding
  semaphore was taken, resulting in data corruption

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-01 19:12:57 -05:00
Andrzej Głąbek
1dbcd0affa samples: bluetooth: hci_spi: Use DT instead of Kconfig to get HW params
Convert the hci_spi sample to get the SPI and GPIO settings from Device
Tree instead of Kconfig.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-02-01 19:12:57 -05:00
Ole Sæther
634a7d0c54 samples: smp_svr: Surrounding BLE code with #ifdefs
Surrounding BLE code with #ifdefs to make sample build
on devices that don't have BLE.

Signed-off-by: Ole Sæther <ole.saether@nordicsemi.no>
2019-02-01 19:09:46 -05:00
Kumar Gala
2d9afbf423 samples: fxos8700-hid: Don't use CONFIG_ namespace for non Kconfig
The sample was defining a #define with a CONFIG_ prefix but this wasn't
coming from Kconfig.  Change the define name not to conflict with the
Kconfig CONFIG_ namespace.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 19:01:16 -05:00
Kumar Gala
5977b3db2f dts: Remove mcuboot.overlay
As we want to remove dts dependency on Kconfig, we had a case based on
CONFIG_BOOTLOADER_MCUBOOT.  From a DTS point of view that was just
getting the chosen property 'zephyr,code-partition' set.  We can easily
move this to the actual dts files and remove the mcuboot.overlay.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-01 10:16:06 -06:00
Piotr Mienkowski
dc6066946e drivers: mb_display: remove usage of gpio_port_ functions.
gpio_port_ functions are being deprecated. This commit removes their
usage.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-01 08:57:58 -05:00
Piotr Mienkowski
6e48e1ecb5 samples: convert altera_max10/pio to use gpio_pin functions
gpio_port_* functions are being deprecated. Convert boards/altera_max10
sample to use gpio_pin_* functions instead.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-02-01 08:57:58 -05:00
Tomasz Bursztyka
4b78a251d7 net/context: Make recv_cb providing the ip and protocol headers
If status is 0, both ip_hdr and proto_hdr will own a pointer to the
relevant IP and Protocol headers. In order to know which of ipv4/ipv6
and udp/tcp one will need to use respectively net_pkt_family(pkt) and
net_context_get_ip_proto(context).

Having access to those headers directly, many callbacks will not need
to parse the packet again no get the src/dst addresses or the src/dst
ports. This will be change after this commit.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-02-01 14:34:38 +02:00
Jukka Rissanen
48abdc2cb9 samples: net: Remove net-app based sample applications
As net-app API is removed, remove also all the sample applications
that use it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-01 12:29:21 +02:00
Armando Visconti
37e77f942a driver/sensor: lps25hb: align driver to auto-generated dts macros
Use auto-generated device tree macros in LPS25HB driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-01 04:19:42 -06:00
Armando Visconti
396ffbd86d driver/sensor: lsm6ds0: align driver to auto-generated dts macros
Use auto-generated device tree macros in LSM6DS0 driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-02-01 04:19:42 -06:00
Paul Sokolovsky
30ba9de4c4 samples: sockets: Remove Zephyr logging from POSIX-compatible samples
As example of echo_async_select added recently shows, we no longer
need to define a logger unconditionally in each source file. These
samples are intended to show Zephyr compatibility with POSIX sockets
API, so the less there're differences between Zephyr vs POSIX
ifdefs, the better.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-02-01 08:50:02 +02:00
Michael Scott
9cd0cfa564 samples: lwm2m: migrate to BSD socket APIs
The LwM2M library has moved from the network application library
APIs to BSD socket APIs.  Let's make the needed changes in the
LwM2M sample to follow those changes.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott
180a365d2f net: lwm2m: support for LwM2M bootstrap
Now that the security data can be loaded into and used from the
security / server objects, we can add support for LwM2M bootstrap.

This is a mode where initially a connection can be made to a server
which can update several LwM2M (including security and server
data) and then trigger a "bootstrap complete".  Once this happens
the client will start it's connection process over but now with
the new information.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott
54c10c04e5 net: lwm2m: use security data for connections
In order to support bootstrap mode, we need to store server data
in the security / server objects.  Once the connection to the
bootstrap server is made, it will clear these objects and add
new server connection data.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott
3bfb7debb3 net: lwm2m: move to flat buffers
As part of the migration from net_app APIs to socket APIs, let's
stop referencing the net_pkt fragments throughout the LwM2M library.

Establish a msg_data flat buffer inside lwm2m_message and use that
instead.

NOTE: As a part of this change we remove the COAP_NET_PKT setting.
The COAP library reverts to COAP_SOCK behavior.

This doesn't mean we use sockets in LwM2M (yet), it only means we
use the socket-compatible COAP library which parses flat buffers
instead of net_pkt fragments.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Michael Scott
d003910460 net: lwm2m: create DTLS config layer for LwM2M
Currently, this will select the needed configs for LwM2M and net_pkt.
During the migration to socket APIs, the net_pkt selections will change
to socket-based selects.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-31 23:02:56 -05:00
Robert Lubos
18af0d1572 samples: sockets: Update echo_client/echo_server documentation
As the net-app based echo samples are being removed, there's no use
referencing them any longer in their socket counterparts.

Additionally, overlay configuration descriptions were added in the
same manner original samples did.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-31 13:56:05 -05:00
Piotr Zięcik
1ef5ad1883 samples: power: power_mgr: Remove redundant test
The removed test does the same thing and runs on the same platforms
as already existing samples/boards/nrf52/power_mgr.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-01-31 17:39:27 +01:00
Piotr Zięcik
b343665064 samples: nrf52: power_mgr: Enable the demo on the nRF51 SoC series
This commit updates the README and sample.yaml in order to signal
that this demo works flawlessly on the nRF51 platform.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-01-31 17:39:27 +01:00
Piotr Zięcik
a0f02b6a6d samples: nrf52: power_mgr: Update sample to use Zephyr PM policy
This commit updates the power management sample in order to use
new features introduced by recent changes in the Zehyr Power
Management subsystem. Now, it shows how to use power management
policies as well as how to implement custom power modes.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-01-31 17:39:27 +01:00
Kumar Gala
75d84ffd7a led: lp3943: Remove dts_fixup.h
Since the lp3943 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Kumar Gala
489cecd505 led: pca9633: Remove dts_fixup.h
Since the pca9633 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Kumar Gala
be0d753721 led: lp5562: Remove dts_fixup.h
Since the lp5562 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Vincent Wan
db022a966c samples: net: add TLS offload support to mqtt_publisher
This commit adds support in the sample to deal with the case when TLS
is offloaded and mbedtls is not necessary.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Vincent Wan
fec0445ebb samples: net: Add support for cc3220sf_launchxl in mqtt_publisher
This commit adds the necessary changes to allow the mqtt_publisher
sample to run on cc3220sf_launchxl.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-31 06:36:08 -05:00
Kumar Gala
a3682f67d4 audio: mpxxdtyy: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert mpxxdtyy driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 03:46:04 -06:00
Aurelien Jarno
4394601524 net: sntp: get rid of the callback function
The original SNTP client library was designed for the net-app API, for
which it makes sense to have a callback function, which is called
asynchronously when an answer is received.

For the socket based interface, the callback is called just before
sntp_request() returns. It gets the status and the epoch_time in
parameter, however the status is already returned by sntp_request(). It
therefore make sense to replace the callback function by a pointer to
epoch_time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-31 10:14:12 +02:00
Andrew Boie
c253a686bf app_shmem: auto-initialize partitions
There are no longer per-partition initialization functions.
Instead, we iterate over all of them at boot to set up the
derived k_mem_partitions properly.

Some ARC-specific hacks that should never have been applied
have been removed from the userspace test.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-01-30 23:15:51 -05:00
Paul Sokolovsky
d6ffca36f3 samples: sockets: Clean up headers included
Don't include net_app.h and net_buf.h, the first is deprecated, the
latter is low-level header, both shouldn't be used for socket apps.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-30 21:05:11 -05:00
Maureen Helm
cb2f9e9590 samples: sensors: adt7420: Fail gracefully if sensor not found
Fixes the adt7420 sensor sample to fail gracefully if the sensor device
is not found and asserts are not enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-30 21:03:44 -05:00
Kumar Gala
1d210dc2d8 sensor: adxl372: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert adxl372 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 17:51:25 -06:00
Andrew Boie
85e1fcb02a app_shmem: renamespace and document
The public APIs for application shared memory are now
properly documented and conform to zephyr naming
conventions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-01-30 15:43:58 -08:00
Kumar Gala
e2b62b411b samples: openamp: Update sample to OpenAMP v2018.10 release
The v2018.10 release of OpenAMP reworks the API set and splits the
remoteproc vs rpmsg interfaces so one can use rpmsg without remoteproc.

This helps drastically reduce the code footprint utilized by OpenAMP.
The remote see around 4k reduction in code size.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 15:55:47 -06:00
Vikrant More
732cfac519 samples: mesh: removed bug which is cause of divide by zero exception
If Client send transition time values as 0x40 or 0x80 or 0xC0 then
this was cause the behind divide by zero exception during calculation
of transition->counter. This PR will solve this bug.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-30 21:48:02 +02:00
Kumar Gala
4f334970ad sensor: adt7420: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert adt7420 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 08:08:03 -06:00
Jakub Rzeszutko
75ad61f7ef shell: removed foreground command functionality
Removed foreground command functionality from shell source files.
Removed associated example.
Removed enter/exit command functions from the Bluetooth example
Updated project config files.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-30 13:05:56 +01:00
Kumar Gala
cdc1b1f103 sensor: ccs811: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ccs811 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-30 02:53:35 -06:00
Michael Scott
b0de8b88dd samples: lwm2m_client: enable HW flow control for WNC-M14A2A modem
The WNC-M14A2A modem is supposed to use HW flow control on the UART
connected to the MCU.  In the past, we were able to bypass this
requirement by using only the LTE-M firmware which supported pulling
the CTS line high via "send-ok" gpio.

This does NOT work for the LTE firmware.

Now that MCUX UART driver supports hw-flow-control setting, let's use
it in the modem overlay so that regardless of modem firmware
(LTE vs. LTE-M) the sample will "just work".

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 02:53:12 -06:00
Michael Scott
0ee0773abd net: lwm2m: remove unused CONFIG_NET_CONTEXT_NET_PKT_POOL config
CONFIG_NET_CONTEXT_NET_PKT_POOL is used by Zephyr's TCP stack as
a way of keeping the original packet data when compression and
other l2 specific actions make the data unusable for retries.

LwM2M uses UDP and this option was never used.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-01-30 10:35:54 +02:00
Kumar Gala
d7b7dbd910 sensor: apds9960: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert apds9960 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 16:03:21 -06:00
Kumar Gala
1300f5bd9e sensor: ms5837: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ms5837 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 15:26:28 -06:00
Kumar Gala
d0aca3b92c display: ili9340: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ili9340 display driver to use new defines so we can remove
the dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 15:25:46 -06:00
Kumar Gala
3e8fc3c0c1 modem: wncm14a2a: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert wncm14a2a driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:56 -06:00
Kumar Gala
fe8edc2884 display: ssd1306: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ssd1306 display driver to use new defines so we can remove
the dts_fixup.h code for it.  Also dropped "-i2c" from compatible.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:32 -06:00
Kumar Gala
3b42943fe7 display: ssd1673: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert ssd1673 display driver to use new defines so we can remove
the dts_fixup.h code for it.  Also dropped "-spi" from compatible.

Fix up references in reel_board dts and sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 14:21:06 -06:00
Anas Nashif
ef77e71184 samples: mpu_stack_guard_test: adapt filters
Keep filters the same for both tests, sample does not work on x86.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-29 15:03:38 -05:00
Andrew Boie
f278f31da1 app_shmem: delete parallel API for domains
The app shared memory macros for declaring domains provide
no value, despite the stated intentions.

Just declare memory domains using the standard APIs for it.

To support this, symbols declared for app shared memory
partitions now are struct k_mem_partition, which can be
passed to the k_mem_domain APIs as normal, instead of the
app_region structs which are of no interest to the end
user.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-01-29 11:11:49 -08:00
Kumar Gala
003bdb5fb6 led_strip: lpd880x: Add Device Tree support
Convert the lpd880x driver to use device tree and new DT_<COMPAT>
defines.  Support both LPD8803 & LPD8806 device tree compats.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 12:04:07 -06:00
Ravi kumar Veeramally
a9acc6d4d7 net: samples: Add socket based SNTP client application
SNTP client sample requests time sync on IPv4 and IPv6 addresses
using socket based SNTP client library.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Ravi kumar Veeramally
f51cebeea2 net: sntp: Rework SNTP client library to use sockets
As networking libraries and protocols are moving to socket
based implementation, reworked SNTP client library to use sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-01-29 12:25:01 -05:00
Peter A. Bigot
cf57312953 samples: sensors: hts221: support triggered readings
Allow trigger-initiated sampling at the support 7 and 12.5 Hz rates.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-29 17:50:02 +01:00
Yannis Damigos
a756cdeeb8 samples: cdc_acm: Remove redundant inclusion
Remove redundant inclusion of stdio.h

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-01-29 17:40:50 +01:00
Armando Visconti
69a3566868 samples/96b_argonkey: divided test into sensor and microphone
We have now two code samples available for ArgonKey board:

    1. sensors sample, fetching data from accel/gyro/mag,
       barometer, humidity and proximity sensors

    2. microphone sample, acquiring 5s audio @16KHz from the
       on-board microphone.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 11:57:25 -06:00
Kumar Gala
e0cd0c2b67 wifi: winc1500: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert winc1500 driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-28 10:39:59 -06:00
Armando Visconti
42c7e8873c driver/sensor: lis3mdl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LIS3MDL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti
a3ae11f897 driver/sensor: lis2mdl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LIS2MDL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti
5ad0d27bd1 driver/sensor: lsm6dsl: Fix attribute setting for gyroscope fs
The API for setting the gyroscope full scale attruibute requires
the argument in radians/s.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Armando Visconti
c81efe25d5 driver/sensor: lsm6dsl: align driver to auto-generated dts macros
Use auto-generated device tree macros in LSM6DSL driver to avoid
usage of dts.fixup code for it.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-28 10:01:19 -06:00
Johan Hedberg
404d9017eb samples: reel_board/mesh_badge: Disable secure network beacon
The app is already sending period heart beat messages, and since it is
not designed to be used for such long times that would require IVI
Update, keep the secure network beacon sending disabled.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-28 14:10:58 +02:00
Johan Hedberg
b5a65d8c81 samples: reel_board/mesh_badge: Add simple power saving implementation
Suspend the mesh network after 30 minutes of inactivity. This should
help prolong the battery life of boards used at multi-day events, if
the user forgets to power off the device for the night.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-28 14:10:58 +02:00
David B. Kinder
aabaa4fab9 doc: reduce sample index clutter
Docs in the samples folder are a mixture of samples and sample indexes
of more samples, cluttering the index display. This change eliminates
the clutter, be we should reorganize the sample docs so we have a
consistent doc hierarchy (and improved organization).

Fixes: #12758

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-26 18:52:54 -05:00
Johann Fischer
6caf4e9144 boards: reel_board: use appropriate labels for HDC1010 and MMA8652FC
Use appropriate labels for HDC1010 and MMA8652FC.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-26 12:08:52 -05:00
Johann Fischer
f36fe23e65 sensor: hdc1008: convert to DT_<COMPAT>_<INSTANCE> defines
Convert hdc1008 sensor driver to use new defines.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-26 12:08:52 -05:00
Emanuele Di Santo
3110937556 samples: bluetooth: hci_uart: add configuration for nrf52840_pca10090
Add a project configuration for nrf52840_pca10090 that will
route the nRF9160 interface pins to the nRF52840, and use them
for HCI over UART.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-25 22:26:17 +01:00
Jukka Rissanen
4043909d69 net: http: Remove HTTP client and server APIs
The old legacy APIs use net-app library and as that is being
removed, then the dependencies need to be removed also.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Jukka Rissanen
1cba0161ed net: websocket: Remove the websocket as HTTP APIs are removed
Remove the experimental websocket code as it uses HTTP APIs
which are being removed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-25 11:21:20 -05:00
Paul Sokolovsky
fe7043d7ca samples: net: sockets: Set explicit min_flash on some samples
Fixes build issues with lpcxpresso54114_m0 which set to have 32K RAM,
and only 64K Flash.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Paul Sokolovsky
8c50ce934b samples: net: socket: Add "socket" tag to sample.yaml's
So it was easy to run all socket tests without remembering
the exact path(s).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-25 10:35:39 +02:00
Armando Visconti
d972bdaba4 samples: Provide x-nucleo-iks01a2 shield sample
This sample is made to demonstrate use of x-nucleo-ik01a2 shield.
It requires a board with Arduino i2c where it can be plugged on.
The sample has been tested on Nucleo F401RE board.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 09:38:08 -06:00
Paul Sokolovsky
df95a423b2 samples: echo_async_select: Add select()-based async echo sample
A copy of poll()-based echo_async, converted to use select().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-24 17:14:43 +02:00
Armando Visconti
aca8ae3fd4 driver/sensor: use lis2dh as common driver among multiple sensors
Share lis2dh driver among few accelerometer sensors that has
same register interface: LIS2DH, LIS3DH, LSM303DLHC, LIS2DH12,
LSM303AGR.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-24 07:26:16 -06:00
Ioannis Konstantelias
5151e8a094 boards: nucleo_l496zg: Add pwm mapping and RTC
Supported PWM at pins A0, D3, D5 and D6 which are also Arduino
compatible. Also the onboard red LED can be used with PWM.

The basic/{fade_led, blink_led} samples to apply to this board
seemlessly and operate on the onboard red LED.

Also supported RTC.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-01-23 09:18:35 -06:00
Armando Visconti
b8d2e1986d samples: sensor: lsm6dsl
This commit provides sample application for sensor lsm6dsl.
This sample has been tested on both 96b_argonkey board,
where lsm6dsl is connect to the micro thru SPI bus, and on
disco_l475_iot1 board, where instead it is connected to I2C bus.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-01-23 04:07:16 -06:00
Robert Lubos
574ec20bbb samples: crypto: Whitelist nrf52840_pca10056 in mbedTLS benchmark tests
Add nrf52840_pca10056 board to the platform whitelist in mbedTLS
benchmark sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-22 08:26:07 -05:00
Robert Lubos
17473e28d9 samples: crypto: Fix mbedtls benchmark time calculations
mbedTLS benchmark used 32-bit arithmetics for time calculations
(nanosecond resolution), which could overflow on slower platforms
on more time-consuming benchmark tests. In result, the benchmark
could give incorrect timing information. Using 64-bit arithmetics
prevents this issue.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-22 08:26:07 -05:00
Paul Sokolovsky
e779f91e0c samples: echo_server: Test overlays for eth_e1000 and eth_stellaris
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-21 09:09:45 +02:00
Paul Sokolovsky
7117b73562 samples: echo_server: Test overlay-smsc911x.conf via sanitycheck
By adding relevant test config to sample.yaml.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky
c3aa195940 samples: sockets: Add eth_smsc911x overlays
Add overlays for commonly used socket samples: big_http_download and
dumb_http_server. Can be used with:

make BOARD=mps2_an385 CONF_FILE="prj.conf overlay-smsc911x.conf"

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Paul Sokolovsky
56cb35a7e8 samples: net: echo_server: Add overlay for eth_smsc911x
As can be used for example with BOARD=mps2_an385.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-19 11:59:29 -05:00
Kumar Gala
5828dda6d4 samples: bluetooth: peripheral_hr: Rework FRDM-KW41Z shield support
Split out the boards that utilize the FRDM-KW41Z as a seperate test
where we explicitly set the shield as an extra_args instead of having to
do it in the CMakeLists.txt file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-19 07:16:40 -05:00
Erwan Gouriou
0115c47b69 cmake: dts: move to specifying shield on the command line
Rather than specifying SHIELD via Kconfig, we move it to being
specified via the command line, similar to board.

So we can do:

  -DSHIELD=x_nucleo_iks01a1

or, for multiple shields:

  -DSHIELD="x_nucleo_iks01a1 frdm_kw41z"

Following cmake change, update x_nucleo_iks01a1 sample in order
not to enable CONFIG option anymore but set SHIELD cmake option.

Last, update documentation to reflect this change.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 13:20:59 -06:00
Kumar Gala
affc1ed253 sensor: bmi160: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert bmi160 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:53:53 -06:00
Kumar Gala
31dad5b411 sensor: vl53l0x: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert vl53l0x sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:52:14 -06:00
Kumar Gala
62e1ed928c samples: sensor: vl53l0x: Fixup sample to build all boards with it
Updated the sample.yaml to use depends_on and update the board yaml that
have the vl53l0x sensor.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:52:14 -06:00
Kumar Gala
957c3009a6 sensor: max30101: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert max30101 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:50:12 -06:00
Kumar Gala
8b691f50ca led_strip: ws2182: Add Device Tree support
Convert the ws2812 driver to use device tree and new DT_<COMPAT>
defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:47:45 -06:00
Peter A. Bigot
12836d9280 drivers: sensors: sht3xd: support multiple devices and DT bindings
Add a configuration structure to sht3xd that holds instance-specific
parameters, implemented in a immutable statically allocated object
initialized with material from device tree binding aliases.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-18 09:43:14 -06:00
Kumar Gala
7b9bf08dce sensor: lps22hb: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert lps22hb sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 09:38:31 -06:00
Kumar Gala
8f04f81e97 sensor: fxas21002: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxas21002 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 08:54:31 -06:00
Robert Lubos
97aa3ac519 samples: openthread: Increase shell stack size
OpenThread commissioner shell command caused stack overflow on shell
thread, hence increase it for OpenThread samples.

Fixes #12455

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-01-18 15:24:16 +02:00
Anas Nashif
eff81c498b power: remove obsolete power samples
We have a new power management system and those samples have been
written for specific boards and using the application based power
management subsystem. We are getting new tests/samples that are generic
with the new subsystem, so remove those in favor of the new ones.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-18 06:50:04 -05:00
Kumar Gala
5431762769 sensor: fxos8700: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert fxos8700 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Kumar Gala
5bc807949a samples: sensor: fxos8700: Add boards to sample
Add missing boards that have the fxos8700 sensor on them to build as
part of this sample.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 13:29:46 -06:00
Kumar Gala
a5e8921de9 sensors: hts221: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert hts221 sensor driver to use new defines so we can remove the
dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-17 11:06:38 -06:00
Sebastian Bøe
c7af520915 cmake: samples: mesh: Remove redundant CMake code
This sample is linking the 'app' with 'subsys__bluetooth', which will
add zephyr/subsys/bluetooth to the include path of the app. But this
is unnecessary as the app already has this path on it's include path.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-01-17 17:26:01 +02:00
Johann Fischer
2dbac49cd6 samples: ipsp: clarify how to build for kernels before 4.12
Clarify how to build for Linux kernels released before 4.12.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-16 21:42:48 -05:00
Johann Fischer
4f81113631 samples: ipsp: remove undefined symbol NET_DEBUG_L2_BT
Remove undefined symbol NET_DEBUG_L2_BT

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-01-16 21:42:48 -05:00
Jakub Rzeszutko
fd0b7f7767 shell: removing legacy shell
Legacy shell removed in order to avoid maintaining two shells
systems.

All examples and tests have been migrated to the new shell.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-16 21:35:36 -05:00
Kumar Gala
efd31af624 sensors: lsm303dlhc: Convert to new DT_<COMPAT>_<INSTANCE> defines
Convert lsm303dlhc_accel & lsm303dlhc_magn sensor driver to use new
defines so we can remove the dts_fixup.h code for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 21:33:16 -05:00
Andrei Gansari
4118b8843f drivers: eth_enc28j60: moved to dts
Driver for networking device Microchip ENC28J60 is used as SPI slave,
moved to DTS type definition. Samples echo_client and echo_server use
this device on Arduino 101 board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 21:28:23 -05:00
Erwan Gouriou
0dc0c9d83a boards: Add arduino_i2c in yaml when supported
Update boards yaml file with arduino_i2c supported option

We exclude disco_l475_iot1 from the x_nucleo_iks01a1 sample since there
are duplicated sensors between the disco_l475_iot1 and shield.  Until
Zephyr drivers can handle multiple sensors we need to have this exclude.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 16:14:56 -06:00
Kumar Gala
be2b6f870d sensor: bme280: Converting to using device tree
Convert the BME280 driver to use device tree and new DT_<COMPAT>
defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-16 12:39:37 -06:00
Maureen Helm
f22bd777d6 samples: bluetooth: Build peripheral_hr sample on more imx rt boards
Adds mimxrt1020_evk and mimxrt1060_evk to the list of boards for the
peripheral_hr sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-16 12:32:16 -06:00
Peter A. Bigot
bc703377d2 boards: arm: nrf51_ble400: add I2C and SPI configuration
This board has headers for these buses so they should be made available
without requiring special overlays.

Also take advantage of the new Nordic auto-enable for peripherals,
which eliminates the need for special configuration.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-16 12:12:54 -05:00
Vikrant More
b5017ec7dc samples: mesh: restriction to re-transmit publish messages
If Server receives re-transmitted message then it will not
transmit corresponding publish message for it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More
a61f7c39aa samples: mesh: feature to save Lightness & Temp. Range on Flash
With this commit, it is now possible to save Lightness &
temperature Range values on SoC flash.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More
f4f6426582 samples: mesh: code improvements
Added app_gpio.c & no_transition_work_handler.c to reduce
burden on main.c. It will simplify & help to understand
overall architecture.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More
b9511f2117 samples: mesh: revised states binding & target value calculation
Simplified algorithm behind states binding & target values calculation.
This has improved code readability.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Vikrant More
41b1e3e238 samples: mesh: Remove redundant code
Removed redundant code.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-01-16 13:35:54 +02:00
Adithya Baglody
25572f3b85 tests: Dont run coverage for select test cases.
Disabled the CONFIG_COVERAGE for benchmarks and other tests.
This is needed because it interferes with normal behavior of the
test case.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-16 06:12:33 -05:00
Paul Sokolovsky
fbcc43393c samples: big_http_download: Set min_flash to 128K.
Previously there was just "min_ram: 32", which took care about
suitable flash size implicitly. But now we have interesting boards
(e.g. lpcxpresso54114_m0) which tout RAM of 32K and Flash of 64K.
So, become more explicit about Flash requirement for the sample.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-15 17:22:39 -05:00
Karol Lasończyk
c0a5739bda drivers: watchdog: align sample and test to new DT
Sample application and test are aligned to new DT naming convention.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2019-01-15 12:40:13 -06:00
Jukka Rissanen
a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Andy Ross
c2c9265b7d tests: cmsis: Disable two cmsis portability tests on x86_64
These two tests are hitting a stack overflow on x86_64 (not entirely
surprisingly), but can't just increase stack size because there is an
assert in the CMSIS compatibility layer that stacks be under 512
bytes.  Just disable for now.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Andy Ross
f033d542ad tests: samples: Disable newlib tests on x86_64
This builds with a host compiler, not one from the SDK, and so no
newlib library is available.  There is work to enable newlib detection
at and above the cmake level.  This patch can be reverted when that
lands.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Andy Ross
d6eeb85046 samples/mpu/mpu_stack_guard_test: Whitelist x86_64
No MPU support there yet.  This test should really be predicated on a
kconfig variable, not architecture.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Andy Ross
b69d0da82d arch/x86_64: New architecture added
This patch adds a x86_64 architecture and qemu_x86_64 board to Zephyr.
Only the basic architecture support needed to run 64 bit code is
added; no drivers are added, though a low-level console exists and is
wired to printk().

The support is built on top of a "X86 underkernel" layer, which can be
built in isolation as a unit test on a Linux host.

Limitations:

+ Right now the SDK lacks an x86_64 toolchain.  The build will fall
  back to a host toolchain if it finds no cross compiler defined,
  which is tested to work on gcc 8.2.1 right now.

+ No x87/SSE/AVX usage is allowed.  This is a stronger limitation than
  other architectures where the instructions work from one thread even
  if the context switch code doesn't support it.  We are passing
  -no-sse to prevent gcc from automatically generating SSE
  instructions for non-floating-point purposes, which has the side
  effect of changing the ABI.  Future work to handle the FPU registers
  will need to be combined with an "application" ABI distinct from the
  kernel one (or just to require USERSPACE).

+ Paging is enabled (it has to be in long mode), but is a 1:1 mapping
  of all memory.  No MMU/USERSPACE support yet.

+ We are building with -mno-red-zone for stack size reasons, but this
  is a valuable optimization.  Enabling it requires automatic stack
  switching, which requires a TSS, which means it has to happen after
  MMU support.

+ The OS runs in 64 bit mode, but for compatibility reasons is
  compiled to the 32 bit "X32" ABI.  So while the full 64 bit
  registers and instruction set are available, C pointers are 32 bits
  long and Zephyr is constrained to run in the bottom 4G of memory.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Andrei Emeltchenko
ad875f0026 samples: sensors: Add accelerometer based HID mouse
Add Accelerometer mouse by using fxos8700 accelerometer and using data
to control USB HID mouse.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-01-11 11:06:02 -05:00
Paul Sokolovsky
f3dce8a6e4 drivers: eth: stellaris: Enable automatic Ethernet support in QEMU
When used suitable config overlay, qemu_cortex_m3 with Ethernet
support can be started with just usual "make run".

An example of such overlay is included with samples/net/echo_server,
can be built and run with:

make BOARD=qemu_cortex_m3 \
    CONF_FILE="prj.conf overlay-qemu_cortex_m3_eth.conf" run

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-11 09:48:27 +02:00
Marcin Szymczyk
c716f9c5aa usb: hid: macro for report descriptor
Added macro that generates simple report descriptor for mouse.
This improves the readability of hid-mouse sample.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-01-10 08:58:31 -05:00
Martin Schwan
c5de716af4 net: mqtt: Fix typo "seg_tag_list"
Fix a typo in the mqtt_sec_config struct where it was "seg_tag_list"
instead of "sec_tag_list".

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
2019-01-10 11:30:33 +02:00
Andrei Gansari
c8d3b3f768 samples: minor documentation fixes
DHCPv4 client typo: '/etc/dhcpd/dhcp.conf'
gPTP Sample -DCONF_FILE=prj.conf (filename changed)

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-01-09 07:57:18 -06:00
Tomasz Bursztyka
fc3f090ab8 samples/sockets: Enable 802.15.4 properly for echo apps
These were still running through Ethernet using generic
overlay-802154.conf thus creating a dedicated one.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-08 11:25:33 +02:00
Sathish Kuttan
108ca81a17 samples: intel_s1000_crb: add doc for dmic sample
Add short documentation on sample app for DMIC driver usage
on Intel S1000 CRB.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
6292a2fc3b samples: intel_s1000_crb: set BOARD for dmic sample
Set BOARD variable in CMakeLists.txt for DMIC Sample App
Since this sample app is for intel_s1000_crb, setting BOARD
in CMakeLists.txt will eliminate the need to specify in
cmake command line every time during build.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Sathish Kuttan
4e6728eb3e samples: intel_s1000_crb: add DMIC sample app
Add a sample application to demonstrate usage of digital microphones
in an Intel S1000 CRB

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-07 16:50:49 -05:00
Jan Van Winkel
81301bf4ae sample: gui: Added basic sample for lvgl library
Added a basic sample showing how to use the LittlevGL library in an
application.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 16:05:35 -05:00
Luiz Augusto von Dentz
330cbfa074 Bluetooth: peripheral: Fix check of BT_GATT_WRITE_FLAG_CMD
Check should be done with & instead of | otherwise it will always be
evaluated as 1/true regardless of the flags.

Fixes #12308

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-04 21:13:06 +01:00
Andy Ross
442e7306bf samples/net/echo: Mark OpenThread test cases as "slow"
The current OpenThread integration wants to download (from github) and
configure the OpenThread source tree every time the app is build.  We
don't want to be doing this in quadruplicate every time sanitycheck is
run.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Andy Ross
5ea39b8c2d samples/net/echo: Remove duplicate test case
These tests were defining a "test_kw41z" case, but that platform is
already whitelisted in the main ("test") case, and this one defines no
different behavior.  It's just a dupe.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Adithya Baglody
4c1667fbfa tests: Updated all the tests which use k_thread_access_grant.
With the new implementation we do not need a NULL terminated list
of kobjects. Therefore the list will only contain valid entries
of kobjects.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-01-03 12:35:14 -08:00
Anas Nashif
5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Peter A. Bigot
173d07c6e5 samples: driver: i2c_scanner: use arduino-defined device if available
nucleo_l476rg uses I2C_3 rather than I2C_0, and uses special magic to
synthesize a corresponding define from a device tree node label.  Update
the sample to use the Arduino binding if that's present.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Peter A. Bigot
c416f61974 samples: driver: i2c_scanner: fix support on Nordic TWIM driver
The Nordic TWIM driver uses DMA which requires that the source address
be located in RAM.  If it isn't the transfer will rejected as invalid.
Provide a RAM address even though it's never dereferenced.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Peter A. Bigot
75240aa504 samples: driver: i2c_scanner: fix upper bound on address range
0x77 is an available device address (and is the secondary address for
the BME280).  0x78 is a reserved address.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Savinay Dharmappa
f0c5470671 samples: subsys: usb: dfu: Add intel_s1000 to platform_whitelist
add intel_s1000 to platform_whitelist

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-12-30 16:24:33 -05:00
Anas Nashif
74a74bb6b8 power: rename api sys_soc -> sys_
sys_soc is just redundant, just call APIs with sys_*.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Anas Nashif
9151fbebf2 power: rename APIs and removing leading _
Remove leading underscore from PM APIs. _ was used for internal APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-28 16:16:28 -05:00
Krzysztof Chruscinski
49bf4300bc samples: subsys: shell: Add foreground command example
Exteneded shell sample with example how to use shell_fprintf from
any context with 'foreground' command.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-28 10:42:06 -05:00
Sebastian Bøe
ef9b08a1d4 test: code_relocation: Fixed CI failure
The test 'samples/application_development/code_relocation' was failing
in master because it was not declaring that it was defining additional
sections.

The CI error is attached below.

This patch fixes the CI failure by declaring in 'sample.yaml' that
these additional sections are expected.

FAILED:
qemu_cortex_m3/samples/application_development/code_relocation/test
has unrecognized binary sections: ['_SRAM2_RODATA_SECTION_NAME',
'_SRAM_TEXT_SECTION_NAME', '_SRAM_RODATA_SECTION_NAME',
'_SRAM_DATA_SECTION_NAME', '_CUSTOM_SECTION_NAME2']

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-12-27 19:25:34 -05:00
David B. Kinder
06d78354ae doc: regular misspelling scan
Fix misspellings in documentation (.rst, Kconfig help text, and .h
doxygen API comments), missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-12-26 13:27:14 -05:00
Erwan Gouriou
bb7d8261d7 samples/basic: Update readme for blinky/button/disco
blinky/button and disco samples are now using definitions
generated from  boards dts files.
Update samples README files accordingly.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-26 09:46:59 -05:00
Andrzej Głąbek
23d28ab400 samples: Remove redundant Kconfig adjustments for nRF boards
The options selecting nRF drivers are now enabled by default when
an nRF SoC is selected as the build target.
The options selecting given hardware instances are now enabled at
the board level.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Spoorthi K
b1e912bdb3 samples: cmsis_rtos_v2: Demo on msgq and timers synchronization
The sample application demonstrates usage of threads, message queue
and timer APIs in CMSIS RTOS V2.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-21 10:28:10 +01:00
Spoorthi K
cea0982f23 samples: cmsis_rtos_v2: Demo with Dining Philosopher's algorithm
The sample application to demonstrate dining philosopher's problem
implementation using CMSIS RTOS V2 APIs with semaphores and mutexes
as resources (forks).

The application makes use of CMSIS_RTOS_V2 APIs on threads, semaphores
and mutexes.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-21 10:28:10 +01:00
Tavish Naruka
72b0289de4 samples: driver: i2c scanner
Scans i2c bus for any devices present.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-12-21 10:27:53 +01:00
Robert Lubos
167486f4a4 samples: sockets: Update OT overlays for echo samples
Increase rx stack size for OpenThread overlay, as updated revision of
OpenThread requires more stack to operate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-21 10:27:33 +01:00
Jakub Rzeszutko
e8a77808c0 samples: reel board: correct timeout condition
After this fix each LED will blink 5 times. Previously
LED_0 has been blining 6 times while others 5 times.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-20 18:58:01 +02:00
Martin Turon
6410a16adb openthread: Update openthread version to latest upstream/master.
Update zephyr integration of openthread to latest api as of 2018-12-17:

2a75d30684

Both echo_server and echo_client compile and are operational.

Signed-off-by: Martin Turon <mturon@google.com>
2018-12-20 12:24:51 +01:00
Ravi kumar Veeramally
95c7079433 samples: net: Port mbedtls benchmark sample to zephyr
This application benchmarks the various cryptographic primitives
offered by mbed TLS.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-12-19 16:24:03 +01:00
Marcin Szymczyk
801b54edb9 usb: hid: boot protocol
Set_Protocol and Get_Protocol requests are handled now.
Tested with USB3CV.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-19 07:36:18 -06:00
Erwan Gouriou
1cfec48646 samples: yaml: filter can be limited to GPIO_CONTROLLER
It is safe to assume that if X_GPIO_CONTROLLER is defined (hence
generated) X_GPIO_PIN should also be defined.
If this is not the case, this is an issue and letting the sample
build will reveal the issue.
Update the yaml filter to rely only on _GPIO_CONTROLLER #define's


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Erwan Gouriou
a002cab080 samples/basic: disco: LED0 and LED1 might not share GPIO controller
In disco basic sample, same GPIO controller was used for LED0
and LED1, which is actually a particular case.

This change implements the general case, where LED0 an LED1 might
not have the same gpio controller.
Tested on nucleo_f429zi and frdm_k64f.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Erwan Gouriou
c338dd9b94 samples/drivers: gpio: LED0 and SW0 might not share GPIO controller
In gpio driver sample, same GPIO controller was used for out pin
(LED0) and in pin (SW0), which is actually a particular case.

This change implements the general case, where button an led might
not have the same gpio controller.
Tested on nucleo_f429zi and frdm_k64f.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Marcin Szymczyk
b0bdc8a4bc samples: usb: hid-mouse: remove get_report_cb
Removed get_report_cb as it was an incorrect implementation
of Get_Report request. Correct response would be returning
current report value, not report descriptor.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-17 11:27:14 +01:00
Robert Lubos
e8620e2cca ext: mbedtls: Unify mbedTLS Kconfig prefixes
Currently there is a mixed approach in prefixes from mbedTLS
configuration (MBEDTLS_ and TLS_). The latter was used in generic config
file and could bring up confusion that it can only be used with TLS
subsystem. Hence unify the approach to MBEDTLS_ prefix to avoid such
confusion.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-17 11:27:02 +01:00
Erwan Gouriou
b1008ccb02 drivers/serial: stm32: Modify Kconfig instance flags
STM32 uart Kconfig instance flags were not following
same naming scheme than other drivers (i2c, spi, ..)

Update driver to use UART_X instead of UART_STM32_PORT_X

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-14 09:59:37 -06:00
Tomasz Bursztyka
e97a543e9b net/pkt: Remove parameters to "reserve" some headroom
Such parameter is not used anymore, it was defaulted to 0 previously.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka
c77d864841 tests/net: Get rid of the ll reserve
As it is unused now, let's default to 0.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Tomasz Bursztyka
d0c1611da3 samples/net: Let's remove the use of ll reserve
This is now useless.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-12-14 14:16:37 +01:00
Marcin Szymczyk
63558efddb samples: usb: hid-mouse: multiple buttons
Added right button, X and Y axis movement to HID mouse example.
Enabled only if board has enough buttons.
Added LED toggling notification when report is sent.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-14 13:17:52 +01:00
Marcin Szymczyk
d356977591 samples: usb: hid-mouse: type change
Change def_val, cur_val and status type from int to u32_t, u32_t
and u8_t.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-14 13:17:52 +01:00
Paul Sokolovsky
4bbdf8b59d samples: sockets: echo_async: Check results of fcntl() calls
Check result of fcntl() to catch any regressions in fcntl() handling
in Zephyr. To facilitate this, also merge block() and nonblock()
functions into single setblocking().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-14 13:21:31 +02:00
Robert Lubos
417cfdd833 samples: sockets: Tweak echo_client/server sample parameters for DTLS
Current application data size in echo_client sample does not fit into a
single datagram with DTLS enbled for default IPv6 MTU (1280 bytes). This
caused abrupt failure of the sample with DTLS enabled over 802.15.4 L2.
Decreasing the application data size allows it to fit into a single UDP
datagram after encapsulating it into DTLS record.

Additionally, finetune DTLS timeout on echo_server to match UDP
application timeout on echo_client (so that a single datagram loss
does not cauase DTLS session to end).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-13 21:13:52 +02:00
Vikrant More
e498271652 samples: mesh: enable retransmission of GET & Publish messages
Now if Server receives re-transmitted messages from client then
it will not get completely ignored but respective GET & Publish
message will get release from Server side.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-13 16:52:24 +02:00
Vikrant More
59d4589e14 samples: mesh: follow Mesh study guide to avoid retransmitted message
As per Mesh Model Specification,
when a Server receives a Set message or a Set Unacknowledged message,
it shall set the state to the target field of the message,
unless the message has the same values for the SRC, DST, and TID
fields as the previous message received within the last 6 seconds.

This commit take care of this requirement.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-13 16:52:24 +02:00
Paul Sokolovsky
5ea1e23202 samples: sockets: echo_async: Don't include <sys/fcntl.h>
POSIX doesn't mandate such a header, only <fcntl.h>. <sys/fnctl.h>
is just an internal implementation detail of Newlib on which we should
not rely.

This makes it possible to build this sample against minimal libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-13 14:21:34 +02:00
Bub Wei
c356b5786f samples: net: zperf: Support existing IP
Considering that IP can be set dynamically by DHCP
or statically before test previously, we could have
alternative way by supporting both setting IP and
existing IP.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-13 14:20:25 +02:00
Andrei Emeltchenko
14f2805c05 wpanusb: Add sanity check configurations
Add sanity check configurations for overlays.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Andrei Emeltchenko
891356027e wpanusb: Correct configuration for frdm + mcr20a
Make buildable configuration

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-12-13 12:49:20 +02:00
Carles Cufi
b51b7becf4 doc: samples: Update samples to point to active boards
Since the Arduino 101 and the Quark SE C1000 are not actively developed
boards, default to other boards that are maintained and used.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-12-12 23:06:16 +01:00
Vikrant More
5ea8454e46 samples: mesh: nrf52: coding style improvement (Vendor Model)
This commit's implementation update Vendor Model dummy response
value in vnd_get() instead of vnd_set_unack().

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Vikrant More
d2f89e16e2 samples: mesh: nrf52: removed bug introduced by PR:9521
Removed bug which get introduced by PR:9521. Because of it
not able to save App's variable on SoC flash.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Vikrant More
c41a837004 samples: nrf52: mesh: removed unwanted lines of Code
Removed redundant lines of code which are inappropriate
as per latest implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-12 16:47:53 +02:00
Jukka Rissanen
eb9f13e3e2 samples: net: gptp: Update AVnu/gptp build instructions
The OpenAVNU gPTP daemon repository has changed so the compile
instructions were not working.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-12 11:09:40 +02:00
Anas Nashif
77bd2c2c7e samples: move userspace sample out of basic/
This sample does not belong under basic/, it should have its own
category.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Anas Nashif
bf649de0b9 samples: gpio: make sample generic and use DT
Do not limit to whitelisted boards, instead make it build/run for any
board that defines required DTS macros.

Simplified documentation and made it more generic. Remove HW setup and
made sample work with built-in LEDs and buttons.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Anas Nashif
d94a75d4dd samples: basic: remove whitelisting and use DT filters
Do not limit to whitelisted boards, instead make it build/run for any
board that defines required DTS macros.
Remove QMSI kconfigs and depend on DTS only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Anas Nashif
44c4367b28 samples: disco: make sample more generic
Do not limit to whitelisted boards, instead make it build/run for any
board that defines required DTS macros.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Anas Nashif
a0982313b2 samples: threads: filter by device tree
Do not limit to whitelisted boards, instead make it build/run for any
board that defines required DTS macros.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Gaute Gamnes
596a11c6bd drivers: pwm: nrf: Modify fade_led PWM example, use new HW drv
1. Modified fade_led PWM example to include
   nRF HW PWM option.
2. Added fade_led nrf52_pca10040.overlay
   in order to enable PWM node and choose
   output PWM GPIO for channel 0. Channel 1
   GPIO enable but not used in sample src.

Signed-off-by: Gaute Gamnes <gaute.gamnes@nordicsemi.no>
2018-12-11 15:18:14 +01:00
Anas Nashif
d6d9ca72eb samples: cfb: move native_posix config to boards
Move project config for native posix under boards/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 09:12:56 -05:00
Andrzej Puzdrowski
2267668e87 sample: host: mesh: onoff_level_lighting align code to reworked settings
The Code need to be align after introduction of stream codec to
setting serialization subsystem.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-12-11 11:22:16 +01:00
Jan Van Winkel
eef1099956 samples: Added native posix board to cfb sample
Added support for native posix board to character framebuffer sample.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 20:37:29 -05:00
Jan Van Winkel
49466e0bc7 samples: doc: Added README.rst for CFB sample
Added missing README.rst for character frame buffer sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jan Van Winkel
c8efd17ae2 samples: cfb: Moved overlay config files to boards dir
Moved the overlay configuration files to board directory.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-12-10 17:21:37 -05:00
Jukka Rissanen
c790290468 samples: net: gptp: Add instructions for native_posix
Remove QEMU instructions as those do not work. Add native_posix
board instructions for running gPTP with linuxptp daemon.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 18:20:54 +02:00
Adithya Baglody
a65df22525 samples: rpl_border_router: Fixed headers files.
This sample was creating objects from header file in the bss.
Fixed it by moving the objects to appropriate object files.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Adithya Baglody
21fa43387e samples: code_relocation: An example for code relocation feature.
This sample provides an example for using the code relocation
feature. This example will place text,data,bss from 3 files to
various parts in the SRAM. For this a custom linker file is used
which is derived from include/arch/arm/cortex_m/scripts/linker.ld.

Signed-off-by: Varun Sharma <varun.sharma@intel.com>
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-12-07 10:32:41 -05:00
Diego Sueiro
b419297fed samples/display: Introduce the cfb_shell sample app
This adds the shell sample app for the Character Framebuffer testing.

cfb - Character Framebuffer shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  init        :[none]
  get_device  :[none]
  get_param   :<all, height, width, ppt, rows, cols>
  get_fonts   :[none]
  set_font    :<idx>
  invert      :[none]
  print       :<col: pos> <row: pos> <text>
  scroll      :<dir: (vertical|horizontal)> <col: pos> <row: pos> <text>
  clear       :[none]

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-07 10:21:02 -05:00
Kumar Gala
c9e5a27f41 samples: cmsis_rtos_v1: Disable tests on qemu_xtensa
We get an intermittent fail when running on qemu_xtensa.  Disable this
sample for now on that platform to allow sanitycheck / CI to pass for
other PRs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-07 08:37:07 -05:00
Anas Nashif
60f7052bc4 samples: cmsis_rtos_v1: remove tracing test
This is not relevant to the test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-07 08:17:37 -05:00
Jakub Rzeszutko
f8178dcb05 shell: remove Console dependencies
Removed Console dependencies from shell uart backend.
Generated define: CONFIG_UART_SHELL_ON_DEV_NAME for each board.

Fixes #10191

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-07 12:11:11 +01:00
Jukka Rissanen
cd4eb946c4 samples: net: Convert to use generic logging macros
Use generic logging macros LOG_*() instead of NET_*() as the
latter are mostly meant for internal networking stack use.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Jukka Rissanen
86689030e8 net: Clarify logging in networking code
Remove network specific default and max log level setting
and start to use the zephyr logging values for those.

Remove LOG_MODULE_REGISTER() from net_core.h and place the
calls into .c files. This is done in order to avoid weird
compiler errors in some cases and to make the code look similar
as other subsystems.

Fixes #11343
Fixes #11659

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-07 12:00:04 +02:00
Robert Lubos
3651e03eeb samples: sockets: Add overlay configs to socket echo samples
Add Bluetooth, 802.15.4 and OpenThread overlay configurations to socket
echo_client and echo_server samples.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
fff401d693 samples: net: echo_server config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration,
* Remove overlay-reel_board-15_4.conf - generic overlay can be used
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Robert Lubos
34b19acc9f samples: net: echo_client config cleanup
* Add generic 802.15.4 overlay config,
* Move OT generic configs into overlay-ot.conf,
* Remove nrf52840_pca10056 board configuration.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-06 12:45:19 -05:00
Spoorthi K
34c4d0e3dd samples: cmsis_rtos_v1: Demo on msgq and timers
Sample to demonstrate usage of message queue, threads
and timers with CMSIS RTOS V1 APIs.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Spoorthi K
940ee4e7e5 samples: cmsis_rtos_v1: Demo with Dining philosopher's problem
Sample application to demonstrate usage of cmsis_rtos_v1 APIs
with dining philosopher's problem implementation.

This covers semaphores, mutex and thread APIs of CMSIS RTOS V1.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-12-06 12:19:23 -05:00
Anas Nashif
40eb3a5869 Revert "samples/display: Introduce the cfb_shell sample app"
This reverts commit 48f493208b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-06 11:39:44 -05:00
Diego Sueiro
48f493208b samples/display: Introduce the cfb_shell sample app
This adds the shell sample app for the Character Framebuffer testing.

cfb - Character Framebuffer shell commands
Options:
  -h, --help  :Show command help.
Subcommands:
  init        :[none]
  get_device  :[none]
  get_param   :<all, height, width, ppt, rows, cols>
  get_fonts   :[none]
  set_font    :<idx>
  invert      :[none]
  print       :<col: pos> <row: pos> <text>
  scroll      :<dir: (vertical|horizontal)> <col: pos> <row: pos> <text>
  clear       :[none]

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-12-06 09:55:15 -05:00
Vikrant More
067d527a34 samples: mesh: nrf52: improved code readability
Improved code readability by defining some macros.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
d4b85837fb samples: mesh: nrf52: state binding improvements
Corrected state binding. With this commit Light Lightness
actual state would not cross its upper & lower limit.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
e8d4290d83 samples: mesh: nrf52: removed bugs in Target values calculation
Target values should change as per min. & max. values of
bound states. This commit handles this.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
6456d14a9d samples: mesh: nrf52: improved coding style
Improved coding style.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
313ce9d54a samples: mesh: nrf52: rename some functions name
Function names should have a verb as the last component.
As per this standard, rename some fuunctions names.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Vikrant More
7871128b19 samples: mesh: nrf52: removed bug in Gen. level Move GET & Publish
Due to recent changes some bugs had introduced in Gen. Level Move
GET & Publish functionalities. Now separatly introduced
gen_level_move_get() and gen_level_move_publisher() to resolved it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-05 20:31:24 +02:00
Jakub Rzeszutko
b928b71756 shell: rename shell_help_print function
Function printing help has been renamed to shell_help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko
3064ca4f2f shell: creating new module for help functionality
1. Created new shell module: shell_help.
2. Simplified command handlers with new shell print macros.
3. Removed help functions from command handlers.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko
e0be6a10b3 shell: printing command's help by shell engine
Removed printing command help from help handler. It is now
realized by the shell engine. This change saves a lot of flash
but still allows to print help in command handler with function
shell_help_print.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko
5451ff2848 shell: remove "options" concept
Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Paul Sokolovsky
1ef52f5c30 samples: console: echo: Be sure to print (both) CR LF in messages
As it stands now, the console effectively works in raw mode, so all
messages should end with "\r\n". This was missed previously, because
the sample was run in QEMU, on top of POSIX cooked console. Running
on real hardware showed this issue.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-12-05 08:54:20 -05:00
Patrik Flykt
079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Marcin Szymczyk
d5b79ff42c usb: hid: implement idle rate
Idle rate functionality has been implemented for HID USB class.
Bassed on Device Class Definition for Human Interface Devices 1.11.
Tested with USB3CV and host with idle rate.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-04 15:58:19 -05:00
Marcin Szymczyk
6a4ddffaf9 usb: hid: default request handlers
HID class now defaults to universal request callbacks in case they
are not provided by the application. This applies to following,
class-specific requests: Get_Report, Set_Report, Get_Idle, Set_Idle,
Get_Protocol and Set_Protocol.
Tested with USB3CV.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-04 15:58:19 -05:00
Jukka Rissanen
4565ca86da samples: net: syslog: Remote syslog service example
The sample application will send syslog messages to remote
syslog server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-12-04 15:55:53 -05:00
Jakub Rzeszutko
1a220b4e80 shell: decrease built-in commands flash usage
Rephrase some help messages to decrease flash usage.
Deactivate shell history feature for test test_netusb_rndis

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-04 15:53:02 -05:00
Vijay Kumar B
9452a1f045 samples: net: Modify echo server / client for Stellaris Ethernet.
Add project configuration files for echo_server & echo_client.

Signed-off-by: Fadhel Habeeb <fadhel@zilogic.com>
Signed-off-by: Nirav Parmar <niravparmar@zilogic.com>
Signed-off-by: Vijay Kumar B <vijaykumar@zilogic.com>
2018-12-04 09:36:51 -06:00
Bub Wei
c9db778042 samples: net: zperf: Refactor zperf_*_receiver_init
Drop tcp and udp rx threads which are just setting
and returning.

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-04 14:01:23 +02:00
Bub Wei
a127984613 samples: net: zperf: Remove invalid forever sleep
We are not expecting forever k_sleep in multithreading.
And k_sleep is empty in non-multihreading.
So remove invalid forever sleep to avoid the below issue.

ASSERTION FAIL [duration != (-1)] @ zephyr/kernel/sched.c:807

Please refer to _impl_k_sleep api in zephyr/kernel/sched.c:807

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-12-03 14:43:49 +02:00
Anas Nashif
0754c67b3d samples: http_server: fixed test dependencies
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Anas Nashif
f3f91f88d6 samples: zperf: expand test coverage
depend on USB device and increase RAM requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-02 22:36:41 -05:00
Vikrant More
089d18b403 samples: mesh: nrf52: upgrade re-transmission parameters
Upgrade NODE's transmission parameters.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Vikrant More
cb0b52837b samples: mesh: update Kconfig parameter for better performance
Upgrade & add few Kconfig parameters to improve Bluetooth Mesh
performance.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-12-01 15:14:43 +02:00
Tavish Naruka
df07e093ce samples: net: mqtt_publisher: Update for latest net_config and TLS setup
Remove adhoc handling of BLE connection setup, rely on net_config for
that. Remove board-specific configs, instead have prt.conf and overlay
configs. Perform TLS setup once before main loop, to avoid errors.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-11-30 11:05:10 -08:00
Peter A. Bigot
6e29416fff samples: sensor: add sample for SHT3XD sensor
Added sample code for Sensirion SHT3XD humidity sensor.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2018-11-30 08:30:13 -08:00
Bub Wei
b5ae7da269 samples: net: zperf: Allow to build with IPv4 or IPv6 only
context4/6 is initilalized in net_context_get function
which is restricted under CONFIG_NET_IPV4/IPV6 with
IS_EANBLED macro. So add the same macro check for
net_context_put function to avoid NET_ASSERT(context).

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-30 14:18:34 +02:00
Bub Wei
3c4bb10127 samples: net: Fix zperf build issue
If NET_IPV6 is disabled, build issue happens as below.

zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_rx_thread’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: error: ‘in6_addr_my’ undeclared (first use in this function)
        &in6_addr_my->sin6_addr);
         ^~~~~~~~~~~
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:171:9: note: each undeclared identifier is reported only once for each function it appears in
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c: In function ‘zperf_tcp_receiver_init’:
zephyr/samples/net/zperf/src/zperf_tcp_receiver.c:250:3: error: ‘in6_addr_my’ undeclared (first use in this function)
   in6_addr_my = zperf_get_sin6();
   ^~~~~~~~~~~
*** [CMakeFiles/app.dir/src/zperf_tcp_receiver.c.obj] error 1
*** [CMakeFiles/app.dir/all] error 2

Signed-off-by: Bub Wei <bub.wei@unisoc.com>
2018-11-29 10:35:50 -08:00
Himanshu Jha
21224a9a78 samples: net: ws_echo_server: remove unnecessary variable
Remove an unnecessary local variable to store the
return value, instead return directly thereby saving
few bits of memory.

Found using Coccinelle.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-28 11:54:01 -08:00
Vikrant More
0c29ca367d samples: mesh: nrf52: removed bug in Gen. onoff unack handler
In Gen. OnOff Unack handler, gen_onoff_publisher(model) was
misplaced previously & now it is set to proper location.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-28 13:39:03 +02:00
Henrik Brix Andersen
0cfaf3d75f samples: display: add sample for demonstrating custom CFB font
Add a sample application for demonstrating automatic generation of
Character Framebuffer (CFB) font headers at build time.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-28 11:46:00 +01:00
Henrik Brix Andersen
4844afa04a samples: drivers: watchdog: enable debug logging
Enable debug logging in the watchdog driver sample application to aid
in debugging watchdog drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-27 14:15:58 -06:00
Vikrant More
d0b74e2f7e samples: mesh: nrf52: improve in execution if trnasition time is Zero
If transition time is not equal to Zero then & then only values
related to transition get calculated.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-24 10:29:30 +02:00
Johan Hedberg
a633ded383 samples: reel_board/mesh_badge: Fix long name truncation
If the first name is longer than HELLO_MAX sending would fail due to
there not being sufficient MIC space (or worse overrun the net_buf).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Johan Hedberg
2f030f94f4 samples: reel_board/mesh_badge: Fix string parsing from buffer
This code was still incorrectly causing corrupt strings to be
generated. Now it should be correct.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-24 00:54:32 +01:00
Vikrant More
66a2bf03ba samples: mesh: nrf52: implementation as Mesh Model specs 3.1.1.1
Now if Gen. OnOff state set by client as '1' with some
transition time then value of Lightness will not jump to default
or last value instantly instead it would gradually increase during
that transition period.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Vikrant More
fc0a310e15 samples: mesh: nrf52: coding style improvements
Create independent function handlers for some Servers. This
would not initiate state binding if current state is equal to
Client requested state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-23 22:29:29 +02:00
Grzegorz Kolodziejczyk
d7b3fe4ab4 samples: reel_board/mesh_badge: Match onoff state with LED light
Inverse logic for onoff state while driving LED GPIO. For LED light on
GPIO pin is 0, 1 for LED light off.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-23 22:04:26 +02:00
Marcin Szymczyk
e4c447aac3 usb: add SoF event
Start of Frame events can now be accessed from USB classes.
This will be useful when implementing idle rate functionality.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-11-23 09:18:41 -05:00
Gil Pitney
9991bcb4c5 net: samples: sockets: http_get: Add secure socket offload support
Update the http_get sockets sample to enable association of secure
tags with certificate filenames.

This allows certificates and keys to be provisioned to the file
system on secure flash, without having to include the actual
certificates in the application.

Validated on the cc3220sf_launchxl board.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-11-23 09:16:21 -05:00
Andrei Emeltchenko
4e21f0651a samples: mesh_badge: Update project config
Add CONFIG_BT.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-23 09:10:01 -05:00
Anas Nashif
3d906dc4c1 net: coap: Move both CoAP implementations into one Kconfig
Two separate folders and Kconfig options causing confusion on
CoAP and CoAP_SOCK implementations. This patch simplifies it.
Current CoAP Kconfig option moved to COAP_NET_PKT.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-22 09:08:46 -05:00
Piotr Mienkowski
970aef2905 kernel: ensure System Power Managment enables Tickless Idle.
System Power Management is only supported in Tickless Idle mode.
This patch modifies Kconfig dependencies to ensure System Power
Management option selects Tickless Idle one.

Fixes: #11046

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2018-11-21 23:16:35 -05:00
Andrei Emeltchenko
240b25e5da usb: testusb: Add README to the sample
The readme mostly combined from the PR #7435

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-21 18:04:32 -05:00
Vikrant More
227c1b28b3 samples: mesh: nrf52: make all transition timer dependent
This commit will take back changes made by previous commit
i.e. fad8ff39c3.

This is beacause k_sleep() based delay is not behaving as
expected while testing & take more time than expected.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-21 22:23:18 +02:00
Kumar Gala
d3c5a4964b samples: wifi: Enable sample on disco_l475_iot1
The disco_l475_iot1 has the Inventek eS-WiFi, so lets enable the sample
on the board.  (This also gets us something that will build test the
eS-Wifi driver as part of sanitycheck).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-21 12:28:25 -05:00
Mariusz Skamra
8f5ba0be88 Bluetooth: Add common Kconfig option to disable LE Data Length Update
This adds common option to disable support for LE Data Length Update
procedure in controller and host.
This will reduce flash usage by compiling out le_data_len_change
event handler that will never be called if controller has been
compiled with BT_CTLR_DATA_LENGTH option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Mariusz Skamra
be314d3af5 Bluetooth: Add common Kconfig option to disable PHY Update
This adds common option to disable support for PHY Update
procedure in controller and host.
This will reduce flash usage by compiling out le_phy_update_complete
event handler that will never be called if controller has been
compiled with BT_CTLR_PHY option disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-21 12:26:27 -05:00
Andrei Emeltchenko
971be35528 usb: console: Notify user about incorrect configuration
Since setting USB console port name is moved to DTS users have
problems enabling it. Notify user that the console is not set.

Fixes #10693

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-21 09:38:15 -05:00
Tom Burdick
4619f8f114 samples: usb: Fixes usb/console sample for nrf52840
Adds the virtualcom device to the nrf52840 SoC dts and adds a board
specific nrf52840_overlay.dts file, copied exactly from the
arduino101_overlay.dts file, to set the console device name
appropriately for the subsys/usb/console sample project.

There were no clear alternatives to add a usb_cdc: virtualcom device to
all known SoC devices with USB support as should probably happen.

There was also no clear alternatives to add a non-board specific overlay
to the example.

This fixes a specific problem with the nrf52840-dk board for this sample
project.

Signed-off-by: Tom Burdick <thomas.burdick@gmail.com>
2018-11-21 06:19:32 -06:00
Luiz Augusto von Dentz
92fba52168 Bluetooth: samples: peripheral: Add write command characteristic
This adds a characteristic that only allows write command.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-11-21 12:54:17 +01:00
Diego Sueiro
27a237f66f samples/ipm_imx: Add i.MX7 boards to platform_whitelist
Adds colibri_imx7d_m4 and warp7_m4 to platform_whitelist for the
ipm_imx sample.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-11-21 04:03:59 -06:00
Vikrant More
fad8ff39c3 samples: mesh: nrf52: use timer in case of transition
With this commit, if message contains transition time then
and only then timer would get started.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-20 20:35:20 +02:00
Vikrant More
53902c680b samples: mesh: nrf52: changes to make immediatly send GET responses
With this commit now it is simple to understand flow of logic when
NODE receives any message & how it proceed things one by one.

Plus NODE will immediately send GET status to Client instead of
waiting for things which has less priority.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-20 20:35:20 +02:00
Grzegorz Kolodziejczyk
3abb8a8521 samples: reel_board/mesh_badge: Fix sensor statuses struct organization
Patch modifies structure organization to be specification compliant.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-20 18:00:51 +02:00
Andrei Gansari
f37ec3b0af samples: net: some samples min_flash = 140k
In order to prevent failing tests on i.MX RT the following samples were
limited to a minimum 140k of flash: http_client, http_server,
socket/echo_client and sockets/echo_server.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2018-11-20 09:54:25 -06:00
Anas Nashif
10970a60c0 sanitycheck: remove unused platforms keyword
This keyword had no effect and was being copied over to many samples
errornously.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-19 15:03:55 -05:00
Robert Lubos
1d4223ef3a samples: sockets: Set correct log module name in echo_server
echo_server used incorrect net_echo_client_* names for logger.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 11:40:39 -05:00
Stanislav Poboril
7ca69b385d sample: Add IMX IPM sample application
Add IMX IPM sample application. It reads the data sent to the
Messaging Unit and sends them back. It has been tested on Udoo Neo Full
board with the Cortex-A9 core running Linux and sending the data
into the Messaging Unit A and the Cortex-M4 running this sample Zephyr
application and reading the data from Messaging Unit B and sending it
back for Linux side to read it from Messaging Unit A.

Origin: Original

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2018-11-19 08:38:38 -06:00
Robert Lubos
4d97d9f6be samples: mqtt: Switch MQTT Publisher to new MQTT implementation
Port MQTT Publisher sample to new socket MQTT API.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Robert Lubos
f50aa6d3fb net: mqtt: Mark existing implementation as legacy
Rename existing headers and sybols to mqtt_legacy, to allow new
implementation to keep old config and header names.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-19 09:31:01 -05:00
Johan Hedberg
d0253d310d samples: reel_board/mesh_badge: Fix various coding style issues
Fix coding style issues, mainly related to whitespace usage.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Johan Hedberg
b164c9723f samples: reel_board/mesh_badge: Fix out-of-bounds array access
The show_sensors_data() function tries to access val[2] when
outputting the Z-axis value, so the array must have at least three
elements. This also triggered Coverity CID 189741.

Fixes #11482

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Johan Hedberg
381a9dd1ee samples: reel_board/mesh_badge: Fix comparison with unsigned number
This comparison was always supposed to be > rather than >=. Fixing
this also fixes Coverity CID 189740.

Fixes #11483

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-19 15:06:14 +02:00
Michael Scott
b010cd763e samples: net: lwm2m_client: expand sanity testing
Let's expand the sanity build testing for the lwm2m_client by
doing the following:

- Add variant builds for DTLS, bluetooth and modem
- Check various combinations of hardware across each of these
  variant builds: frdm_k64f, nrf52_pca10040, nrf52840_pca10056,
  disco_l475_iot1

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Michael Scott
7f6fcf2198 dts-binding: modem: wnc-14a2a: remove base_label to fix build errors
When the WNC-14A2A modem binding was originally introduced, I thought
the base_label would shorten the define keeping the result short and
easily portable.  Turns out with the latest changes, it has a side
effect of removing the "DT_*" prefix which is breaking the build.

Let's remove "base_label" from the modem binding and adjust all of
the dts_fixups referring to the WNC14A2A defines.

NOTE: This commit moves the left-over WNC14A2A dts_fixup defines from
the nRF52 soc into samples/net/lwm2m_client as the new values.
They will stay there until the modem can be re-configured as a shield.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Michael Scott
d80e6f24d4 samples: net: lwm2m_client: add "ok" and baud rate to k64f overlay
During the modem overlay move from the K64F board directory to the
LwM2M sample code, 2 DTS entries were dropped:
current-speed = <115200>;
status = "ok";

Without these entries the DTS defines for UART2 and CURRENT_SPEED
are missing from the generated_dts_board.h file.

Signed-off-by: Michael Scott <mike@foundries.io>
2018-11-17 00:50:15 -05:00
Kumar Gala
1634cf2248 drivers/spi: Always selecet HAS_DTS_SPI once SPI is enabled
All drivers require DTS for their primary SPI settings.

Removing SPI_[0-9]_NAME config option added some more samples changes.
Usage of these options there was anyway not relevant.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Paul Sokolovsky
325954de8f samples: console: echo: Test output-only mode too
We have cases with UART drivers where TX interrupt handling is not
bootstrapped properly on enabling them. To make such cases more
obvious, start this sample with console_write(), the output of which
wouldn't appear if that's the case. (Of course, the sample starts
with printk() exlaining what may happpen.)

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-16 11:48:06 -06:00
Kumar Gala
90823520e2 dts: Remove ifdef CONFIG_FS_FLASH_STORAGE_PARTITION from dts files
Remove the ifdef related to CONFIG_FS_FLASH_STORAGE_PARTITION.  There
shouldn't be any harm in always having the partition around as we'll
just generate the defines related to and most applications will ignore
them.

Helps get one step closer to have DTS not depend on Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 17:37:59 -05:00
Kumar Gala
edefd7dc7d boards: nrf52840_pca10056: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the
nrf52840_pca10056 board and should be maintained and configured
outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Kumar Gala
94bf29561e boards: nrf52840_mdk: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the nrf52840_mdk
board and should be maintained and configured outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 16:31:35 -05:00
Vikrant More
8da14d79fd samples: mesh: nrf52: improvement in transition type reassignment
Simplifies message handler for Servers & transition type reassignment.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Vikrant More
931eeee070 samples: mesh: nrf52: merged timer in transtion structure
In this commit, struct k_timer timer_lightness & struct k_timer
timer_temp picked & merged into struct transition lightness_transition
& struct transition temp_transition resp.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 22:43:41 +02:00
Robert Lubos
f60b580710 samples: sockets: Configure correct number of FDs for echo_server
echo_server can use up to 6 sockets therefore it needs more file
descriptors than the maximum default value specified.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-11-15 10:02:49 -05:00
Kumar Gala
a0b660730f samples: Add explicit zephyr_include_directories to get <board.h>
There are a small handful of samples that still utilize <board.h>
include, to minimize the use of <board.h> to these specific cases and
allow us to remove adding the board dir to the top level include search
path, we explicitly in each sample add the specific board dir it needs.

For the microbit cases these could be replaced by DTS support in the
future when the pwm_nrf5_sw supports DTS.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-15 09:14:07 -05:00
Vikrant More
21f7bad751 samples: mesh: nrf52: Removed bug in reassignment of transition type
This PR will solve bug in reassignment of transition type to
Server.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 14:38:45 +02:00
Vikrant More
a7d1ce667c samples: mesh: nrf52: optimisation in timer uses
Now states which are bound have single timer that means
means for lightness variation there is one timer & for
temperature variation there is one timer.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
3ca4f7e215 samples: mesh: nrf52: corrected mapping of Message handler
Corrected mapping of message handler for Generic
Move Set, Generic Move Set Unack, Light CTL Set &
Light CTL Set Unack.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
ac1045acd2 samples: mesh: nrf52: coding style improvements.
Removed extra blank line. Add new
bound_states_transition_type_reassignment() function in
transition.c to improve code readability & understanding.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Vikrant More
bbef36e071 samples: mesh: nrf52: edition to improve Mesh performance
This edition would improve by default mesh network
performance. This is after testing with nRFMesh app
from Nordic Semiconductor.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-11-15 10:30:37 +02:00
Spoorthi K
93ddc232d7 samples: drivers: Update yaml with regex and fixture
Include regex pattern matching of console output
to determine the sample execution status.

Add fixture to determine the hardware dependency
if any. If FRAM is connected to board externally,
then with fixture, automation would be able to
identify the board with sensor to trigger the
execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-11-14 23:43:48 -05:00
Spoorthi K
a38042d2eb samples: sensor: Include regex matching and fixture
Regex pattern matching is included to match the
execution log from console to return test result
in automation.

Also add fixture to identify the external sensor
connected for automation framework to trigger test
cases on particular board which is connected with
required sensor.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-11-14 23:43:48 -05:00
Kumar Gala
ff74f24bef samples: boards: Rename microbit dir to bbc_microbit
Have the sample directory match what we call the board name directory.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 12:41:12 -05:00
Radoslaw Koppel
9a1e7d06b0 samples: subsys: usb: hid-mouse: Align report descriptor
This commit fix the alignment of the report descriptor
to make it easier to read.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-14 08:53:55 -05:00
Radoslaw Koppel
f9be2c563d samples: subsys: usb: hid-mouse: Activate pull on switch pin
This commit would add the pull-up or pull-down on the switch pin and
makes it functional on the board where there is no external pull-up.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-14 08:53:55 -05:00
Kumar Gala
f210d11970 boards: Remove including soc.h in board.h
We should let drivers or board code include soc.h directly so we can keep
board.h to local info for board specific code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-14 06:44:02 -06:00
Ulf Magnusson
4638652214 Kconfig: Use 'default' instead of 'def_bool' in Kconfig.defconfig files
This can help find unused symbols. Those end up without a type if
'default' is used instead of 'def_bool', which generates a warning.

Search for "Kconfig.defconfig" in
https://docs.zephyrproject.org/latest/application/kconfig-tips.html for
a longer explanation.

Keep the 'def_bool' for the following symbols, which seem to be
deliberately defined only in Kconfig.defconfig files:

 - ALTERA_AVALON_I2C
 - ALTERA_AVALON_MSGDMA
 - ALTERA_AVALON_PIO
 - ALTERA_AVALON_QSPI
 - ALTERA_AVALON_SYSID
 - CLOCK_CONTROL_IMX_CCM
 - CPU_EM4_DMIPS
 - CPU_EM4_FPUDA
 - CPU_EM4_FPUS
 - FP_FPU_DA
 - I2C_GECKO

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-11-13 16:04:01 -05:00
Kumar Gala
0324423de6 samples: wifi: winc1500: Don't assume all GPIO pins on same controller
Change the sample to use a different controller device name per pin.  We
shouldn't assume that on a given board that all the pins we are using
will be on the same GPIO controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 14:12:18 -05:00
Kumar Gala
9730ca1852 wifi: winc1500: Add Device Tree support
Add a dts binding for the Atmel WINC1500 WIFI chip.  Update the
quark_se_c1000_devboard to utilize this binding as well as the wifi
sample app.

We now get all the GPIOs related to the Atmel WINC1500 from the device
tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 14:12:18 -05:00
Andrzej Głąbek
20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek
f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Krzysztof Chruscinski
6d1a31b3fc logging: Add uart backend dependency to shell uart backend
If shell UART backend was enabled and logger uart backend was
not explicitly disabled then both were used resulting in logs
being printed twice on terminal.

Patch modifies default state of log uart backend to depend on
state of shell uart backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-13 09:17:05 -05:00
Jukka Rissanen
1a67e06f66 samples: net: promisc: Add simple shell to toggle promisc mode
Add a shell that implements "promisc [on | off] <interface>"
command to toggle promiscuous mode support.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-13 12:53:44 +02:00
Grzegorz Kolodziejczyk
2cce0a6f9f samples: reel_board/mesh_badge: Introduce sensor model
Patch introduces sensor model to mesh badge application. Along with
model definition a sensor get message is implemented and handled on
server.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Grzegorz Kolodziejczyk
5148e68da5 samples: reel_board/mesh_badge: Add generic on off model
Add generic on/off model which drives green led on board.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Grzegorz Kolodziejczyk
92117dc27c samples: reel_board/mesh_badge: Add sensors
This patch introduces new screen to mesh_badge application. Sensor
screen shows measurements from board sensors updated every 2 seconds.

Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl>
2018-11-13 12:33:14 +02:00
Kumar Gala
a134438840 sensors: bmi160: Add DTS support
Convert the BMI160 to use Device Tree to get SPI and GPIO params instead
of Kconfig.  Updated samples, tests, and arduino_101_sss board support
for this.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-13 10:23:22 +01:00
Krzysztof Chruscinski
5e346812ac logging: Refactor LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros
Changed LOG_MODULE_REGISTER and LOG_MODULE_DECLARE macros to take log
level as optional parameter. LOG_MODULE_DECLARE can now also be used
in static inline functions in headers. Added LOG_LEVEL_SET macro
which is used when instance logging API is used to indicate maximal
log level compiled into the file.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Krzysztof Chruscinski
97345dbb1b logging: Fix errors in log usage
Couple of findings which were revealed after changing
LOG_MODULE_REGISTER macro:
- missing semicolons after LOG_MODULE_REGISTER()
- missing LOG_LEVEL defines
- other

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Jukka Rissanen
a8b742362e samples: net: echo-server: Introduce overlay file for e1000
The overlay-e1000.conf can be used for example with Qemu
which has support for e1000 ethernet driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-10 09:13:45 -05:00
Andrzej Głąbek
386846fbff samples: reel_board: Change a DTS-derived label to the alias one
Change the label GPIO_KEYS_BUTTON_0_GPIO_CONTROLLER that is generated
for the DT node directly to the corresponding one generated through
the "sw0" alias (i.e. SW0_GPIO_CONTROLLER) to make it consistent with
other DT related labels used in this code (SW0_* and LED?_*).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-10 08:59:50 -05:00
Kumar Gala
ee5c8ac7fb samples: blinky: cleanup to use just DT and remove board.h
Now that we set LED info in the device tree for all boards we don't need
to special case handle in the name/led pin (it comes from DT).  We can
also remove include board.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-09 11:53:18 -05:00
Tomasz Bursztyka
d658e03488 drivers/spi: Remove unused legacy options
These have been osbolete for some time already.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Tomasz Bursztyka
79e24fe7f0 boards/x86: Removing cc1200 support on quark_se_c1000_devboard
This required wiring external daughter board by hand, it's not provided
by the board directly, let's remove this.

Applying the change on relevant samples.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Tomasz Bursztyka
eae1ed8f2b samples/net: Removing support of cc2520 on frdm_k64f
There is an mcr20a shield board for frdm_k64f which is easier to use
than wiring a cc2520 by hand. So let's remove this.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Andrei Emeltchenko
f22060cdbe usb: logs: Rename USB_INF to LOG_INF
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Andrei Emeltchenko
17f7abd3dc usb: logs: Rename USB_ERR to LOG_ERR
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Andrei Emeltchenko
92c7ab74c0 usb: logs: Rename USB_DBG to LOG_DBG
Since logger is now suitable for our logs use it directly.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-08 08:35:20 -05:00
Benoit Leforestier
270ec15482 board: Add support of STM32F143xG SOC
The only difference between the F413xH and F413xG is flash memory size.
STMF413xH: 1536 Kbytes
STMF413xG: 1024 Kbytes

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2018-11-08 07:05:04 -06:00
Himanshu Jha
148d515f9b samples: flash_shell: Replace incorrect assignment to boolean expression
`shell_cmd_precheck()` function has the second argument as boolean
and currently we pass assignment expression instead of boolean
expression. Therefore, fix the expression by passing `argc == 2`
as the boolean argument.

Fixes #11099
Coverity-CID: 189507

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-08 10:46:17 +01:00
Emanuele Di Santo
7e8b44f774 subsys: bluetooth: services: dev. information service enhancements
This commit moves the BLE GATT Device Information service
from /samples/bluetooth/gatt to /subsys/bluetooth/services and adds
a Kconfig entry to enable and configure the service;
when enabled, it will register itself automatically.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-11-07 18:08:05 +01:00
Ravi kumar Veeramally
a34d14b03c net: samples: Remove semaphore from sntp_client
Issue found using Coccinelle. Semaphore is not required at all
in this application.

Fixes #11150

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-11-07 14:34:52 +02:00
Zhang WenChao
93d3065235 samples: application_development: fix #11074
external_lib using the wrong ar

Signed-off-by: Zhang WenChao <zhangwenchao001@gmail.com>
2018-11-07 12:04:04 +01:00
Jakub Rzeszutko
59c23b11ff shell: wildcard active by default
Wildcard plugin is active by default.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-11-06 17:12:41 -05:00
Krzysztof Chruscinski
4962618e5f shell: shell_uart: add ring_buffers and interrupt support
Improved RX path to use ring buffer for incoming data instead of single
byte buffer. Improved TX path to use ring buffer. Added support for
asynchronous UART API (interrupts).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-06 17:11:26 -05:00
Anas Nashif
79095099bb samples: bmg160: use default log level
Do not use debug level by default. It will not fit on some devices with
small RAM.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-06 17:09:25 -05:00
Andrei Emeltchenko
5addb3a925 samples: net: Correct FRDM + CR20A configuration
Correct configuration for frdm_k64f + mcr20a shield.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Andrei Emeltchenko
94fc0e9cb0 samples: net: Add 802154 overlay configuration for reel_board
Add reel_board configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Johan Hedberg
39155d55b6 samples: boards/mesh_badge: Fix checking for null in hello message
Use strncpy instead of memcpy to make sure copying stops at the first
null-character.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Johan Hedberg
a19ca5cce6 samples: reel_board/mesh_badge: Fix null-termination of string buffer
The way the code is structured the buffer is always guaranteed to be
large enough, however perform explicit termination anyway to avoid
Coverity warnings.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Niranjhana N
d158c07ddb samples: net: echo: fix unchecked returns
Before connecting, check for errors in
bind and listen calls in the echo test.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-11-06 13:18:20 +02:00
Jukka Rissanen
4f0d8b7680 samples: net: echo-server: ROM usage of quark_se_c1000_devboard
Tweak ROM usage of quark_se_c1000_devboard so that test_usbnet
test will pass. The board just disables network statistics as
that is not really needed here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:11:08 +02:00
Kumar Gala
937f45dc86 samples: baisc: Update to use DT generated pwm defines
We update 'blink_led', 'fade_led' and 'rgb_led' to support dt generated
defines for the PWM info needed for each.  Since hexiwear_k64 supports
generating the info, moved the support for hexiwear_k64 to just use the
dt generated defines.

For 'blink_led' and 'fade_led' we use an alias in dt called 'pwm-led0'.
For 'rgb_led' we use aliases 'red-pwm-led', 'green-pwm-led' and
'blue-pwm-led'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-05 14:01:21 -06:00
Anas Nashif
bb313d1e71 boards: frdm_k64f: move modem configurtion to overlay
The wncm14a2a modem is an add-on/shield and not part of the frdm_k64f
board and should be maintained and configured outside of the board.

This needs to be moved to a shield, see #10965.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Anas Nashif
8d138ede02 boards: dts: define default console only
When using USB CDC, set that via an overlay instead of in the board DTS.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 12:07:30 -06:00
Jukka Rissanen
d83ade773f samples: net: zperf: Remove task_profiler as it is not used
The task_profiler is not needed nor used by zperf so remove
it from CMakefile.

Fixes #11051

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-03 23:53:28 +02:00
Daniel Leung
a87a6d82ac soc: apollo_lake: fix build errors for GPIO due to DTS changes
The DTS changes introduced in 7ae220c845
changes the naming of GPIO related macros. This updates the usage
of previous macros via DTS fixup.

Fixes #10993

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-11-02 21:58:02 -04:00
Daniel Leung
69ede2f1ce boards: up_squared: add GPIO sample to sanitycheck
This changes the sample.yaml so that it can be included when running
sanitycheck.

Fixes #10994

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-11-02 21:58:02 -04:00
Anas Nashif
eea8e697d2 samples: echo_server: remove features to make binary fit
Remove net shell and stacks to make the binary fit on some platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-02 17:20:06 -04:00
Jukka Rissanen
cf063fe85b net: Rename net_is_xxx...() functions to net_xxx_is...()
Unify the function naming for various network checking functions.

For example:
     net_is_ipv6_addr_loopback() -> net_ipv6_is_addr_loopback()
     net_is_my_ipv6_maddr() -> net_ipv6_is_my_maddr()
etc.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-02 14:52:33 -04:00
Aurelien Jarno
e8a59728e1 samples: usb: mass: rewrite documentation
The USB mass storage documentation was completely outdated. Rewrite it
using reStructuredText, and mentioning the two possible overlays.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-02 12:08:53 -04:00
Andrei Emeltchenko
6f045d1b9d net: samples: Refactor netusb configuration for http_server
Move configuration to overlay-netusb.sonf, enable zero-configuration,
working with LLMNR in Windows and avahi-autoipd in Linux.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-02 10:03:04 +02:00
Andrei Emeltchenko
9492abfe1d net: samples: Clean overlay-netusb.conf
Remove CONFIG_LOG which is defined in the main prj.conf

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-02 10:03:04 +02:00
Kumar Gala
a8f1431a53 boards: bbc_microbit: Move button data into dts from board.h
Move the GPIO info for the buttons into the dts, this lets us match what
all other boards are doing.  Update some sample & test code to use the
dts generated SW0_GPIO_CONTROLLER define instead of SW0_GPIO_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 15:58:51 -05:00
Kumar Gala
366cc150ee samples: nrf52: power_mgr: Remove board.h
We don't need board.h, but do need soc.h for the sample to build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Kumar Gala
856decf2f7 samples: Remove board.h include
Remove including board.h from samples that don't need it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Kumar Gala
c78379bc26 samples: 96b_argonkey: Remove board.h
We don't need board.h, but by including it we would end up picking up
stdio.h from somewhere which we need for sprintf.  So just included
stdio.h and drop board.h

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Kumar Gala
ab439ca7fd samples: basic: limit board.h to where its needed
For blink_led, fade_led, and rgb_led, we only need board.h for the
hexiwear_k64 board.  Remove other references to board.h and only
include it if we are building on hexiwear_k64

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-01 13:15:18 +01:00
Aurelien Jarno
af2ed46775 samples: usb: hid-mouse: enable CONFIG_GPIO
The HID mouse sample uses the GPIO to read the state of a button, but
does not enable CONFIG_GPIO, causing the example to fail. Fix that.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-01 06:59:03 -05:00
Maureen Helm
91381b60c9 samples: bluetooth: Add a configuration using the kw41z shield
Adds a new configuration to the peripheral_hr sample that utilizes the
frdm_kw41z as a ble controller shield.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-11-01 07:22:10 -04:00
Ravi kumar Veeramally
077408c860 samples: net: coap_server: Implemented over sockets
Sample application coap_server is implemented now over sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-10-31 19:44:25 -04:00
Ravi kumar Veeramally
2ab8f599ce samples: net: coap_client: Implemented over sockets
Sample application coap_client is implemented now over sockets.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-10-31 19:44:25 -04:00
Maureen Helm
bdd1b3897b samples: synchronization: Add openocd configuration
Adds an openocd configuration to sample.yaml.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-31 12:05:11 -04:00
Niranjhana N
709bc8ae0d samples: userspace: remove unwanted check
No need to check if array elements are less
than 0 as they are of type unsigned char.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-10-31 08:42:40 -04:00
Anas Nashif
b23bcaf406 samples: ms5837: move to new logger
Move sample to the new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-31 08:34:36 -04:00
Jan Van Winkel
7b4b7f5bc2 samples: display: Updated ili9340 sample to use DTS
Update ili9340 display driver sample to make use of device tree overlay.

Part of #10894

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-29 22:19:58 -04:00
Sebastian Bøe
f2b9cc62bb cmake: ipc: Fix ipm_mcux sample
Stop specifying that the 'remote' app should use the same board as the
root app.

Also, add assertions to make sure that the user does not try to
override the board that is specified in the app build scripts.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-29 14:14:00 -04:00
Sebastian Bøe
b3d77a0c62 cmake: openamp: Fix OpenAMP sample
Stop specifying that the OpenAMP 'remote' app should use the same
board as the root app.

Also, add assertions to make sure that the user does not try to
override the board's that are specified in the app build scripts.

This fixes #10345

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-29 14:14:00 -04:00
Loic Poulain
6c20180fa7 samples/net/wifi: Add TCP stack
Useful for testing tcp socket via net shell.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2018-10-29 16:38:02 +02:00
Vikrant More
358329c7e9 samples: mesh: nrf52: unsolicitedly publishing the states
With this commit, some prime Servers would unsolicitedly
publishes thier states values.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Vikrant More
0f86ba3dfd samples: mesh: nrf52: defined common publisher for Gen. Level
Defined common publisher i.e. gen_level_publisher() for
all three gen. level related messahe handlers.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Vikrant More
c38f178257 samples: mesh: nrf52: enum redefined
Redefined & relocate enums to improve code readability.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-29 10:51:17 +02:00
Anas Nashif
203948e156 sensors: move grove sensors under drivers/sensor
Grove devices are sensors, so no need to have them under their own
category.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-28 11:46:36 -04:00
Anas Nashif
d2c8d52336 grove: lcd: move grove lcd driver to drivers/display
Move to display drivers where it belongs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-28 11:46:36 -04:00
Henrik Brix Andersen
8d56730b00 samples: hci_uart: add note about reduced baudrate on the BBC micro:bit
The BBC micro:bit uses a baudrate of 115200 for the hci_uart
sample. Add a note about this to avoid any confusion.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-10-28 07:29:05 +00:00
Reto Schneider
7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Johan Hedberg
b0ad17d0a4 samples: reel_board/mesh_badge: Add statistics and new message
Add a new "heartbeat" message so that number of hops between nodes can
be discovered. Also add a statistics page which can be toggled using a
long key press, showing local information and the top message senders.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-27 11:16:30 +01:00
Vikrant More
5a341f5590 samples: mesh: nrf52: upgrade bound states publish mechanism
If user aggresively vary the state then previous mechanism
failed to publish status of other bounded states since it
has to publish multiple things back to back.
This PR repair the things.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 15:26:35 +01:00
Vikrant More
87f5fc63fc samples: mesh: nrf52: follow the standard while naming variables
Change variable names to follow standard.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
ee6e55ed33 samples: mesh: nrf52: removed unnecessary Models
Generic OnOff Server & Client has removed from Second
element which is redundant.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
acbaaed31a samples: mesh: nrf52: improvement in status responses details
If transition is in process, then as per current implementation bound
states only respond with Present value. But with this commit, now
bound states too would respond with present, target & remaining time
values in status response.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
ceab98f825 samples: mesh: nrf52: Vendor Model opcodes redefine
Redefine opcode values for Vendor Model to mimic like
Generic OnOff Server opcode values for sake of convenience.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
06862268aa samples: mesh: nrf52: coding style improvements
Removed unwanted lines of codes. In transition.c
define Timers just before they get utilised.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
0a11c958fe samples: mesh: nrf52: improvements in gen. delta message handler
Now in case of Generic Delta handler, if message with same TID
received after 6 seconds with same source address would consider
as new transaction instead of ignoring it.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
7e40faa37f samples: mesh: nrf52: storing of some Prime states on SoC flash
With this commit it is now possible to save some Mesh Model
Servers State on SoC flash. This impacts initialization &
state binding after NODE reset & that is why some additional
modification has done as per requirements & removed some
code & comments which are redundant as per current
implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
c0f893480a samples: mesh: nrf52: short time multireset bt-mesh unprovisioning
In general, Bluetooth Mesh provisioning process could be failed
because of any reason. Using some h/w interrupt we can call
bt_mesh_reset() or something which will push device into factory
reset mode.

But with some actual products it is not always possible or feasible
to add extra h/w to achieve this goal.

This commit adds facility to push device into factory reset mode
using power reset. As per current implementation user have to
do 5 times reset so that gap between two consecutive reset
should not exceed 7 seconds.

Co-authored-by: Laczen JMS <laczenjms@gmail.com>

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
0030aa9e0a samples: mesh: nrf52: support for extra status responses
With this commit, IUT will send additional status responses
whenever required as per PTS requirements.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Vikrant More
9d5697f50a samples: mesh: nrf52: added separate Server's Publisher functions
Separately defined functions for Servers. This would help
to send extra status responses whenever required.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-10-26 10:21:04 +01:00
Gil Pitney
40bf45a81d samples: net: wifi: Fix README, to account for new shell regression
This updates documentation to account for the new shell which
does not support 'select' for command context anymore.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-25 20:47:06 +03:00
Gil Pitney
92f4837413 samples: net: wifi: Remove sleep K_FOREVER, which asserts.
The wifi shell sample asserts when trying to do a sleep
forever.

The sleep should not be necessary, so removing it.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-25 20:46:38 +03:00
Johan Hedberg
7fd7be0fc6 samples: reel_board: Add Bluetooth Mesh badge demo app
Add a demo app for showcasing badge functionality together with
Bluetooth Mesh.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-24 22:06:46 +01:00
Kumar Gala
060b8c1512 drivers: ssd1306: fixup dts support
A few issues with the dts support for the SSD1306 display driver:
1. binding file mixed description & generation up together
   - rename most uses of generation to description and add proper
     generation field into yaml
2. Drop use of BASE_LABEL, this shouldn't be used by most bindings
3. dts defines that are being assumed in driver aren't correct.  We
   should be using a dts_fixup.h in the sample to map the generated
   defines to those used in the driver.  We remove the incorrect
   defines that the driver assumes right now.
4. Fixup 'segment-remap' and 'com-invdir' properties that are booleans
   in the binding file and associated code changes.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-24 16:42:35 +01:00
Jukka Rissanen
da699e4a3b samples: net: zperf: UDP download cmd params incorrectly checked
The "zperf udp download" optional port parameter was not properly
checked, the default port check branch was never reached.
Fix also the same issue in tcp download command.

Coverity-CID: 188881
Fixes #10758

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-23 14:23:24 +03:00
Jukka Rissanen
82fa5bcf59 drivers: eth: native_posix: Allow non-root access
Change the default behaviour of the host network interface
setup. Now user needs to execute net-setup.sh script from
net-tools project to setup host ethernet interface. The script
needs to be run as a root user. Then zephyr.exe can be started
as a normal user.

Example:
    cd net-tools
    sudo ./net-setup.sh

This will create zeth network interface and set IP address and
routes properly. See other command line options by typing
    ./net-setup.sh --help

Old behaviour is still there if one enables
    CONFIG_ETH_NATIVE_POSIX_STARTUP_AUTOMATIC=y

in which case one needs to use the command
    sudo --preserve-env zephyr.exe

to start the Zephyr process.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-23 11:08:39 +03:00
Jukka Rissanen
fb73aee36f net: openthread: Remove remaining SYS_LOG usage
Remove the last SYS_LOG reference from OpenThread code as SYS_LOG is
being deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-22 11:11:35 +03:00
Andrei Emeltchenko
6f6f0da589 wpanusb: Add registering logs
Add missing log register

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-19 16:21:34 -04:00
Johan Hedberg
f98f4e243a samples: ipsp: Convert from SYS_LOG to new logger
Use the LOG_* macros instead of the deprecated SYS_LOG_* ones.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg
6bb5a3536a samples: hci_uart: Convert from SYS_LOG to new logger
Use the LOG_* macros instead of the deprecated SYS_LOG_* ones.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg
e52c20c13c samples: hci_spi: Convert from SYS_LOG to new logger
Use the LOG_* macros instead of the deprecated SYS_LOG_* ones.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg
251d99132d Bluetooth: Remove custom stack macros
Now that log processing happens in a separate thread, the
BT_STACK_EXTRA macro is not needed (since there's no significant
overhead), and therefore the BT_STACK macros become unnecessary as
well.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg
343c53e841 Bluetooth: Switch from SYS_LOG to logger-based logging
Initial conversion to use syslog instead of logger.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Johan Hedberg
18270d0bdf samples: boards: mesh/onoff-app: Remove SYS_LOG usage
SYS_LOG is being deprecated. Use printk instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-10-19 14:50:22 +02:00
Jakub Rzeszutko
147122e77f shell: examples unification
Updating examples according to new return value of function
shell_cmd_precheck.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-19 13:35:56 +02:00
Anas Nashif
8eff21a8dd drivers: gpio: add shell for controlling GPIO
Provide basic commands for configuring/setting/reading GPIO ports.

> gpio conf ..
> gpio set ..
> gpio get ..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-18 10:15:50 -04:00
Anas Nashif
79f434273e shell: kernel: list configured devices
Very simple command to list configured devices and their priorities.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-18 10:15:50 -04:00
Andrei Emeltchenko
302d9c8ef4 wpanusb: Use USB_DBG instead of NET_DBG
Use USB_* log helpers for wpanusb

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-18 09:45:29 -04:00
Johann Fischer
4ccf075d3b samples: fxos8700: add accelerometer devices to README.rst
Add information about MMA8451Q, MMA8652FC and MMA8653FC
accelerometers to README.rst

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
d294d87038 samples: fxos8700: add config for accelerometer devices
Add configuration for accelerometer devices like
MMA8451, MMA8652 and MMA8653.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
3ad8431f8a Revert "samples: sensors: mma8451q: Add accelerometer sample"
Driver fxos8700 can also be used for the MMA8451
accelerometer and offers more functionality.
Revert the commit to avoid duplicate code.

This reverts commit 70a35e2346.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
6ca2794a88 samples: fxos8700: revised the output of the sensor values
Revised the output of the sensor values.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
9c9b4adb9e samples: fxos8700: enable pulse and motion detection in sample.yaml
Enable pulse and motion detection in sample.yaml.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
4a855eff4a samples: fxos8700: add motion detection overlay and test
Add motion detection overlay and test.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
80d9ecc9db samples: fxos8700: remove DECIMATION_FACTOR
Remove DECIMATION_FACTOR from sample as the default
output data rate is set to 6.25Hz.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Jean-Paul Saman
fea87ae717 samples: blink_led: make it work for nrf52832-mdk
Add support for nRF52832-MDK to blink_led sample.

Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Jean-Paul Saman
4324333611 samples: blink_led: make it work for nrf52840-mdk
Add support for nRF52840-MDK to blink_led sample.

Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Galen Seitz
96172a1d0b samples: basic: blink_led: Add support for nucleo_f302r8
Add support for the blink_led sample code using a PWM output
from PA0 of the STM32F302R8.

Signed-off-by: Galen Seitz <galens@seitzassoc.com>
2018-10-16 22:52:07 -04:00
Ajay Kishore
9e7f2940ff samples: USB mass storage sample.yaml cleanup
Add console harness support for USB mass storage test.
Also, using overlay config for DISK_ACCESS configuration
and accessing the different config file with different
method.

Signed-off-by: Ajay Kishore <ajay.kishore@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 17:32:25 -04:00
Andy Ross
b8ffd9acd6 sys_clock: Make clock_always_on true by default
This flag is an indication to the timer driver that the OS doesn't
care about rollover conditions of the tick count while idling, so the
system doesn't need to wake up once per counter flip[1].  Obviously in
that circumstance values returned from k_uptime_get_32() are going to
be wrong, so the implementation had an assert to check for misuse.

But no one understood that from the docs, so the only place these APIs
were used in practice were as "guards" around code that needed to call
k_uptime_get_32(), even though that's 100% wrong per docs!

Clarify the docs.  Remove the incorrect guards.  Change the flag to
initialize to true so that uptime isn't broken-by-default in tickless
mode.  Also move the implemenations of the functions out of the
header, as there's no good reason for these to need to be inlined.

[1] Which can be significant.  A 100MHz ARM using the 24 bit SysTick
    counter rolls over at about 6 Hz, and if it had to come out of
    idle at that rate it would be a significant power issue that would
    swamp the gains from tickless.  Obviously systems with slow
    counters like nRF or 64 bit ones like RISC-V or x86's TSC aren't
    as affected.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
Andy Ross
220d4f8347 sys_clock.h: Make "global variable" APIs into proper functions
The existing API defined sys_clock_{hw_cycles,ticks}_per_sec as simple
"variables" to be shared, except that they were only real storage in
certain modes (the HPET driver, basically) and everywhere else they
were a build constant.

Properly, these should be an API defined by the timer driver (who
controls those rates) and consumed by the clock subsystem.  So give
them function syntax as a stepping stone to get there.

Note that this also removes the deprecated variable
_sys_clock_us_per_tick rather than give it the same treatment.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-16 15:03:10 -04:00
Johann Fischer
f89283b250 samples: add sample for character framebuffer
Add sample for monochrome character framebuffer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-16 14:54:47 -04:00
Anas Nashif
deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif
20b73e74a1 tests/samples: rename 'app' tag to something meaningful
Remove very generic apps tag and replace it with something that matches
what the test/sample does.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif
733a054ab0 samples: fix sample tags
Use correct tags instead of obvious 'sample' tag.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Punit Vara
e5620a2b87 drivers: sensor: Migrate to new logger
Move all sensor drivers and samples to new logging system.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-10-16 08:49:53 -04:00
Yannis Damigos
017a3515e8 samples/sensor/lsm303dlhc: Add LSM303DLHC sample
Add sample application for LSM303DLHC, ST MEMS
system-in-package featuring a 3D digital linear
acceleration sensor and a 3D digital magnetic
sensor.

Enable sample to build on stm32f3_disco board
during sanitycheck.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-15 12:47:13 -05:00
Jakub Rzeszutko
99b5c65edb samples: mpu: migrate sample to the new shell
Migrate mpu example to use the new shell.
Fixed scripts/checkpatch.pl warnings.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-15 13:03:23 -04:00
Jukka Rissanen
a048a7719e samples: net: http_server: Remove Quark devboard from sanity
ROM consumption is higher with new shell which prevents
quark_se_c1000_devboard from building. Remove that board
from sanitychecker runs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen
7cd17d58ca samples: net: zperf: Convert to use the new shell
Use new shell instead of the legacy one. This commit also fixes
the configuration file mess and allows the program to be run on
more hardware.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen
1d81fd8211 samples: net: wpanusb: Removing useless shell
There were no shell commands implemented so remove the shell
support from this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen
a4a64453d6 samples: net: rpl_border_router: Convert to use new shell
Use new shell instead of the legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jukka Rissanen
d8defbd08a net: bt: Convert network Bluetooth shell to use new shell
Use new shell instead of the legacy one.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-15 11:14:02 +03:00
Jan Van Winkel
d696a56cf4 samples: sensor: Added sample for MS5837 sensor
Added sample code for MS5837 pressure sensor

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-12 14:28:32 -05:00
Gil Pitney
ca61459300 net: samples: sockets: http_get: build for cc3220sf_launchxl
Adds boards prj conf file, and updates CMakeLists.txt to
enable build.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-12 13:06:53 +03:00
Jukka Rissanen
2c69edc149 net: Remove obsolete config options from samples and tests
Removed obsolete CONFIG_SYS_LOG_* and CONFIG_NET_DEBUG_* options
from various sample and test applications.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-11 14:44:14 -04:00
Jukka Rissanen
bdbf551e8a samples: net: coap_client: Remove obsolete prj_bt.conf file
The conf file contained obsolete config options and it was
not really used. Cleaned also the sample.yaml file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-11 14:44:14 -04:00
Gil Pitney
ab09674e4c samples: net: include sockets echo sample build in cc3220sf sanitycheck
Previously, wifi-enabled samples were not built by sanitycheck for the
cc3220sf_launchxl.

This patch gets the sockets echo sample to build.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 15:51:57 +03:00
Gil Pitney
c2cdbbafd7 net: sockets: Get socket offload to build after net logging overhaul.
Also, defines one LOG_MODULE_NAME for the simplelink WiFi driver, and
uses the same name for all files in this driver (module).

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-10-11 15:51:57 +03:00
Jakub Rzeszutko
f6197c4f3c shell: create instances automatically basing on enabled backend
If user will enable shell than for each backend shell instance
will be created automatically.

Update all shell examples according to the new initialization
procedure.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-11 12:08:04 +02:00
Anas Nashif
5f74f142a9 samples: usb: move to new logger
Move to new logger and use new logger macros/Kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 18:32:13 -04:00
Anas Nashif
7853c32b81 samples: dfu: move to new logger
Move to new logger and use new logger macros/Kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 18:32:13 -04:00
Anas Nashif
6f20aa1aaa samples: olimex_stm32_e407: move to new logger
Move to new logger and use new logger macros/Kconfig variables.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 18:32:13 -04:00
Ulf Magnusson
92ef8582b9 Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's
The $srctree environment variable gives the path relative to which
'(o)source' statements work (the current directory is used if $srctree
is unset). It is set to $ZEPHYR_BASE in cmake/kconfig.cmake, so there's
no need to qualify the source of Kconfig.zephyr in sample Kconfig files
(or in external projects).

All 'source's in Zephyr assume that the Zephyr root directory is used as
the srctree as well, and would break otherwise.

Remove the $(ZEPHYR_BASE)s to make it clearer that all 'source'
statements work relative to the Zephyr root. There was some user
confusion on IRC.

Also explain how things work in the documentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-10-10 11:28:27 -05:00
Anas Nashif
c1d2930471 drivers: wifi: move to new logger
Move drivers to new logger and change samples enabling logging in
prj.conf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-10 10:22:01 -04:00
Andrei Emeltchenko
47be332b79 samples: hid: Use new logger
Use new USB logger with function names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
1eb6a01723 usb: Use const for status_callback parameter
usb_dc_status_callback() parameters are interface or configuration
numbers and should be const.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
24b5775fd1 samples: hid: Use delayed work for report send
Delegate report sending to delayed work.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
245b267f1a samples: hid: Make callbacks static
Make callbacks static according to standards.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
5534a58e66 samples: hid-mouse: Trivial README correct
Correct title marking.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
61349e3157 samples: hid: Add README for the sample
Describe building and testing of the sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Andrei Emeltchenko
9047e8eec0 samples: hid: Refactor basic HID sample
Refactor USB writes, start transfer only when device
is configured, the change makes it possible to work with native_posix
USB virtual controller.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-10 09:21:55 -04:00
Jakub Rzeszutko
b0571746e2 shell: parsing output LF character
Some terminals literally interprets shell output data. Hence to print
a message in new line shell needs to send `\r\n` each time. To minimize
flash usage user can now send `\n` as a line delimiter and shell will
automatically add missing CR character.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-10 10:45:28 +02:00
Ioannis Glaropoulos
52b729a6a4 arch: arm: fix mem domain sample/test for ARMv8-M access permissions
This commit updates the mem_domain_apis_test sample and the
mem_protect test, so they can compile and execute in ARMv8-M
platforms, which do not support the P_RW_U_RO access permissions
combination (privileged read/write, unprivileged read-only). The
modification consists of, simply, selecting a different access
permission (P_RO_U_RO) when building for ARMv8-M MPUs with the
unmodified ARM MPU architecture.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-10-09 19:33:24 -04:00
Jakub Rzeszutko
3d4c525c4c samples: flash_shell: migrate example to new shell
Convert flash_shell example to use the new shell API.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-09 13:22:53 +02:00
Anas Nashif
12984c6d1f subsys: nvs: move to new logger
Move to new logger and update all related samples and configs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
24a8351aab samples: display: set log level correctly
Use boolean kconfig for setting log level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
68958b35a1 drivers: display: define DISPLAY log level
Use a common log level for display drivers.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
88aa2ca49f driver: spi: use new logger
move SPI drivers to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
27eec649bf samples: led: fix default log level kconfig
Use correct Kconfig for default log level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
c60aa42da7 samples: flash_shell: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
a37274b8f4 samples: led_lpd8806: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
6038070704 samples: led_pca9633: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
567f818d44 samples: led_ws2812: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
7d9d0451fb samples: led_lp3943: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
b5c795d909 samples: led_lp5562: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
ff9c20826c driver: pwm: use new logger
move PWM driver to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
f7009d3a95 samples: move crypto sample to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
c4d1324ce4 samples: crypto: move to new logger
Move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
88587b34c8 samples: fix prj.conf to use new logger
Configure samples to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
f7dac85d15 drivers: i2c: move to new logger
Move to new logger subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
3da714193f drivers: crypto: move to new logger
Move to new logger subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif
8e38670af3 arch: setup logging using new logger
Use the new logger framework for architecture code.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Yannis Damigos
d1a655a624 subsys/usb: Move to new logger subsystem
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Andrei Emeltchenko
c7567fe025 samples: zperf: Fix sanity check with NET, USB and logs
Decrease number of buffer for sanity check, in real sample logs
consuming a lot of memory might be traded for buffers. The sample was
failing for quark_se_c1000_devboard.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-10-08 12:54:57 -04:00
Yannis Damigos
1674d061b6 drivers: usb: device: Migrate to new logger
Move to new logger subsystem.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-10-08 12:54:57 -04:00
Sebastian Bøe
8eb734cd82 DT: Rename from dts.fixup to dts_fixup.h
The Zephyr configuration system uses many different files in many
different formats. It makes it a lot easier for users to understand
what these files do if when we use the correct file extensions.

To this end we rename the dts.fixup files to the correct file
extension '.h'.

This is a breaking change for out-of-tree fixup files. Such files will
be detected and given an appropriate error message.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-08 11:38:56 -04:00
Joakim Andersson
773b21ac38 bluetooth: config: Fix bluetooth config dependencies
Fix bluetooth config dependencies where the definitions depend on other
definitions.
BT_RX_PRIO is not always defined in a controller only build.
BT_CTLR_TX_BUFFER_SIZE does not depend on BT_CTLR, but BT_LL_SW.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2018-10-05 11:15:27 -04:00
Anas Nashif
4402c4b057 samples: logger: exclude qemu_xtensa [REVERTME]
The way uart console is setup for this is not compatible with the logger
and needs additional changes, excluding until we have this implemented
in a generic way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-05 10:09:08 -04:00
Anas Nashif
771b4defad samples: logger: test sample in CI
Add test stub for this sample to verify it in CI on default platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-05 10:09:08 -04:00
Jukka Rissanen
d056d63ee7 samples: net: wifi: Adding sample.yaml file
As the sample.yaml file was missing, then sanitychecker did
not testing any wifi drivers or other wifi related APIs.

Fixes #10389

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-05 10:08:32 -04:00
Jukka Rissanen
69eeddd8a9 drivers: wifi: Convert to use new logging
Convert the wifi drivers to use the new logging system.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-05 10:08:32 -04:00
Jakub Rzeszutko
bc6da1c34a shell: Enable backends via Kconfig file
Added functionality to enable active shell backends via Kconfig
file. When there will be more backends implemented user will
have an option to select only required ones.

It is no longer needed to select SERIAL in prj.conf.

Fixes #10190

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-05 10:04:44 +02:00
Jukka Rissanen
57a8db7789 net: Use log_strdup() when printing debug strings
As the debugging print calls are async, all the strings that might
be overwritten must use log_strdup() which will create a copy
of the printable string.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
d67414e96c samples: net: syslog: Remove the sample application
The application won't work anymore as it uses the old syslog
logging and networking is now converted to use the new logger
so there is no need for this sample application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
7088d4e949 samples: net: lwm2m_client: Convert to new logging system
Use new logging system instead of SYS_LOG.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
5ad399e0d1 samples: net: leds_demo: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
61cc71e4c1 samples: net: echo-*: Add openthread tag for sanitychecker
Add "openthread" tag for sanitychecker when it is running
OpenThread specific tests. This way it is easier to run just
those few OpenThread specific tests.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
e5ab098ceb samples: net: wpanusb: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
b8f70b749b samples: net: wpan_serial: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
ef6eb3d628 samples: net: mqtt_publisher: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
5f2f8629d0 samples: net: rpl_node: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
5ead61089b samples: net: rpl_border_router: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
782655f89b samples: net: nats: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
e1f45c6733 samples: net: lldp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
f5a3e77434 samples: net: sntp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
22c8ccbca9 samples: net: zperf: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
77c9071495 samples: net: ws_echo_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
2883d92c5e samples: net: telnet: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
b08d420fad samples: net: stats: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
7b2bdfc491 samples: net: sockets: Convert to use new logging
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
9bae75dbd3 samples: net: ws_console: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
3565d7ff5b samples: net: vlan: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
96be19ae23 samples: net: traffic_class: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
0ccba6a14b samples: net: throughput_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
1bcf1cf475 samples: net: promiscuous: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
d38694af80 samples: net: mdns_responder: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
de5cbf9ed4 samples: net: irc_bot: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
31a6d93c41 samples: net: ipv4_autoconf: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
7218467055 samples: net: http_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
c69cdc0599 samples: net: http_client: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
749e957e62 samples: net: gptp: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
be7ea732e4 samples: net: eth_native_posix: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
85e7610fab samples: net: dns_resolve: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
2f0f88ebf1 samples: net: dhcpv4_client: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
11a019053d samples: net: coap_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jukka Rissanen
5f238ac2ea samples: net: echo_server: Convert to new logging system
Use new logging system with support for network log level.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-10-04 14:13:57 +03:00
Jan Van Winkel
d332ae5b6a driver: Updated ILI9340 driver to use display API
Updated ILI9340 display driver and sample application to make use off
the display API

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-03 11:29:00 -07:00
Jan Van Winkel
2288d547ee samples: display: Migrate to new logging subsystem
Migrate from SYS_LOG to LOG logging mechanism.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2018-10-03 11:29:00 -07:00
Sebastian Bøe
8c791a999e cmake: openamp: Fixed a bug where the wrong BOARD was set
Fixed a bug in the OpenAMP sample's recursive build scripts, where it
would pass on the wrong board to it's second CMake invocation.

This fixes #10345

Fixed the same bug in ipm_mcux.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-03 08:24:46 -05:00
Jakub Rzeszutko
c471614cb6 subsys: shell: fix accept either CR or LF as as line delimiter
1. Shell will accept CR or LF as line delimiter.
2. Macro SHELL_DEFINE simplified - it no longer requires
   new line character.
3. Fixes: #10207.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 11:55:47 -07:00
David Leach
96e877a52e samples: buttons: Add GPIO_INT_EDGE to button configuration
Add GPIO_INT_EDGE triggering for the button push for boards where
the dts generates a SW0_GPIO_FLAGS.

Signed-off-by: David Leach <david.leach@nxp.com>
2018-10-02 11:27:30 -05:00
Jakub Rzeszutko
0eea1ef212 subsys: shell: add int ret_val to command handlers
1. Command handler can return command exectution status as int.
2. Existing command handlers rework.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-02 14:44:25 +02:00
Maureen Helm
eeb4411de7 drivers: boards: Merge HAS_DTS_GPIO_DEVICE with HAS_DTS_GPIO
Every board that uses dts-enabled gpio drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_GPIO_DEVICE and
HAS_DTS_GPIO.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
89ccead382 drivers: boards: Merge HAS_DTS_SPI_DEVICE with HAS_DTS_SPI
Every board that uses dts-enabled spi drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_SPI_DEVICE and
HAS_DTS_SPI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
75bc6ba454 drivers: boards: Merge HAS_DTS_I2C_DEVICE with HAS_DTS_I2C
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Maureen Helm
9dea0315f7 samples: arduino_101: Add dts overlay and fixup to env sensing sample
Adds a board-specific dts overlay and fixup file to the arduino_101
environmental sensing sample, in preparation for making the sensor
drivers require dts.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Krzysztof Chruscinski
a15438e8f5 logging: add mechanism for handling transient strings
Extending logger to support logging transient strings (with %s).
With dedicated call (log_strdup), string is duplicated to a buffer
from internal logger pool. Logger implicitly manages the pool.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-01 15:26:14 -04:00
Sebastian Bøe
d6de4c7a99 cmake: Fall back to ZEPHYR_BASE when the board is not in BOARD_ROOT
It is very inconvenient to maintain an application that both runs on a
Zephyr board and an out-of-tree board.

It forces one to write build scripts like this in the app:

if(BOARD STREQUAL my_out_of_tree_board)
  set(BOARD_ROOT some/out/of/tree/board/path)
endif()

To avoid this we change the semantics of BOARD_ROOT. Instead of it
being a path to the board root it is now a prioritized list of board
root directories. Zephyr will append ZEPHYR_BASE to BOARD_ROOT.

This ensures that Zephyr boards can be used when the out-of-tree board
directory can not supply the requested board.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-01 09:46:46 -04:00
David B. Kinder
432562dd19 doc: fix doc misspellings
Fix misspellings missed during regular reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-09-29 22:55:14 -04:00
Maureen Helm
4e5a316bb8 samples: blinky: Remove platform whitelist
Removes the platform whitelist so we test this sample on more than just
the arduino_101 board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-28 11:43:41 -05:00
Alberto Escolar Piedras
3e41ac5f04 subsys: shell: Add missing dependency to SERIAL
The shell subsystem, as it is today, depends on having a UART,
therefore let's add the dependency explicitly in its Kconfig

Fixes #10190

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-27 17:24:34 +02:00
Anas Nashif
6d3fb8b4cf shell: kernel: add more thread data to threads command
Show thread and stack data all under one command and reformat output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
2f30c5dcb8 samples: synchronisation: set thread names
- Use new k_thread_name_set to set thread names.
- Use board name in sample instead of architecture.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
739fd90127 samples: synchronization: remove unused conf
prj_stack_guard.conf not related to this sample, we have tests other
samples for stack guard testing/demonstration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Anas Nashif
46f7cd51dd shell: kernel: print thread name
Use new kernel API to display thread name when listing threads.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-27 08:58:55 +05:30
Sebastian Bøe
c0287695fb kconfig: Remove remnants of unimplemented BUILD_TIMESTAMP feature
The Kconfig option CONFIG_BUILD_TIMESTAMP became unused when
BUILD_VERSION was introduced, but it's option and parts of it's
implementation was not completely cleaned from the repository.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-26 22:18:29 +05:30
Robert Lubos
a6de97b3a4 samples: net: sockets: Update docs with TLS information
Update documentation of socket samples that support TLS with information
on how to enable it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-26 18:13:34 +03:00
Paul Sokolovsky
e4fa2f5db7 samples: sockets: echo_client/server: Build for minimal libc
With recent changes, sockets no longer depend on Newlib libc, so
let's have actual samples which demonstrate this. echo_client/
echo_server, which were ported from net_app samples, are converted.
The rest of socket samples are intended to be buildable on a
POSIX system (e.g. Linux), so they rather stay with more
full-fledged libc.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-09-26 18:11:24 +03:00
Robert Lubos
b4d856397e samples: net: sockets: Use TLS overlay config file
Unify method of enabling secure TLS sockets in samples by using TLS
overlay config file instead of standalone config files.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Robert Lubos
743e64992b samples: net: sockets: Put echo samples configuration into single file
Avoid having not-necessarily board specific configs in a separate file.
Instead, have a single project file with appropriate overlay configs.
Board specific configurations can be added in future if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-09-25 15:20:58 +03:00
Johan Hedberg
cf6f87f25b Bluetooth: samples/peripheral_sc_only: Improve logging
The periphreal_sc_only sample app wasn't very clearly logging
information about pairing failures and could give the false
impression that everything work when it doesn't. Enable some more
logging Kconfig features and take advantage of the pairing complete &
failed callbacks to give more information to the user.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-09-24 10:48:40 +03:00
Anas Nashif
b3829adc78 samples: shell: enable kernel shell
Enable kernel shell and adapt test data and remove limited whitelisting.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-23 11:43:33 -04:00
Erwan Gouriou
7ee8b7a512 samples: Provide x-nucleo-iks01a1 shield sample
This sample is made to demonstrate use of shield x-nucleo-ik01a1.
It will display embedded sensor data endlessly.
It requires a board with Arduino i2c as minimum configuration

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-09-21 18:51:26 -04:00
Sebastian Bøe
72e7bfa680 cmake: Remove unnecessary KCONFIG_ROOT configuration
It is no longer necessary to set the KCONFIG_ROOT variable when the
KConfig file is in the application root directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Johann Fischer
59a6ec44b7 drivers: apds9960: use power management
Use power management

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-09-21 09:02:00 -05:00
Johann Fischer
cc56de7005 samples: apds9960: rework APDS9960 sample
Rework APDS9960 sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-09-21 09:02:00 -05:00
Spoorthi K
58542d8d6c samples: Include regex matching in samples
Add harness console and include regex for output
pattern matching to determine correctness of
sample execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-09-21 00:40:44 -04:00
Ramakrishna Pallala
7e273b28c8 samples: subsys: power_mgr: Add changes as per PM policy Kconfig
Enable the CPU Residency based PM policy Kconfig option for
the sample application.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-09-20 10:20:23 -04:00
Piotr Zięcik
9331064ff9 arch: nrf52: Remove ARM_MPU_NRF52X option.
The ARM_MPU_NRF52X option is just selecting ARM_MPU option,
which could be also controlled through menuconfig.

This commit removes the ARM_MPU_NRF52X option and replaces
its usage by ARM_MPU option.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-09-20 14:16:50 +02:00
Jukka Rissanen
27d99d16f8 samples: net: sockets: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
b17b1609ec samples: net: sockets: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
b9fa6d4b22 samples: net: echo-client: Add VLAN support
Add support for VLANs which are disabled by default.
The application can be configured to use the VLANs by setting
the IP addresses properly in config file. The VLAN support in
this sample application is only meant for testing multiple network
interface handling.

The application can be compiled like this for VLAN support:

    cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Jukka Rissanen
3d83601661 samples: net: echo_server: Add VLAN support
If user enables VLAN support, then the sample application will
create two extra VLAN network interfaces for testing purposes.

The application can be compiled like this for VLAN support:

  cmake -DBOARD=qemu_x86 -DOVERLAY_CONFIG=overlay-vlan.conf ..

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-20 11:21:22 +03:00
Daniel Leung
79e8f79498 boards/x86: up_squared: add sample app for GPIO
This adds a sample app to utilize GPIOs on the UP Squared
board.

Origin: Original

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-19 21:36:16 -04:00
Krzysztof Chruscinski
ba808d789e samples: subsys: shell: Port sample to new shell subsystem
Ported shell sample to use new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Krzysztof Chruscinski
527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Maureen Helm
a0efbf3c9c samples: bme280: Disable i2c in spi project configuration
The spi project configuration was incorrectly enabling i2c, which causes
a cmake failure if a board supports spi but not i2c. Found by CI when
adding spi support to the mimxrt1050_evk board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-09-19 09:15:29 -04:00
Johannes Hutter
8c8de70f6e samples: blink_led: add support for nRF boards
Add support for nRF boards by using the software-based PWM driver. The
prescaler has to be configured so that the clock runs slower in order to
make the on-board LED blink in the way it is described in the Readme.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
2018-09-19 09:15:11 -04:00
Anas Nashif
006ca97006 samples: openamp: build with ninja
Fixed building with ninja adding BUILD_BYPRODUCTS based on suggestion
from @SebastianBoe in issue #7760.

Fixes #7760

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-18 23:14:38 -04:00
Alberto Escolar Piedras
169cab0902 sample: subys: logging: fix for posix arch
In the POSIX arch, time does not pass inside infinite loops.
=> Add a small delay in each iteration of those loops
when compiled for it.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-09-18 14:56:10 +02:00
Anas Nashif
e36c7f5b2b samples: hello world: print board name
Use CONFIG_BOARD instead of CONFIG_ARCH.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Anas Nashif
47c20d6ece sample: we have dedicated test for single thread
No need for this here in this sample.
Remove CONFIG_SCHED_MULTIQ which was added by mistake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-17 09:46:24 -04:00
Aurelien Jarno
8ec537dc40 samples: nvs: improve one output message, fix another one
Fix the Id of the longarray message.

Also change the display of the "Address" entry to use "Id" instead of
"Entry" to be consistent the other displayed entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-09-17 07:54:35 -04:00
Kumar Gala
236a2d6f13 dts: arm: nrf: Remove use of CONFIG_SOC_* from Nordic dts files
To move forward and remove use of Kconfig in dts files lets just create
SoC specific dtsi files that the boards can include.  This lets us
remove:

CONFIG_SOC_NRF51822_QFAA
CONFIG_SOC_NRF51822_QFAB
CONFIG_SOC_NRF51822_QFAC
CONFIG_SOC_NRF52810_QFAA
CONFIG_SOC_NRF52832_QFAA
CONFIG_SOC_NRF52832_CIAA
CONFIG_SOC_NRF52832_QFAB
CONFIG_SOC_NRF52840_QIAA

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-09-15 15:33:43 -05:00
Flavio Ceolin
da49f2e440 coccicnelle: Ignore return of memset
The return of memset is never checked. This patch explicitly ignore
the return to avoid MISRA-C violations.

The only directory excluded directory was ext/* since it contains
only imported code.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-14 16:55:37 -04:00
Krzysztof Chruscinski
4add83c5e2 samples: subsys: logging: example of kconfig.log_template usage
Logger sample extended to use template for configuration of
sample module.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-14 12:32:56 -04:00
Anas Nashif
81b272119a docs: fixed documenation pointers
Fixed URL to documentation, now latest docs are under /latest/..
Fixes #9932

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-09-12 12:03:18 -04:00
Carles Cufi
ef7a2318bb samples: shared_mem: Reduce CMake required version to 3.8.2
There is no reason why this sample should have a higher version required
of CMake in order to build.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-09-12 09:45:19 -04:00
Vikrant More
ccade20ccf samples: mesh: nrf52: corrected Range status response
As per PTS, IUT is expected to return success for the
Range Get messages (Light Lightness Range Get for
MMDL/SR/LLNS/BI-01-C, Light CTL Temperature Range Get
for MMDL/SR/LCTLS/BI-01-C). This commit take care of
this issue.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
09e2cf3db0 samples: mesh: nrf52: corrected state Binding for Delta Level
Now if transition (instantaneous or non-instantaneous) is due
to delta level, then state binding would be as per it.

This is as per 3.3.2.2.3 of Bluetooth Mesh Model
Specification.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
be27afb705 samples: mesh: nrf52: corrected spelling
Corrected spelling mistakes for content of enum defined in
transition.h & renamed some functions. Corrected comments
in main.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
864ebaaba6 samples: mesh: nrf52: revised status resp. behaviour & TT calculation
With this it is possible to get proper target value & remaining
time in status response from Servers when transition in progress.
If transition is not in progress then those things would not
get integrate into status response. This is as per Bluetooth
Mesh Model specification.

It is inspired concept from Bluetooth Mesh Developer study
Guide.

Also updated Transition Time (TT) related parameter calculation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
6858cb417d samples: mesh: nrf52: corrected conditional compilation
Corrected conditional compilation directives defined in
publisher.c

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
c805beeaaa samples: mesh: nrf52: initialized dev_uuid to some arbitrary value
Initialized dev_uuid defined in ble_mesh.c to some arbitrary value.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Vikrant More
89f00e6426 samples: mesh: nrf52: upgrade README.rst
Added Generic Default Transition Time Server & Client
Models names in list of Models supported by this App.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2018-09-12 11:14:58 +03:00
Paweł Zadrożniak
7c2197f2d8 boards: nrf: uart: Moved UART pin configuration to DTS (nRF boards)
UART pins (TX, RX, RTS, CTS) are now configured in DTS files.
RTS and CTS definitions are optional. If flow control is enabled
and RTS/CTS pins are not defined, then compiler will issue
an error message.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2018-09-11 23:29:50 -05:00
Ulf Magnusson
d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Daniel Leung
7a1ec635d0 doc: convert internal http links to references
This converts the http links within the Zephyr document
into references. This allows the links within the PDF file
to jump to the correct sections instead of going to
the Internet.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-11 14:55:43 -04:00
Kumar Gala
4fede8dd0b log: make name param explicit
Rather than having some implied name for the logging name, explicitly
pass it in the macros LOG_MODULE_REGISTER & LOG_MODULE_DECLARE.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-11 13:25:55 -05:00
Emanuele Di Santo
ea4f8b7d6c samples: nrf52: power_mgr: use dts-generated defines
This commit updates the power_mgr sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
0a15793830 samples: nrf52: onoff-app: use dts-generated defines
This commit updates the onoff-app sample to use the dts-generated
defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
7fb051bc72 samples: nrf52: onoff_level_lightning_vnd_app: use dts-generated defines
This commit updates the onoff_level_lightning_vnd_app sample
to use the dts-generated defines instead of the aliases in board.h.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Emanuele Di Santo
53cd7c2496 samples: basic: button: use dts-generated defines
This commit updates the button sample to use the dts-generated
define to configure the button pull-up when the custom define
is not present.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2018-09-11 11:42:20 -05:00
Gil Pitney
844e6f5a2e samples: net: sockets: echo: enable socket offload for cc3220sf_launchxl
Add a prj conf file for the TI cc3220sf_launchxl board
to enable socket offload to the simplelink WiFi driver.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-09-11 18:42:34 +03:00
Shawn Mosley
26c51c43d0 userspace: sample app domain applications
Added a sample using the app_memory submodule to protect memory
used by three threads.

Signed-off-by: Shawn Mosley <smmosle@tycho.nsa.gov>
2018-09-11 09:17:37 -04:00
Filip Kubicz
5c3992f34f dts: update I2C bindings for nRF chips
Change 'nRF5' family names to 'nRF' in I2C DTS.

Signed-off-by: Filip Kubicz <filip.kubicz@nordicsemi.no>
2018-09-11 11:41:37 +02:00
Andrei Emeltchenko
e02dcf2545 samples: lldp: Add simple parsing to sample
Add simple parsing using LLDP RX API

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-09-11 10:55:01 +03:00
Jukka Rissanen
c4cc8a5f3e net: if: Refactor IPv6 address lifetime timer
Refactor IPv6 address lifetime timer setting in net_if_addr to support
longer lifetime than 24 days.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-09-11 10:53:30 +03:00
Flavio Ceolin
f6210cf430 samples: drivers: crypto: Fix minimum values for mbedTLS
The latest mbedTLS (2.12) release increased resources requirements on
Zephyr, so it was required increasing the minimum SRAM to run this test
and the main stack size.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Flavio Ceolin
8b70ace563 crypto: tests: Change crypto tests to use Kconfig defined header
While it's possible to define which mbedTLS config header to use, our
samples should use config-tls-generic.h as default because this header
is configurable through Kconfig.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Daniel Leung
0340d66847 samples: grove: re-add Quark D2000 to sample.yaml
Since we now have a working ADC driver for Quark D2000,
add the whitelist back.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-09-05 18:38:57 -04:00
Ravi kumar Veeramally
42c19497b6 samples: net: coap: Remove apps using raw mbedtls APIs
This removes these network sample applications
  samples/net/coaps_client
  samples/net/coaps_server

as they are using low level mbedtls APIs. You should use
preferably socket based or net-app based applications.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 16:17:37 -04:00
Ravi kumar Veeramally
9c605c1711 samples: net: Fix out-of-bound access
Payload variable can hold max 64 bytes but value of size can be more
than that. Memsetting using value of size can overrun payload array.
Fixes coverity issue.

Coverity-CID: 187823
Fixes: #9638

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-09-04 08:10:18 -04:00
Jukka Rissanen
385345218d samples: net: mbedtls: Remove apps using raw mbedtls APIs
This removes these network sample applications

  samples/net/mbedtls_sslclient
  samples/net/mbedtls_dtlsserver
  samples/net/mbedtls_dtlsclient

as they are using low level mbedtls APIs. You should use
preferably the samples/net/sockets/echo_[server|client] applications
instead, or as a last option use net-app based applications
in samples/net/echo_[server|client] if needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-30 14:27:33 -04:00
Luiz Augusto von Dentz
4e208b24bd Bluetooth: IPSP: Fix pointing to invalid file
sample/net/README no longer exists so this removes its mention since
it is already described how to use echo-client at the end of the
document. Also state that CONFIG_BT_6LOWPAN shall be set in order to
use Bluetooth 6LoWPAN module with Linux.

Fixes #9727

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2018-08-30 09:25:30 -04:00
Punit Vara
108b5398e4 tests: adc_api: Remove sample width test scenario
Remove unnecessary sample width scenario.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
094531bf9f samples: grove_temperature: Use device name from Kconfig
Use Kconfig to get device name. Make LIBC conditional to get
output.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
52339f4b1d samples: grove_light: Provide device name from Kconfig
check return value for sample fetch. Conditional printk
added to print adc value.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Diego Sueiro
9255bf5f7f gpio: Use GPIO_FLAGS instead of GPIO_INT_CONF
Rename GPIO_INT_CONF to GPIO_FLAGS in order to be able to use
the definition generated by the devicetree, eliminating the need
for definition in the board.h file

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-29 08:49:29 -04:00
David B. Kinder
1d1a4b321b doc: fix misspellings in reST files
Fix misspellings missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-08-28 13:59:38 -04:00
Michael Scott
3b80998ff2 net: lwm2m: correct Copyright to Foundries.io
Due to a change in the company name, the LwM2M copyrights need
to be changed from "Open Source Foundries Limited" ->
"Foundries.io".

Signed-off-by: Michael Scott <mike@foundries.io>
2018-08-27 19:29:16 -04:00
Maureen Helm
42c5d519b1 samples: mpu_stack_guard_test: Update console output in README
The fault dump text has changed since this sample was originally
written, so update the README accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 16:24:48 -04:00
Maureen Helm
3ef2cc66c0 samples: mpu_stack_guard_test: Fix yaml regexes
The mpu_stack_guard sample was failing in both configurations on arm
platforms. Fix the regexes in sample.yaml so they work on multiple
architectures.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 16:24:48 -04:00
Maureen Helm
7976d2b564 samples: nvs: Use flash erase block size from dts
The nvs sample assumed a 1 KB flash erase block size, which caused the
sample to fail on frdm_k64f because its erase block size is 4 KB. Get
the erase block size from dts instead.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-27 12:49:32 -04:00
Maureen Helm
9039d6fd6e samples: nvs: Use depends_on to select platforms
Removes the platform whitelist, leaving just the depends_on/supported
pattern to select which platforms the sample can run on.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-25 07:13:56 -07:00
Maureen Helm
f2662acd90 samples: nvs: Allow mpu flash write
Make this sample work on mpu-enabled platforms by configuring the mpu to
allow flash writes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-25 07:13:56 -07:00
Radoslaw Koppel
0d0b221efa samples: bluetooth: peripheral_hids: Add settings module
This commit adds settings module to the peripheral_hids that makes
bonding persistent.
Now it is possible to connect with previously bonded device.

Fixes #9580

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2018-08-23 15:29:46 +03:00
Gil Pitney
a4cc88ad30 samples: net: sockets: echo-client: fix sock fd test, allow zero.
Per: http://pubs.opengroup.org/onlinepubs/009695399/functions/socket.html
"Upon successful completion, socket() shall return a non-negative
integer, the socket file descriptor."

The test in prepare_fds() however fails if socket fd is
zero (non-negative), which should be a valid value.

This was found while testing the SimpleLink socket offload driver,
which can return a zero-valued socket fd, per the POSIX spec.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2018-08-22 15:37:15 -07:00
Ramakrishna Pallala
b69d286180 samples: subsys: Add sample app to demo OS managed PM
Add a sample application to demonstrate OS managed
Power Management framework.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-08-22 08:07:14 -07:00
Michael Hennerich
84c352d0f3 samples: sensor: adxl372: Add ADXL372 sample application
This sample application produces slightly different outputs based on
the chosen driver configuration mode. In Measuring Mode with trigger
support, the acceleration on all three axis is printed in m/s^2 at
the sampling rate (ODR). In polled Measuring Mode the instantaneous
acceleration is polled every 2 seconds. In most high-g applications,
a single (3-axis) acceleration sample at the peak of an impact event
contains sufficient information about the event, and the full
acceleration history is not required.
In this Max Peak Detect Mode the device returns only the over
threshold peak acceleration between two consecutive sample fetches or
trigger events. Instead of printing the acceleration on all three axis,
the sample application calculates the vector magnitude
(root sum squared) and displays the result in g rather than in m/s^2,
together with an bar graph.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
2018-08-21 20:19:44 -05:00
Diego Sueiro
22b61c7f43 sensors: add WaRP7 board listing for fxos8700 and fxas21002
Update yaml files to include warp7_m4 board in the platform_whitelist
for fxos8700 and fxas21002 sensors.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-21 18:54:41 -05:00
Anas Nashif
aa81a92213 tests: build philosophers sample with systemview
Build sample with sysview enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
a2248782a2 kernel: event_logger: remove kernel_event_logger
Move to more generic tracing hooks that can be implemented in different
ways and do not interfere with the kernel.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
457fc799ba samples: debug: remove sysview sample
We will implement this as a core feature using tracing points and make
it available to any application.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Anas Nashif
3f02e0d5d3 samples: remove kernel_event_logger sample
We are replacing kernel_event_logger with a more generic tracing API.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Karol Lasończyk
c9e3c938e6 tests/samples: watchdog: Update projects' configuration
WDT_NRFX is now enabling by default. Its configuration from proj.conf
files was removed.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00
Karol Lasończyk
6c669ace6e samples: watchdog: Update watchdog example to new API
Watchdog example is updated to use new watchdog API.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00