Commit graph

9378 commits

Author SHA1 Message Date
Kumar Gala
3a223bc45b samples: sensor: hts221: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding.  This
is more generic than the hardcoded string that was being used.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-14 14:08:44 -07:00
Johann Fischer
3c971307dc arch/kernel/soc/samples: use unsigned int for irq_lock()
irq_lock() returns an unsigned integer key.
Generated by spatch using semantic patch
scripts/coccinelle/irq_lock.cocci

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-14 14:37:13 -05:00
Alexandre Bourdiol
ff9e6f2661 sample: subsys: nvs: support stm32l562e_dk board
Add stm32l562e_dk support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
f73873b9e2 sample: subsys: nvs: support nucleo_wb55rg board
Add nucleo_wb55rj support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
88140089f0 sample: subsys: nvs: support nucleo_l152re board
Add nucleo_l152re support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
75f8685bd1 sample: subsys: nvs: support nucleo_g071rb board
Add nucleo_g071rb support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
e0f7ed09fe sample: subsys: nvs: support nucleo_f429zi board
Add nucleo_f429zi support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
e9014130f8 sample: subsys: nvs: support nucleo_f103rb board
Add nucleo_f103rb support to sample nvs

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Alexandre Bourdiol
503514f0b9 sample: subsys: nvs: disco_l475_iot1: use MCU flash instead of QSPI
This allow storage partition to be erased on automatic bench,
(mass erase) and thus test is now passed.
By the way it allows to test MCU flash driver,
whereas other drivers tests operates on QSPI.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-14 10:43:53 +02:00
Attie Grande
d713aa8e2f samples: drivers: adc: fixup sam0 samples
The sam0 ADC driver has ADC_CONFIGURABLE_INPUTS enabled, which means
that the device tree ADC nodes must include the zephyr,input-positive
property.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-14 10:31:19 +02:00
Glauber Maroto Ferreira
c4ed27f0ec esp32: samples: counter: conf removal & overlay inclusion
Removes deprecated conf files from the counter/alarm
sample and adds overlays to enable timer nodes in use.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-13 15:53:04 +02:00
Johann Fischer
a1bfd8336e samples: rtu_server: add support for CDC ACM UART
Allow to use RTU server sample on any board that has supported
USB device controller. Although it is only a point to point
connection and does not represent a bus, it can, apart from
testing the server implementation, also be used practically
for example to control relays or to read ADC values via
USB connection without implementing custom USB class or driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-13 11:36:59 +02:00
Henrik Brix Andersen
d22a9909a1 drivers: net: canbus: move CAN bus network driver to drivers/net
Move the CAN bus network driver from drivers/can to drivers/net as it
implements a network driver, not a CAN controller driver.

Use a separate Kconfig for enabling the CAN bus network driver instead of
piggybacking on the SocketCAN Kconfig. This allows for other
(e.g. out-of-tree) SocketCAN transports.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-13 10:34:51 +02:00
Francois Ramu
b5f3df0303 samples: canopenmode exclude nvs_sector_size above 64K
This commits is restricting the execution of the
samples/modules/canopennode to board configuration where
the nvs_sector_size is less than 0x10000.
When the CONFIG_CANOPENNODE_STORAGE is selected, the
settings_subsys_init do not accept
nvs_sector_size > UINT16_MAX.
Then all the stm32h723/h743/h745/h750 cannot run the
sample.modules.canopennode testcase

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-13 10:14:03 +02:00
Emil Gydesen
c699ae5850 Bluetooth: Audio: Expose broadcast sink adv data to application
In the broadcast sink `scan_recv` which is called when we
scan for broadcast source, we now also provide the entire
AD struct to the application.

The reason for this is that the advertising data may
contain other information that is useful for the application
like the broadcaster device name or any other
vendor/application specific data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:17:02 +02:00
Emil Gydesen
bd64be452c samples: Bluetooth: Update unicast audio client to disconnect
Update the sample to reset data and restart scanning for new
unicast audio servers if the connected one disconnected.

This does not handle if a disconnect happens in the middle of
setting up the audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:12:08 +02:00
Emil Gydesen
9b15426455 Bluetooth: Audio: Refactor ISO allocation endpoints
Modify how the ISO channels are allocated for the audio streams,
as well as how the CIG is allocated for the unicast group.

This fixes an issue where the unicast group could not be
fully allocated before _after_ the bt_audio_streams had been
configured by bt_audio_stream_config, thus making it impossible
to create a unicast group before the connections have been established.

This leaves us with 3 basic data types:
1) Streams allocated by the application
2) Endpoints that represent ASEs
3) Audio_iso which is used to couple streams and ISO channels.

The Unicast Group for the unicast client will now have the same
lifetime as the ISO CIG for the central.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-12 14:12:08 +02:00
Kumar Gala
4fab930c6d samples: video: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-12 10:20:00 +02:00
Gerard Marull-Paretas
e0c647c147 samples: drivers: flash_shell: remove duplicate include
<stdlib.h> was included twice, keep the first occurence only.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-11 17:56:55 +02:00
Gerard Marull-Paretas
d424d66aff samples: drivers: flash_shell: remove unused soc.h
The sample included soc.h for no reason, remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-11 17:56:55 +02:00
Carlo Caione
2f5fef960e sample: s2ram: Introduce S2RAM sample
Introduce a template / sample for S2RAM running on rf5340dk.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-11 15:26:26 +02:00
Jonathan Rico
1f226e0c4b samples: boards: fix bbc_microbit pong build
The GATT caching feature isn't needed, and was making the memory
consumption blow up because of the recent addition of `long_wq` for
deferred work.

Fixes #47428 .

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-07-11 14:38:10 +02:00
Manuel Arguelles
f2ae4b67b2 tests: samples: bump timeout for FVP BaseR board
Timeout must be increased for fvp_baser_aemv8r_aarch32 board. Enabling
MPU on this board makes simulation slower.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-07-11 11:17:02 +02:00
Kumar Gala
ca22924f2f samples: drivers: espi: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 10:51:30 +02:00
Kumar Gala
d1b685a84b samples: drivers: espi: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-11 10:51:30 +02:00
Aastha Grover
6f5c26d71e samples: kernel: condvar: add README
Add readme for the sample for conditional variables in kernel.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-08 21:06:33 -04:00
Emil Gydesen
4b953eabf8 Bluetooth: Audio: Moved ASCS metadata verification to higher layer
Instead of rejecting metadata at the BAP layer, we now
expect the higher layer to provide the verification.

The reason for this is that the higher layer may be better
equiped at determining which metadata it supports.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 20:08:45 +00:00
Kumar Gala
4faf362030 soc: apollo_lake: gpio: Drop use of DT_LABEL
Change APL_GPIO_DEV_* defines to be DT_NODELABELs instead of
"label" strings.  This lets us change users of these defines to
use DEVICE_DT_GET.

We update samples/board/up_squared/gpio_counter to use DEVICE_DT_GET
as part of this change.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 20:01:47 +00:00
Gerard Marull-Paretas
6026022ccf samples: boards: bbc_microbit: line_follower: use i2c-dt-spec
Create a sample level compatible for the motor controller and make use
of i2c-dt-spec facilities.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Gerard Marull-Paretas
6a23d983a7 samples: boards: bbc_microbit: line_follower: refactor motor code
Simplify motor control logic to improve application
readability/structure.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Gerard Marull-Paretas
dd54e82b84 samples: boards: bbc_microbit: line_follower: fix variable types
For left/right gpio values:

- GPIO API returns `int` (signed).
- Drop array as only first index was used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Gerard Marull-Paretas
c1f0c9afe8 samples: boards: bbc_microbit: line_follower: use gpio-dt-spec
Specify left/right GPIOs in DT (zephyr,user node). Make use of
gpio-dt-spec and cleanup the code.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Gerard Marull-Paretas
ee9ab9756c samples: boards: bbc_microbit: pong: use pwm-dt-spec
Specify PWM parameters in Devicetree. Code has been updated to operate
in native PWM units (nsec) everywhere.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Gerard Marull-Paretas
ab959061ff samples: boards: bbc_microbit: sound: use pwm-dt-spec
Specify PWM parameters in Devicetree. Period in DT is used as the
initial period. Code has been updated to operate in native PWM units
(nsec) everywhere.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-07-08 14:08:47 +02:00
Yuriy Vynnychek
99479ecbda drivers: adc: introduce new Telink B91 ADC driver
ADC driver basic support for Telink B91 SoC.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-07-08 11:07:18 +02:00
Kumar Gala
a4ae3afd1f samples: ps2: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 11:03:23 +02:00
Kumar Gala
209a4c3c18 samples: updatehub: Remove use of DT_BUS_LABEL
The use of DT_BUS_LABEL in a logging call can easily be replaced
with uart_dev->name.  This moves us slowly forward to removing
use of devicetree `label` property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:52:47 +02:00
Kumar Gala
b77aeb0c21 samples: counter: maxim_ds3231: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:52:34 +02:00
Kumar Gala
43c4066e0e samples: spi_bitbang: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 10:52:21 +02:00
Emil Gydesen
d595b64252 sample: Bluetooth: Add BT_SETTINGS for connected ISO samples
Add BT_SETTINGS support for the samples as well as
enabling security.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-08 10:49:12 +02:00
Kumar Gala
4415a3bd3c samples: drivers: spi_flash: Exclude hifive_unmatched
hifive_unmatched has a jedec,spi-nor flash node, however we have no
SPI driver for the controller so exclude the platform from this sample.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 09:36:43 +02:00
Kumar Gala
3cfc8d5875 samples: spi_flash: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-08 09:36:43 +02:00
Kumar Gala
c4cdba3833 samples: lwm2m_client: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:27:52 -05:00
Kumar Gala
9ceeb3a0ae samples: lwm2m_client: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:27:52 -05:00
Joep Buruma
91f659d70a samples: led_pwm: add overlay for rpi_pico board
Add an overlay for rpi_pico board to the led_pwm sample.
This board only supports fairly high pwm frequencies so
the blinking of the LED is not supported. Turning it on/off
and fading is.

Signed-off-by: Joep Buruma <burumaj50@gmail.com>
2022-07-07 15:17:26 +02:00
Kumar Gala
798c2ef0ee samples: boards: nrf: nrfx_prs: Remove DT_LABEL usage
As we work to phase out `label` property usage, remove DT_LABEL
from BUILD_ASSERT macro.  Just use SPIM_NODE and UARTE_NODE in
the assert message.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:12:11 -05:00
Kumar Gala
7c39210324 samples: boards: nrf: system_off: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:12:11 -05:00
Kumar Gala
4cb17cca08 samples: boards: nrf: clock_skew: Convert to use DEVICE_DT_GET{_ONE}
Move to use DEVICE_DT_GET{_ONE} instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:12:11 -05:00
Kumar Gala
0efbba947a samples: boards: nrf: battery: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 08:12:11 -05:00
Kumar Gala
465cc93bf0 samples: drivers: i2s: echo: Remove DT_LABEL usage
As we phase out usage of 'label' devicetree property, remove uses
of DT_LABEL.  Replace DT_LABEL with swN_spec.port->name.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:27:36 +00:00
Kumar Gala
0e00cccb7a samples: reel_board: mesh_badge: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access for SW0.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:27:16 +00:00
Maciej Perkowski
d224d7fcd5 sample: usb: Change integration_platforms to platform_allow
The sample proviades required overlays only for 3 platforms.
Therefore, flash scenarios can only work on those 3 platforms.
To reflect this, platform_allow has to be used instead of
integration_platforms, so boards without overlays are not picked up
into a scope.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-07-07 10:11:44 +02:00
Kumar Gala
6a177e0a31 samples: usb: hid-cdc: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:11:29 +02:00
Kumar Gala
5e5a2cc3ca samples: sensor: fxos8700-hid: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:11:16 +02:00
Kumar Gala
1424912d56 samples: sensor: fxos8700-hid: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:11:16 +02:00
Kumar Gala
b17bc71889 samples: led_sx1509b_intensity: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:09:48 +02:00
Kumar Gala
52b4cab493 samples: sensor: bme680: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
bd25909ced samples: sensor: grove_light: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
471eb98032 samples: sensor: grove_temperature: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
b8b9bcc8f7 samples: sensor: icm42605: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
bdaa339881 samples: sensor: max17262: Remove dead code
MAX17262 and MAX17262_LABEL defines aren't used anymore so remove them

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
e12a44f536 samples: sensor: max6675: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
e0854d9e31 samples: sensor: vl53l0x: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
7e286bfc5e samples: basic: threads: Remove dts label prop usage
Replace access to dts 'label' property (which we are phasing out)
with simple int as the serve the purpose for error report.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:47 +02:00
Kumar Gala
95ee61529a samples: cc13x2_cc26x2: system_off: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:32 +02:00
Kumar Gala
c2f3f32ec8 samples: cc13x2_cc26x2: system_off: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:32 +02:00
Kumar Gala
0f25daa8fe samples: bbc_microbit: line_follower_robot: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

The I2C & GPIO devices are not represnted in devicetree and thus we
aren't converting this sample over to i2c_dt_spec or gpio_dt_spec.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:12 +02:00
Kumar Gala
13bff2b253 samples: bbc_microbit: pong: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:12 +02:00
Kumar Gala
85094fb9f8 samples: bbc_microbit: pong: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:12 +02:00
Kumar Gala
400069b106 samples: bbc_microbit: sound: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:12 +02:00
Kumar Gala
7b6b7cf37c samples: bbc_microbit: sound: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:02:12 +02:00
Kumar Gala
b3bbaa5400 samples: edac: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:01:45 +02:00
Kumar Gala
d9c5022d3b samples: tflite-micro: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:01:20 +02:00
Kumar Gala
64819c3ac2 samples: spi_flash_at45: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-07 10:01:15 +02:00
Pieter De Gendt
e381170282 uart_pipe: Remove obsolete UART_PIPE_ON_DEV_NAME Kconfig
The UART pipe device is selected with devicetree chosen zephyr,uart-pipe

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-07 09:59:49 +02:00
Andrey Borisovich
aa253d9ab1 soc: intel_adsp: reading HP SRAM banks count for ACE1X from Devicetree
Replaced hardcoded for intel_adsp_ace15_mtpm board
HP_MEMORY_BANKS value used in SOF code with generic approach -
using PLATFORM_HPSRAM_EBB_COUNT read from Devicetree.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
2022-07-06 15:11:07 -04:00
Flavio Ceolin
e4a3e2d8b6 intel_adsp: Unify cavs and ace timers
These two timers were sharing pretty much the same code. Actually
mtl timer was a "superset" of cavs timer. Just merge them into a
single one called intel audio dsp timer (intel_adsp_timer).

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-07-06 15:11:07 -04:00
Arsen Eloglian
293c55a3ee dts: align CONFIG's with ace hardware
Align CONFIG_HEAP_MEM_POOL_SIZE & CONFIG_DAI with ace hardware.

Signed-off-by: Arsen Eloglian <ArsenX.Eloglian@intel.com>
2022-07-06 15:11:07 -04:00
Anas Nashif
e3c9eb2495 intel_adsp: add the board definition for the Meteorlake
Board definition for the meteorlake platform.
Enable intel_adsp_ace15_mtpm in the sof sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Co-authored-by: Michal Wasko <michal.wasko@intel.com>
Co-authored-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
2022-07-06 15:11:07 -04:00
Kumar Gala
19636b5087 sapmles: watchdog: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:42:29 -05:00
Kumar Gala
046cb83996 samples: esp32: flash_encryption: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:42:11 -05:00
Kumar Gala
057f1555c3 samples: lorawan: class_a: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:41:54 -05:00
Kumar Gala
ceeaef5100 samples: gsm_modem: Remove use of DT_BUS_LABEL
The use of DT_BUS_LABEL in a logging call can easily be replaced
with uart_dev->name.  This moves us slowly forward to removing
use of devicetree `label` property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:41:35 -05:00
Kumar Gala
c96f8f9c29 samples: lsm6dso: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Also, Removed 'lsm6dso' from board & sample yaml's and move to just
filtering based on devicetree compat.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 12:26:42 -05:00
Kumar Gala
544140dfe4 samples: boards: h7_dual_core: Convert to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:22:43 -05:00
Anas Nashif
8fe4ca699c samples: add mising braces to single line if statements
Following zephyr's style guideline, all if statements, including single
line statements shall have braces.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-06 11:00:45 -04:00
Kumar Gala
36a507d271 samples: 96b_argonkey: sensors: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 09:54:50 -05:00
Kumar Gala
a4514f2771 samples: 96b_argonkey: sensors: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 09:54:50 -05:00
Kumar Gala
55a7c6dc20 samples: sensortile_box: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 09:53:48 -05:00
Kumar Gala
322b23a2c9 samples: sensortile_box: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 09:53:48 -05:00
Kumar Gala
e9c83b3e9b samples: reel_board: mesh_badge: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:13:02 +00:00
Kumar Gala
4aaa9cea01 samples: reel_board: mesh_badge: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:13:02 +00:00
Kumar Gala
7761b5c4e2 samples: bluetooth: iso_receive: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:22:04 +02:00
Alexandre Bourdiol
2b54f0fcf4 samples: drivers: led_ws2812: add fixture to sample.yaml
This sample should be executed only when connecting external
hardware (Led strip). Thus it is necessary to add fixture to avoid
execution when no hardware is connected.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-06 11:19:13 +02:00
Maciej Perkowski
a83cec9f8b samples: drivers: flash: Add missing fixture requirement
This sample can only be tested if the DUT has external memory
connected. This commit aligns the yaml description, so the test
is not picked up on setups without required fixture.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-07-06 11:12:04 +02:00
Kumar Gala
1ee23437ee samples: nrf: mesh: onoff-app: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:11:31 +02:00
Kumar Gala
18ede6e681 samples: alarm: Convert sample to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 11:11:00 +02:00
Emil Gydesen
504feb77c4 Bluetooth: Audio: Updated samples and shell to use seq_num
Update the samples and the shell to use the sequence number
and timestamp when sending.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-06 11:03:27 +02:00
Jamie McCrae
db469784ae samples: drivers: watchdog: Add support for Raspberry Pi Pico
This adds support for running the watchdog driver sample on a Raspberry
Pi Pico board.

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2022-07-06 10:52:29 +02:00
Kumar Gala
b2ad545887 samples: x_nucleo_iks02a1: microphone: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
d10fc848f0 samples: x_nucleo_iks02a1: sensorhub: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
e263876065 samples: x_nucleo_iks02a1: standard: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
775907aaee samples: x_nucleo_iks01a2: sensorhub: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
76f2d82bf8 samples: x_nucleo_iks01a2: standard: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
9d038c93da samples: x_nucleo_iks01a3: standard: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
c4b98aa3c8 samples: x_nucleo_iks01a3: sensorhub: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Kumar Gala
aa7e23c949 samples: x_nucleo_iks01a1: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-06 10:48:09 +02:00
Fredrik Danebjer
2283aad798 Bluetooth: Audio: Removed Streaming Context from LC3 PAC Record
This fix removes the Streaming_Audio_Context LTV from the LC3 Codec
helper macro, and subsequently a faulty exposure of this LTV in the
PAC records used.

Signed-off-by: Fredrik Danebjer <fredrik@danebjer.com>
2022-07-06 10:46:22 +02:00
Thomas Stranger
831506b82b samples: sensor: ds18b20: add sample for this temperature driver
This commit adds a sample for the maxim ds18b20 1-wire temperatue
sensor in a single-drop bus configuration.
Includes overlay files for nucleo_g0b1re und nrf52840dk_nrf52840 with
the required open drain configuration.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-05 23:06:45 +02:00
Benjamin Björnsson
95717e7b4d samples: sensor: adxl362: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-05 08:51:13 -05:00
Kumar Gala
53f25d0231 samples: nrf: onoff_level_lighting_vnd_app: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-05 12:29:09 +02:00
Emil Gydesen
f46842a788 Samples: Bluetooth: Fix missing codec reference for broadcast audio sink
The broadcast audio sink sample had a bad codec reference after
multiple commits were merged.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-05 06:15:59 -04:00
Johann Fischer
6a102eeffd samples: usb: add integration platforms to flash tests in USB MSC sample
Add integration platforms to mass_flash_fatfs and mass_flash_littlefs
tests as these options are tuned for specific platforms.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-04 16:57:48 +02:00
Johann Fischer
fbe7a1067d samples: usb: fix flash test subsections in USB MSC sample
Test sections, mass_flash_fatfs and mass_flash_littlefs,
and corresponding Kconfig options are mixed up.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-04 16:57:48 +02:00
Kumar Gala
ff2032a3ae samples: wifi: enable reel_board to test winc1500
We don't have anything that build tests the win1500 driver, so
enable reel_board to provide coverage on the driver.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-04 16:50:20 +02:00
Erik Robstad
06586e960d samples: Bluetooth: broadcast_audio_sink sample bugfix
Fixed handling of k_sem_take() return codes.
Also some minor cleanup in broadcast_audio samples.

Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
2022-07-04 16:22:28 +02:00
Emil Gydesen
4c471914b9 Bluetooth: Audio: Remove codec from bt_audio_broadcast_sink_sync
The codec (or rather codec configuration) is now taken from the
previously received BASE. This also means that the BASE (with
the codec configurations) is now also stored statically.

When the application attempts to synk to the broadcaster
the stack will lookup the codec configuration based on the
bis index, as a BASE may have multiple subgroups
with multiple codec configurations.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 16:08:52 +02:00
TOKITA Hiroshi
3b4e6c76f6 samples: fat_fs: Add arduino_mkrzero to supported board list
Update README.rst for adding arduino_mkrzero to
supported board list in README.rst.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-07-04 16:00:56 +02:00
Emil Gydesen
bb6c0866d8 Bluetooth: Audio: Add PACS for broadcast sink
Add support for using PACS and/or capabilities for
the broadcast sink role. PACS and capabilities were
originally only supported for the unicast server
role, so the PACS callbacks were moved their own
struct, as if a device supports both the unicast
server role and the broadcast sink role, it will
only have a single PACS instance.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-04 15:59:09 +02:00
Reto Schneider
7a6c5710ff cmake: Update cmake_minimum_required to 3.20.0
As Zephyr currently requires CMake version 3.20.0, update all
occurrences of cmake_minimum_required.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-04 10:18:45 +02:00
Kumar Gala
0f2ec0222c samples: 96b_argonkey: microphone: Convert to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-04 09:50:47 +02:00
Kumar Gala
82f6a3e134 samples: 96b_argonkey: microphone: Convert to use gpio_dt_spec
Move sample to use gpio_dt_spec for GPIO access.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-04 09:50:47 +02:00
Kumar Gala
015a667667 samples: sx9500: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-04 09:49:01 +02:00
HaiLong Yang
de052b2993 samples: drivers: adc: add gd32 boards support
This add gd32 boards support for the adc sample.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2022-07-04 09:48:32 +02:00
Jordan Yates
75680f7ae0 treewide: update flash_area name retrieval
Update usage of `flash_area->fa_dev_name` to `flash_area->fa_dev->name`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-07-02 16:04:16 +02:00
Maureen Helm
5dd9c21b98 samples: sensor: Remove hmc5883l magnetometer sample
The magn_polling sample application now supports the hmc5883l driver, so
we can remove this driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-07-02 06:03:33 -04:00
Maureen Helm
331de27f5a samples: sensor: Remove bmm150 magnetometer sample
The magn_polling sample application now supports the bmm150 driver, so
we can remove this driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-07-02 06:03:33 -04:00
Maureen Helm
0e917af9e3 samples: sensor: Extend magn_polling to support additional drivers
Extends the magn_polling sample application to support additional
magnetometer drivers. This is a first step towards reducing the number
of driver-specific sensor sample applications.

Integration platforms were selected to exercise different magnetometer
drivers.

Tested on hardware with the following configurations:
- fxos8700 driver with the on-board sensor on the frdm_k64f board
- lis2mdl driver with a x_nucleo_iks01a3 shield attached to a frdm_k64f
  board

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-07-02 06:03:33 -04:00
Maureen Helm
e0208be634 samples: sensor: Remove GPIO references from magn_polling
The magn_polling sample application doesn't use GPIO.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-07-02 06:03:33 -04:00
Glauber Maroto Ferreira
5686368eec boards: riscv: esp32c3_devkitm: dts: use pin grouping
Updates device tree pin states definitions and node
descriptions to group pins sharing common properties.

Accordingly, updates in-tree overlays as well.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-01 16:22:18 +00:00
Glauber Maroto Ferreira
f82d3d444d boards: xtensa: esp32s2_saola: dts: use pin grouping
Updates device tree pin states definitions and node
descriptions to group pins sharing common properties.

Accordingly, updates in-tree overlays as well.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-01 16:22:18 +00:00
Glauber Maroto Ferreira
dfad263fc2 boards: xtensa: esp_wrover_kit: dts: use pin grouping
- update device tree pin states definitions and node
descriptions to group pins sharing common properties.
- update fat_fs sample code overlay.
- remove unused ledc pin states

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-01 16:22:18 +00:00
Glauber Maroto Ferreira
f79029a074 boards: xtensa: esp32: dts: use pin grouping
- update device tree pin states definitions and node
descriptions to group pins sharing common properties.
- update ESP32's in-tree overlays.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-07-01 16:22:18 +00:00
Ryan Erickson
fb34a9749f logging: add log_source_id_get
Add API to get the logging module source ID from the
module name;

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-07-01 16:30:30 +02:00
Maciej Perkowski
824ccc00df tests: samples: tfm: Increase timeout for tfm samples tests
Scenarios sample.tfm.psa_test_crypto and
sample.tfm.psa_test_crypto require longer timeout to fully finish.
This commit increase them accordingly.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-07-01 11:37:47 +02:00
Hu Zhenyu
0d323960a3 dts: adc0 content in mec172xevb_assy6906.overlay
To make the test case of samples/drivers/adc work on mec172xevb_assy6906

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-07-01 11:35:54 +02:00
Francois Ramu
816449c138 samples: sensor: new sample to demonstrate the Vbat monitoring
This new application is monitoring the Vbat in Volts
from the internal ADC.
Running on the nucleo_g071rb and nucle_wb55rg boards.
Vref is a property of the ADC.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-01 11:34:17 +02:00
Kumar Gala
e0ce8436a5 samples: boards: nrfx_prs: Fix use of deprecated spi_cs_control fields
The gpio_dev, gpio_pin, etc fields of struct spi_cs_control are
deprecated.  Move to using the gpio field.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-30 18:57:12 -05:00
Andrzej Głąbek
c7e4d23c5d samples: boards: nrfx: Align code with the recent nrfx_gpiote API
Replace calls to nrfx_gpiote functions deprecated in nrfx 2.6.0
with recommended equivalents.
On the occasion, switch to using available `nrfx_gppi_*` functions
instead of separate paths for DPPI and PPI channels.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-30 18:14:02 +02:00
Kumar Gala
8abcaf5365 samples: spi_bitbang: Fix use of deprecated spi_cs_control fields
The gpio_dev, gpio_pin, etc fields of struct spi_cs_control are
deprecated.  Move to using the gpio field.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-30 07:14:56 -05:00
Andrei Emeltchenko
2a61e30384 samples: echo_server: Remove unused error code
Remove setting unused error code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-30 10:34:40 +02:00
Andrei Emeltchenko
82b9282e60 samples: socketpair: Remove unused error code
Remove unused variable.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-30 10:34:40 +02:00
Andrei Emeltchenko
3cd5bd600f samples: dumb_http_server_mt: Remove unneeded statement
ret is not used so assignment is not needed.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-06-30 10:34:40 +02:00
Lucas Tamborrino
7519ce35a5 samples: basic: blinky_pwm: add support for espressif boards
Add overlay for espressif boards that does not have a built-in LED.

Add instructions on README file about the required LED connection.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-06-29 14:48:25 +00:00
Lucas Tamborrino
02675bbc80 dts: esp32: full ledc configuration in binding
This commit moves the hardware configuration for ledc
peripheral to the device-tree instead of Kconfig.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-06-29 14:48:25 +00:00
Francois Ramu
9a29f182c3 samples: drivers: spi_flash rename definitions
This commits prefixes all the definitions
with 'SPI_' to be used by the sample application.
This will avoid compilation conflict especially
on FLASH_SECTOR_SIZE.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-06-29 10:25:16 +02:00
Emil Gydesen
c5fc32756a Bluetooth: Audio: Remove hardcoded location and context for LC3 macros
The BT_CODEC_LC3_CONFIG_* macros had a hardcoded location
and context, which makes them a lot less usable.

Updates the macro, and the macros that used them.
This also removes the BT_CODEC_LC3_CONFIG and instead
just uses the BT_CODEC_LC3_CONFIG_N macro, which has
then been renamed to BT_CODEC_LC3_CONFIG.

As an addition, the macros and their input has
also been better documented.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-29 10:24:49 +02:00
Anas Nashif
872f7a9dc4 samples: display: do not build if lvgl is not available
This sample depends on lvgl, so do not try and build it if lvgl is not
part of the workspace and if it was excluded in a local manifest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-28 18:09:26 -04:00
Maureen Helm
fd204f31d4 samples: rtio: Add sensor batch processing sample application
Adds a new sample application that demonstrates using the RTIO subsystem
to read periodic sensor data directly into buffers allocated by the
application, asynchronously process batches of data with an algorithm,
and recycle buffers back for reading additional sensor data.

The sensor iodev in this application is an timer-driven device that
executes one read request per timer period. It doesn't actually send any
transactions to a real I2C/SPI bus or read any real data into the
application-provided buffers. This timer-driven behavior mimics how a
real sensor periodically triggers a GPIO interrupt when new data is
ready.

The sensor iodev currently uses an internal message queue to store
pending requests from the time they are submitted until the next timer
expiration. At least one pending request needs to be stored by the iodev
to ensure that it has a buffer available to read data into. However,
any more than that should probably be handled by the application, since
it's the application that determines how often it can submit new
requests and therefore how deep the queue needs to be.

The sensor iodev is implemented to support multiple instances with
devicetree, but additional work remains to enable and use more than one
in the application.

Tested on native_posix and frdm_k64f.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-06-28 13:53:13 -04:00
Jeppe Odgaard
f49cbc98f9 samples: drivers: led_ws2812: use compatible based filter
Replace 'platform_allow' with 'filter' based on ws2812 compatible
being enabled. This will allow, for example, to run the sample on
mimxrt1050_evk and mimxrt1050_evk_qspi boards.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2022-06-28 16:50:26 +02:00
Jeppe Odgaard
33f942a887 samples: drivers: led_ws2812: add mimxrt1050 boards
Allow mimxrt1050_evk and mimxrt1050_evk_qspi boards to use ws2812.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2022-06-28 16:50:26 +02:00
Gerard Marull-Paretas
69fc9a3d0a boards: esp_wrover_kit: enable SPI if CONFIG_DISPLAY=y
If we enable DISPLAY=y, ILI9341 will be selected automatically if all of
its dependencies are met as well (SPI), let's add this to the board
defconfig.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-28 15:53:10 +02:00
Gerard Marull-Paretas
aeb7475920 samples: display: lvgl: add min_flash/min_ram
LVGL eats a considerable amount of flash, so tests may fail on platforms
that meet all requirements but that have a low amount of flash, e.g.
nucleo_g071rb. Set min_flash for all cases to 250K (result of some quick
experimentation). Also update minimum ram to exclude platforms that
cannot run Zephyr + LVGL (e.g. those with just 16K).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-28 15:53:10 +02:00
Gerard Marull-Paretas
062e2998b4 samples: display: lvgl: filter by zephyr,display chosen
Sample can be built on any board that defines a zephyr,display and has
it enabled.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-28 15:53:10 +02:00
Gerard Marull-Paretas
df7c156996 samples: display: lvgl: adjust harness field
'display' harness doesn't exist, so replace it with 'none' to make
things more clear. It is required so that test is not run e.g. on CI,
test would timeout because the GUI is left ON forever.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-28 15:53:10 +02:00
Gerard Marull-Paretas
d87a37fd76 samples: display: lvgl: remove extra samples
Simplify sample.yaml by just adding a single test case. In future
commits, test case will be refined to be based on DT filters so that it
is made more generic.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-28 15:53:10 +02:00
Steffen Jahnke
612b9247e4 boards: Exclude boards from shield samples
Some of the Panasonic's evaluation boards have limited amount of pins.
So not all arduino pins can be occupied and not all shields are
compatible.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2022-06-28 15:51:55 +02:00
Kumar Gala
14d0bd677e samples: vcnl4040: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-28 08:22:24 -05:00
Kumar Gala
fca571955b samples: ti_hdc: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-28 11:07:50 +02:00
Torstein Grindvik
fe9893ec86 samples: tfm: Enumerate more test variants
Some TFM samples run different test suites/cases based on
which configurations are set.
Enumerate more of these.

For samples/tfm_integration/tfm_psa_test,
add the following new build configurations:
	* Add CONFIG_TFM_PSA_TEST_STORAGE
	* Add CONFIG_TFM_PSA_TEST_CRYPTO
	* Add CONFIG_TMF_PSA_TEST_INITIAL_ATTESTATION

For samples/tfm_integration/tfm_regression_test,
add this to all build configurations:
	* Add CONFIG_TFM_PARTITION_PROTECTED_STORAGE
	* Add CONFIG_TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
	* Add CONFIG_TFM_PARTITION_CRYPTO
	* Add CONFIG_TFM_PARTITION_INITIAL_ATTESTATION
	* Add CONFIG_TFM_PARTITION_PLATFORM
	* Add CONFIG_TFM_PARTITION_AUDIT_LOG

And build the above for CONFIG_TFM_IPC as well.

Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
2022-06-27 15:41:57 -05:00
Benjamin Björnsson
5be2c81222 samples: sensor: sm351lt: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:59:53 -05:00
Benjamin Björnsson
f61607c57c samples: sensor: sht3xd: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:43:51 -05:00
Benjamin Björnsson
bc92171af9 samples: sensor: mpr: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:34:13 -05:00
Benjamin Björnsson
4ce7e2dfb1 samples: sensor: mpu6050: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:31:14 -05:00
Benjamin Björnsson
7322375a07 samples: sensor: max44009: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:23:48 -05:00
Benjamin Björnsson
76785bb12c samples: sensor: max17262: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:18:27 -05:00
Benjamin Björnsson
99c91656bc samples: sensor: isl29035: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 10:10:44 -05:00
Kumar Gala
72cd1c40a6 samples: wsen_itds: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-27 09:47:06 -05:00
Benjamin Björnsson
97275659ac samples: sensor: lsm303dlhc_magn: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 09:40:16 -05:00
Benjamin Björnsson
fc518e1eb0 samples: sensor: lps22hb: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-27 09:34:37 -05:00
Benjamin Björnsson
9d1668b365 samples: sensor: lsm6dsl: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-24 20:29:54 +02:00
Andrzej Głąbek
800b086908 samples: code_relocation_nocopy: Update documentation
Extra steps for programming the external memory on nRF5340 DK are
no longer needed. Now west is capable of handling this itself.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Andrzej Głąbek
788fe5b4bf samples: code_relocation_nocopy: Fix initialization of external memory
Despite the comment it contains, the initialization procedure for
the external memory chip on nRF5340 DK does not enable the High
Performance Mode in the chip, so communication using a frequency
higher than 8 MHz fails and the sample crashes (it works only right
after programming the chip with nrfjprog, which enables the High
Performance Mode, but the chip returns to the Low Power mode after
the board is power-cycled).
This commit fixes the initialization procedure and performs some
additional clean-up.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Andrzej Głąbek
e329353f21 samples: code_relocation_nocopy: Disable gap filling
... to prevent producing a huge (over 700 MB) hex file for nRF5340 DK.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-24 20:29:00 +02:00
Christopher Friedt
9d433c89a2 lib: posix: semaphore: use consistent timebase in sem_timedwait
In the Zephyr implementation, `sem_timedwait()` uses a
potentially wildly different timebase for comparison via
`k_uptime_get()` (uptime in ms).

The standard specifies `CLOCK_REALTIME`. However, the real-time
clock can be modified to an arbitrary value via clock_settime()
and there is no guarantee that it will always reflect uptime.

This change ensures that `sem_timedwait()` uses a more
consistent timebase for comparison.

Fixes #46807

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2022-06-24 20:12:05 +02:00
Benjamin Björnsson
22fd253fea samples: sensor: ccs811: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:52:26 -05:00
Benjamin Björnsson
3710af9a1b drivers: sensor: bmi270: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:46:01 -05:00
Benjamin Björnsson
4ba3e136f1 samples: sensor: bmc150magn: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:40:03 -05:00
Benjamin Björnsson
44b96f9b68 drivers: sensor: dht: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:34:28 -05:00
Benjamin Björnsson
a8586e8409 drivers: sensor: dps310: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:32:19 -05:00
Benjamin Björnsson
f69bf5412f samples: sensor: hmc5883l: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-23 16:24:43 -05:00
Krzysztof Chruscinski
9833ca61c9 logging: Removing v2 suffix from logging names
Renaming objects which had 2 in the name to indicate that
it is v2 specific. Once logging v1 has been removed such
suffixes are redundant.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 15:46:37 -04:00
Maximilian Deubel
1c1c72ea08 ADXL362: Add separate activity/inactivity triggers
This patch modifies the ADXL362 driver to use the new
SENSOR_TRIG_MOTION trigger for activity detection
and SENSOR_TRIG_STATIONARY for inactivity detection.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2022-06-23 10:28:34 -05:00
Krzysztof Chruscinski
041f0e5379 all: logging: Remove log_strdup function
Logging v1 has been removed and log_strdup wrapper function is no
longer needed. Removing the function and its use in the tree.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-23 13:42:23 +02:00
Robert Lubos
fb802fb6c0 samples: net: zperf: Comply with Coccinelle requirements
Cocinelle complains about "shell" being used as a parameter name:

"Violation to rule 5.7 (Tag name should be unique) tag: shell"

Therefore rename the parameter throughout the sample to "sh".

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos
fd2fab1a49 samples: net: zperf: Rewrite download part to use sockets
Rewrite the TCP/UDP download part of the zperf sample to use socket API.
For UDP, performance impact is negligible (< 1 Mbps), for TCP it's
noticable, but still throughputs can be considered satisfactory (up to
~75 Mbps).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Robert Lubos
6c30c9ac47 samples: net: zperf: Rewrite upload part to use sockets
Rewrite TCP/UDP upload part of the zperf sample to use socket API
instead of net_context. This has a negligible impact on the upload
throughputs (< 1 Mbps).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-06-23 11:10:34 +02:00
Marcin Niestroj
46b0f64868 samples: crypto: remove default mbedTLS options
Whenever MBEDTLS_BUILTIN is selected then
CONFIG_MBEDTLS_CFG_FILE="config-tls-generic.h" is set as a default value.

Remove explicit configuration from prj_mtls_shim.conf.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-06-23 09:10:03 +02:00
Emil Gydesen
e211bd8931 Bluetooth: Audio: Fix ASCS stream->conn cleanup
The stream->conn was never unref'ed on disconnect with
unbonded devices.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:09:45 +02:00
Emil Gydesen
17ca15067a Bluetooth: Audio: Fix issue with sending on bidirectional streams
This commit fixes some issues with setting up and
using bidirectional audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:09:45 +02:00
Emil Gydesen
a757fc8c46 samples: Bluetooth: Update unicast audio samples to use bidirectional
Modified the samples such that the client will attempt to
setup 2 sink streams and 1 source stream, basically
representing a headset use case.

This also excercises both setting up a unidirectional
and a bidirectional ISO channel using the 3 audio streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:09:45 +02:00
Emil Gydesen
f404d583ba samples: Bluetooth: Unicast audio client stream send fix
The sample used `net_buf_ref` to send the same data multiple
times on multiple streams, but the send procedure, which
ends up calling bt_conn_send_cb, does not work
with multiple refs. We thus replace the refs with net_buf_clones.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-23 09:09:45 +02:00
Martí Bolívar
f49d11d310 civetweb: remove obsolete code
This code has gone unmaintained and bugs continue to be reported
against it. We do not have the resources as a project to maintain this
in "odd fixes" mode, and nobody has stepped up to maintain it [1], so
sadly this must be removed for now.

If anyone would like to see civetweb supported in upstream Zephyr
again, they are welcome to add it back, as long as they promise to
maintain it going forward.

Many thanks to everyone who has contributed to civetweb support in
Zephyr while it was here. So long and thanks for all the fish.

Fixes: #45807
Fixes: #43910
Fixes: #34226
Fixes: #46743

[1] https://lists.zephyrproject.org/g/devel/message/8466

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-06-22 08:26:13 -07:00
Kai Vehmanen
855adb1514 samples/subsys/audio/sof: fix sys-ticks-per-sec to 15000
The value of CONFIG_SYS_CLOCK_TICKS_PER_SEC has side-effects that
are not expected with tickless kernel mode. In bug #46378, application
code is shown to run slower with higher sys clock tick value. In SOF
bug #5921, audio quality issues were root-caused to k_timer inaccuracy
with 50000 sys clock tick.

Set the the value to 15000 for all SOF applications. All existing
test cases pass with this value.

BugLink: https://github.com/zephyrproject-rtos/zephyr/issues/46378
BugLink: https://github.com/thesofproject/sof/issues/5921
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-06-22 12:28:48 +02:00
Sylvio Alves
3335e612f1 samples: subsys: esp32s2: add configuration file
This sample won't work without custom configuration.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-06-22 12:27:32 +02:00
Benjamin Björnsson
1a246ba5c0 samples: sensor: fxos8700: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-22 12:27:17 +02:00
Emil Gydesen
93eccad72f samples: Bluetooth: Fix timeout for iso_broadcast
The timeout was accidentally changed from 60 seconds
to 0.6 seconds.

This commit also fixes the number of prints, since we are now
sending at 10ms intervals.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-22 12:23:52 +02:00
Vinayak Kariappa Chettimada
8e5e0bd45e samples: Bluetooth: peripheral and central GATT write command use
Samples peripheral_gatt_write and central_gatt_write to
demonstration use of GATT Write Command.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-06-22 12:22:29 +02:00
Aastha Grover
17d64e0bf9 samples: arch: mpu_test: Update Readme.
Update the readme for mpu_test sample to contain
correct sample outputs for mpu read, write and run operations.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-06-21 20:29:15 -04:00
Benjamin Björnsson
d5e37638b2 drivers: sensor: ens210: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-20 08:46:01 -05:00
Kumar Gala
a7dc80f12e samples: ams_iAQcore: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-20 08:25:32 -05:00
Stephanos Ioannidis
ac04889ee0 samples: kernel: condition_variables: Remove unneeded tstack extern
This commit removes the `tstack` symbol extern that is not used
anywhere in this sample.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-06-20 10:25:52 +02:00
Benjamin Björnsson
d7578804dd drivers: sensor: bmm150: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-17 11:09:19 -05:00
Rubin Gerritsen
c8de8e93cd Bluetooth: samples: Remove nrf52840 from iso benchmark platfrom_allow
The controller does not support connected ISO yet, so it does not make
sense to build it form devices that build both host and controller.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2022-06-17 10:49:51 -05:00
Benjamin Björnsson
bc55f57349 drivers: sensor: bq274xx: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-06-17 08:52:44 -05:00
Kumar Gala
384bcc812b samples: apds9960: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as
we work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-16 10:51:42 -05:00
Kumar Gala
25d8b781fb samples: adt7420: Convert sample to use DEVICE_DT_GET
Move to use DEVICE_DT_GET instead of device_get_binding as we work
on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-16 10:35:48 -05:00
Krzysztof Chruscinski
c5f2cdef09 logging: Remove logging v1 from the logging
Remove v1 implementation from log_core and all references in the tree.
Remove modules used by v1: log_list and log_msg.
Remove Kconfig v1 specific options.
Remove Kconfig flags used for distinction between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-16 10:51:15 -04:00
Krzysztof Chruscinski
85f202744d samples: logging: syst: Remove support for logging v1
Remove references to logging v1.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 10:55:26 -04:00
Krzysztof Chruscinski
6ec4aba841 samples: logging: logger: Remove logging v1 support
Remove v1 case from the logger sample.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-06-15 10:54:49 -04:00
Gerard Marull-Paretas
6f9f45d034 samples: remove redundant <zephyr/zephyr.h> includes
Files including <zephyr/kernel.h> do not have to include
<zephyr/zephyr.h>, a shim to <zephyr/kernel.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-15 09:13:11 +02:00
Kumar Gala
8cb69f2c6b samples: amg88xx: Convert sample to use DEVICE_DT_GET_ONE
Move to use DEVICE_DT_GET_ONE instead of device_get_binding as we
work on phasing out use of DTS 'label' property.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-14 09:21:21 -05:00
Veijo Pesonen
e90e1fc539 net: lwm2m: adds disabled SenML JSON to the...
...v1.1 overlay

Shows the dependencies which makes it easier to enable the content
format when necessary

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-06-14 09:31:23 +02:00
Anas Nashif
93685a8e53 samples: remove intel_s1000_crb samples
Remove all samples specific to the intel_s1000_crb board.
The board is no longer supported.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-13 16:19:51 -04:00
Keith Packard
de7a944f40 samples/logging: Make logging sample 'main' return int
POSIX main is supposed to return int, and there's no reason not to have
this example do that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-14 01:50:36 +09:00
Chay Guo
0d64506130 boards: Add I2C and sensor driver support on MIMXRT595-EVK
Enable I2C access to FXOS7000 sensor on the mixrt595_evk board
Tested using samples/sensor/fxos8700 for mimxrt595_evk_cm33.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-13 12:10:57 +02:00
Kumar Gala
bb03af637c drivers: gpio: remove unused HAS_DTS_GPIO Kconfig symbol
All the gpio drivers are based on devicetree and thus we always set
HAS_DTS_GPIO, thus we don't need this Kconfig option anymore.  Remove
uses as its safe to assume DTS is supported for GPIO.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-06-10 09:47:31 +02:00
Anas Nashif
157869338f samples: hci_spi: remove dependency on hw
This test only runs on one platform, so make sure we do not exclude the
only platform using some other hardware related filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-06-09 12:15:28 -04:00
Daniel Leung
cf5a6e816d samples: syst: exclude XCC from C++ tests
The logging subsys has evolved to a point where XCC/GCC cannot
compile anymore as it only supports C++98. So exclude C++
samples from build. And just use XCC/Clang instead for C++.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-09 11:34:41 +02:00
Keith Packard
be606f0932 samples/net/virtual: Increase sprintk buffers to hold parameter types
This sample app uses a stack buffer to hold the interface name which is
generated at runtime using sprintk. The buffer is only sized for the
expected range of values, not the full possible range of the datatype
(int).

To mitigate this, increase the size of the buffer to hold the full range of
an int value.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-09 11:33:09 +02:00
Chay Guo
191f93c325 boards: Add analog comparator support on MIMXRT1170 EVK
Updated mcux_acmp sample to support discrete mode config.
Add ACMP support on MIMXRT1170 EVK.

Signed-off-by: Chay Guo <changyi.guo@nxp.com>
2022-06-09 11:30:49 +02:00
Seppo Takalo
e0296ca0b9 net: lwm2m: Allow initializing opaque and string data to zero length
By default, any string or opaque data that LwM2M engine initializes
sets data lenght to same value as given buffer length for that
resource.

However, on run time, engine keeps track how much data is written
to each resource, so when reading from any resource, should only
return data that has been written there. But uninitialized resources
return the content of the whole buffer.

Fixed the problem by introducing macros INIT_OBJ_RES_LEN(),
INIT_OBJ_RES_MULTI_DATA_LEN() and INIT_OBJ_RES_DATA_LEN() that
allows you to give the amount of data existing in buffer when
the resource is initialized. This sets the data_len and max_data_len
variables correctly.

Also introduced new functions lwm2m_engine_get_res_buf() and
lwm2m_engine_set_res_buf() that distinct between data size and
buffer size. Deprecated the previous functions
lwm2m_engine_get_res_data() and lwm2m_engine_set_res_data()

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-06-09 11:30:37 +02:00
Daniel Leung
fbf0fddbe2 samples: logging/syst: exclude XCC from logging v2 tests
XCC does not support _Generic as it is being used by the runtime
tagged argument feature. So exclude them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 09:31:42 -04:00
Mariusz Skamra
868b180d64 Bluetooth: Make use of BT_CODEC_LC3_CHAN_COUNT_SUPPORT macro
Use the BT_CODEC_LC3_CHAN_COUNT_SUPPORT macro to define the supported
channel counts.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-06-08 12:45:34 +02:00
Emil Gydesen
c513fd87e1 Bluetooth: ISO: Rename sn to seq_num
Rename the `sn` field(s) to `seq_num` to be more readable
and clear what the value covers.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-07 18:53:44 +02:00
Emil Gydesen
65b5db6e3a Bluetooth: ISO: Rename ISO_INTERVAL_MIN/MAX
Rename the BT_ISO_INTERVAL_MIN/MAX to
BT_ISO_SDU_INTERVAL_MIN/MAX to avoid confusing this
the the ISO interval which is different from the SDU
interval.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-07 18:53:44 +02:00
Emil Gydesen
6786bbdb32 Bluetooth: ISO: Add sn and ts to bt_iso_chan_send
Add two new parameters to bt_iso_chan_send:
sn: The packet sequence number which shall be incremeted
per SDU interval.
ts: An optional timestamp value used to synchronize SDUs.

The sequence number in the API uses a 32-bit value even though
the sequence number for the HCI command is 16-bit. This is to
properly handle wrapping of sequence numbers, which is much
easier to do with additional bits allocated.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-07 18:53:44 +02:00
Carlo Caione
86bb739b7b reserved_memory: Remove it and cleanup
The reserved memory mechanism (sections and regions definition) has been
entirely replaced, greatly extended and made it better by the work done
on the zephyr,memory-region compatible.

Since there is are no actual users, we can remove it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-07 09:41:57 -07:00
Gerard Marull-Paretas
29e321d89a samples: drivers: adc: adjust README
- Inform about the requirement to configure ADC channels in Devicetree
- Fix sample output example

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-08 01:17:31 +09:00
Gerard Marull-Paretas
0753dc2a12 samples: drivers: adc: minor fixes and cleanups
- Improve include list, so that file is self-contained
- Don't use an array type for the samples buffer, as its length is 1
- Improve some error messages
- Use PRId16/32 for printing fixed-width signed integers

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-08 01:17:31 +09:00
Gerard Marull-Paretas
765818283c samples: drivers: adc: rely on Devicetree channel configuration
Simplify sample by relying exclusively on channel data from Devicetree.
This change makes sample simpler and more portable at the same time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-08 01:17:31 +09:00
Gerard Marull-Paretas
adbc83fbf6 samples: drivers: adc: configure ADC channel/s in Devicetree
It is now possible to configure ADC channels in Devicetree. This makes
code more portable, since there is no need to hardcode hardware specific
bits in the C sources.

This patch adds channel/s configuration for all support sample overlays.
Hardcoded values have been used:

- Resolution: 12-bit
- Gain: 1
- Reference: internal
- Acquisition time: default

Some nRF channels have been adjusted to include resolution as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-08 01:17:31 +09:00
Gerard Marull-Paretas
b31ecf72df samples: drivers: adc: remove redundant controller labels
The controller name can be obtained from its device name field instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-08 01:17:31 +09:00
Daniel Leung
de4f21c75b samples: logging/syst: catalog msg now support 64-bit arch
This adds to the usual qemu_x86_64 and qemu_cortex_a53 to
the entries for Sys-T catalog message in sample.yaml.
As the Sys-T backend has been updated to support 64-bit
for catalog messages.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 00:15:55 +09:00
Daniel Leung
fee58e8bf7 samples: logging/syst: convert to use integration_platforms
Convert the remaining platform_allow into
integration_platforms so to be consistent.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-06-08 00:15:55 +09:00
Gerard Marull-Paretas
f875d027a0 samples: bluetooth: peripheral_hr: remove pinmux
Remove pinmux dependency, as it is going to be deprecated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-06 15:39:50 -07:00
Gerard Marull-Paretas
5bef7e71dd samples: basic: minimal: remove pinmux
Remove pinmux dependency, as it is going to be deprecated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-06-06 15:39:50 -07:00
Dominik Ermel
2453e4de00 samples/mgmt/mcumgr: Remove info on BT tiny configuration
The BT tiny configuration has been removed some time ago,
but documentation has been still referencing it.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-06-05 14:47:50 +02:00
Carlo Caione
01305942f6 ipc: static_vrings: Support DT-defined buffer size
Recently OpenAMP introduced the possibility to set the sizes for TX and
RX buffers per created instance. Expose this also to Zephyr users by
using a DT property "zephyr,buffer-size".

For the sake of simplicity use the same DT property to set the buffer
size for both TX and RX buffers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-06-05 14:46:18 +02:00
Yuriy Vynnychek
3960bf598c Bluetooth: samples: peripheral_sc_only support for tlsr9518adk80d
Provided sample support for Telink tlsr9518adk80d board.
Set CONFIG_BT_TINYCRYPT_ECC=n (supported by BLE controller).

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-06-05 14:45:10 +02:00
Joakim Andersson
63a65bead0 samples: tfm_integration: Set TF-M profile type to none.
Set the TF-M profile type to none for TF-M integration samples.
If the default profile has been set to something else these samples may
fail.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-06-05 14:42:20 +02:00
Kamil Piszczek
53b70dc012 samples: mcumgr: smp_svr: increase dfu throughput over Bluetooth
Adjusted Bluetooth parameters that have an impact on MTU and DLE
negotiation during a connection.

Enabled the Packet Reassembly feature from mcumgr libraries in the SMP
Server sample with the Bluetooth transport configuration. This change
should increase the overall throughput of the DFU process over
Bluetooth.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-06-05 14:29:42 +02:00
Jose Alberto Meza
72f9797fee samples: drivers: adc: Enable test for mec172xevb_assy6906
Add overlay for mec172xevb_assy6906 board to enable 4 channels.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-06-05 14:29:05 +02:00
Nickolas Lapp
b425627629 RT10xx Power Management: Enable RT1060 Soft Off Mode and Fixup PM API
This PR adds a soft off mode to the RT10xx Power Management API.
Additionally, it corrects the PM API function in rt10xx_power.c to
use the correct function prototype to be properly overridden.

Signed-off-by: Nickolas Lapp <nickolaslapp@gmail.com>
2022-06-05 14:16:43 +02:00
Emil Gydesen
f05e608f9a samples: Bluetooth: Add tx support for unicast audio server
Add support to send mock data on any source endpoint/streams
configured by the client.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-05 14:13:33 +02:00
Emil Gydesen
0334853e42 samples: Bluetooth: unicast_audio_server multi-cis support
Add support for multiple CIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-05 14:13:33 +02:00
Emil Gydesen
21903ab65f samples: Bluetooth: Update unicast audio client to multi-cis
Add support for setting up, configuring, and using
multiple CIS in the sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-05 14:13:33 +02:00
Emil Gydesen
57e1056bef Bluetooth: ISO: Guard sec_level with CONFIG_BT_SMP
The ISO security implementation works by verifying
against the acl (bt_conn) sec_level field. The
bt_conn sec_level field is only available
if CONFIG_BT_SMP is enabled, so this commit
adds guards for all ISO security checks as well.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-06-05 14:12:50 +02:00
Andrzej Głąbek
a78e7c5c90 samples/drivers/adc: Fix output specification
This is a follow-up to commit f5ffd05e6b.

Since twister removes leading spaces from received lines before
further processing, the regular expression for checking the output
produced by the sample cannot contain such space. Also negative
values read from ADC channels need to be allowed.
For consistency, remove the leading space also in the actual string
printed by the sample.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-06-02 16:04:04 +02:00
Gerson Fernando Budke
2ef3fe7bca samples: net: cloud: tagio: Drop pinmux dependency
This dependency it is not required since majoprity of platforms are
working with new pinctrl API. This drops the pinmux dependency.

Fixes #46091

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-05-30 10:31:41 +02:00
Stephanos Ioannidis
c875893e00 samples: clock_control_litex: Fix stale devicetree node reference
This commit fixes the stale reference to the devicetree
`clock0@82005000` node, which was changed in the commit
7b601b7f50.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2022-05-29 16:52:31 -04:00
Keith Packard
d1dc3e823a samples/soc_flash_nrf: Fix printf usage with off_t values
off_t is often unsigned long, which means printf needs to use %lx. Insert
a cast in case the value is unsigned int.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-05-27 15:34:34 -07:00
Fabio Baltieri
e24314f10f include: add more missing zephyr/ prefixes
Adds few missing zephyr/ prefixes to leftover #include statements that
either got added recently or were using double quote format.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-27 15:20:27 -07:00
Kevin Townsend
5d72b5b1a4 samples: tfm: Add fixed PID to custom partition
As per 'Adding Secure Partition' in the TF-M documentation,
every secure partition must have a unique 32-bit partition ID.

If no value is provided, one will be auto-allocated by the
TF-M build system, but this can lead to unpredictable behaviour
in some cases. One example is key derivation where the partition
ID is used as part of the key derivation inputs. Different builds
can results in different PID values being assigned, resulting
in inconsistent key derivation output.

To avoid these problems, this commit sets a fixed PID as a
best pratice.

A value of 1000 has been set to place it within the
'PSA and user Partitions' range (256 - 2999) described in the
documentation.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-27 15:18:01 -07:00
Dominik Ermel
1d6b275c2a samples/mgmt/mcumgr: Fix CDC ACM sample build information
The commit adds missing info on required usb.overlay.

Fixes: #45834

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-05-25 13:51:32 -07:00
Fabio Baltieri
67a0f95aed dts: fix a bunch of odd partition values dts entries
Fix various board fixed-partition definitions where the devicetree cell
has been defined oddly, such as 9 nibbles (which makes no sense since
the cells are 32 bit) or 7 nibbles where all the others are 8.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-05-25 14:21:04 +02:00
Maciej Perkowski
4830cbd802 samples: spi: bitbang: Fix missing pass conditions
The sample did not have defined pass condition and was failing
due to a timeout. Add harness: consol and an explicit regex matching
the sample's output so it can pass on a hw. In addition, a requirement
for a gpio_loopback fixture was added to the sample.yaml.

fixes: #45229

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-05-24 08:57:12 -07:00
Emil Gydesen
12eda22dfe samples: Bluetooth: Fix bad info->flags check in unicast_server
The check did not properly check the info->flags as a bitfield,
and thus never decoded the data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-24 08:50:07 -07:00
Francois Ramu
7054fda0c8 samples: drivers: led ws2812 running on the nucleo h743
Define the configuration through an overlay file
to run the sample on the nucleo_h743zi target board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-24 08:48:33 -07:00
Lukasz Majewski
c5faa3df14 arm: Enable NOCACHE_MEMORY on nucleo_h743zi when littlefs sample is run
It has been validated that the nucleo_h743zi board works correctly,
with '__nocache' buffers and data caches enabled, so this patch enables
support for the former.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-05-24 08:47:20 -07:00
Kevin Townsend
06cd8abde1 samples: tfm_integration: Add missing MPS3 support
Adds mps3_an547_ns to certain TF-M samples to improve
testing in CI by including the Arm Cortex-M55 platform.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-23 15:28:36 +02:00
Kevin Townsend
8a252422c8 samples: tfm_integration: Remove LPC55s69 tests
Removes lpcxpresso55s69_ns from certain sample.yaml files due
to changes required for TF-M 1.6.0 not being added to the
upstream project before the 1.6.0 release.

The NXP SDK available for download from NXP contains the required
updates, but these will need to be committed to TF-M, then made
available in the Zephyr fork, at which point the yaml files here can
have the LPC added back.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-05-23 15:28:36 +02:00
Emil Gydesen
78962268c2 samples: Bluetooth: Broadcast audio scan and adv data size increase
Increases the scan and adv data sizes to better support
the extended advertising data and periodic advertising
data (BASE).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-19 13:21:19 +02:00
Emil Gydesen
a263308cf2 samples: Bluetooth: Audio sample board files cleanup
Clean up some of the board specific configuration files.
Removed all CONFIG_BT_CTLR* configs from the nRF5340
appcore conf files as that does not compile the controller.

Ensured that the ISO buffer in the controller for
nRF52840 can contain SDUs from all BAP LC3 minimum
requirements, as the controller does not yet
support segmentation of SDUs.

Also fixed a few bad configurations (broadcast sink not
enabling the sync support etc.).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-19 13:21:19 +02:00
Christoph Heller
12532ee13d samples: littlefs: Add support for nucleo_h7a3zi_q board
Add specific configuration and DTS overlay files for NUCLEO-H7A3ZI-Q
board to the littlefs example project. The second half of the SOC flash
is used as flash partition for littlefs.

Signed-off-by: Christoph Heller <chris@metanetics.de>
2022-05-18 10:54:36 +02:00
Filip Kokosinski
a0aa8c76d6 samples/philosophers: use stack_data_t type
This commit changes the pointer type used in the philosophers demo to
`stack_data_t *` when stacks are used for synchronization purposes.
The previously used `void *` was causing AMO address-misaligned
exception on the HiFive Unleashed platform.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2022-05-18 10:53:50 +02:00
Francois Ramu
fd5189e6f9 samples: drivers: pwm led running on stm32 boards
On the stm32l073rz nucleo and stm32f091rc nucleo
boards, the DTS pwm-leds node is disabled, because
the output pin might conflict with SPI1.
It is necessary to enable the node in the overlay
to compile and run the sample.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-17 18:20:55 +02:00
Vinayak Kariappa Chettimada
f755550ec0 samples: Bluetooth: Remove explicit Ext and Periodic Adv Kconfig enable
Remove the explicit enable of Extended and Periodic
Advertising support in Controller, the feature is no
longer experimental in the Controller and is now enabled
by default when application uses them by enabling as
Host feature.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-16 18:25:14 +02:00
Felipe Neves
b3611b4cd0 samples: net: wifi: add mikroe wifi bt click
as supported wifi interface for this sample.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-05-15 21:34:32 +02:00
Emil Gydesen
f34c9132d6 Bluetooth: Sample: Add iso get info use to iso connected benchmark
Add a call to bt_iso_chan_get_info for each CIS in the sample
to ensure that we don't attempt to send any data on a CIS
that is RX only.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-15 21:32:19 +02:00
Anas Nashif
8faca29fea tests/samples: fix usage of integration_platforms
integration platforms can't be filtered out, adapt tests so that those
platforms are always available for testing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-14 14:49:59 -04:00
Anas Nashif
bfe16bdc17 samples: logging: fix filtering in yaml file
integration platforms should not be in common section if we have
scenarios with different set of integration platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-05-13 17:25:56 -07:00
Keith Packard
05946ed9b2 lib/libc/minimal: Move sqrt/sqrtf from samples
The lmp90100_evb sample included an implementation of double sqrt, and the
on_off_level_lighting_vnd_app sample included an implementation of float
sqrtf. Move that code into minimal libc instead of requiring applications
to hand-roll their own version.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-05-14 08:49:36 +09:00
Andrzej Głąbek
07b4362bac samples/drivers/adc: Add support for nRF52840 DK and nRF51 DK boards
The overlay for the nRF52840 DK board uses ADC controller child nodes
for specifying channel configurations and it shows how to configure
a channel in differential input mode, so it can serve as an example
of how to use these new possibilities. The overlay for the nRF51 DK
board shows how to use a specific ADC resolution (the default 12 bit
setting is not supported by nRF51 SoCs).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-13 12:46:06 -07:00
Andrzej Głąbek
f5ffd05e6b samples/drivers/adc: Rework to use channel configurations from DT
Allow specifying configuration of channels through child nodes of ADC
controllers. This way analog inputs can be specified for channels in
SoCs that require this and it is also possible, for example, to use
different gain or reference selections for particular channels.

This commit also removes a few former limitations of the sample: now
it is possible to use more than 2 channels and each channel can use
a different ADC controller. Also the ADC resolution to be used can be
specified through devicetree.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-05-13 12:46:06 -07:00
Emil Gydesen
3f247b212b Bluetooth: ISO: Add Kconfig for ISO central/peripheral
Add two new Kconfigs: BT_ISO_CENTRAL and BT_ISO_PERIPHERAL
that is used to do central or peripheral only builds,
similar to the BT_CENTRAL or BT_PERIPHERAL Kconfigs.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-13 12:44:47 -07:00
Francois Ramu
ffa1532be2 samples: drivers flash add a test case for stm32 octospi
This add a new sample application to test and validate
the stm32 octospi driver on the NOR octo-flash present on
stm32 disco kits
There should be a special case to erase the complete flash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-05-12 14:56:25 -05:00
Mahesh Mahadevan
5f5337b9f3 samples: display: Increase Heap size for RT1170 EVK
Increase the heap size for RT1170 EVK to allocate the
display buffers for a 720x1280 display

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-05-12 09:26:50 -05:00
Jimmy Brisson
806ee8601c tests: psa: Allow more time between watchdog resets in qemu
mps2_an521 and mps3_an547 need yet more time with TFM 1.6 to pass their
tests. This change was recomended by RajKumar Kanagaraj. Thanks!

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-05-12 10:33:52 +02:00
Tomislav Milkovic
9a4f148f02 samples: subsys: display: lvgl: add config for stm32f746g_disco
Enable pointer device and set its name in LVGL Kconfig

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-05-12 09:21:46 +02:00
Robert Lubos
7acb31894f samples: net: openthread: Increase main stack size in OT samples
Since the recent OpenThread update, OT needs more stack to initialize,
therefore bump the stack size in samples using OpenThread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-05-11 11:02:57 +02:00
Gerard Marull-Paretas
23225c68c6 samples: basic: servo_motor: delete nrf52840dk wrong overlay
The overlay was accidentally pushed as part of another commit while
doing some pinctrl/pwm tests.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-11 10:49:05 +02:00
Piotr Dymacz
e02acca690 samples: cc13x2_cc26x2: system_off: fix force state usage
This is the same fix as the one introduced in 49520eea57 ("samples: nrf:
system_off: Fix force state usage") for nRF boards. Quoting original
commit:

  The sample cannot spin in an infinity loop because the idle thread
  will not run and consequently the forced state will not be used.

Without this fix, the system doesn't enter SOFT_OFF state:

  *** Booting Zephyr OS build zephyr-v3.0.0-3495-ga456c5274614  ***

  cc1352r1_launchxl system off demo
  Busy-wait 5 s
  Sleep 2000 us (IDLE)
  Sleep 3 s (STANDBY)
  Entering system off (SHUTDOWN); press BUTTON1 to restart
  ERROR: System off failed

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-05-11 10:48:45 +02:00
Henrik Brix Andersen
3f97d11afd drivers: can: convert enum can_mode to a bit field
Convert the can_mode enum to a bit field to prepare for future extensions
(CAN-FD mode, transmitter delay compensation, one-shot mode, 3-samples
mode, ...).

Rename the existing modes:
- CAN_NORMAL_MODE   -> CAN_MODE_NORMAL
- CAN_SILENT_MODE   -> CAN_MODE_LISTENONLY
- CAN_LOOPBACK_MODE -> CAN_MODE_LOOPBACK

These mode names align with the Linux naming for CAN control modes.

The old CAN_SILENT_LOOPBACK_MODE can be set with the bitmask
(CAN_MODE_LISTENONLY | CAN_MODE_LOOPBACK).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-05-11 10:47:54 +02:00
Sylvio Alves
54aa7a9a56 samples: tests: exclude esp32 platform
Remove ESP32 and ESP32S2 from not working samples
and tests. Reason for not working is not enough memory
space in RAM to execute it. This can be worked out as next steps.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-11 10:47:27 +02:00
Esteban Valverde
3158b1bc26 samples: drivers: adding sample to use Cyclone V SoC FPGA DK LCD display
LCD display is connected to the I2C bus SoC bus in the development kit,
this sample guides the user on how to use the LCD display with I2C commands

Signed-off-by: Esteban Valverde <esteban.valverde.vega@intel.com>
2022-05-10 13:29:47 -04:00
Emil Gydesen
83c7baf34a Bluetooth: Audio: Add recv_info to audio recv callback
The audio stream receive callback now contains a
recv_info struct, which contain crucial information
such as timestamps and packet validity.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:28 +02:00
Emil Gydesen
6191a76f55 Bluetooth: Audio: Add _DIR_ infix to BT_AUDIO_SINK/SOURCE
The values represent an enum, and it makes sense for the
enum values to follow the enum type name, so an
_DIR_ infix was added to the values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen
19d7420f07 Bluetooth: Audio: Standadize the use of enum bt_audio_dir
Many functions and struct fields had the directory/type
value, but named in different ways and stored in different ways.

This change updates all uses of it to use the same name
and type.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
Emil Gydesen
6b41e9991d Bluetooth: Audio: Rename enum bt_audio_pac_type
The enum bt_audio_pac_type does not fully
represent the what the value is used for.

The typical use of it is not for just published
audio capabilities (PAC), but rather describes the
type, or direction, of audio endpoints.

For the unicast client, the type/direction is
relative to the unicast server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-10 18:56:00 +02:00
TLIG Dhaou
4de1d01956 boards: stm32: use size helpers to describe size of storage partition
The goal of this commit is to update existing STM32 boards descriptions
to use these size "DT_SIZE" macros to enhance readability. To realize this
i used a python script, which will detect the STM32 Boards
/zephyr/board/arm, and then will update in the dts files the partition
description using "DT_SIZE_K" and "DT_SIZE_M" macros.
Check manually and modify in .overlay files in samples and tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-05-10 09:22:43 -05:00
Maureen Helm
de514bb7d0 dts: arc: synopsys: Move SoC devicetree includes under a vendor dir
Cleans up SoC devicetree include file locations to follow the convention
of dts/<arch>/<vendor>/

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-05-09 17:54:48 -04:00
Gerard Marull-Paretas
1d45511888 samples: fade_led: update include paths
Use the <zephyr/...> prefix.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Gerard Marull-Paretas
d342e4c4c1 linker: update files with <zephyr/...> include prefix
Linker files were not migrated with the new <zephyr/...> prefix.  Note
that the conversion has been scripted, refer to #45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:45:29 -04:00
Erwan Gouriou
d6a4b6b9e4 samples: Migrate overlay includes to <zephyr/...>
Leftover of work done on #45420 and #45417.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-05-09 10:34:42 -04:00
Daniel DeGrasse
49b06dbf9e boards: lpcxpresso55s28/lpcxpresso55s69: add pinmux for lpadc
Add pinmux settings for lpadc to LPCXpresso55s69 and LPCXpresso55s28
boards. Enable ADC driver sample for LPCXpresso55s69, to aid in testing
pinmux settings.

Fixes #45401

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-09 08:56:11 -05:00
Emil Gydesen
d72126d2d9 samples: Bluetooth: Update broadcast audio samples to new API
The broadcast audio source API changed the array type
when creating a source or sink.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Emil Gydesen
6e60451e09 Bluetooth: Audio: Change array of unicast streams to array of pointers
In bt_audio_unicast_group_create, bt_audio_unicast_group_add_streams
and bt_audio_unicast_group_remove_streams to use an array
of pointers, instead of an array of streams.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-05-09 09:28:14 +02:00
Kamil Piszczek
d87552a128 drivers: bluetooth: hci: rpmsg: use chosen to abstract ipc instance
Added chosen syntax in Device Tree to abstract the IPC device that is
used with the IPC service module in the Bluetooth HCI RPMsg driver.
Ported affected boards to declare this alias.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-05-06 14:15:27 +02:00
Kamil Piszczek
d550320af6 dts: arm: nordic: nrf5340: clean up ipc in dts
Cleaned up the IPC configuration for nRF5340 SoC in Device Tree. This
change fixes the (simple_bus_reg) warning about the missing or empty
reg/ranges property.

This is a follow-up to commit cf6a58d.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-05-06 14:15:27 +02:00
Vinayak Kariappa Chettimada
6f84446659 samples: Bluetooth: iso_receive: Print ISO information
Update the sample to print the ISO information like flags,
sequence number and timestamp received in the ISO receive
callback.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-05-06 11:32:11 +02:00
Gerard Marull-Paretas
c7b5b3c419 samples: migrate includes to contain <zephyr/...> prefix
In order to bring consistency in-tree, migrate all samples to the use
the new prefix <zephyr/...>. Note that the conversion has been scripted:

```python
from pathlib import Path
import re

EXTENSIONS = ("c", "h", "cpp", "rst")

for p in Path(".").glob("samples/**/*"):
    if not p.is_file() or p.suffix and p.suffix[1:] not in EXTENSIONS:
        continue

    content = ""
    with open(p) as f:
        for line in f:
            m = re.match(r"^(.*)#include <(.*)>(.*)$", line)
            if (m and
                not m.group(2).startswith("zephyr/") and
                (Path(".") / "include" / "zephyr" / m.group(2)).exists()):
                content += (
                    m.group(1) +
                    "#include <zephyr/" + m.group(2) +">" +
                    m.group(3) + "\n"
                )
            else:
                content += line

    with open(p, "w") as f:
        f.write(content)
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 11:29:59 +02:00
Mariusz Skamra
d43272efdf samples: unicast_audio_server: Remove unused buf pool
The statically defined buffer pool is unused and can be removed.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-05-04 18:57:15 -04:00
Bernardo Perez Priego
7c641e957e samples: sensor: Add sample to demonstrate NPCX ADC Comparator driver
Add sample code that demonstrate the usage for Nuvoton ADC Comparator
driver, this driver is available for NPCX microcontroller family,
this sample is supported on npcx9m6f_evb board.

Signed-off-by: Bernardo Perez Priego <bernardo.perez.priego@intel.com>
2022-05-03 08:51:53 -05:00
Sylvio Alves
7fe5ab315a samples: boards: esp32: add flash encryption sample
Sample code to demonstrate and document ESP32
flash encryption feature.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-05-02 10:30:24 -05:00
Carlo Caione
55dc21ffb9 openamp: Bump to v2022.04.0
Bump OpenAMP to v2022.04.0 and fix Zephyr terminology linked to OpenAMP.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-05-02 08:44:17 -05:00
Maciej Perkowski
bf3cd116e9 samples: tmf: psa: Increase timeout for psa_protected_storage_test
The test takes longer and requires its timeout to be increased
as in this commit.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-04-29 16:22:32 +02:00
Veijo Pesonen
aa42e3e238 net: lwm2m: enable SenML CBOR
With LwM2M v1.1 SenML CBOR is preferred over SenML JSON.

TLV is on by default only with v1.0.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-29 16:10:43 +02:00
Krzysztof Chruscinski
3b990c9ddd samples: shell: shell_module: Add section subcommands
Extend sample to show how to use alternative approach of adding
subcommands using new APIs: SHELL_SUBCMD_SET_CREATE, SHELL_SUBCMD_ADD
and SHELL_SUBCMD_COND_ADD.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-29 14:54:08 +02:00
Vinayak Kariappa Chettimada
2da7a8d786 samples: Bluetooth: hci_rpmsg: Fix Broadcast and Sync Receiver prj conf
Fix Broadcast ISO and Synchronized Receiver project
configurations related to IPC use.

Relates to commit cf6a58d3f6 ("bluetooth: hci: rpmsg:
use ipc service library").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-29 08:57:02 +02:00
Carlo Caione
69b28bfd07 pm: policy: Consider substates for state lock functions
Extend the current pm_policy_state_lock_*() functions to support
substates.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-28 16:32:23 +02:00
Rajkumar Kanagaraj
725ce535f2 sample: tfm: Improve the error handling at tfm_secure_partition NS-side
- Previously non-secure request at the 6th run expected to return status
  "-135 (PSA_ERROR_INVALID_ARGUMENT)" which is the expected status so
  updating "if" condition on the non-secure side handles this expected
  type error status from the secure side.
- update sample YAML harness config regex of Digest message as this gets
  compared at the run of twister.
- Update the readme console logs.

Signed-off-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@linaro.org>
2022-04-28 14:18:24 +02:00
Gerard Marull-Paretas
ae91933c4a drivers: pwm: always use nanoseconds for set
In order to be consistent with what is possible in Devicetree, always
take a period in nanoseconds. Other scales or units may be specified by
using, e.g., the PWM_MSEC() macros (all of them converting down to
nanoseconds). This change then deletes the "_nsec" and "_usec" versions
of the pwm_set call.

Note that this change limits the period to UINT32_MAX nanoseconds,
~4.3s. PWM is, in generali, used with periods below the second so it
should not be a problem.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas
9e964d0a61 samples: basic: servo_motor: use pwm_dt_spec
The sample did not use PWM in a proper way: it relied on a PWM device
handle, but channel or flags were hardcoded in the code. This patch
changes the sample to use a local binding ("pwm-servo") where the `pwms`
property is defined. This allows to make use of pwm_dt_spec facilities,
reducing the overall sample complexity and making it more portable
without editing the source code. The custom binding also requires to
provide the minimum/maximum pulse width so that different servos can be
easily plugged in without the need to edit sources.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas
cd2d867fa6 samples: basic: rgb_led: use pwm_dt_spec
Simplify the sample by using pwm_dt_spec.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas
f60bb8741b samples: basic: fade_led: use pwm_dt_spec
Simplify sample by using pwm_dt_spec.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas
627f9e9ec8 samples: basic: blinky_pwm: use pwm_dt_spec
Simplify the sample by using pwm_dt_spec facilities.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Gerard Marull-Paretas
10ee44c94b drivers/samples/tests: remove usage of deprecated PWM APIs
Use the new API calls that remove pin naming.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-28 11:29:38 +02:00
Keith Packard
6f9f8c1e32 samples, tests: Add z_libc_partition to all test domains
When a memory domain is initialized, the z_libc_partition must be
included so that critical libc-related data can be accessed.

On ARM processors without TPIDRURO when THREAD_LOCAL_STORAGE is enabled,
this includes the TLS base pointer, which is used for several
thread-local variables in the kernel.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Keith Packard
19c8956946 tests: Disable HW stack protection for some mpu tests
When active, z_libc_partition consumes an MPU region which leaves too
few for some MPU tests. Free up one by disabling HW stack protection.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-04-28 11:09:01 +09:00
Aleksandar Markovic
9760c83267 samples: cdc_acm_composite: Use proper type for variable 'read'
Function uart_fifo_read() returns 'int' (it may return negative values
in error cases). Its return value is stored in the variable 'read' that
is, however, of type 'size_t'.

Change the type of the variable 'read' from 'size_t' to 'int' to
accomodate proper handling of uart_fifo_read() invocation.

Coverity-CID: 248408

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2022-04-26 12:05:26 -04:00
Veijo Pesonen
7c6cd4c9e6 net: lwm2m: adds LwM2M v1.1 overlay
Makes possible to enable LwM2M protocol v1.1 features. Uses SenML JSON
as default content format.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-22 09:44:36 +02:00
Andrzej Głąbek
00f878f6f3 samples: bluetooth: mesh_demo: Align with changes in pwm_nrf5_sw driver
- add an overlay file for the bbc_microbit board with specification
  of GPIO that should be used as the PWM output to buzzer
- update a PWM related macro in the microbit specific code to refer
  to PWM channel instead of pin

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-22 09:43:26 +02:00
Andrzej Głąbek
92b3cc78e7 samples: servo_motor: Align with recent changes in pwm_nrf5_sw driver
- add `channel-gpios` property with GPIO assignment for the used PWM
  channel to the `sw_pwm` node
- replace ambiguous "pin 21" in the sample's README with "pin P19"
  that uses notation from the official micro:bit documentation and
  is consistent with this pin number within the edge_connector node

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-22 09:43:26 +02:00
Andrzej Głąbek
34630a81dd samples: bbc_microbit: Align with recent changes in pwm_nrf5_sw driver
- add `channel-gpios` property with GPIO assignments for PWM channels
  to `sw_pwm` nodes
- update PWM related macros to refer to channels instead of pins
- remove no longer needed inclusion of boards/arm/bbc_microbit/board.h

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-22 09:43:26 +02:00
Aleksandar Markovic
7af3b8cbb3 doc: Fix links to Zephyr include directory on Github
At some recent point, directory <zephyr-root>/include was moved to
<zephyr-root>/include/zephyr. However, links from documentation to
Zephyr source on Github were not updated. Update them now.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2022-04-21 18:35:16 -04:00
Daniel Leung
c5244ffa2b samples: logging/syst: build for C++ too
This extends the samples to build for C++ using the same code.
This shows MIPI Sys-T can work C++ too.

The change to main.c regarding to the struct log_msg_ids is
simply that the compiler errored out complaining the members
must be initialized the same order as the declaration.

Also C++ dislikes a string literal being assigned to char*,
so assign them to const char* instead.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-21 11:38:42 -04:00
Peter Mitsis
195072dcd1 samples: syst: Update sample.yaml
Updates the sample.yaml file to exclude problem architectures
from this sample project. SYS-T does not support 64-bit or
big endian architectures. The posix arch is excluded as it
is generating numerous anomolous runtime messages because it
does have the means to determine when data resides in the
rodata section.

It also converts the list of allowed platforms to lists of
platforms to use for integration testing. This helps to increase
general testing coverage.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-04-20 10:25:16 -04:00
Aastha Grover
7141c8763f sample: syst: Add intel_adsp_cavs support
Adding configurations for enabling this sample project on cavs
platforms. This patch also contains a fix to mipi_syst library
which resolves the memory alignment issue across different
architectures.

Fixes #43344

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2022-04-20 10:25:16 -04:00
Glauber Maroto Ferreira
a58193a333 esp32: samples: overlays: use pin states
Updates samples' overlays to use pin states.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-04-20 13:27:47 +02:00
Anas Nashif
e2a3e72a02 samples: synchronization: use k_thread_cpu_pin
Use shortcut API to pin thread to a CPU.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 13:05:09 -04:00
Anas Nashif
2d97bdd85d samples: add module requirement into samples
Do not build those samples if the needed modules are not available in
the workspace.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-19 09:38:55 -04:00
Aleksandar Markovic
8a32b05905 doc: Fix spelling errors in .rst files
Fix spelling errors in assorted .rst files. The errors were found
using a tool called 'codespell'.

Signed-off-by: Aleksandar Markovic <aleksandar.markovic.sa@gmail.com>
2022-04-19 11:48:26 +02:00
Kai Vehmanen
33ede77bed samples/subsys/audio/sof: enable CONFIG_LOG_PRINTK
Route printk()'s through logging subsystem. This is required
to get clean OS panics in log output. If this is not defined, e.g.
the stack backtrace is mixed with the Zephyr OS panic information.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-04-19 11:47:26 +02:00
Yuval Peress
aaf0c6e827 modules: chre
Add initial build rules for CHRE. This change includes a Kconfig and
CMakeLists.txt to begin compiling code from the CHRE module.
Additional files are included to bridge the APIs from CHRE's to
Zephyr's. These can be found in modules/chre/include and
modules/chre/src.

Additionally, add a sample to make sure that the module builds. It can
be built via:

```
$ west build -b native_posix -p=always samples/application_development/chre
```

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-18 13:21:52 -05:00
Krzysztof Chruscinski
b9a25568aa samples: logging: dictionary: Add frontend support
Extended sample to support UART dictionary frontend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-04-13 13:45:36 -07:00
Jamie McCrae
51e3cecb31 doc: mcumgr: Fix reference formatting
Documentation build for 2.7 was failing due to using only a single
character instead of double for showing a module name.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-04-13 13:40:16 -07:00
Nicolas Pitre
5393103084 hello_world_user: don't always assume userspace
Print whether or not the code is actually in usermode.
Fail the execution with an assertion if not the case.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2022-04-13 13:29:52 -07:00
Lauren Murphy
2faa6f5c0b samples: misc fixes to docs
Changes console blocks in hello_world and magic_wand tflite-micro
samples to Kconfig blocks to match content. Fixes typos in
some networking samples so that code blocks display instead
of being hidden. Fixes path to litex-vexriscv-tflite.resc.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-04-12 08:33:32 -04:00
Szymon Czapracki
af2e781f5a Bluetooth: Immediate Alert Service
This commits adds IAS for zephyr bluetooth.

Signed-off-by: Szymon Czapracki <szymon.czapracki@codecoup.pl>
2022-04-12 09:59:34 +02:00
Veijo Pesonen
3071173e87 samples: lwm2m: enables LwM2M shell commands
Makes LwM2M SEND operation possible.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-04-12 09:57:20 +02:00
Yuval Peress
a98f5d719e samples: Normalize .cc extensions to .cpp
Rename all .cc files to .cpp (note that no .hh files were found).
Addresses #44196

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-11 16:09:21 -05:00
Jimmy Brisson
dd8260cdcb samples: psa-firmware: Correct readme instructions
Prior instructions were incomplete, included extra, unneeded ways to
build the app.

This should simplify the instructions.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Jimmy Brisson
0dcd6bd58a modules-tfm: Configure image versions with KConfig
Previously, you were required to set the image versions through the
CMake variables TFM_IMAGE_VERSION_{S,NS}. For better integration with
the rest of the zephyr build system, these are now KConfig variables
with the same name.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Jimmy Brisson
b6d4788297 samples: psa-firmware: Display active Secure firmware version
This displays the secure firmware version before the nonsecure firmware
version at the beginning of boot.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Jimmy Brisson
57cefda9ae samples: psa-firmware: Document purpose of split-header.py
This should provide context to this small python script

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Jimmy Brisson
6ec7e7b6e0 samples: psa-firmware: Push firmware over psa_fwu_write
Previously, the example was a scheleton. This patch
pushes firmware images with psa_fwu_write, and completes
the firmware update example.

Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Kevin Townsend
eacae5e4e9 samples: tfm: PSA firmware update sample
This commit adds a sample application demonstrating how to use
the PSA Firmware Update API from TF-M. It also enables the
`FIRMWARE_UPDATE` partition to be included at build time.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
Signed-off-by: Jimmy Brisson <jimmy.brisson@linaro.org>
2022-04-08 15:52:01 -07:00
Yuval Peress
53ef68d459 include: Prefix includes to use a scope
Move include paths and add new target_include_directories to support
backwards compatibility:
* /include -> /include/zephyr
  example: <irq.h> -> <zephyr/irq.h>

Issue #41543

Signed-off-by: Yuval Peress <peress@google.com>
2022-04-08 19:03:32 +02:00
Alexander Wachter
b0089162e9 samples: net: socket: can: Remove LOG immediate config
Do not log immediate in the sample, because it causes stack overflows.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2022-04-08 09:31:51 +02:00
Alexander Wachter
55255a5ad4 samples: net: sockets: socketCAN: add loopback mode
Add loopback mode config to the sample so that the code
can be tested without an actual CAN network, but wit a
single board.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2022-04-08 09:31:51 +02:00
Abe Kohandel
f1e75dea50 bluetooth: ots: notify application prior to object name change
This change augments the application object name change notification to
occur prior to the actual name change done by the OTS layer.

Notifying prior to the actual name change makes it possible to inform the
application of the current name of the object as well as the new name.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2022-04-08 09:31:31 +02:00
Anas Nashif
6d15643705 tests: fix filtering on integration platforms
Fixed filtering on integration platforms.

Fixes #39738

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-08 09:31:01 +02:00
Anas Nashif
2e65ee17f6 tests: eeprom: fix integration_platforms
Fix usage of integration_platforms. Do not set it when the board is
excluded using some other filters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-04-08 09:31:01 +02:00
Titouan Christophe
1d89cc5ad8 boards: shields: x_nucleo_53l0a1: new shield
Add support for the X-NUCLEO-53L0A1 expansion board and an
accompanying sample application

Signed-off-by: Titouan Christophe <moiandme@gmail.com>
2022-04-07 14:30:01 -05:00
Gerard Marull-Paretas
e70e2fe4df samples: basic: blinky_pwm: delete overlay with LEDs not on board
Samples should run on a board if they have the peripheral connected, in
this case, if any LED on the board is connected to a PWM output. A
shield could be used to demonstrate a sample on a board that doesn't
have the required peripheral. In this case, it was also unclear where
that "external LED" had to be connected, unless one checks where channel
1 for PWM1 is routed to. All board LEDs are connected to pins that
cannot be driven by PWM.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:16 +02:00
Gerard Marull-Paretas
bca7e65465 boards: arm: nucleo_l073rz: define PWM LEDs
The board had PWM LEDs defined in the blinky_pwm sample, mainly because
it conflicts with SPI1 pinmux. A better approach is to still define the
PWM LEDs in the board but keep the PWM controller disabled by default.
Then, samples just need to enable the PWM controller (and disable SPI if
used simultaneously).

Also updated period to 20ms (reasonable value for a PWM-driven LED).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:16 +02:00
Gerard Marull-Paretas
855cb90b6a boards: arm: nucleo_l4r5zi: define PWM LEDs
The board had PWM LEDs defined in the blinky_pwm sample, mainly because
it conflicts with SPI1 pinmux. A better approach is to still define the
PWM LEDs in the board but keep the PWM controller disabled by default.
Then, samples just need to enable the PWM controller (and disable SPI if
used simultaneously).

Also updated period to 20ms (reasonable value for a PWM-driven LED).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:16 +02:00
Gerard Marull-Paretas
a65cec3042 boards: arm: nucleo_f091rc: define PWM LEDs
The board had PWM LEDs defined in the blinky_pwm sample, mainly because
it conflicts with SPI1 pinmux. A better approach is to still define the
PWM LEDs in the board but keep the PWM controller disabled by default.
Then, samples just need to enable the PWM controller (and disable SPI if
used simultaneously).

Also updated period to 20ms (reasonable value for a PWM-driven LED).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:16 +02:00
Gerard Marull-Paretas
5c61e4444b samples: fade_led/blinky_pwm: add pwm-leds compat check to filter
While the pwm-led0 alias may exist, it could happen that the node with
pwm-leds compatible is disabled, making the sample fail compilation.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-07 09:35:16 +02:00
Henrik Brix Andersen
40982395b9 samples: drivers: can: remove mcp2515 build-only configuration
Remove the MCP2515 build-only configuration from the CAN driver sample
application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-04-06 11:23:06 +02:00
Casper Bonde
52843f7f9d Bluetooth: BAP: use codec configuration parameters for LC3 processing
Replace hardcoded LC3 codec config with the selected configuration
used in the GATT profiles.
The selected codec configuration on the client will be used on both
sides for LC3 encode/decode.
This required completing the LC3 macroes for building codec
cababilities and codec configuration as they were not setting the
max_frames_per_sdu and frames_per_sdu values.
So as a side effect this change adds the capability to pack multiple
audio frames into a single SDU - tested with 2 frames every 20ms.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2022-04-06 11:00:20 +02:00
Emil Gydesen
ffedee6e39 Bluetooth: ISO: Change ISO recv flags to bitfield
Change the receive flags in the struct bt_iso_recv_info
to a bitfield instead of a single value. This will allow
us to extend the flags with more options.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-06 11:00:10 +02:00
Joakim Andersson
b34a944136 samples: psa_crypto: Fix error handling and logging
Fix err and sys_token_sz not initialized when used.
Fix logging of uint32_t variables as signed.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-05 11:18:49 +02:00
Joakim Andersson
94505c6604 samples: psa_crypto: Fix size of hash field in sign hash call
Fix argument to psa_sign_hash call. Sending in the size of the hash
buffer instead of the size of the hash.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-04-05 11:18:49 +02:00
Gerard Marull-Paretas
c925b5991a include: remove unnecessary autoconf.h includes
The autoconf.h header is not required because the definitions present in
the file are exposed using the compiler `-imacros` flag.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-04-05 11:18:20 +02:00
Jamie McCrae
9ecc7ddff8 doc: Add link to J-Link virtual MSD disable for SMP
Virtual MSD J-Link support on some development boards has caused an
issue with SMP due to limiting the maximum size of UART data via the CDC
endpoint, add a link to the SMP documentation and smp_svr sample
application on how to disable MSD functionality and resolve the issue.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-04-04 13:03:33 +02:00
Vinayak Kariappa Chettimada
7b9ef30b53 tests: Bluetooth: bsim: Increase to 250 simultaneous connections.
Increase to 250 simultaneous connections in the BabbleSim
test. Update connection interval to accommodate 250
non-overlapping connections and a scan window. And make the
use of is_disconnecting flag consistent between central and
peripheral sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-04-04 10:24:34 +02:00
Emil Gydesen
9dd7efa4f1 samples: Bluetooth: Add broadcast audio sink sample
Add sample for the Basic Audio Profile (BAP) broadcast
audio sink role, that can scan for a receive audio
data over ISO from BAP broadcast sources.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-02 15:39:48 +02:00
Emil Gydesen
a84d2b2e1a samples: Bluetooth: Add broadcast audio source sample
Add a sample using the Basic Audio Profile (BAP)
broadcast source role, that advertises mock audio
data over ISO.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-04-02 15:39:48 +02:00
Andrzej Głąbek
bc26629ba8 dts: nrf: Rename "nordic,nrf-watchdog" compatible to "nordic,nrf-wdt"
For consistency with the scheme used for other nRF peripherals,
use the peripheral name that nRF Product Specifications use.
In this case, it is WDT, not WATCHDOG.

Also remove the requirement for the label property in the binding.
It is no longer needed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-02 15:14:38 +02:00
Andrzej Głąbek
79cc5a96bd dts: nrf5340: Use dual compatible property for mbox nodes
This is a follow-up to commit cf6a58d3f6.

Restore the "nordic,nrf-ipc" compatible property in mbox nodes for both
nRF5340 cores and use it together with the new "nordic,mbox-nrf-ipc"
one. This way either the MBOX or the IPM driver can be used for these
nodes without further modifications. This eliminates the need to use
overlays in quite a few cases, so remove all those no longer needed
ones (which are also a bit confusing now as they refer to no longer
existing ipc@2a000 and ipc@41012000 nodes).

Restore also the ipc node label removed in the commit mentioned above,
as the label is used in validation of base addresses of nRF DT nodes.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-04-02 15:14:38 +02:00
Carlo Caione
35e058bcad sample: static_vrings: Use NOCOPY capability.
At least for one of the instances, use the NOCOPY feature of the
backend.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-04-01 09:05:06 -05:00
Daniel Leung
5e9f1722a9 samples: logging/syst: add README
Add a README.rst on how to build the MIPI Sys-T logging sample
and how to parse the output.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung
97dd0ec684 samples: logging/syst: build for catalog messages
This adds to sample.yaml to build for MIPI Sys-T catalog message
support.

Note that the current implementation of emitting Sys-T
catalog messages does not support 64-bit and architectures
having additional alignment requirements. So only allow qemu_x86
and mps2_an385 at the moment.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung
a3b31149cb samples: syst: allow some 64-bit boards
This adds qemu_x86_64 and qemu_cortex_a53 to make sure 64-bit
support for Sys-T is not broken in the future.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung
f7047c4026 samples: logging/syst: update sample for combined strings
Compilers often combine strings to conserve space, if one string is
a perfect substring of another one towards the end. So add another
string in the test to make sure sys-t with catalog messages is still
working correctly under this scenario.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Daniel Leung
2e859368bd tests: logging/dictionary: update test for combined strings
Compilers often combine strings to conserve space, if one string is
a perfect substring of another one towards the end. So add another
string in the test to make sure dictionary logging is still working
correctly under this scenario.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00
Johann Fischer
6be45c2a18 usb: move USB device stack code to own directory
Until now the whole USB device stack code is located
in the top subsys/usb directory. Move it to own directory
in preparation for upcoming extension and rework of USB support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-03-31 18:30:14 +02:00
Martijn Stommels
0b1f97031a usb: dfu: update sample README
Some information in the USB DFU sample was out of date.

Also added some example lines for the Permanent download and automatic
reboot features.

Signed-off-by: Martijn Stommels <martijn@martijnpc.nl>
2022-03-31 15:33:16 +02:00
Martijn Stommels
49cb6537be usb: dfu: add permanent download and automatic reboot
This commit adds the USB_DFU_PERMANENT_DOWNLOAD and USB_DFU_REBOOT and
symbols.When the permanent download symbol is enabled, slot 1 will be
marked as confirmed. With the reboot symbol enabled, the devices
automatically reboots after the download is completed.

The functionality is split into two symbols to allow the automatic
reboot without confirming the image. This enables image confirmation via
another channel. For example via the shell’s Mcuboot commands.

This functionality allows downloading an image to the device without the
user having to interact with the device. It is useful in cases where
ease of use is more important then safety. For example  when using USB
download for daily development. This is especially applicable for
devices with a closed case.

The changes were tested on an nrf52840dk. The following line can be used
to build the USB DFU example with the symbols enabled.

west build -b nrf52840dk_nrf52840 zephyr/samples/subsys/usb/dfu \
-d build-dfu -- -DCONFIG_BOOTLOADER_MCUBOOT=y \
-DOVERLAY_CONFIG=overlay-reboot-permanent.conf \
-DCONFIG_MCUBOOT_SIGNATURE_KEY_FILE\
=\"bootloader/mcuboot/root-rsa-2048.pem\"

Fixes #41921

Signed-off-by: Martijn Stommels <martijn@martijnpc.nl>
2022-03-31 15:33:16 +02:00
Gerard Marull-Paretas
efd2872e43 samples: drivers: soc_flash_nrf: use DEVICE_DT_GET
Flash device can be obtained at compile time using DEVICE_DT_GET.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Gerard Marull-Paretas
f8c0e3907e samples: drivers: flash_shell: use DEVICE_DT_GET_OR_NULL
The optional flash device can be obtained at compile time using
DEVICE_DT_GET_OR_NULL. Init code has been adjusted so that flash_dev is
forced to NULL when device is not ready (user can later specify the
device manually).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Gerard Marull-Paretas
d3f8d75e70 samples: boards: reel_board: mesh_badge: use DEVICE_DT_GET
Obtain flash device at compile time using DEVICE_DT_GET.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Gerard Marull-Paretas
abe3c1d3c5 samples: arch: mpu: mpu_test: use DEVICE_DT_GET
Use DEVICE_DT_GET to obtain the flash device at compile time. Add
readiness check at main.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-31 13:55:10 +02:00
Francois Ramu
8043fb922a samples: blinky pwm running on the nucleo_l4r5zi
Adding an overlay to configure the nucleo_l4r5zi for testing the pwm
blinky application on red led (PB14 on nucleo board)
Each has a specific pwm output from different timers/channels

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-31 10:28:47 +02:00
Katarzyna Giadla
681e3a16c7 tests: Change duplicated names of the test cases
Some names of the test cases are duplicated within the project.
This commit contains the proposed names of the test scenarios.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-03-30 17:42:01 -04:00
Casper Bonde
237e3c8127 Bluetooth: BAP: Add LC3 lib to BAP sample applications
LC3 codec integration into BAP Unicast client and server
sample applications.
Will be enabled by default for a native_posix and nrf5430
cpuapp builds.
The client will continuously transmit a LC3 encoded 400Hz
sine wave and the client will receive and decode the data.
Implementation verified using UART based HCI controller
with ISO interface (userchan.c modified to open the UART
directly as bluez do not have support for ISO data) as well
as on-target execution on the nrf5340.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
Co-authored-by: Emil Gydesen <Thalley@users.noreply.github.com>
2022-03-30 14:18:01 +02:00
Tomislav Milkovic
694ad59dcf samples: subsys: display: lvgl: add config for stm32h7b3i_dk
Add configuration for stm32h7b3i_dk board which enables
integration of touch controller (KSCAN) present on the board
into LVGL

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
2022-03-29 18:30:02 -07:00
Emil Obalski
764f9fc6f9 ipc_service: samples: Remove redundant config options from samples
This change remove options that no longer needs to be set in
configuration file.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-03-29 12:30:50 -07:00
HaiLong Yang
823b468890 samples: spi_flash: add gd32f450i_eval and gd32vf103v_eval boards
This add gd32f450i_eval and gd32vf103v_eval boards to spi_flash sample.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-03-29 10:21:15 -05:00
Carlo Caione
92d8329d5b ipc_service: static_vrings: Move to one WQ per instance
Instead of having one single WQ per backend, move to one WQ per
instance instead and add a new "zephyr,priority" property in the DT to
set the WQ priority of the instance. Fix the sample as well.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-03-28 12:46:15 +02:00
Henrik Brix Andersen
2f43226b3d modules: canopennode: CANopenNode does not support CAN-FD
The CANopenNode stack does not support CAN-FD. Depend on it being
disabled and explicitly disable it in the CANopenNode sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-25 15:35:10 -07:00
Emil Gydesen
9c2cf4ded5 Bluetooth: Host: Add auth_info_cb struct
Add a new callback structure for Bluetooth authentication

This struct is meant to replace the information-only
callbacks in bt_conn_auth_cb. The reason for this is that
due to the nature of bt_conn_auth_cb, it can only be registered
once. To allow mulitple users gain information about pairing
and bond deletions, this new struct is needed.

Samples, tests, etc. are updated to use the new struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:17:18 -07:00
Emil Gydesen
9e862411b3 Bluetooth: ISO: Add STATE infix for ISO state enum
Change from BT_ISO_<state> to BT_ISO_STATE_<state>
to make the value more descriptive.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-25 15:36:02 +01:00
Mariusz Skamra
6eafc64855 Bluetooth: audio: Enable auto ATT MTU Exchange for BASS and unicast client
This enables automatic MTU exchange for services that require MTU size
bigger than default ATT MTU to operate.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-25 10:41:19 +01:00
Gerson Fernando Budke
c1ad9c39e4 drivers: pinctrl: Drop obsolete atmel sam/sam0 entries
Drop all old and obsolete atmel sam/sam0 pinctrl entries.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
9b40960926 drivers: serial: Update sam0 drivers to use pinctrl
This update Atmel sam0 serial drivers to use pinctrl driver and API. It
updates all boards with new pinctrl groups format.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
0f472f6d1b drivers: sensors: Update sam qdec driver to use pinctrl
This update Atmel sam qdec sensor driver to use pinctrl driver and API.
It update board and sample with new pinctrl groups format.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Gerson Fernando Budke
bd485ea960 drivers: adc: Update sam afec driver to use pinctrl
This update Atmel sam afec driver to use pinctrl driver and API. It
updates all boards with new pinctrl groups format. In addition, it
add overlay files to allow run samples/drivers/adc example.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2022-03-24 15:45:37 -07:00
Constantin Krischke
8ee675946c modbus: stop bits can now be set individually in client mode
Added the stop_bits_client parameter to the modbus_serial_param struct.
Being able to configure the number of stop bits for the client
independently from the parity setting, allows to support connecting to
modbus server that do not follow the MODBUS over Serial Line Specification
and Implementation Guide.

Signed-off-by: Constantin Krischke <constantin.krischke@lemonbeat.com>
Signed-off-by: Jan Geldmacher <jan.geldmacher@lemonbeat.com>
2022-03-24 08:23:17 -04:00
Jamie McCrae
2681c6dfb8 samples: subsys: mgmt: smp_svr: Fix dupicate fs mgmt registration
This fixes an issue with the filesystem mcumgr being registered twice
in the sample application which resolves an issue with an endless loop
if a mcumgr handler is used which is not registered.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-03-24 11:56:48 +01:00
Gerhard Jörges
4fd24a4341 libc: minimal: Add strtoll() and strtoull()
- strtoll() and strtoull() are copies of strtol() and strtoul() with
  types changed to long long instead of long.
- added tests
- added documentation
- removed stubs from civetweb sample

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2022-03-24 11:03:06 +01:00
Matthias Fend
b83b72beec samples: ipc: openamp_rsc_table: do not enable CONFIG_IPM_MCUX
This is a device-specific option and should therefore not be activated in
a generic project. Since the only boards that use this Kconfig symbol
(lpcxpresso54xx, lpcxpresso55sxx) don't build anyway, this option could
be removed. The device/board specific configuration should be placed in
the boards folder along with an appropriate device tree describing the
IPC nodes.

Signed-off-by: Matthias Fend <matthias.fend@emfend.at>
2022-03-24 10:41:39 +01:00
Lauren Murphy
5e8b7b5b37 samples: tflite-micro: fix hello_world README
Corrects number of loops mentioned in README of sample
to match NUM_LOOPS in main.c. NUM_LOOPS was lowered in
PR #41123 to reduce the noise the sample produced in CI,
but the PR missed changing the README.

Cleans up one line.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-03-23 16:51:22 -04:00
Jonathan Rico
10025bdc86 samples: Bluetooth: hci_rpmsg: Fix event buffer handling
This fixes an issue where we dropped the send buffer when
ipc_service_send() timed out waiting for a shared memory buffer.

We now wait in the IPC RX endpoint, but this shouldn't be a problem for
other IPC users, as PR #43806 introduces separate workqueues
per instance, with configurable priorities.

This also includes small changes regarding the IPC service return value.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2022-03-23 12:54:26 +01:00
Emil Obalski
66a8d5baef ipc_service: samples: Add sample that uses icmsg backend
Add sample to demonstrate newly introduced backend (icmsg).

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2022-03-22 12:36:39 +01:00
Daniel DeGrasse
f1b3f00114 boards: remove pinmux usage for acmp peripheral
Remove pinmux usage for acmp peripheral on kinetis boards, as mcux_acmp
driver supports pinctrl

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-22 12:36:04 +01:00
Daniel DeGrasse
d0c535924f boards: remove unused adc pinmux from kinetis boards
adc16 driver supports pinctrl, so remove unused pinmux from kinetis
boards

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-22 12:36:04 +01:00
Benjamin Björnsson
ab6f5cf077 boards: arm: Add support for Arduino Nicla Sense ME
This commit adds support for the Arduino Nicla Sense ME board.
The board functionality has been tested using the samples:
- hello_world
- philosophers
- peripheral_dis
- spi_flash

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-03-21 18:37:05 +01:00
Harshil Bhatt
0e3e344391 samples: subsys: console: Fix typo in README file
Fixed typo in samples/subsys/console readme

Signed-off-by: Harshil Bhatt <harshilbhatt2001@gmail.com>
2022-03-21 17:55:08 +01:00
Gerard Marull-Paretas
452133cf47 samples: out_of_tree_board: port nRF board to pinctrl
nRF boards are expected to use pinctrl now, so port this sample as well.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
504e6cb10b samples: boards: nrf: dynamic_pinctrl: remove existing configs
The nrf52840dk_nrf52840 board has been ported to pinctrl, so there's no
need to keep duplicated definitions in the sample anymore.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
117a352b5a samples: code_relocation_nocopy: use pinctrl for nRF noard
The sample relied on `-pin` properties from QSPI node, move to pinctrl.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
1ff2b365ad samples: sensor: icm42065: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
9a265b03b4 samples: sensor: ccs811: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
c7b808b810 samples: sensor: adxl362: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
1ad24c5ac7 samples: net: wifi: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
4adc0b512d samples: drivers: spi_flash_at45: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
b4368d8e37 samples: drivers: i2s: echo: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
a3dfcdaec1 samples: drivers: audio: dmic: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
27c5d39a47 samples: boards: nrf: nrfx_prs: migrate to pinctrl
nRF boards now require usage of pinctrl, migrate the sample and
overlays.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Gerard Marull-Paretas
e3dd5c784d samples: bluetooth: hci_spi: use pinctrl for nrf board overlay
nRF boards now require usage of pinctrl, migrate them.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-21 15:09:28 +01:00
Henrik Brix Andersen
67ba9900f0 drivers: can: add struct device argument to callback functions
Include a pointer to the CAN controller device for the CAN
transmit, receive, and state change callback functions.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-19 14:31:22 -04:00
Nazar Kazakov
f483b1bc4c everywhere: fix typos
Fix a lot of typos

Signed-off-by: Nazar Kazakov <nazar.kazakov.work@gmail.com>
2022-03-18 13:24:08 -04:00
Andrzej Głąbek
a5234f3647 soc_nrf_common: Extend and rename the NRF_DT_ENSURE_PINS_ASSIGNED macro
Extend the macro with checks for DT properties related to pin
assignments that are defined but would be ignored, depending on
whether PINCTRL is enabled or not, what presumably indicates
a resulting configuration different from what the user expects.

Add also a possibility to indicate that the pinctrl-1 property
should not be checked because the caller does not support the
sleep state.

Rename the macro so that its name better reflects its function.
Update accordingly all drivers that use it.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-18 16:26:21 +01:00
Anas Nashif
1e4027aa7c samples: prefix should be sample, not samples
convention is to start sample identifiers with sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-03-18 10:50:57 -04:00
Kamil Gawor
3e9dfdd850 bluetooth: samples: hci_uart: Add Direction Finding doc
Add the Direction Finding documentation section into
the sample README.rst file.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2022-03-18 12:00:03 +01:00
Kamil Gawor
5ed949cfc1 bluetooth: samples: hci_uart: Add nrf5340 antenna description
Adds antenna description for the nrf5340dk_nrf5340_cpunet
target. It allows to performthe Direct Test Mode with the
CTE feature on this target.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2022-03-18 12:00:03 +01:00
Kamil Gawor
2f4843f60b bluetooth: samples: hci_uart: Add support for nrf52833dk
Adds support for the nrf52833dk_nrf52833 which supports
the Direction Finding feature. It allows also to perform
the Direct Test Mode with the CTE feature.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2022-03-18 12:00:03 +01:00
Piotr Pryga
21a64561a5 samples: Bluetooth: df: fix wrong GPIO assignment for ant switching
There were wrong GPIOs assigned for antenna switches.
Used pins were assigned to other peripehrals so that
there were no outpus printed.

The samples should use GPIOs that are not assigned to any
peripheral.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-03-18 10:21:19 +01:00
Gerard Marull-Paretas
6c261f2e5a samples: hello_world: remove redundant header
<zephyr.h> ends up pulling <sys/printk.h> via <kernel_includes.h>, so
simplify the sample.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-17 17:40:11 -04:00
Guennadi Liakhovetski
63a109e17f sof: disable the System Agent
The SOF System Agent is redundant under Zephyr, we're using different
performance monitors there.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-03-16 18:33:58 -04:00
Gerard Marull-Paretas
5a71eeb35c pm: policy: move constraints to policy API
The pm_constraint_* APIs were effectively used by the policy manager
only. This patch renames the API to the policy namespace and makes its
naming more explicit:

- pm_constraint_set -> pm_policy_state_lock_get()
- pm_constraint_release -> pm_policy_state_lock_put()
- pm_constraint_get -> pm_policy_state_lock_is_active()

The reason for these changes is that constraints can be of many types:
allow/disallow states, impose latency requirements, etc. The new naming
also makes explicit that the API calls will influence the PM policy
behavior.

All drivers and documentation have been updated accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-16 15:26:47 +01:00
Mariusz Skamra
145948efa0 Bluetooth: audio: Remove BT_CODEC_META_CONTEXT_* defines
There are no more context defines specific to metadata, the ones
coming from Assigned Numbers shall be used.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-03-16 10:25:31 +01:00
Piotr Pryga
f7f6a5544b samples: Bluetooth: df: Add missing harness to DF sample.yaml
Some build configurations in direction finding samples
sample.yaml didn't have harness=bluetooth. That enables
these configurationsto be be executed on hardware by
CI. Those runs end causing CI failures.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-03-15 12:15:26 -04:00
Lukasz Majewski
d7cd42699b fs: littlefs: sample: Generate fname[12] strings after mount
The littlefs_mount() function sets the mount point for block devices,
so fname[12] shall be generated after calling it.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
2c8a7e7757 fs: littlefs: Extend sample program to test block devices
Up till now, the littlefs sample program was only supporting the flash
medium. However, it would be also welcome to be able to test reading and
writing data from littlefs stored on block devices - like SD card.

In this case we do use the block API, to read and write data to it.
To achieve this goal - the CONFIG_APP_LITTLEFS_STORAGE_BLK_SDMMC define
has been introduced.

One can change the disk mount point by defining board specific
CONFIG_SDMMC_VOLUME_NAME.

The test for nucleo board equipped with SD card shall be built with:
west build -p always -b nucleo_h743zi ./zephyr/samples/subsys/fs/littlefs \
 -DCONF_FILE=prj_blk.conf

Moreover, the README.rst has been extended to describe running this
test on block devices.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
7710f5ef61 fs: littlefs: sample: Move littlefs_flash_erase() to flash mount
The littlefs_flash_erase() function shall be called from flash specific
littlefs_mount function. This allows removal of the stub function
when block device support is added.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
447ebe34d9 fs: littlefs: Introduce CONFIG_APP_LITTLEFS_STORAGE_FLASH define
This KConfig define (by default defined) is necessary to extend the
littlefs test functionality to support other test scenarios - for
example running it on device with block device (i.e. SD card) backend.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
663a4bbcb8 fs: littlefs: sample: Add test with binary pattern file modification
This commit extends the littlefs test to use binary pattern file.

This file has the 0x55 and 0xAA patterns (to avoid fast wear leveling)
written alternately with special "marks" bytes on each eight position.
Those values are incremented each time the board boots. One can adjust
the size of this file with the TEST_FILE_SIZE define.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
dd25b6405c fs: littlefs: sample: Move flash initialization code to its own function
The code for potential erasing the flash area has been moved to the
separate function.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
982a739bb1 fs: littlefs: sample: Move value increment test to separate function
The code responsible for incrementing the in-file value has been moved
to the separate function for better readability and reusage.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
f6204e607c fs: littlefs: sample: Move listing directory code to its own function
The code for presenting content of the directory, has been moved to the
separate function to be easily reusable.

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Lukasz Majewski
ab314c3378 fs: littlefs: sample: Replace calls to printk with LOG_PRINTK
Replace calls to printk with LOG_PRINTK to use the logging Zephyr
infrastructure. After this change it would be possible to set the
logging mode (to e.g. reduce the verbosity of output and final size
of the binary).

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-03-15 10:01:54 +01:00
Yong Cong Sin
e401b0a9f3 samples: net: gsm: should be able to start/stop freely
The gsm modem should be able to be started or stopped freely,
independent from the networking state.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2022-03-14 22:04:11 -04:00
Yong Cong Sin
edcf929b37 samples: net: gsm: starting should be based on GSM_PPP_AUTOSTART
The `starting` flag causes the sample to work only if
GSM_PPP_AUTOSTART is enabled, its initial value should be
dependent on GSM_PPP_AUTOSTART.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2022-03-14 22:04:11 -04:00
Thomas Ebert Hansen
7f4471c84e Bluetooth: controller: Rename local proc ctx config
Rename
BT_CTLR_LLCP_PROC_CTX_BUF_NUM
to
BT_CTLR_LLCP_LOCAL_PROC_CTX_BUF_NUM
to match naming scheme of
BT_CTLR_LLCP_REMOTE_PROC_CTX_BUF_NUM

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2022-03-14 11:38:09 +01:00
Andrzej Głąbek
88b83471a4 samples/boards/nrf/system_off: Fix configuration of the wake up button
Use NRF_DT_GPIOS_TO_PSEL() in calls to nRF GPIO HAL functions as they
need a psel value, a pin number combined with the corresponding GPIO
port number, not only the pin number as provided by DT_GPIO_PIN().
This way buttons connected to pins in the P1 port can also be handled
properly.
Replace also DT_NODELABEL(button0) with DT_ALIAS(sw0) for consistency
with other samples that use the standard button.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-14 11:28:15 +01:00
Piotr Pryga
fc6b100bc8 samples: Bluetooth: df: Forward GPIO pins from app to network core
To give control over GPIO pins for Direction Finding Extension of
Radio peripheral when build for nRF53 network core, the application
core has to assign those pins to network core.

There is a mechanism that uses a device tree overlay to get
information about GPIO pins to be assigned to network core.

The commit adds overlays with appropriate configuration
to assign GPIO pins in all DF related samples.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-03-11 11:35:46 -08:00
Robert Lubos
bb5909f7d1 net: tcp: Update receive window in other direct net_context users
As the receive window is now decreased at the TCP module level, other
direct net_context users are also responsible for acknowledging the
received data with net_context_update_recv_wnd() - otherwise, the
communication will stall.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-03-11 09:21:51 +01:00
Emil Gydesen
0d719ba893 Bluetooth: Audio: Add endpoint type to capabilities config cb
The capabilities callback did not provide information about
the type of the endpoint being configured, making it
impossible for the application to determine if it is a
sink or source endpoint.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
b880637231 Bluetooth: Audio: Remove bidirectional audio streams
Audio streams as defined by the BAP spec does not
support bidirectional audio streams. This commit
updates the API and implementation to match that.

The use a bidirectional CIS with 2 audio stream will
be added in a future commit.

This removes the _IN_ and _OUT_ and _INOUT_ QOS
values, as well as the direction of the codec QOS
struct.

To keep direction for internal use, the direction
has been added to the endpoint struct.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 14:07:17 -05:00
Emil Gydesen
e485305b7c Bluetooth: Audio: Fix ordering of array size after array parameter
Make it consistent for audio.h and capabilities.h that the
array size parameter appear after the array parameter.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Emil Gydesen
a01cc054c9 Bluetooth: Audio: Use size_t for audio.h array len arguments
Use size_t instead of uint8_t to describe array lengths.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-10 13:50:20 -05:00
Daniel Leung
a6e35c6ab0 samples: logging/dictionary: set UART backend to do dictionary
This enables CONFIG_LOG_BACKEND_UART_OUTPUT_DICTIONARY so that
the UART backend is in dictionary logging mode.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-03-10 13:48:08 -05:00
Henrik Brix Andersen
d4023b3c1b drivers: gpio: move non-standard dts flags to be soc specific
Reserve the upper 8 bits of gpio_dt_flags_t for SoC specific flags and
move the non-standard, hardware-specific GPIO devicetree flags (IO
voltage level, drive strength, debounce filter) from the generic
dt-bindings/gpio/gpio.h header to SoC specific dt-bindings headers.

Some of the SoC specific dt-bindings flags take up more bits than
necessary in order to retain backwards compatibility with the deprecated
GPIO flags. The width of these fields can be reduced/optimized once the
deprecated flags are removed.

Remove hardcoded use of GPIO_INT_DEBOUNCE in GPIO client drivers. This
flag can now be set in the devicetree for boards/SoCs with debounce
filter support. The SoC specific debounce flags have had the _INT part
of their name removed since these flag must be passed to
gpio_pin_configure(), not gpio_pin_interrupt_configure().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-10 13:46:34 -05:00
Francois Ramu
57c8c0cce5 samples: drivers: DAC testcase running on more stm32 boards
It includes the samples/drivers/dac application for
existing nucleo and disco target boards.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-10 13:30:06 -05:00
Erwan Gouriou
f36a6abf9c samples/boards/stm32: stm32_ble: Add bt_disable/bt_enable sequence
Demonstrate bt_disable/bt_enable.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Erwan Gouriou
925c84a75b samples/boards/stm32: stm32_ble: Use bt_disable to reset the BLE stack
Application is now supposed to explicitly shut down the ble stack
before shutdown.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-03-10 13:28:41 -05:00
Francois Ramu
2620c53771 samples: pwm for stm32l073 and stm32f091 nucleo boards
The overlay are defined to run the samples application with PWM
feature on the nucleo_l073rz,nucleo_f091rc, nucleo_g474re

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-03-10 13:25:54 -05:00
Kai Vehmanen
ec7451b485 soc/intel_adsp: add support for Intel Jasper Lake
Add a variant of Intel cAVS2.0 used in Jasper Lake based
products.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-03-10 09:26:41 -06:00
Enjia Mai
8300ffd302 samples: fix the metairq_dispatch sample sporadically failed on ehl_crb
The metairq sample sometimes failed due to stuck because it has a
potential race when recording the latencies. The previous solution
checks whether the stats.mirq greater than MAX_EVENT. But stats.mirq
might also have a race here. So we change to check the msg sequence,
its correctness ensured by the kernel's message queue.

And also remove the spinlock in previous fix because tests only use
1 CPU, no need to add this. It also improves the fix for #40889,
to prevent test failed sporadically on acrn_ehl_crb and ehl_crb.

Fix #42874.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-03-09 14:09:12 -05:00
Henrik Brix Andersen
e9c9caa80d net: remove unmaintained 6LoCAN implementation
Remove the unmaintained, experimental 6LoCAN (IPv6 over CAN bus)
implementation.

Fixes: #42559

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-09 18:07:31 +01:00
Gerard Marull-Paretas
95fb0ded6b kconfig: remove Enable from boolean prompts
According to Kconfig guidelines, boolean prompts must not start with
"Enable...". The following command has been used to automate the changes
in this patch:

sed -i "s/bool \"[Ee]nables\? \(\w\)/bool \"\U\1/g" **/Kconfig*

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-09 15:35:54 +01:00
Emil Gydesen
452b897aec samples: Bluetooth: Add missing bt_conn_ref for a few samples
Some samples were missing a call to bt_conn_ref when assigning
default_conn.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-03-09 15:04:57 +02:00
Andrzej Głąbek
70fb3124db drivers: serial: nrfx: Ensure that instances have some pins assigned
Add build assertions that will ensure that every peripheral for
which a driver instance is created has some pins assigned to it.
Neither pinctrl-0 nor *-pin properties can be currently marked as
required in devicetree, so these assertions will help users avoid
invalid configurations where it could be hard to figure out why
the UART is not working.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-03-09 12:05:22 +01:00
Ryan Erickson
6c03b3ad41 sample: smp_svr: add Pinnacle 100 DVK to test allow list
Add Pinnacle 100 DVK to sample.yaml where appropriate.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-03-08 09:29:31 -06:00
Ryan Erickson
0062693a00 samples: smp_svr: add Pinnacle 100 DVK board config
Pinnacle 100 DVK uses QSPI to store slot1 partition.
Add board config overlay to ensure QSPI is enabled
so slot1 can be read/written.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-03-08 12:06:45 +01:00
Sam Hurst
986093c8cc samples: boards: Add sample application based on the STM32 USB TCPC Driver
This sample application uses the STM32 USB TCPC Driver to create a USBC
Sink Application for the STM32G081b_eval board.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-03-08 11:08:43 +01:00
Henrik Brix Andersen
4828fa0649 samples: drivers: eeprom: fix spelling
Fix spelling in the EEPROM driver sample application.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-03-08 10:23:53 +01:00
Mikkel Jakobsen
5a4d2c5979 samples: sensor: icm42605: remove deprecated *_OWN_THREAD
the icm42605 defaults to a global thread for trigger processing,
the CONFIG_ICM42605_TRIGGER_OWN_THREAD is deprecated.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@escolifesciences.com>
2022-03-07 16:23:36 -06:00
Arnaud Pouliquen
0130d4be7e sample: ipc : add rpmsg tty channel support in openamp rsc table sample
Add the support of a rpmsg tty channel that responds to the generic
Linux rpmsg_tty driver.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-03-07 10:49:54 +01:00
Arnaud Pouliquen
8558b2785c sample: ipc: restructure the openamp_rsc_table sample
Restructure to separate the management of the rpmsg stack
add the rpmsg client into 2 threads.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
2022-03-07 10:49:54 +01:00
Yuval Peress
ea3f3dac50 samples: nanopb: Add .options file to the sample
Add an options file to the sample to help developers that aren't
familiar with nanopb

Signed-off-by: Yuval Peress <peress@google.com>
2022-03-07 10:48:06 +01:00
Daniel DeGrasse
954dcbd754 boards: twr_ke18f: Add pinctrl groups for twr_ke18f
Add pinctrl groups for twr_ke18f

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-03-03 13:00:20 -06:00
Kamil Piszczek
3e5812cc5f modules: hal_nordic: Port nrf_802154 to ipc_service
The nrf_802154 Spinel serialization was ported to multi-instance
ipc_service.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-02 17:03:01 +01:00
Kamil Piszczek
cf6a58d3f6 bluetooth: hci: rpmsg: use ipc service library
The Bluetooth HCI driver based on the RPMsg transport now uses the IPC
service module. The compatible Bluetooth sample - HCI RPMsg - has also
been migrated to the new IPC solution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-03-02 17:03:01 +01:00
Gerard Marull-Paretas
260deccb6e doc: use :kconfig:option: domain role
Kconfig options now belong to the Kconfig domain, therefore, the
:kconfig:option: role needs to be used.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-02 09:28:37 +01:00
Flavio Ceolin
df3d1f83f7 drivers: crypto: Rename cipher file
This file defines the crypto driver API, cipher is supposed to be just
one type of capability (other can be hash) of these drivers, just
change the file name to be consistent with it.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-01 16:32:43 -05:00
Flavio Ceolin
637fd58efb drivers: crypto: Change HW capabilities query namespace
This is not cipher specific, just replace it crypto to make it clear.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-01 16:32:43 -05:00
YuLong Yao
86f460cd30 boards: gd323103_eval: add dac support.
add dac support.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2022-03-01 18:06:14 +01:00
YuLong Yao
adfc82206b board: gd32e103v_eval: add at24 eeprom.
add support for at24 eeprom.

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2022-03-01 18:06:14 +01:00
Vinayak Kariappa Chettimada
8a8d26b98d samples: Bluetooth: Add Synchronized Receiver board specific conf files
Add Synchronized Receiver board specific conf files.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Vinayak Kariappa Chettimada
13c41c0bc1 samples: Bluetooth: Add ISO Broadcaster board specific conf files
Add ISO Broadcaster board specific conf files.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-03-01 14:54:35 +01:00
Gerard Marull-Paretas
13e953c452 samples: subsys: nvs: use nvs_mount
Replace deprecated nvs_init() with nvs_mount().

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-03-01 12:46:34 +01:00
Andrzej Puzdrowski
d0e31883c8 samples/../mcumgr/smp_svr: differentiate integration platform
Differentiate integration)platforms list per each sample test.
Removed sample.mcumg.smp_svr.bt_tiny as it can not fit in
nr51422 flash anymore, even with configuration tweeks.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-03-01 11:53:07 +01:00
Flavio Ceolin
49520eea57 samples: nrf: system_off: Fix force state usage
The sample cannot spin in an infinity loop because the idle thread will
not run and consequently the forced state will not be used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-03-01 11:10:46 +01:00
Henrik Brix Andersen
8386e1f2d3 samples: subsys: testsuite: pytest: add test of custom cmd line args
Add test case for passing custom command line arguments to a pytest
harness via twister.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-28 12:18:48 -05:00
Kamil Piszczek
a850993352 samples: mgmt: mcumgr: use conn params control config for BT transport
By default, the Connection Parameters control feature is enabled for the
SMP Server sample with the Bluetooth transport.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2022-02-28 11:10:03 +01:00
Emil Gydesen
628b54a959 Bluetooth: Audio: Remove ISO disconnected and connected cbs
The callbacks were implemented to notify the application
about the state of the ISO. However, since then, callbacks
such as `started` and `stopped` have been implemented,
and as such the `connected` and `disconnected` callbacks
no longer server any purpose.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-28 11:04:37 +01:00
Kai Vehmanen
1bcf79f729 soc/intel_adsp: add intel_adsp_cavs25_tgph board
Add a new board to support Intel Tiger Lake H PCH variant of cAVS2.5.

Move common Kconfig options for cavs25 to soc level. No need to
replicate these for every board.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-25 14:28:45 -06:00
Kai Vehmanen
50ec4231d8 samples/subsys/audio/sof: fix rimage signing schema for cavs2.5
The correct signing schema for cAVS2.5 is "tgl".

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-02-25 14:28:45 -06:00
Mariusz Skamra
8da5fefce2 samples: unicast_audio_server: Fix codec specific capabilities
This fixes format of codec specific capabilities in PAC record.

Fixes: #43058
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-02-25 10:05:33 -08:00
Simon Frank
ba7af2f780 include: sensor: sensor_value from double overflow
sensor_value_from_double had a early overflow when converting the
fractional part (val2).  This occured when input was more then
2147.493647 (inp >= INT32_MAX/1000000.0 + 0.01).

return value -ERANGE as this is what errno is set to by `strtod` and
similar posix functions.

fixes issue #39176

Signed-off-by: Simon Frank <simon.frank@lohmega.com>
2022-02-24 13:45:29 -08:00
Fabio Baltieri
bbb6b17403 samples: can: build with mcp2515 driver
Add a test config using the mcp2515 sheild to samples/drivers/can so we
catch build issues.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-02-24 09:09:02 -08:00
Fabio Baltieri
ed3471aa5c samples: display: build for st7735r, gd7965 and ls0xx
Add a couple of extra shield configurations to catch regressions with
the st7735r, gd7965 and ls0xx drivers.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2022-02-24 09:09:02 -08:00
Henrik Brix Andersen
cc394e073d samples: can: filter out tests if zephyr,canbus not enabled
- Filter out the remaining CAN tests if no zephyr,canbus chosen node is
  enabled in the devicetree.
- Rename the tests to shorten the name a bit.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Henrik Brix Andersen
878ea22eac samples: modules: canopennode: filter tests based on dts
- Filter out the CANopenNode tests if no zephyr,canbus chosen node is
  enabled in the devicetree.
- Enable the program download build-only test on all boards with the
  necessary fixed partions.
- Explicitly exclude boards without the needed flash support from the
  program download build-only test as these do not even pass Kconfig and
  thus fail to complete the twister filter stage.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Henrik Brix Andersen
8372de867d samples: modules: canopennode: enable CONFIG_GPIO
The CANopenNode sample uses GPIO. Ensure it is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-24 07:12:54 -06:00
Bartosz Golaszewski
0f09360456 lvgl: change the prefix of Zephyr-specific LVGL config options
We're now using the Kconfig copied from the upstream lvgl repository. It
uses the LV_ prefix for all options while we're using LVGL_ for
Zephyr-specific ones. Make the latter consistent with upstream but also
make sure they're distinct from lvgl's by using LV_Z_ as the prefix.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Bartosz Golaszewski
6c190292c0 lvgl: move the lvgl glue out of the zephyr tree
Start using the upstream Kconfig from LVGL and move the glue code out
of the zephyr tree and put it under lvgl/zephyr/ in modules.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Bartosz Golaszewski
1244a89a21 lvgl: bump version to v8.1.0
This updates the lvgl in-tree glue code to work with version v8.1.0 and
bumps the west manifest accordingly.

The following are the most significant changes:
- The logging callback has changes in lvgl and no longer provides the
  caller with an integer log level code. We now need to parse the log
  string's prefix to determine the level.
- Several Kconfig options (mostly for default values of various settings)
  have been removed because these values are no longer configurable in
  lvgl.
- The library no longer performs a deep copy of the display and input
  device driver structs, so these must no longer be allocated on the
  stack in the init func.

Other than that it's mostly about renaming of various structures and
functions and adjusting the calls if function's signatures have changed.

This patch allows all in-tree users to work correctly but it's likely
it doesn't support all new widgets and layouts added in lvgl v8. These
however can be added gradually once this is upstream.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Bartosz Golaszewski
595131c2d0 lvgl: kill LVGL_MEM_POOL_HEAP_KERNEL and LVGL_MEM_POOL_KERNEL
Current lvgl code allows to use the kernel heap for dynamic memory
allocation. The k_heap API doesn't however provide k_realloc() which
will be needed in order to update lvgl to v8. Nico suggested there's
no good reason for lvgl to use k_heap and it should stick to either
the libc's allocator or depend on its own private sys_heap.

The alternative would be to extend the k_heap API to provide k_realloc()
but this may be tricky for several reasons and for now there would
be a single user anyway.

This removes the choice of using k_heap for lvgl and renames the user
pool to SYS_HEAP in Kconfig and makes it the default option.

The prj.conf for the lvgl sample is modifed to specify the number of
memory pool blocks instead of the total size as the default block
size is 2048 and it results in the same size of memory.

Suggested-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Bartosz Golaszewski
b653cc8bad samples: lvgl: add missing Kconfig options
The sample graphical Hello World program uses the image widget as well as
the Montserrat font size 14. While currently those are being selected by
default, it won't be the case once we update to lvgl v8. Select relevant
Kconfig option in prj.conf.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
2022-02-24 11:51:33 +01:00
Aastha Grover
c0d7e10beb logging: Add support to backends to switch log format at runtime.
Adding mechanism to all the backends to switch the logging formats
at runtime while leveraging the function pointer table based upon
the Kconfigs which also cleans up the logging backend design.
Also demonstrate the working API with the changes
to syst sample. Clean up Kconfig for backends and add a standard
template to generate the Kconfigs for logging formats to be used
by all backends.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-02-23 14:12:22 -06:00
Flavio Ceolin
6142fcb8ba pm: Rename pm_power_state_force
Aligning with the rest of PM API, replace pm_power_state_force with
pm_state_force.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-23 07:33:46 -05:00
Gerard Marull-Paretas
5d7bd90529 samples: sensor: th02: add Grove LCD compatible to the filter
The sample required the Grove LCD, so add it to the filter.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas
9bbdc24864 samples: sensor: th02: fix grove lcd usage
The sample enabled the Grove LCD by default in prj.conf, and in the
README it is clearly stated that the sample is intended to work using
the LCD module. This patch remove the unnecessary ifdeffery and obtains
a reference to the display at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas
b5b7579e72 samples: drivers: misc: grove_display: filter by DT compat enabled
Filter sample by checking if the Grove LCD compatible is enabled or not.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas
5be50262ea samples: drivers: misc: grove_display: use DEVICE_DT_GET
Obtain a reference to the Grove LCD device at compile time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas
0bb486aa29 drivers: misc: grove_lcd: port to Devicetree
The driver was never migrated to Devicetree, this patch converts the
driver to a proper Devicetree based device.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Gerard Marull-Paretas
9a00b99884 drivers: display: grove_lcd_rgb: move to misc
The driver does not implement a display API, it has a custom API. Having
it under display is confusing, since display API consumers may expect
they can use it. These sort of custom drivers fit better under
drivers/misc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-22 11:58:33 -08:00
Henrik Brix Andersen
c4f229f98f samples: drivers: can: enable CAN statistics
Enable CAN controller device statistics support.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-02-22 11:54:27 -08:00
Robert Lubos
b3188fdd1c samples: net: sockets: big_http_download: Increase TCP recv window size
Increase TCP receive window size in the sample to improve the download
speed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-02-22 10:09:45 -08:00
Carles Cufi
e83a13aabf kconfig: Rename the TEST_EXTRA stack size option to align with the rest
All stack sizes should end with STACK_SIZE.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-22 08:23:05 -05:00
Moritz Fischer
aa283e5439 samples: modules: canopennode: Add stm32f072b_disco support
Add support for the stm32f072rb discovery board.

Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-02-22 10:25:08 +01:00
Casper Bonde
86574107dd Bluetooth: BAP: Unicast client sample accept EXT_ADV
Minor change to let the client accept EXT_ADV reports
when connecting.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2022-02-22 10:23:44 +01:00
Carlo Caione
ac6060f966 code_relocation: Extend the nocopy sample to nRF5340dk
The nRF5340dk is shipping an external QSPI flash that can be used to do
XIP from. Extend the code_relocation nocopy sample to support this
platform so that part of the functions are executed from internal flash
and others from external flash.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 22:09:46 -05:00
Carlo Caione
d3203dc70d code_relocation: Add NOCOPY feature
* Use case of interest:

Some platforms are shipping in parallel to the internal FLASH some other
storage / external FLASH (usually a QSPI FLASH) that can be used to
execute (XIP) code from.

The content of this external FLASH can usually be written at flash time
using proper tools (see for example the case of the external FLASH on
the nRF5340DK that can be written at flash time using nrfjprog).

The external FLASH is a nice addition that is extremely useful when a
large application code doesn't entirely fit on the internal FLASH so
that we could want to move part of it in the auxiliary FLASH to XIP the
code from there.

* The problem:

Right now Zephyr doesn't have a formal and generic way to move at build
time part of the code to a different memory region.

* The current status:

Zephyr is indeed shipping a code_relocation feature but that doesn't
entirely match our needs.

When XIP is enabled, the code_relocation feature is used in Zephyr to
move the selected code (that is to copy text section, to initialize data
and zero bss) from FLASH to SRAM at run time and execute code from SRAM.

The relocation is done by a generated snippet of code that is
memcpy()-ing the right content to the destination region also using some
build-time generated portions of linker script to retrieve start and
destination addresses and regions.

* This patch:

This patch is leveraging the code_relocation code and adding a NOCOPY
feature. This feature is using the code_relocation feature to
dynamically build the linker script snippets but entirely skipping the
run-time code relocation so that the code can be XIP-ed from the
destination region.

* Example:

Let's say that we have a big file called `huge_file.c` that we want to
XIP from the external FLASH that is mapped in an EXTFLASH region.

In this case we should enable `CONFIG_XIP` and
`CONFIG_CODE_DATA_RELOCATION` and instruct cmake as follows:

  zephyr_code_relocate(src/huge_file.c EXTFLASH_TEXT NOCOPY)
  zephyr_code_relocate(src/huge_file.c SRAM_DATA)

this means that:

- The .text section of the `huge_file.c` must reside in the EXTFLASH
  memory region and we do not need to copy the section there because we
  are going to XIP it (and we assume that the file is going to be placed
  in the external FLASH at flash time).
- The .data section of the `huge_file.c` must still reside in the SRAM
  memory region.

* TODOs:

It's desirable to have the possibility to relocate libraries and
pre-build files instead of source code files.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 22:09:46 -05:00
Carlo Caione
11f1dd2370 pm: Reference pm_state_info only by pointer
It's unnecessary to move the pm_state_info around by value, just use a
pointer.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-02-21 20:58:01 -05:00
Sebastian Bøe
5e63f8fbce samples: rename user-tls.conf to user-tls-conf.h
user-tls.conf is a header file and should therefore have the suffix
.h.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-02-21 20:55:20 -05:00
Gerard Marull-Paretas
9636b46519 samples: boards: stm32: power_mgmt: blinky: use dtcompatible role
Reference DT compatible using the :dtcompatible: role.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-02-21 20:47:10 -05:00
Mike Szczys
e535cc76db doc: add OTA section to device management
Zephyr docs should mention OTA:
- Define Over-the-Air update
- Indicate OTA can be used with MCUboot
- Link examples of the OTA DFU process

Signed-off-by: Mike Szczys <mike@golioth.io>
2022-02-21 20:39:08 -05:00
Yuriy Vynnychek
e94b3f7a9f samples: openthread: overlay update to new Pinctrl driver.
Applied changes required by new Pinctrl driver.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2022-02-21 19:41:44 -05:00
Herman Berget
8b46aaaf69 Bluetooth: Add common BT_CONN_INTERVAL_TO_MS macro
The same macro was defined in multiple places.

Signed-off-by: Herman Berget <herman.berget@nordicsemi.no>
2022-02-21 19:40:42 -05:00
Emil Gydesen
8671fa683e Samples: Bluetooth: Remove RX workround for iso connected benchmark
CONFIG_BT_ISO_TX_MTU=230 had been added to deal with the RX
buffers not fitting TX's of same size, which is fixed now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-02-21 19:40:02 -05:00
Bartosz Bilas
1fd95768c8 samples: net: modem: add modem power callbacks
Register modem power callbacks to show how it can be
used to provide e.g modem power on and off sequences.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-02-21 19:38:32 -05:00
Ederson de Souza
863ffbf1b7 tests and samples: Don't build some C++ tests under XCC
XCC (based on GCC 4.2) doesn't support C++11, and can't build those
tests. So exclude them from twister.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-02-21 19:37:54 -05:00
Flavio Ceolin
bc3d166c74 samples: pm: device_pm: Fix harness
Both drivers enable device runtime on init, so they will be suspended
in the very beginning. The async get operation no longer exists, so
just remove the message related with this.

Fixes #42740

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-21 19:36:09 -05:00
Flavio Ceolin
955489fcc0 samples: pm: device_pm: Remove spurious comments
Remove comments that just make noise and does not add anything to the
test.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-21 19:36:09 -05:00
Flavio Ceolin
8fdb0117eb samples: pm: device_pm: Get the device before use it
The open function should resume the device, not only its parent.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-02-21 19:36:09 -05:00
Johann Fischer
3b7807cc9b usb: dfu: disable USB DFU uploading by default
Firmware uploading to the host may not always be desired,
disable it by default.

Enable it for existing USB DFU sample to keep
the usual behavior, add note about new option to README.rst.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-02-18 09:32:22 -08:00
Piotr Pryga
c3696cf06c samples: Bluetooth: df: add missing integration platforms
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga
63cc9decf7 Bluetooth: samples: df: Decrease RAM usage in DF connectionless RX
Direction finding connectionless RX sample didn't fit into
nRF52820 SRAM. The sample will not be able to store IQ samples
for maximum number of CTEs allowed by Bluetooth Core 5.3
specification.

For nRF52820 the new allowed maximum number of scanned CTEs
is set to one, to save more space in SRAM for an application.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga
4f17726bb1 samples: Bluetooth: df: Fix problem with samples split build
Fix problem with building sample applications where Host is
split from Controller into separate binaries. In that situation
samples does not have access to controllers Kconfig options.
To optimize memory usage by an application, disable not needed
features (angle of arrival or angle of departure).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-17 13:07:12 +01:00
Piotr Pryga
2b3ec2bd96 Revert "samples: Bluetooth: df: Forward GPIO pins from app to network core"
This reverts commit 9bd218347c.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 14:12:13 +01:00
Piotr Pryga
f126d23b67 Revert "samples: Bluetooth: df: add missing integration platforms"
This reverts commit ba939b1262.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 14:12:13 +01:00
Piotr Pryga
ba939b1262 samples: Bluetooth: df: add missing integration platforms
Add missing integration plaforms in direction finding samples.
There were no nRF52820 and nRF5340 added.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 09:56:34 +01:00
Piotr Pryga
9bd218347c samples: Bluetooth: df: Forward GPIO pins from app to network core
To give control over GPIO pins for Direction Finding Extension of
Radio peripheral when build for nRF53 network core, the application
core has to assign those pins to network core.

There is a mechanism that uses a device tree overlay to get
information about GPIO pins to be assigned to network core.

The commit adds overlays with appropriate configuration
to assign GPIO pins in all DF related samples.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-16 09:56:34 +01:00
Perry Hung
5d34652b3f samples: drivers: can: add CONFIG_GPIO to prj
This samples blinks an LED, so CONFIG_GPIO is required.

Signed-off-by: Perry Hung <perry@genrad.io>
2022-02-15 13:06:27 -05:00
Piotr Pryga
2f8a579ba6 samples: Bluetooth: df: Fix periodic sync termination handling
There was a bug it periodic advertising sync termination handling.
If a sync was terminated before sync established was reported,
for example sync may be filtered out by CTE type, then sample
will wait until sync_create_timeout_ms is reached.
Also sem_per_sync_lost semaphore is given in term_cb.
Result of the bug is next time a sync is established, CTE sampling
is enabled, sample starts waiting for periodic sync lost and
immediately ends waiting because sem_per_sync_lost is given.
Scan is restarted and already synchronized sync is terminated.

Correct behavior is, when term_cb is executed sem_per_sync_lost
may be given only if sync established was already reported.
Also sample must not wait for sem_per_sync if sync is terminated
due to wrong CTE type. It can end wait immediately.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-15 18:37:40 +01:00
Xabier Marquiegui
79047b5da8 samples: net: gptp: add NXP RT series config support
Add NXP RT samples config support for gptp sample

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Co-authored-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
2022-02-11 10:03:05 -06:00
Xabier Marquiegui
270b7c84bc samples: net: gptp: Enable deferred log mode
In applications where timing is critical it seems like enabling
deferred log mode could be desirable.

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
Co-authored-by: Seb Laveze <sebastien.laveze@nxp.com>
Signed-off-by: Xabier Marquiegui <xmarquiegui@ainguraiiot.com>
2022-02-11 10:03:05 -06:00
Daniel DeGrasse
5094a6e08c samples: blinky_pwm: decreased min PWM period for blinky sample
Blinky PWM sample minimum pwm period was too high for iMX.RT PWM module.
decrease the minimum pwm period so sample will pass pwm calibration
phase.

Fixes #38954

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-10 14:33:08 -05:00
Enjia Mai
6bec54401b samples: fix the metairq_dispatch sample failed on acrn_ehl_crb
The samples/kernel/metairq_dispatch runs failed on acrn_ehl_crb
due to the potential race condition in accessing the global stat
data. Add a spinlock to prevent this.

Fixes #40889

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-02-10 08:55:39 -05:00
Johann Fischer
d6c6c3fa20 sample: modbus: mark MODBUS samples as build only
Mark MODBUS samples as build only, otherwise they would
need different fixtures for each sample.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-02-09 22:11:16 -05:00
Daniel DeGrasse
41a63f48fd samples: task_wdt: Increase min watchdog timeout
MCUX watchdog timer supports min window of 500ms. Increase maximum task
watchdog timeout window to 500ms by default, so that this sample can run
on iMX RT SOCs. Also update iMX RT watchdog driver to reject timeout
maximums under 500ms with a useful error message

Fixes #40153

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-02-09 14:07:26 -06:00
Carles Cufi
7f6524949a lib: os: crc: Rework the crc16() implementation
As described in #42403, there was an issue with the existing crc16_ansi()
implementation, since it was not calculating the CRC-16-ANSI (aka
CRC-16-MODBUS). This is because the  existing crc16() function only
supported non-reflected input and output (and the CRC-16-ANSI requires
reflection on both) and also it did not seem to support correctly inial
seeds different from 0x0000 (and, again, the CRC-16-ANSI requires 0xffff
as an initial seed).

This commit replaces the existing crc16() with a functional pair,
crc16() and crc16_reflect(), that also work with any poly, any initial seed
and allow to select whether reflection is performed.
It also adapts crc16_ansi() so that it actually returns the correct CRC.

Fixes #42403.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-04 12:33:22 -05:00
Martí Bolívar
efc0e75463 samples: blinky: use a gpio_dt_spec
Using a gpio_dt_spec is the current best practice for getting at pins
defined in the DT, because it gets all the boilerplate and flags right
for you. Use that in blinky, keeping the documentation in sync with
the code.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2022-02-04 11:20:46 +01:00
Daniel Leung
77f832fde3 samples: logging/syst: expand to doing v1/v2 immediate/deferred
This expands the sample to do both v1 and v2, and both immediate
and deferred modes for each logging verion. This is to make sure
MIPI Sys-T output is not broken for all combinations. Default is
v2/immediate using prj.conf. Deferred mode is enabled via
overlay.

Also add qemu_x86 as an allowed platform as the samples are
working there too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Daniel Leung
6eb3cc11e2 samples: logging/syst: add more lines to show string processing
This adds a few log lines to show how string processing works
with Sys-T.

Note that CONFIG_LOG_BLOCK_IN_THREAD=y to make sure all log
messages are printed instead of being dropped.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-02-04 11:14:55 +01:00
Attie Grande
ec1ab6d104 samples: drivers: adc: Add a device tree overlay for atsamd21_xpro
Add a basic device tree overlay to support the use of the ATSAMD21 XPro
dev board with the ADC sample application.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Attie Grande
c53a1e8b32 samples: drivers: adc: Revise handling of configurable inputs
All drivers that require input_positive to be set should be given it.
Some parts may require an offset, so abstract this away too.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-02-04 10:49:09 +01:00
Piotr Pryga
8f56d4ee19 samples: Bluetooth: df: Remove dep on CTLR Kconf in sample sources
Direction finding samples had dependency on KConfig option defined
in Controller. That caused a problem for split builds where
an application and host are not part of the same binary as
controller. The code dependend on the Kconfig option
was always disabled.

To fix that issue new Kconfig options were introduced to
Host. The dependency is removed. Unwanted features may stil be
disabled and samples binaier will be smaller.

The commit aligns all direction finding samples code.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-02-03 14:57:17 +01:00
Yong Cong Sin
731241f8d0 kernel: workq: Fix type errors in delayable work handlers
A common pattern here was to take the work item as the subfield of a
containing object. But the contained field is not a k_work, it's a
k_work_delayable.

Things were working only because the work field was first, so the
pointers had the same value. Do things right and fix things to
produce correct code if/when that field ever moves within delayable.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2022-02-02 18:43:12 -05:00
Joakim Andersson
17f8932f16 modules: trusted-firmware-m: Use TF-M install headers as interface
Use the set of headers that the TF-M build system places in the
install output. Not all public header files are available in the
interface/include directory and the TF-M build system uses the install
mechanism of cmake to include additional headers based on platform
or configuration.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-02-01 11:31:36 +01:00
Erwan Gouriou
fa16f8654a samples: lora: Add harnesses for execution with twister
Lora samples are missing harnesses and hence are reported
failed by default by twister.
Add required harnesses to be able to detect correct and faulty
test executions.

Fixes #42159

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-28 19:15:01 -05:00
David Leach
96599830cf samples: grove_display: Exclude ip_k66f from sample build
The ip_k66f doesn't have I2C_0 status set to OKAY so the build of
this sample generates warnings in the nightly build. Root problem
is that the groove display is not ported to the device tree so
there isn't a standard way of filtering on the display being
part of the platform.

fixes #41523

Signed-off-by: David Leach <david.leach@nxp.com>
2022-01-28 14:31:50 -06:00
Erwan Gouriou
d6f150e97b samples/compression/l4z: Increase min_ram
Increase minimum RAM requirements on this test as it appears
that 32 is too low and 40 is verified ok.

Fixes #42161

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-28 10:07:00 +01:00
Moritz Fischer
499cc72411 samples: modules: canopennode: Fix example code
When moving the samples to samples/modules the example code was not
updated accordingly.

Fixes: 613f1cde4a
Signed-off-by: Moritz Fischer <moritzf@google.com>
2022-01-28 10:05:58 +01:00
Henrik Brix Andersen
2aed5a1237 drivers: can: remove CAN_BUS_UNKNOWN CAN controller state
The CAN_BUS_UNKNOWN CAN controller state is only used to indicate that
the current CAN controller state could not be read.

Remove it and change the signature of the can_get_state() API function
to return an integer indicating success or failure.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-28 10:05:29 +01:00
Emil Gydesen
f24d4bcf75 Bluetooth: Samples: Add unicast audio client and server samples
Adds Basic Audio Profile (BAP) unicast server and client samples.

These are the barebones versions of what is needed to scan/advertise
for audio and setup a stream using the mandatory LC3 preset defined by
the BAP spec.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-27 12:01:34 +02:00
Emil Gydesen
ed268b734d Bluetooth: Samples: Add controller Kconfig requirement for ISO samples
Add reference to specific CONFIG_BT_CTLR_ Kconfig options
for the ISO samples. This is due to the fact that ISO
isn't fully supported in the Zephyr controller yet, and
won't be enabled by default for a while yet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-26 13:29:45 +01:00
Wealian Liao
7467dc4c12 tracing_user: Add ISR nest level parameter
For tracing_user, the sys_trace_isr_enter() & sys_trace_isr_exit()
block any nest interrupts & most SMP interrupts for the user. It is
hard to analyze the IRQ preemption(e.g., each IRQ counter and execution
time). This commit adds ISR nest level for each CPU to the user instead
of blocking user call back when nest interrupts.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2022-01-21 14:38:35 -05:00
Tom Burdick
b5d9c047d3 boards/intel_adsp_cavs25: Improve test coverage
Remove the only_tags filter for the board and add ignore_tags for net
and bt.

Adds a filter to a userspace sample that didn't correctly filter on
usermode being Kconfiged.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-01-21 14:36:49 -05:00
Emil Gydesen
59840b1a7b Bluetooth: Samples: Iso connected benchmark fix unidirectional tx
Add a check for SDU size and tx qos to ensure that we do not
attempt to send any data and neither central or peripheral
if the benchmark has been setup to be rx-only.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-21 14:25:04 -05:00
Emil Gydesen
e6265685a1 Bluetooth: Sample: ISO connected benchmark change to callback
Change the sample to use the callback instead of a timer
to send next packet.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-01-21 14:25:04 -05:00
Piotr Pryga
6590ffd330 samples: Bluetooth: df: Fix too early per sync create timeout
Periodic advertising synchronization create had a timeout set
to fixed value of 10 seconds. BT 5.3 Core specification defines
synchronization timeout as 6 consecutive periodic advertising
events. When advertiser set the periodic interval to be more than
1.6 second it was possible the application timeout is reached
before time allowed by BT Core specification.

Changed implementation of timeout to depend on the periodic
advertising interval.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 19:32:17 +02:00
Piotr Pryga
bda4eea41d samples: Bluetooth: df: Add DF peripheral sample
Add new sample application for direction finding to show
how the functionality works in connected mode for peripheral role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 10:50:21 -05:00
Piotr Pryga
1acf326993 samples: Bluetooth: df: Add DF central sample
Add new sample application for direction finding to show
how the functionality works in connected mode for central role.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-21 10:48:26 -05:00
Henrik Brix Andersen
cc557260c8 samples: drivers: can: add support for CAN_ERROR_WARNING
Add support for CAN_ERROR_WARNING CAN controller state.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-19 18:34:26 +01:00
Gerard Marull-Paretas
8be86f7ffb samples: userspace: drop DEV_DATA/DEV_CFG usage
Stop using redundant DEV_DATA/DEV_CFG macros and use dev->data and
dev->config instead.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-19 18:16:02 +01:00
Krzysztof Chruscinski
2a0e66453c samples: boards: nrf: Add nrf53_sync_rtc sample
Add sample which demonstrates how RTC clocks are synchronized
between application and network core.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-19 17:46:28 +01:00
Anas Nashif
01b7800bc8 include: remove deprecated headers
Remove all deprecated headers which were moved to a different location.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-01-18 19:17:50 -05:00
Carlo Caione
993cb4cd62 sample: openamp: Add OpenAMP performance test.
Add a simple sample that tries to answer the silly question: how fast
can I move data from one core to another using OpenAMP?

It depends on a lot of factors but at least we can use this sample as a
skeleton to build tests on top.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-01-18 13:23:43 -05:00
Gerard Marull-Paretas
ddc168fa78 pm: s/PM_DEVICE_(DT_(INST))_REF/PM_DEVICE_(DT_(INST))_GET
In order to align with macros used to obtain a device reference (e.g.
DEVICE_DT_GET), align the PM macros to use "GET" instead of "REF". This
change should have low impact since no official release has gone out yet
with the "REF" macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-01-18 12:14:06 -05:00
Erwan Gouriou
322175e4fc boards: stm32l5: Update TFM related flashing instructions
Following the work done to add TFM support on b_u585i_iot02a,
update other STM32 TFM enabled boards to benefit from the
progress made on TFM flashing instructions.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-18 10:42:45 -05:00
Alexander Wachter
22a10752ed samples: net: sockets: can: Disable Ethernet
Disable Ethernet on SocketCAN sample because some Ethernet
drivers cannot operate on such small buffers.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2022-01-18 10:39:55 -05:00
Carlo Caione
93b0ea9782 ipc: Remove multi-instance backend
Remove the legacy multi-instance backend and the sample.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-01-17 15:50:58 -05:00
Krzysztof Chruscinski
262cc55609 logging: Deprecate v1, default to v2
Reduced logging mode selection to deferred, immediate, minimal and
frontend. Decoupled logging version from mode and created CONFIG_LOG1
which can be used to explicitly select deprecated version.

From now on, chosing CONFIG_LOG_MODE_{IMMEDIATE,DEFERRED} will result
in version2.

Deprecated CONFIG_LOG2_MODE_{IMMEDIATE,DEFERRED} with cmake warning.

Codebase adapted to those changes.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-17 15:49:10 -05:00
Piotr Pryga
ab32c06275 samples: Bluetooth: df: Fix possible stack overflow issue
Host receive thread has small default stack size.
Attempt to convert data from binany to string requires
large array. Allocation of such array on stack could
cause stack overflow.

To limit the scope of the array and avoid stack overflow
the array is changed to be static local variable in a function.

Also the array has been prepared to accept max advertising
data sieze of 1650 bytes.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-17 12:54:10 -05:00
Henrik Brix Andersen
2c0e0a74af doc: use extlink for github issue links
Use extlink for GitHub issue links in documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-17 12:48:43 -05:00
Alexander Mihajlovic
b9aca25206 samples: adc: Add nucleo_wl55jc support
Add support for nucleo_wl55jc board to adc driver sample.

Signed-off-by: Alexander Mihajlovic <a@abxy.se>
2022-01-17 11:48:30 -05:00
Francois Ramu
ff34965a0a samples: drivers led strip ws2812 overlay for stm32 nucleo
The spi node of the led_ws2812 now includes the frame format
as defined by the dts bindings spi-device.yaml
SPI_FRAME_FORMAT_TI is selected with overlay for target boards.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-01-17 11:46:14 -05:00
Manojkumar Subramaniam
4c54e23377 samples: drivers: nucleo_h7a3zi_q: Configuring ADC sample application
I tested ADC sample on the board mentioned above
0v = 0
3.3v = 4095

Signed-off-by: Manojkumar Subramaniam <manoj@electrolance.com>
2022-01-17 11:45:21 -05:00
HaiLong Yang
1d3c710eaf samples: eeprom: add gd32f450i_eval board
Add gd32f450i_eval board with AT2402C eeprom.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2022-01-14 10:42:24 -06:00
Martin Jäger
9322a238db samples: drivers: uart: move echo_bot into dedicated folder
The STM32 single_wire example was merged in parallel to this sample
and ended up as a sub-folder of this one. Separate both into their
own folders.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-01-14 09:55:30 -06:00
Wouter Cappelle
c3ca3aa27d sensors: STM32: Add support for L5 die temp sensor
This PR adds the different handling of temperature sensor for the
STM32L5 soc. In this soc, there are some calibration settings which
need to be applied for temperature conversion.

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-01-13 10:34:10 +01:00
Wouter Cappelle
ba12740049 sensors: STM32: code formatting of stm32_temp with sample
clang format on stm32_temp.c & the sample

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-01-13 10:34:10 +01:00
Daniel Leung
b63b71aa1b tfm: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Daniel Leung
1be8c15e4c cpp: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Daniel Leung
c955a44f13 usb: remove @return doc for void functions
For functions returning nothing, there is no need to document
with @return, as Doxgen complains about "documented empty
return type of ...".

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-01-12 16:02:16 -05:00
Wealian Liao
1fd29fb131 tracing: Fix tracing_user config
`tracing_user.h` lost several definitions, which made
CONFIG_TRACING_USER build fail. This fixes the TRACING_USER
config & adds it to the test case.

Moreover, the idle task stack is overflow on qemu_x86, qemu_cortex_m0 &
qemu_riscv64. This makes the test fail. So this commit sets the idle
stack size to 2048 for this sample to avoid it.

Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
2022-01-11 18:13:18 -05:00
Henrik Brix Andersen
13e6d264bb samples: modules: canopennode: add stm32f3_disco support
Add support for the ST STM32F3 Discovery development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-11 14:40:49 -06:00
Henrik Brix Andersen
e919db3222 drivers: can: add user_data to state change callback
Add optional user data argument to can_set_state_change_callback() to
comply with Zephyr API design guidelines.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-11 11:54:04 +01:00
Jonathan Hahn
236aeadd4f samples: uart: Add sample for single line uart
The sample uses st single-line uart mode on stm32 boards.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2022-01-11 11:47:47 +01:00
Yuval Peress
ab1caef8c3 ztest: Update ztest with more powerful testing APIs
1. Test suites in prior ztest serve no purpose other than logical
ordering of tests into a named-group. Move the construct of setup and
teardown into the test suite and away from individual tests.
Additionally, add the constructs of before/after to the test suites.
This model more closely resembels other testing frameworks such as gTest
and Junit.
2. Test can be added to a suite by using ZTEST() or ZTEST_F() where _F
stands for fixture. In the case where _F is used, the argument `this`
will be provided with the type `struct suite_name##_fixture*`. Again,
this models other modern testing frameworks and allows the test to
directly access the already set up data related to the test suite.
3. Add the concept of test rules (from Junit). Rules are similar to the
before/after functions of the test suites but are global and run on all
suites. An example of a test rule can be to check that nothing was
logged to ERROR. The rule can cause the test to fail if anything was
logged to ERROR during an integration test. Another example would be a
rule that verifies that tests ran within some defined timeout.

Signed-off-by: Yuval Peress <peress@google.com>
2022-01-11 11:47:30 +01:00
Johann Fischer
cba4adecef samples: modbus: tcp_gateway: use default arduino header UART
Use default arduino header UART in DT overlay for FRDM-K64F board.
This is also consistent with documentation if a shield is to be
used for communication.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-01-10 09:45:42 -06:00
Martin Jäger
0bd3d46cfb samples: drivers: add UART serial sample
This sample demonstrates the use of the UART driver. The data is
received using an ISR callback and a message queue. For sending data,
the polling API is used.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-01-10 09:34:02 -06:00
Erwan Gouriou
60dea97942 samples/boards: STM32: Move Olimex E407 ccm sample under STM32
This sample could apply to more STM32 targets, so move it under
STM32 umbrella.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-10 10:23:57 -05:00
Erwan Gouriou
8a517109e6 samples/boards/stm32: stm32wb ble: Rework name for doc index coherency
Rename sample for sample index page consistency.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-10 10:23:57 -05:00
Henrik Brix Andersen
8af4bb722d drivers: can: rename API functions for better consistency
Rename a few CAN API functions for clarity and consistency with other
Zephyr RTOS APIs.

CAN_DEFINE_MSGQ() becomes CAN_MSGQ_DEFINE() to match K_MSGQ_DEFINE().

can_attach_isr() becomes can_add_rx_filter() since a filter callback
function is not an interrupt service routine (although it is called in
isr context). The word "attach" is replaced with "add" since filters are
added, not attached. This matches the terminology used is other Zephyr
APIs better.

can_detach() becomes can_remove_rx_filter() to pair with
can_add_rx_filter().

can_attach_msgq() becomes can_add_rx_filter_msgq() and documentation is
updated to mention its relationship with can_add_rx_filter().

can_register_state_change_isr() becomes can_set_state_change_callback()
since a state change callback function is not an interrupt service
routine (although it is called in isr context). The word "register" is
replaced with "set" since only one state change callback can be in
place.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-10 10:44:37 +01:00
Kai Vehmanen
60325019aa samples/subsys/audio/sof: use -fstrict-overflow for SOF
Align compiler flags of SOF Zephyr build with the build SOF XTOS
and use -fstrict-overflow.

With -fno-strict-overflow, some versions of XCC compiler (e.g. xt-xcc
12.0.8) always emit a "bltu" instruction to check for overflow in loops
like:

  unsigned int n;
  for(n = 0; n < 1024; n++)
	do_arithmetic();

With "-fno-strict-overflow", you'll have:
  18:   068076                  loop    a0, 22 <dummy_dspload+0x22>
  1b:   445a                    add.n   a4, a4, a5
  1d:   551b                    addi.n  a5, a5, 1
  1f:   023657                  bltu    a6, a5, 25 <dummy_dspload+0x25>
  22:   fffc86                  j       18 <dummy_dspload+0x18>

With "-fstrict-overflow":
  16:   038476                  loop    a4, 1d <dummy_dspload+0x1d>
  19:   223a                    add.n   a2, a2, a3
  1b:   331b                    addi.n  a3, a3, 1

As this is a common pattern in audio DSP code, change the default
for SOF builds to -fstrict-overflow.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-01-07 10:46:14 -05:00
Kai Vehmanen
212347f94d samples/subsys/audio/sof: build with CONFIG_SPEED_OPTIMIZATIONS
The inner loops of SOF audio algorithms benefit from
compiler optimizations. On Intel cAVS platforms, it was noted
zero-overhead loops ("loop" family of instructions) is not
used for fixed-size inner loops when using -Os (optimize for
size) and the XCC xtensa toolchain.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-01-07 10:46:14 -05:00
Jakub Rzeszutko
d4559f53fa lib: getopt: rework and extend getopt library
Getopt has been rework in this way that calling it does not require
extra state parameter and its execution is thread safe.
Global parameters describing the state of the getopt function have been
made available to ensure full API compatibility in using this library.
However, referencing these global variables directly is not thread
safe. In order to get the state of the getopt function for the thread
that is currently using it, call: getopt_state_get();

Extended the library with getopt_long and getopt_long_only functions.

Moved getopt libary from utils to posix.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2022-01-06 21:26:59 +01:00
Marc Herbert
f38c6b67ed samples: big_http_download: make num_iterations unsigned
It is documented as unsigned in
samples/net/sockets/big_http_download/Kconfig

Signed overflow is undefined behavior, unsigned is not. This fixes the
following warning:

   -Wstrict-overflow=1

samples/net/sockets/big_http_download/src/big_http_download.c:346:2:
In function 'main':
error: iteration 2147483648 invokes undefined behavior
                           [-Werror=aggressive-loop-optimizations]
  346 |  } while (--num_iterations != 0);

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-05 15:00:32 -05:00
Konstantinos Papadopoulos
5da3d3148d samples: exclude platform stm32f769i_disco
Excluded due to conflicts with adafruit_2_8_tft_touch_v2.
Both boards got a touch controller.

Signed-off-by: Konstantinos Papadopoulos <kostas.papadopulos@gmail.com>
2022-01-05 14:59:58 -05:00
Aastha Grover
d13613750b samples: logging: Add v2 logging support for sys-t sample.
Adding #ifndef CONFIG_LOG2 condition for log_msg_ids and
log_string_sync in sys-t sample. Extending support for
v2 logging in sys-t sample.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-01-05 14:41:51 +01:00
Lukasz Majewski
3e73fc287e samples: dts: Extend nucleo_h743 DTS to support attached QSPI memory
The nucleo_h743 allows extra capes to extend its functionality.

In our case it has been extended to use 32MiB SPI-NOR memory
connected to QUADSPI dedicated pins from block2.

Moreover, upper 16MiB of SPI-NOR memory has been used to store
littlefs data to test 4B addressing mode (which may cause problems
when NOR-flash is larger than 16 MiB).

Now the littlefs sample can be used to test this extension:
west build -p always -b nucleo_h743zi ./zephyr/samples/subsys/fs/littlefs

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2022-01-04 20:47:29 -05:00
Piotr Golyzniak
22e82ecf6d samples: fix wrong extra_args definitions
Fix wrong extra_args definitions wich cause that this args were not used
by CMake during building this samples via Twister in CI.

Signed-off-by: Piotr Golyzniak <piotr.golyzniak@nordicsemi.no>
2022-01-04 17:15:06 -05:00
Krzysztof Chruscinski
768c5d42c0 sample: logging: logger: Extend sample to use tag
Extended sample to use tag which is prepended to each message.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-01-04 14:57:31 -06:00
Enjia Mai
27db56468a samples: userspace: fix syscall_perf test cannot be run
The syscall_perf test cannot be built successfully due to region RAM
overflow on qemu_riscv32_xip and hifive1_revb. The dtim is only 16KB,
To reduce the main stack size to make it can be built successfully.

Base on the spec(fe310-g002-manual-v1p1.pdf), the size of itim should
be 8KB. Modify the definition in its DTS file.

And it also fix some of the gcc warning when testing it by twister.

This PR partially fixes #41399.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-01-04 15:51:43 -05:00
Piotr Pryga
3b5c1efc16 Bluetooth: host: Align usage of cte_type in DF host implementation
The CTE type is used in two ways by HCI layer:
1) single value representing particular CTE type: AoA, AoD 1 us,
  AoD 2 us
2) bit-filed where bits 0-2 represent particular CTE types AoA
  AoD 1 us, AoD 2 us

The bit-field is used to inform Controller about allowed types
of CTE, hence single value carries more than one value.
To avoid confusion between these use cases in code that refers
to case 1) all named cte_type (singular form). For case 2)
cte_types (plural form) is used.

There is an enumeration that is used for both cases:
bt_df_cte_type. For cte_type only single value from the
enumeration may be assigned to variable except
BT_DF_CTE_TYPE_NONE and BT_DF_CTE_TYPE_ALL.
For cte_types all enum members may be used. Ocasionally
BT_DF_CTE_TYPE_NONE may be excluded. If that is true,
it is described in code documentation.

Thanks to that applications are released from requirement
to include hci.h header file.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-01-04 16:02:40 +01:00
Erwan Gouriou
81bd4ba9c5 samples/tfm_integration: psa_crypto: Remove nucleo_l552ze_q
This sample requires to much flash compared to nucleo_l552ze_q
available resources.
Remove it from this sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-04 09:05:11 -05:00
Erwan Gouriou
830d9bdf89 samples/tfm_integration: nucleo_l552ze_q: Update flash partition
Due to a recent change in TFM, some more space should be allocated
to mcuboot flash partition (some space should be allocate for OTP)
(Cf commit db07170a34f ("Platform: Allocate space in flash for OTP")
in trusted-firmware-m repo)
Take this into account and increase mcuboot flash partition for
nucleo_l552ze_q_ns target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-01-04 12:33:23 +01:00
Sebastian Bøe
22365b4dea mcumgr: kconfig: Have OS_MGMT_TASKSTAT default to n
OS_MGMT_TASKSTAT depends on THREAD_MONITOR, so when it defaults to y
and THREAD_MONITOR is disabled we get a build error.

Add a depends on to enforce a correct configuration.

Remove default y, as features should be default n.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-04 11:54:28 +01:00
TOKITA Hiroshi
a194ef6191 samples: drivers: dac: add longan_nano board
DAC sample support longan_nano and longan_nano_lite board.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-01-04 11:49:14 +01:00
Henrik Brix Andersen
b1b77c1774 drivers: can: change can_tx_callback_t function signature
Change the can_tx_callback_t function signature to use an "int" (not an
uint32_t) for representing transmission errors.

The "error" callback function parameter is functionally equivalent to
the return value from can_send() and thus needs to use the same data
type and needs to be able to hold negative errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-01-01 07:40:29 -05:00
Gerard Marull-Paretas
bcab9f9ac5 samples: bluetooth: hci: replace SYS_DEVICE_DEFINE with SYS_INIT
SYS_INIT can be used for the same purpose, what is being run is simply
an initialization hook.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-24 20:59:10 -05:00
Carlo Caione
67ef1df950 mbox: Enforce callback registration before enabling the channel
Specify in the API that the callback must be registered before the
channel is enabled, fix the NRFX IPC driver to be compliant and change
the MBOX sample.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-12-23 12:38:21 +01:00
Henrik Brix Andersen
1f8255a311 samples: drivers: can: convert from can_attach_workq() to triggered work
Convert the CAN sample from using can_attach_workq() to using
can_attach_msgq() and triggered work via k_work_poll_submit().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-22 18:04:02 +01:00
Andrzej Kuros
e1b845cc88 samples: echo_server: increase sys workqueue stack
For nrf5340 with 802.15.4 system work queue stack size was too small.

Signed-off-by: Andrzej Kuros <andrzej.kuros@nordicsemi.no>
2021-12-21 15:20:41 -05:00
Erwan Gouriou
215822d161 samples: Take into account PINCTRL in minimal configurations
Now that PINCTRL is available, don't forget to disable it
in minimal configurations.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-12-21 18:30:35 +01:00
Dominik Ermel
659fee4460 samples: subsys: dfu: Fix image signing tool executable name
It is imgtool.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-12-21 17:08:35 +01:00
Kevin Townsend
8dbf0f31f2 doc: guides: tfm: Add pages on test suites
Adds notes on how to run the two main test suites for TF-M using
the supplied sample applications.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-12-21 17:07:58 +01:00
Yong Cong Sin
1e32d44729 samples: sensor: Add sample for MH-Z19B
Add sample for MH-Z19B CO2
sensor.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-12-20 18:47:47 +01:00
Carlo Caione
11f936c87e samples: mbox: Fix incorrect DT addressing
Place the nodes to the proper place into the DT. The driver is calling
directly into the NRFX without using any direct memory addressing so
this is mostly a cosmetic fix.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-12-20 17:48:36 +01:00
Jimmy Johnson
5fda6a3b2f sample: sensor: tmp108: Add ti tmp108 sample
This sample writes the tmp108 temperature to the console
once every 3 seconds. There are macro definitions included
for turning off and on alerts if that is set up, and
also using low power one shot mode.

Signed-off-by: Jimmy Johnson <catch22@fastmail.net>
2021-12-17 21:15:25 +01:00
Anas Nashif
05ecd46a84 tests: fix typos and misnamed platforms
Various obsolote and misnamed platfomrs in test filters theat went
undetected for a while.

Fixes #41222

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-12-17 12:24:37 -05:00
Andrzej Głąbek
bf7d655a48 samples: boards: nrf: Add sample for the display_nrf_led_matrix driver
Add a sample that can be used to see the nRF LED matrix display driver
in action and that will prove that the driver is buildable for both the
bbc_microbit_v2 and bbc_microbit boards.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-12-17 15:48:08 +01:00
Glauber Maroto Ferreira
1abf5394e9 samples: fat_fs: esp_wrover_kit: sdmmc support
- adds support to sdmmc through SPI
- adds support to samples/subsys/fs/fat_fs

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-16 20:49:27 -05:00
Glauber Maroto Ferreira
2bea827f05 samples: blinky_pwm: esp_wrover_kit: pwm led support
- adds overlayed board info to support PWM LED
- adds support for blinky_pwm sample code.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-16 20:49:27 -05:00
Glauber Maroto Ferreira
47f13d99a6 samples: lvgl: esp_wrover_kit: lcd display support
- adds dts support to ESP-WROVER-KIT's LCD display
controller
- adds support to samples/subsys/display/lvgl
- updates sample code documentation

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-16 20:49:27 -05:00
HaiLong Yang
ff9d967832 samples: drivers: dac: add gd32f450i_eval board
DAC sample support gd32f450i_eval board.

Signed-off-by: HaiLong Yang <cameledyang@pm.me>
2021-12-16 10:13:56 +01:00
Jeremy Wood
8068ab5261 samples: led_apa102: overlay and config for blueclover_plt_demo_v2
Added dts overlay and config to support using
samples/driver/apa201 with blueclover_plt_demo_v2_nrf52832.

Signed-off-by: Jeremy Wood <jeremy@bcdevices.com>
2021-12-16 10:12:57 +01:00
Enjia Mai
521e6ffb7c samples: enlarge the stack size to run a sample successfully
CMSIS limits the stack size, but for qemu_x86_64, qemu_xtensa, qemu_leon3
and the boards sunch as up_squared, ehl_crb, acrn_ehl_crb need more
stack size to run this successfully, or the stack overflow will happened.
So we enlarge the stack size to 1024 for this sample case.

For other boards the original 512 is enough.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2021-12-15 21:23:29 -05:00
Joakim Andersson
0f3169648b cmake: Update messages mode using INFO to the correct mode STATUS
Search and replace `message(INFO " ` with `message(STATUS "`.
This would otherwise print "INFO <message"

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-12-15 14:58:05 -06:00
Flavio Ceolin
18b932f10d pm: device_runtime: Return possible error on enable
Change the function pm_device_runtime_enable() to return 0 on
success or an error code in case of error.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-12-14 19:23:05 -05:00
Casper Meijn
92e317c158 samples: boards: pinetime: Remove duplicate sample
samples/boards/pine64_pinetime has the same functionality as the more
general samples/basic/button application with the board specific
driver `pinetime-key-out`.

Signed-off-by: Casper Meijn <casper@meijn.net>
2021-12-14 12:32:32 +01:00
Jeffrey Urban
34a958f545 samples: net: google_iot_mqtt: Change read publish to blocking
Avoid endless loop in `case MQTT_EVT_PUBLISH`
Fail on any error for mqtt_read_publish_payload_blocking, inc. -EAGAIN.

Fixes zephyrproject-rtos#40965

Signed-off-by: Jeffrey Urban <jeffrey@jeffreyurban.com>
2021-12-14 12:30:59 +01:00
Alex Sergeev
a485eed871 samples: net: gptp: Add nucleo_f767zi and nucleo_h745zi_q boards
Add nucleo_f767zi and nucleo_h745zi_q boards to gPTP samples.

Signed-off-by: Alex Sergeev <asergeev@carbonrobotics.com>
2021-12-13 22:19:25 -05:00
Martí Bolívar
68e5745d05 samples: spi_flash_at45: fix build
Add a missing include.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-13 20:41:33 -05:00
Robert Lubos
6d3c1ddec2 samples: net: google_iot_mqtt: Fix CI for the sample
The sample did not specify any tests in its sample.yaml file, causing CI
failures.

Additionally, the sample requires to generate secure key before building
the sample, otherwise the build fails. For the CI needs, specify a dummy
test key, which is only included if the build was triggered by Twister.
For this, specify a USE_DUMMY_KEY variable in the sample.yaml file.

Finally, fix some minor build issues in the sample itself - remove
unused variable, and remove deleted (and also unneeded) mbed TLS header
inclusion.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-13 20:34:28 -05:00
Lauren Murphy
5b62546eed samples, modules: tflite-micro: reduce sample test case noise
Reduces noise of sample test case in CI by reducing number of
output lines from 50 to 10.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-12-13 19:24:32 -06:00
Glauber Maroto Ferreira
0dfc2ea103 doc: samples: display: update documentation
- fixes sample codes' relative paths
- updates instructions to build and run for native posix
platforms on its 64 flavor.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-12-13 19:39:47 -05:00
Erwan Gouriou
9407add27c samples/drivers: led_pca9633: Convert to build_only
Sample should only be run if led is present on board.
Since, this is not the case on any of the in tree boards,
set the sample as build-only.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-12-13 10:02:44 -06:00
Gerard Marull-Paretas
459c3f918f doc: drop single quote references
Many documents relied on single quotes to create references, e.g.
`my_reference`. This is possible because `default_role = "any"` is
enabled in Sphinx conf.py. However, this method comes with its problems:

- It mixes all domains together, so it's not clear to what are you
  referencing: a document? a Kconfig option? a C function?...
- It creates inconsistencies: in some places explicit roles are used
  (e.g. :ref:`my_page`) while in some others not.
- _Conflictis_ with markdown. Single quotes are used for literals in
  Markdown, so people tend to use the same syntax in Sphinx, even though
  it has a different purpose.

Usages have been found using `git grep ' `[^`]*` ' -- **/*.rst`.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-10 16:43:34 -05:00
Johann Fischer
5296339fde usb: rework to use macro STRUCT_SECTION_FOREACH
Replace deprecated macro USBD_CFG_DATA_DEFINE by
USBD_DEFINE_CFG_DATA which places usb_cfg_data structures
in specific iterable section.

Replace __usb_data_start, __usb_data_end usage patterns
  size_t size = (__usb_data_end - __usb_data_start);
  for (size_t i = 0; i < size; i++) {...}
by
  STRUCT_SECTION_FOREACH(usb_cfg_data, ...) {...}

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 07:22:15 -06:00
Johann Fischer
307c13b218 drivers: display: remove unused Kconfig options
remove unused options SDL_DISPLAY_* and DUMMY_DISPLAY_*.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer
bf0b879067 samples: cfb_custom_font: set required pixel format
Set for this sample required pixel format.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer
4541f1f76a samples: use chosen property to get default display controller
Rework samples to use DEVICE_DT_GET and DT_CHOSEN
to get default display controller device.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer
2d175d14f3 drivers: display_dummy: rework to obtain configuration from devicetree
Add bindings for dummy display controller.
Rework dummy display controller driver to obtain
configuration from devicetree. Remove unnecessary casts,
add multi-instance support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:30 +01:00
Johann Fischer
af620ef196 sample: dfu: exclude b_u585i_iot02a board
Exclude b_u585i_iot02a board from USB DFU sample since
it has no flash driver.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-12-10 12:47:10 +01:00
Daniel DeGrasse
e9b74593b8 boards: mimxrt11xx: Enable Flash driver on RT1160 and RT1170
Enable the flash on RT1170 and RT1160. When booting from the CM7 core,
flash will be started in XIP mode and used as storage as well as boot
memory. When booting from the CM4 core, flash is available as storage
only, and does not run in XIP mode.

This commit was tested with the following samples
-flash_shell
-littlefs

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-12-09 19:32:45 -05:00
Gerard Marull-Paretas
a66b79999b samples: tfm_integration: tfm_ipc: replace deprecated header
<power/reboot.h> needs to be replaced with <sys/reboot.h>

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-09 14:43:06 -05:00
Henrik Brix Andersen
f499559434 drivers: can: deprecate the use of CAN-specific error return values
Deprecate the use of CAN-specific error return values and replace them
with standard errno values.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-12-09 12:37:40 -05:00
Jukka Rissanen
4c038464c3 samples: net: gsm_modem: Fix gsm_ppp.h path
The gsm_ppp.h is currently in include/drivers/modem directory
so change the path accordingly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-12-08 10:06:55 -05:00
Guillaume Lager
ed68ef5678 samples: tmp116: Add access to eeprom
Add read access to internal tmp116 eeprom which
contains the device unique id after manufacturing

Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
2021-12-08 07:51:46 -06:00
Alexander Wachter
2bf02f4854 samples: net: sockets: echo server/client add 6locan to yaml
Add congiguration for 6locan to the sample yaml file.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2021-12-06 08:15:14 -05:00
Robert Lubos
f85e37ae2c samples: net: sockets: coap_client: Make use of CoAP APIs for observe
The sample oversimplified the observe mechanism a bit - instead of
making use of CoAP APIs to verify the packets received (if they are
actually notifications for the observe) it blindly assumed that any
received packet was a notification. This could be misleading for
potential users of the CoAP library, as the sample had little use as
a reference for the Observer functionality.

Fix this by making use of `coap_reply` structure and a corresponding
`coap_response_received()` function.

Additionally, make the observe cancellation compliant with the CoAP
specification - it should be either an empty Reset message, or a GET
request with Observe option set to 1. The sample used invalid
construct of a Reset message with Observe option. For the purpose of
the sample, use the latter option.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-06 08:09:13 -05:00
Robert Lubos
ed497ba6f9 samples: net: sockets: coap_client: Fix notification ACK
The sample intended to send an empty ACK for the notification message
(response code equal to 0), yet it included a token in the ACK reply
(which is not correct for an empty ACK).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-06 08:09:13 -05:00
Robert Lubos
3bc0319940 samples: net: sockets: coap_server: Support both Observe cancel methods
Add support for both Observe cancellation methods - empty Reset reply
(in place of ACK) and GET message with Observe option set to 1.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-06 08:09:13 -05:00
Robert Lubos
0fb4b405be samples: net: sockets: coap_server: Switch to IPv6 by default
The documentation of the sample refers IPv6 instead of IPv4.
Additionally, the coexisting coap_client sample also uses IPv6 by
default. Therefore, switch the sample default configuration to use IPv6
instead of IPv4.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-12-06 08:09:13 -05:00
Marc Reilly
54b6d26242 drivers: spi: add spi-bitbang driver
This adds an spi master mode driver via bitbanged gpio. Only syncronous
transfers are implemented. Clock signal timing is accomplished via busy
waits, the gpios are manipulated via the standard gpio interface; these
two factors limit the frequency at which it can operate - but here
a simple and generic implementation was chosen over performance.

The driver supports the various clock polarity and phase
configurations, and can also work with word sizes which are non
multiples of 8bits, currently up to 16 bits.

A sample program is also added demonstrating basic use of the driver
with 9bit data words.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
2021-12-06 07:29:45 -05:00
Gerard Marull-Paretas
7bfd0976aa pm: state: PM_STATE_DT_ITEMS_LEN->DT_NUM_CPU_POWER_STATES
Rename PM_STATE_DT_ITEMS_LEN to DT_NUM_CPU_POWER_STATES to make its
purpose more clear. This macro could be made part of a Devicetree API
for PM in the future.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Gerard Marull-Paretas
fa96955305 pm: state: PM_STATE_INFO_DT_ITEMS_LIST->PM_STATE_INFO_LIST_FROM_DT_CPU
Rename the PM_STATE_INFO_DT_ITEMS_LIST macro to
PM_STATE_INFO_LIST_FROM_DT_CPU to make its purpose more clear. Similar
naming scheme is found e.g. in the GPIO API.

Associated internal macros and docstrings have been adjusted, too.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-12-04 12:33:57 -05:00
Paul He
2bf27f5953 samples: prod_consumer: use app_shared.h instead of main.h
Normally main.c file doesn't have a header file, because it doesn't
need to declare any interfaces to other modules.

In this sample, it's better to put the shared variables in one place,
and provide the interfaces to other modules, such as app_a, app_b,
and main.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2021-12-02 10:53:55 +01:00
Joakim Andersson
e4a88c4ce6 samples: tfm_secure_partition: Remove conditional from partition
Remove the conditional attribute from the sample partition manifest.
The conditional behavior will change with TF-M 1.5 to only accept
cmake bool values on/off enabled/disabled true/false and is intended
to be generated by the build system.
Since the partition is supposed to always be enabled in the sample
there is no need to have a conditional for it.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-12-01 14:14:59 -06:00
Krzysztof Chruscinski
08de059c8a samples: logging: logger: Add configuration for nrf52840dk
Added board specific configuration which enables use of
asynchronous UART API in UART log backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-12-01 10:02:28 +01:00
Daniel Leung
917b3cf7c0 samples: debug/gdbstub: update instructions to run
This corrects the directory pointing to sample in the README
file. Also changes the TCP port number for the second serial
port exposing the GDB stub. This allows QEMU itself to expose
GDB interface through port 1234, and Zephyr's GDB stub at
port 5678.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-30 15:24:00 -05:00
Kim Bøndergaard
ee6c552805 boards: frdm_k64f: Solve conflict between UART3 and enet
Arduino compatible boards should have a working UART on pin 0 & 1.
On frdm_k64f this is handled by uart3

Unfortunately pinmuxing of uart3 was destroyed when enabling NETWORKING,
because the uart3 RX/TX pins was reconfigured for 1588 timers.

1588 timers are enabled by the enet child node, ptp which by some reason
is enabled by default.
1588 timers aren't needed in most cases when ethernet is being used,
so this fix ensures ptp is by default disabled. Likewise pinmuxing of
the 1588 timer functionality is now dependant of ptp being active

Signed-off-by: Kim Bøndergaard <kim.boendergaard@escoglobal.com>
2021-11-30 11:08:15 -06:00
Francois Ramu
1fa0828d22 samples: stm32 power mngt enters low power
Remove this line because the pm_device_busy_set function will
prevent the system to enter low power.
This sample application wants to.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2021-11-29 18:19:46 -05:00
Christopher Friedt
7ea93a8853 tests: kernel: cycle64: mark test as slow
Previously cycle64 was under `samples/`. It's been moved to
`tests/` and has been marked with `slow: True` so that it
will not disrupt CI by adding excessive delays.

Fixes #40367

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-29 10:35:49 -05:00
Gerard Marull-Paretas
89a4f36fc8 device: remove inclusion of pm/device.h
The device PM subsystem _depends_ on device, not vice-versa. Devices
only hold a reference to struct pm_device now, and initialize this
reference with the value provided in Z_DEVICE_DEFINE. This requirement
can be solved with a forward struct declaration, meaning there is no
need to include device PM headers.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-29 11:08:38 +01:00
Jair Jack
0b06a06814 net: lwm2m: Supported Protocol to pull firmware update must be optional
The supported protocol must be delivered to the firmware update object
as optional, then configured in the application.

This information is device/server dependent so does not can be fixed
in library.

Signed-off-by: Jair Jack <jack@icatorze.com.br>
2021-11-26 10:26:32 -05:00
Gerard Marull-Paretas
a6520ad690 samples: boards: nrf: dynamic_pinctrl: initial version
Add a sample that shows how dynamic pin control can be useful to remap a
peripheral to a different set of pins.

NOTE: default pin configuration is provided for the nRF52840-DK board.
Such configuration will be removed once all nRF-based boards are ported
to pinctrl.

Thanks to Francesco for documentation suggestions.

Co-authored-by: Francesco D. Servidio <francesco.servidio@nordicsemi.no>
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-26 14:20:51 +01:00
Erwan Gouriou
dd0b133a62 samples/drivers: led_pca9633: Replace target stm32373c_eval
Pinctrl is missing in i2c1 device description on stm32373c_eval
ovderlay file, besides using I2C1 this board (as mentioned in readme)
requires to remove 2 resistors on the board.

Make it simple and instead use a board with arduino_i2c port
available.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-26 11:36:42 +01:00
Robert Lubos
666e9f80d6 net: ipv6: Remove in6_addr from packed net_ipv6_hdr struct
Replace unpacked in6_addr structures with raw buffers in net_ipv6_hdr
struct, to prevent compiler warnings about unaligned access.

Remove __packed parameter from `struct net_6lo_context` since the
structure isn't really serialized.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Robert Lubos
064200b420 net: ipv4: Remove in_addr from packed net_ipv4_hdr struct
Replace unpacked in_addr structures with raw buffers in net_ipv4_hdr
struct, to prevent compiler warnings about unaligned access.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-25 10:46:35 -05:00
Maik Vermeulen
f2ca6a8c22 net: lwm2m: Add observe callback for observe and notification events
Added an observe callback so that the application can register to
receive events like observer added/deleted, and notification acked/
timed out. The notifications can be traced back to the exact data
contained within them by use of the user_data pointer.

Fixes #38531.

Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
2021-11-25 10:45:36 -05:00
Yeshvanth M
a1947006d6 samples: Bluetooth: Added Observer sample
This sample scans for nearby BLE devices and prints the address of the
device found and the RSSI value to the UART terminal.

Uses passive scanning and demonstrates the role of the observer.

Signed-off-by: Yeshvanth M <yeshvanthmuniraj@gmail.com>
2021-11-25 17:09:32 +02:00
Yeshvanth M
118f37b574 samples: Bluetooth: Added Broadcaster sample
This sample periodically sends out advertising data packets with
manufacturer data element.

The content of data sent is a single byte indicating how many
advertising packets the device has sent which rolls back to 0 after 255.
Demonstrates role of broadcaster.

Signed-off-by: Yeshvanth M <yeshvanthmuniraj@gmail.com>
2021-11-25 17:09:32 +02:00
Stephanos Ioannidis
6ee8182e0a samples: tflite-micro: hello_world: Increase main stack size
This commit increases the main stack size to 2048 since the current
stack size is insufficient for the `qemu_x86` board (the default stack
size is 1024 for that board) and results in a stack overflow in the
main thread.

Note that this is required because the newlib full variant, which is
used by this sample, included in the Zephyr SDK 0.13.2 now has an
increased stack usage requirement due to enabling the C99 format
specifier support.

For more details, refer to the issue #40469 [1].

[1] https://github.com/zephyrproject-rtos/zephyr/pull/40469#issuecomment-977854095

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-11-25 06:58:45 -05:00
Ryan McClelland
ed96eb6e63 samples: fix double promotion warnings
With -Wdouble-promotion added to the warning base, fix warnings given
by the compiler.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2021-11-24 17:14:25 -05:00
Abe Kohandel
a6f932a194 bluetooth: ots: Add Create and Delete procedures
Add the ability to perform an OTS Create or Delete Procedure.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-11-24 21:49:11 +02:00
Flavio Ceolin
6451626ce7 pm: Use pm_device_action_run instead of state_set
Since drivers implement a callback based on action and not the state,
we should be using the API based on the action instead of the one based
on the state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-24 14:21:50 -05:00
Jordan Yates
8e99db5801 Kconfig: net: deprecate NET_BUF_USER_DATA_LEN
As user data sizes are now set on a per pool basis, this Kconfig option
has no purpose.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Jordan Yates
df327eeb58 net: buf: POOL_FIXED_DEFINE explicit user data
Update the macro prototype to explicitly require the length of the
desired user data. Update all in-tree usage of this macro.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-11-24 16:04:50 +02:00
Johann Fischer
cf8d7764da usb: fix bulk endpoint configuration for high-speed capable device
In the current USB device support, the sizes of bulk endpoint
are mostly configure through Kconfig and do not care if a device
is high-speed capable. The information if a USB device controller
supports high-speed comes from devicetree. Add a Kconfig option to
map this information and configure bulk endpoint sizes
accordingly.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-24 12:28:02 +01:00
Johann Fischer
67a265b0df samples: cdc_acm: check return value of uart_fifo_read()
uart_fifo_read() can return negative values in case
it is not implemented or CONFIG_UART_INTERRUPT_DRIVEN
is not enabled. Both cases can not actually happen in the
case of CDC ACM UART, check it anyway in case behavior
of the UART API changes unnoticed.

Align the code in RX path code of both camples and
enable TX interrupt only if data was received successfully.

Fixes: #39835
Fixes: #39824
Fixes: #39809
Coverity-CID: 240667
Coverity-CID: 240679
Coverity-CID: 240697

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-24 10:50:11 +01:00
Carlo Caione
2e9c57ec28 sample: ipc_service: Add ipc_rpmsg_static_vrings sample
Add a new sample to show and test the usage of the newly introduced
backend.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-22 23:03:23 -05:00
Øyvind Rønningstad
449cb60815 samples: Add TF-M sample for custom secure partitions
The sample implements a dummy ARoT (Application Root of Trust) partition
in TF-M and calls it from the app.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-22 22:19:41 -05:00
Daniel Leung
bb595a85f1 kernel: mem_domain: add/remove partition funcs to return errors
This changes both k_mem_domain_add_partition() and
k_mem_domain_remove_partition() to return errors instead of
asserting when errors are encountered. This gives the application
chance to recover.

The arch_mem_domain_parition_add()/_remove() will be modified
later together with all the other arch_mem_domain_*() changes
since the architecture code for partition addition and removal
functions usually cannot be separately changed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Daniel Leung
fb91ce2e21 kernel: mem_domain: init function to return error values
This changes k_mem_domain_init() to return error values
instead of asserting when errors are encountered.
This gives applications a chance to recover if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-11-22 12:45:22 -05:00
Glauber Maroto Ferreira
66130da4c9 board: esp32: update SPI RAM sample code documentation
to mention sample code support added for ESP32-S2.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-11-20 11:57:38 -05:00
Glauber Maroto Ferreira
c5857dc0cd soc: esp32s2: SPIRAM: remove unused configs
and updates hal_espressif's revision.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-11-20 11:57:38 -05:00
Tomasz Bursztyka
f6be2835bd drivers: Apply SPI API change to relevant places
Mostly drivers, but also one sample and one test.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-19 11:50:38 +01:00
Gerard Marull-Paretas
16d1e80cbe samples: pm: use new PM macros
Use recently introduced PM macros to define device PM resources.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Gerard Marull-Paretas
f4417dab46 device: remove PM capability from SYS_DEVICE_DEFINE
The macro already mentions in the docstrings that PM is not supported:

"Invokes DEVICE_DEFINE() with no power management support".

This patch removed the PM entry from the macro and ajusts its uses.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-19 10:11:32 +01:00
Daniel DeGrasse
6608e68af5 boards: mimxrt11xx: Enabled FXOS8700 Accelerometer
Enables the FXOS8700 accelerometer included on the RT1160 EVK and RT1170
EVK.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-18 16:39:18 -06:00
Johann Fischer
5315c285cc sampes: shell: remove usage of CONFIG_USB_UART_CONSOLE
Remove option CONFIG_USB_UART_CONSOLE where it has no influence
or enable CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR without taking
a detour through CONFIG_USB_UART_CONSOLE.

Check the compatibility of chosen property instead
of usage of CONFIG_USB_UART_CONSOLE option.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Johann Fischer
0908a52d0d samples: usb: console: fix configuration
This sample uses console driver and therefore
Kconfig option CONFIG_CONSOLE and CONFIG_UART_CONSOLE
are required.

Kconfig option CONFIG_USB_UART_CONSOLE no longer has
any influence here and should be removed.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-18 14:29:18 +01:00
Flavio Ceolin
4998c52ba8 pm: Make pm_power_state_force multicore aware
Change pm_power_state_force to receive which cpu the state should be
forced. Also, it changed the API behavior to force the given state only
when the idle thread for that core is executed.

In a multicore environment force arbitrarily a core to suspend is not
safe because the kernel cannot infer what that cpu is running and how it
impacts the overall system, for example, if it is holding a lock that is
required by a thread that is running in another cpu.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-11-18 13:56:15 +01:00
Emil Gydesen
19c032ed78 Bluetooth: ISO: Rename bt_iso_cig_create_param
Renames the struct from bt_iso_cig_create_param to
bt_iso_cig_param as the same struct can, without
modification, be used to update the CIG as well
(function to support that will come in a later commit).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
ba0a053f94 Bluetooth: ISO: Change CIG/BIG to use slist instead of array
A CIG may be updated later to include more CIS, and thus a slist
makes more sense.

The BIG doesn't need the change, but it makes more sense to
have similar handling for both.

This change also removes the requirement that the arrays
used to create the CIG/BIG need to static.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-15 14:39:59 -05:00
Emil Gydesen
12decc70d0 Bluetooth: ISO: Add bitmask for retrieving iso header lenght
Add a macro to retrieve the iso data load length (the
length stored in the iso header) with a bit mask that
ensures that we only take the first 14 bits.

This is to remove any RFU bits that may have been set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-12 14:52:33 +01:00
Emil Gydesen
08b1dfb4a2 Bluetooth: ISO: Fix incorrect struct for ISO hdr data
There were a few cases where bt_hci_iso_data_hdr was used
instead of the proper struct bt_hci_iso_hdr.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-11-12 14:52:33 +01:00
Carlo Caione
2e3481b59c samples: ipc_service: Make space for new backends
Move the backend-specific samples to a new subdirectory to make space
for new samples.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-12 14:51:29 +01:00
Carlo Caione
b64666bcc7 samples: Move IPM samples in a different directory
Currently the IPM samples are hosted in the IPC sample location. Clean
this situation up by moving the IPM samples to a new location.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-12 14:51:29 +01:00
Joakim Andersson
ba85663a42 doc: Update TF-M documentation to match current TF-M version
Update TF-M documentation to match the current integrated TF-M version.
Include mention of the Platform secure partition that can be enabled.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-12 14:51:22 +01:00
Fabio Baltieri
911a483f7a samples: canopennode: update led and sw to use gpio_dt_spec
Switch the LED and button code to the gpio_dt_spec APIs. This also gets
rid of the code conditionals, so that the entire sample code is always
compiled.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-12 14:51:16 +01:00
Fabio Baltieri
fa87410cd6 samples: canopennode: increase main stack size
Bump up the main stack size from 1kB to 2kB, seems like the settings
restore function right now goes above the default stack size for SPI
flash devices:

0x20000aa8 main (real size 2048): unused 864 usage 1184 / 2048 (57 %)

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-11-12 14:51:16 +01:00
Robert Lubos
41c2789b77 samples: net: telnet: Enable command handling by default
Not handling telnet commands may lead to some unexpected behaviour, like
telnet client locking when it does not receive a response for DO TIMING
MARK command.

Therefore enable it by default in the sample to improve user exprience.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-11-11 19:23:20 -05:00
Felipe Neves
b50cb2a537 drivers: counter: esp32: add support for esp32c3
to the unified esp32 counter driver.

Signed-off-by: Felipe Neves <felipe.neves@espressif.com>
2021-11-11 19:14:15 -05:00
Sylvio Alves
9d159ba86f samples: shell_module: fix missing qsort reference
PR #39980 added qsort to minimal libc but caused
shell_modules sample to fail building.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-11-11 18:12:09 -05:00
Tomasz Bursztyka
32db35a721 net/tcp: Rename TCP2 to TCP
TCP2 is no longer needed as it is the unique implementation since the
legacy one has been removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2021-11-11 07:26:41 -05:00
Carlo Caione
74b701065d bindings: nrf-ipc: Enable DT helpers
Make the MBOX NRF IPC instances referenceable using the MBOX DT helpers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-10 10:28:14 -06:00
Christopher Friedt
bd83df1552 libc: minimal: add qsort to the minimal libc
This change implements qsort() for the minimal libc via Heapsort.

Heapsort time complexity is O(n log(n)) in the best, average,
and worst cases. It is O(1) in space complexity (i.e. sorts
in-place) and is iterative rather than recursive. Heapsort is
not stable (i.e. does not preserve order of identical elements).

On cortex-m0, this implementation occupies ~240 bytes.

Fixes #28896

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-10 07:00:36 -05:00
Devaraj Ranganna
c3e5899658 samples: psa_crypto: Create Certificate Signing Request
This is a first step towards demonstrating provisioning of X.509
certificates. The device certificate signing request is created using
Mbed TLS X.509 APIs. The elliptic curve key `SECP256R1` used to sign the
CSR is generated inside TF-M and Mbed TLS is configured to use TF-M for
crypto services. This approach will ensure that private key never
leaves secure side.

The CSR is encoded in JSON and is printed on the console.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-11-09 19:57:28 -05:00
Erwan Gouriou
32f61c1d71 samples: Add a stm32wb sample code for ble shutdown
Target is shutdown after 4 sec advertisement.
Wake up using reset button.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-11-09 05:49:23 -05:00
Henrik Brix Andersen
5bc0451f72 drivers: can: remove DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro
Remove the DT_CHOSEN_ZEPHYR_CANBUS_LABEL macro and replace it with
DEVICE_DT_GET(DT_CHOSEN(zephyr_canbus)) were possible.

Where both devicetree CAN controllers and Kconfig specified CAN loopback
controllers are supported, the macro is replaced with
DT_LABEL(DT_CHOSEN(zephyr_canbus)) for now.

This is the first pass for removing the requirement for devicetree
labels for CAN controllers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-09 11:19:50 +01:00
Christopher Friedt
43856f2dc6 samples: kernel: add cycle64 sample
The cycle64 sample is intended to complement
`test_clock_cycle_64()` in `tests/kernel/common`.

The sample demonstrates the upper 32-bits of the 64-bit cycle
counter incrementing when the bottom 32-bits roll over from
`UINT32_MAX` to 0.

If the upper 32-bits of the 64-bit cycle counter does not
increment, then an error message is printed.

```
west build -p auto -b qemu_cortex_a53 -t run \
	samples/kernel/cycle64
...
*** Booting Zephyr OS build v2.7.99-1124-gd7ba4e394832  ***
wrap-around should occur in 68s
[ddd:hh:mm:ss.0ms]
[000:00:00:00.020]: c64: 0000000000174258
[000:00:01:08.760]: c64: 000000010027f8bb
[000:00:02:17.490]: c64: 0000000200348c85
```

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-11-08 13:41:53 -05:00
Johann Fischer
02c32d4474 usb: move USB_DEVICE_REMOTE_WAKEUP option to drivers
Kconfig USB_DEVICE_REMOTE_WAKEUP option depends only on
USB device controller capability, but is not controlled
by the USB device controller drivers configuration.
Move USB_DEVICE_REMOTE_WAKEUP option to drivers and
make it promptless.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-11-08 17:01:32 +01:00
Henrik Brix Andersen
c817a09b0a canbus: rename zephyr,can-primary chosen property to zephyr,canbus
Rename the Zephyr chosen property for specifying the default CAN bus
controller from "zephyr,can-primary" to "zephyr,canbus".

The "zephyr,can-primary" property name was selected in antipation of
adding support for redundant CAN networks, which we have yet to
add. Meanwhile, the "primary" term causes confusion for non-redundant
CAN bus configurations (and the "can" term doesn't match the name of the
Zephyr CAN bus subsystem).

The CAN in Automation (CiA) 302-6, which deals with CANopen network
redundancy, uses the terms "default interface" and "redundant
interface". If/when we add support for redundant CAN networks, the
"zephyr,canbus" chosen property can be supplemented with a
"zephyr,canbus-redundant" chosen property.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-11-07 09:05:39 -05:00
Pavel Hübner
104714394f kernel: Introduce K_MEM_SLAB_DEFINE_STATIC
As the already existing macro K_MEM_SLAB_DEFINE results in
two variable definitions, the preceding static modifier leads to
a seemingly working solution, though linkage conflicts will occur
when the same memory slab name is used across multiple modules.

The new K_MEM_SLAB_DEFINE_STATIC macro duplicates the functionality of
K_MEM_SLAB_DEFINE with the difference that the static keywords are
internally prepended before both variable definitions.

The implementation has been tested on my Zephyr project (the build
issue faded out). The documentation has been updated altogether
with all incorrect occurences of static K_MEM_SLAB_DEFINE.

Signed-off-by: Pavel Hübner <pavel.hubner@hardwario.com>
2021-11-07 05:36:48 -05:00
Andrei-Edward Popa
ea82845f1b samples: led_pwm: added overlay for the esp32 board
added pwm leds in board overlay file,
added configs in board conf file

Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
2021-11-07 05:36:42 -05:00
Andrei-Edward Popa
02c2cae942 samples: blinky_pwm: added overlay for the esp32 board
added pwm leds in board overlay file,
added configs in board conf file

Signed-off-by: Andrei-Edward Popa <andrei_edward.popa@upb.ro>
2021-11-07 05:36:42 -05:00
Dominik Ermel
a333ffce1d storage/flash_map: Add FLASH_AREA_DEVICE macro
The macro returns pointer to a device object the flash area
exists on.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-11-06 21:37:47 -04:00
Andrzej Głąbek
cd2236c199 samples: hci_spi: Decrease maximum number of BT connections
With the maximum number set to 20, the sample fails to build for
both platforms set as allowed for this sample and mentioned in its
documentation, i.e. 96b_carbon_nrf51 and nrf51dk_nrf51422 (a build
attempt ends up with an SRAM region overflow). Use a lower number
to prevent this failure and set both those boards as integration
platforms, so that such problem, if it was to appear again, could be
caught by CI.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-11-06 13:54:08 +01:00
Carlo Caione
2c08114c27 ipc_service: mi: Convert to device driver
As part of the work to support multiple IPC instances / backends using
IPC service, the static vrings mi code must be reworked to resemble a
classic device driver.

Fix also the sample using it.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-04 18:03:16 +01:00
Gerard Marull-Paretas
a8fc8ef17f samples: use common PM action callback naming
The PM callback is no longer referenced as "pm_control" but
"pm_action_cb", so reflect this new naming on the callbacks.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 20:27:18 -04:00
Gerard Marull-Paretas
1cee284a46 pm: device: runtime: use pm_device_runtime* namespace
Move all PM device runtime API calls from pm_device* to the
pm_device_runtime* namespace.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00
Gerard Marull-Paretas
e3fece5241 pm: device: runtime: remove pm_device_wait
After the removal of pm_device_get_async, the pm_device_wait API has
become redundant. Its usage after pm_device_put_async should not be
considered a valid usecase, since after that call what will happen is a
pm_device_get (which is blocking).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00
Gerard Marull-Paretas
30d217aa28 pm: device: runtime: remove pm_device_get_async
As of today there is no clear usage of asynchronous gets, since in
general, a resume operation should be synchronous (we are about to use
the device immediately after resuming it). Removing this API simplifies
the runtime implementation in a significant way (refer to future
commits).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-11-03 16:37:33 -04:00
Daniel DeGrasse
7cd8c06bb3 boards: mimxrt1160: Enable watchdog timer on RT1160
Enable watchdog timer on RT1160 evk. This was tested using
the watchdog timer api test (tests/drivers/watchdog/wdt_basic_api)

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-03 16:18:25 -04:00
Daniel DeGrasse
a477b25060 boards: mimxrt1160: Enabled ADC support for RT1160
ADC support verified with driver sample. LPADC1 channel 0 pin used,
which maps to pin 10 on J9 on the EVK.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-11-03 16:18:25 -04:00
Vinayak Kariappa Chettimada
5f5a50aa14 tests: Bluetooth: bsim: Add iterations to multiple conn to peripherals
Add iterations of connections and disconnections to
Babblesim test of Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Enable Auto PHY Update and Auto Data Length Update procedure
in the central_multilink sample.

Enable Auto PHY Update and Auto Data Length Update procedure
in the peripheral_identity sample. Fixed issues related to
rotation of identities after maximum number of connection
iterations are repeated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:59:00 +01:00
Vinayak Kariappa Chettimada
80d590c689 samples: Bluetooth: periodic_adv: Add Extended Advertising disable
Add implementation to iteratively perform Extended
Advertising enable and disable while Periodic Advertising is
active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-11-03 16:51:40 +01:00
Sylvio Alves
220a55f5fd samples: hci_uart: esp32: add overlay and config files
Enabling hci_uart sample requires changing
max BT connections and proper uart overlay. Use
this as sample for ESP32 soc.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-11-03 15:12:30 +01:00
Andrew Hedin
52c298e0e3 drivers: sensors: lis2dh: Add ability to read temperature
Allow user to read temperature from LIS2DH family of sensors.

Signed-off-by: Andrew Hedin <andrew.hedin@lairdconnect.com>
2021-11-02 22:23:39 -04:00
Bartosz Bilas
865ff22b3f samples: subsys: dfu: update URL of the MCUboot zephyr readme
Switch to the new MCUboot zephyr documentation URL
since the old one returns error 404.

Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
2021-11-02 13:25:43 +01:00
Jun Lin
ef995dfbdc samples: drivers: spi_flash: add support for the NPCX EVB
This commit adds the support to run the SPI NOR sample code on the
npcx7m6fb_evb and npcx9m6f_evb boards.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: I780c5dfcf53f3ac537da946673fc03f5ee24e90c
2021-11-01 21:48:20 -04:00
Chris Pearson
c4842c1879 net: openthread: add log_strdup to role text, fix doc gender issue
- Add a `log_strdup` to the role text output for logging V1
  compatibility
- Fix style issues
- Change where the documentation refers to an OpenThread device as
  "himself" to "itself"

Signed-off-by: Chris Pearson <ctpearson@gmail.com>
2021-11-01 21:47:43 -04:00
Chris Pearson
b8dff131dd net: openthread: Change OT net log to display current role in text
If CONFIG_NET_LOG=y is set, OpenThread will output the current OT
role whenever the state changes.

To simplify understanding of the log output, this change replaces
the numerical role ID with the text name of the role. This also
required a change to a documentation file to replace an instance
of a numerical ID.

NOTE: This is potentially a breaking change should anyone be using
test scripts that monitor the OpenThread state changes and look
for the numerical ID. This does not seem to be the case for the
Zephyr tests, however.

Signed-off-by: Chris Pearson <ctpearson@gmail.com>
2021-11-01 21:47:43 -04:00
Carlo Caione
c03519fffc mbox: ipc: s/_MBOX_NRFX/_MBOX_NRFX_IPC/
Use a more precise Kconfig symbol name to avoid namespace conflicts when
more NRFX-dependent drivers will be added.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-11-01 11:30:59 -04:00
Joakim Andersson
dda3a5ad0d modules: tfm: Split trusted-firmware-m repository
Split the zephyr project maintained repository trusted-firmware-m into
forks of the individual upstream repositories.

https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git
Upstream: TF-Mv1.4.1
Additions:
zephyr: module: Add zephyr module file
trusted-firmware-m: platform: lpcxpresso55s69: Update SDK

https://git.trustedfirmware.org/TF-M/tf-m-tests.git
Upstream: 51ff2bdfae043f6dd0813b000d928c4bda172660
Additions:
zephyr: module: Add module file for tf-m-tests

https://github.com/ARM-software/psa-arch-tests.git
Upstream: 60faad2ead1b967ec8e73accd793d3ed0e5c56bd
Additions:
zephyr: module: Add module file for psa-arch-tests
psa-arch-tests: Allow overriding of toolchain file

The organization of folders remain the same with the following
exceptions:
Moved:
root folder moved from modules/tee/tfm to modules/tee/tf-m to avoid
problems with west update.
zephyr/module.yml to trusted-firmware-m/zephyr/module.yml and
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR} points to what was previously
${ZEPHYR_TRUSTED_FIRMWARE_M_MODULE_DIR}/trusted-firmware-m.
Added:
psa-arch-tests/zephyr/module.yml and ${ZEPHYR_PSA_ARCH_TESTS_MODULE_DIR}
tf-m-tests/zephyr/module/ and ${ZEPHYR_TF_M_TESTS_MODULE_DIR}
Removed:
init-git.sh
README.rst

Fixes: #39353

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-11-01 11:20:06 -04:00
Henrik Brix Andersen
265cdf8dc6 cmake: use find_package() instead of literal include in tests and samples
Convert remaining tests and samples to using find_package() instead of
literally including the CMake boilerplate code.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-11-01 10:33:09 -04:00
Robert Lubos
a80b59e0c9 samples: net: http_get: Update root CA certificate
The root CA used so far (GlobalSign R2) is about to expire soon
(December 2021) and Google have switched to a new certificate, signed by
GlobalSign R1 (valid until 2028). Therefore we need to replace the
root CA used by the sample to the new one, in order to establish secure
connection to with google.com.

Additionally, the new certificate chain sent by Google is larger again,
so it's needed to increase mbed TLS max content length parameter in
order to process it correctly. This also implies an increase in heap
usage, so increase the heap size as well.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-10-28 10:38:38 -04:00
Marcin Niestroj
3f9a78ede9 samples: sockets: http_get: increase main thread stack size
After commit eeb15aa393 ("timer: hpet: enable 64 bit mode for
better usages") was applied, main thread stack usage on qemu_x86
platform increased from 984 to 1040 bytes.

Default stack size, which is 1024, is no longer enough. Change that to
1536 to make sure this sample runs correctly on qemu_x86.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-10-28 10:36:23 -04:00
Glauber Maroto Ferreira
bcf78f29d6 soc: riscv: esp32c3: nvs: add NVS support using fixed partitions
add NVS support to esp32c3 using fixed partitions defined on DT

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-10-28 06:47:21 -04:00
Daniel DeGrasse
813a74d415 boards: mimxrt1020_evk: Enable ADC on RT1020 EVK
Enables ADC1 on the RT1020 evaluation board. Channels 10 and 11 of this
ADC are exposed as pins 1 and 2 of J18 on the evk.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse
ac174d3075 boards: mimxrt1015_evk: Enable ADC on RT1015
Enables ADC on RT1015 evaluation board. Channels 1 and 13 are exposed as
pins 2 and 1 of J18 on the EVK.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse
4e6ac9324b boards: mimxrt1010_evk: Added ADC support to RT1010
Added ADC support to RT1010 evaluation board. ADC channels 1 and 2 are
exposed as pins 10 and 12 of J26.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse
b0d613d9ba boards: mimxrt1024_evk: Add ADC support to RT1024
Adds ADC support to RT1024 EVK. ADC channels 10 and 11 are enabled as
pins 2 and 4 on J18 of the evaluation board

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse
19983e605a boards: mimxrt1060_evk: Enable ADC on RT1060
Enables the ADC on the RT1060 evaluation board. Channels 0 and 15 of
ADC1 are available on pins 1 and 0 of J23, respectively.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Daniel DeGrasse
478d6a45ee boards: mixmrt1064_evk: Enable ADC on RT1064 EVK
Enables ADC inputs 0 and 15 on the RT1064

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2021-10-28 11:20:55 +02:00
Radoslaw Koppel
d1a93c1426 drivers: sensor: Const sensor trigger data in trigger handler
This commit adds const modifier in second argument for
sensor trigger handler.
There is no reason to modify this data and this change
would allow to store trigger configuration also in FLASH.

Fixes: #38929

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2021-10-27 15:09:35 -04:00
Carlo Caione
af94cf55d0 sample: mbox: Introduce MBOX NRFX IPC sample
Make use of the new MBOX APIs to create a ping-pong sample application.
This sample is using the NRFX IPC peripheral to send and receive signals
on different channels

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-10-27 18:27:21 +02:00
Jordan Stein
aeee57bfe1 samples: fxos8700: fp support for accel devices
Adds a config flag to enable floating point support for fxos8700
compatible accelerometer devices.

Signed-off-by: Jordan Stein <jordan.stein@fortrobotics.com>
2021-10-27 09:37:05 -05:00
Maureen Helm
fc9347cf52 boards: arm: Configure DAC driver on bl5340_dvk
Moves DAC driver configuration defaults from the application level to
the board level for the bl5340_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm
1d7d294a58 boards: arm: Configure DAC on bl654_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl654_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm
96c7875f40 boards: arm: Configure DAC on bl653_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl653_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Maureen Helm
192d710c45 boards: arm: Configure DAC on bl652_dvk
Moves DAC dts node and driver configuration defaults from the
application level to the board level for the bl652_dvk board.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-27 10:58:33 +02:00
Jordan Yates
13c516e04b samples: lora: receive: demo async reception
Demonstrate asynchronous reception in the LoRa sample.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-10-26 15:48:09 +02:00
Gerard Marull-Paretas
838380bb63 doc: fix C domain reference usage
THis patch fixes multiple issues when referencing to the C domain. In
some cases there were typos (e.g. missing :), in some others no domain
syntax was used for referencing, etc.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-10-26 10:57:45 +02:00
Maureen Helm
165963c115 drivers: counter: Refactor drivers to use shared init priority
Refactors all of the counter drivers to use a shared driver class
initialization priority configuration, CONFIG_COUNTER_INIT_PRIORITY, to
allow configuring counter drivers separately from other devices. This is
similar to other driver classes like I2C and SPI.

The default is set to CONFIG_KERNEL_INIT_PRIORITY_DEVICE to preserve the
existing default initialization priority for most drivers. The
exceptions are the maxim_ds3231 and mcp7940n drivers which have a
dependency on a SPI driver and must therefore initialize later than the
default device priority.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2021-10-23 20:44:49 -04:00
Jacob Siverskog
046f29a8cb Bluetooth: ATT: Fix typo in defines
Fix typo in ATT first/last attribute defines.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-10-23 20:39:36 -04:00
Andrei Auchynnikau
822f2c3cb4 boards: add adc support to the mimxrt1050 board
add adc to board dts file,
update yaml files and documentation,
add adc 1 channel pins 1 and 15 to the pinmux file,
add overlay file to the board adc sample,
add board to the adc test file and

Signed-off-by: Andrei Auchynnikau <ovchinnikov@strim-tech.com>
2021-10-22 15:43:36 -05:00
Anas Nashif
75cb6e6498 tests: uefi: move uefi test out of hello world
Do not misuse the hello world sample for testing of features, keep it
simple. Create a new test for booting with uefi instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-10-22 06:36:51 -04:00
Abe Kohandel
190848177e bluetooth: ots: Enable testing with assert
Fix compilation and logic issues to allow testing OTS functionality with
assert enabled.

The compilation fixes are simple and do not require an explanation.

The assertion in bt_ots_dir_list_init was logically reversed. Its
purpose is to ensure the directory list is not already initialized
and as such should assert that the dir_list is not set (i.e. is NULL).

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-10-21 11:21:13 -04:00
Iuliana Prodan
dd1c96d123 samples/subsys/audio/sof: add configuration for imx8m board
Add support for SOF with Zephyr on i.MX8MP board.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-10-20 19:08:50 -04:00
Evgeniy Paltsev
efc9cee834 samples: shell_module: fix build on 64bit platforms
After the __printf_like validation was added to the shell_fprintf
functions we got warnings while building the
'samples/subsys/shell/shell_module' due to incorrect specifiers
while printing size_t variables. Fix that.

Fixes: #39386
Fixes: fe2075d140 "shell: Add __printf_like to shell_fprintf"

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-10-19 06:44:20 -04:00
Emil Gydesen
a56cbed603 Bluetooth: ISO: Split ISO broadcast config
Splitt he ISO broadcast config into broadcaster and
sync receiver. This will allow a device that only
wants to one of the roles to have a much more optimized
configuration.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-10-18 12:43:38 +02:00
Tom Burdick
f523c336ef pm: Use stats subsys for tracking system states
Uses the stats subsys to provide simple but useful debugging stats for
power management state changes and timing.

Removes the no longer needed PM_DEBUG config option

Replaces the use of PM_DEBUG for a test clock output pin for mec1501 and
adds in its place an SoC Kconfig option to enable it.

Adds a STATS_SET macro for assigning a value to a stat group field

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-10-17 10:56:21 -04:00
Filip Kokosinski
3fff2550d0 samples/subsys/shell/shell_module: add board name command
This commit adds a new subcommand to the `demo` command that prints out
the name of the used board.

Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
2021-10-14 16:33:42 -04:00
Krzysztof Chruscinski
eb3375f47c shell: Add __printf_like to shell_fprintf
Add __printf_like modifier to validate strings used by shell.
Fixing warnings triggered by this change.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-10-14 16:32:19 -04:00
Tom Burdick
fc34338d77 stats: Add a stats shell command
Adds the stats shell command to list all stats and enable the command in
the shell sample app.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2021-10-14 06:32:57 -04:00
Pavlo Hamov
11dd83b02b samples: drivers: watchdog: remove accidential copy-paste
watchdog dts instance was already present for esp32 family

Signed-off-by: Pavlo Hamov <p.hamov@venstar.com>
2021-10-13 14:59:36 -04:00
Pavlo Hamov
8ed9f64064 samples: wdt: add esp32s2 support
Add support of esp32s2_soala board

Signed-off-by: Pavlo Hamov <p.hamov@venstar.com>
2021-10-13 10:14:35 -04:00
Robert Lubos
875c75c4f9 net: lwm2m: Replace float32_value_t with double
Replace the custom float32_value_t LwM2M type with native double, to
facilitate LwM2M API and improve floating point precission.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-10-13 10:13:32 -04:00
Guennadi Liakhovetski
5ec9738c9b boards: xtensa: intel_adsp_cavs15: force COMP_SRC_TINY
cAVS 1.5 has little RAM, force COMP_SRC_TINY to fix SOF build
failures under Zephyr with XCC.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-13 08:34:51 -04:00
Evgeniy Paltsev
eacabaf5ae tests: tracing.osawareness.openocd cleanup
Move all config options to prj.conf. No functional
changes intended.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-10-13 06:22:44 -04:00
Evgeniy Paltsev
8077907827 tests: fix tracing.osawareness.openocd when thread names disabled
tracing.osawareness.openocd relies on the CONFIG_THREAD_NAME is
enabled, however we don't enable it in test config.

Fix that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-10-13 06:22:44 -04:00
Evgeniy Paltsev
2677e55b92 tests: fix tracing.osawareness.openocd for SMP platforms
The tracing.osawareness.openocd doesn't support executing
on multicore Zephyr. However we disable multiple CPUs
usage in two different ways for this test:
 - by setting CONFIG_MP_NUM_CPUS to 1
 - by setting CONFIG_SMP to n

It's not correct for all SMP platforms to disable SMP. As
it is also excessive (we can guarantee the execution on
single core by setting CONFIG_MP_NUM_CPUS=1) let's drop
SMP disabling.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2021-10-13 06:22:44 -04:00
Carlo Caione
6c00e980b2 ipc: ipc_service: Rework multi-instance backend.
Only one single IPC service backend is currently present: multi_instance
backend. This backend is heavily relying on the RPMsg multi_instance
code to instanciate and manage instances and endpoints. Samples exist
for both in the samples/subsys/ipc/ directory.

With this patch we are "unpacking" the RPMsg multi_service code to make
it more modular and reusable by different backends.

In particular we are re-organizing the code into two helper libraries:
an RPMsg library and a VRING / virtqueues static allocation library. At
the same time we rewrite the multi_instance backend to make fully use of
those new libraries and remove the old multi_instance sample.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-10-11 20:58:09 -04:00
Piotr Pryga
fba51111cf samples: Bluetooth: df: enable filtering of per adv by CTE type
Enable filtering of periodic advertisements to synchronize
with advertisenemts that include CTE.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-10-07 21:36:55 -04:00
David Brown
26a630bf59 samples: tfm_integration: Fix PSA crypto APIs
Moving to Mbed TLS 3.0 changes some of the Mbed TLS to better match the
PSA spec.  Fix up the things where we are affected by these API changes.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-10-07 14:02:40 -05:00
Stephan Linz
ca1f3c32be samples: echo_server: Enable USB by the application
This commit allows let build echo_server sample with
overlay-netusb.conf.

USB subsystem must be enabled by the application.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2021-10-07 10:53:54 +02:00
Kumar Gala
bfcb32b755 samples/subsys/mgmt/osdp: Fix build issues
The samples/subsys/mgmt/osdp utilize GPIO so having it set in the
prj.conf is needed since not all platforms enable GPIO by default.

To address the 'No SOURCES given to Zephyr library: drivers__gpio'
add a 'depends on gpio' to the sample.yaml to only build this on
platforms that have GPIO driver support.

Fixes #39180

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-10-06 10:32:10 -04:00
Johann Fischer
fb454d09bb doc: usb: refactor USB device support documentation structure
Move related areas to their own files and order
documentation logically from lower to upper layer.
Fix gross errors and inconsistencies.

Co-authored-by: Carles Cufí <carles.cufi@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-10-06 11:51:07 +02:00
Ryan Erickson
e706967d34 samples: lwm2m: update client stop API
Try to deregister client when closing connection.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-10-05 19:23:59 -04:00
Igor Knippenberg
e32c974336 samples: sensors: fdc2x1x: fixed bugs in pm_info()
Both ARG_UNUSED in pm_info(), cause errors when using PM_DEVICE=y.
Added a default case in pm_info(), to fix warnings.

Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
2021-10-05 13:13:46 -04:00
Glauber Maroto Ferreira
774aef0cf8 wifi: esp32s2: add board wifi station sample
by adding esp32s2 configs and documentation.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-10-01 10:51:37 -04:00
Nick Ward
e0f18128bf task_wdt: fix silent init failures
The task_wdt_init() API can fail to install a timeout for the fallback
hardware WDT (hw_wdt) without returning an error code.  This patch
enables task_wdt_init() to return the hw_wdt install timeout error code
if the hw_wdt install timeout fails.

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
2021-10-01 15:21:32 +02:00
Henrik Brix Andersen
7a525c1c24 samples: sensor: fxos8700: add mimxrt1024_evk board configuration
Add configuration for the mimxrt1024_evk board. This board does not have
any of the FXOS8700 interrupt pins connected by default, so triggers are
not available.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-09-29 10:07:41 -04:00
Emil Gydesen
8d20e8d5bc Bluetooth: ISO: Add iso accept info struct
Add a new struct that provides information to the upper
layer when accepting an connected isochronous stream.

The CIG ID and CIS ID makes it possible for the upper layer
to determine which ISO channels are "together" in a group.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-28 20:19:37 -04:00
Håkon Øye Amundsen
ede29d849d samples/mgmt/smp_svr: Increase main stack size
Some build variants will fail runtime for certain boards (e.g. nRF52832)
due to stack overflow. Avoid this by increasing the stack size.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2021-09-28 20:15:25 -04:00
Emil Gydesen
5a11a19713 Bluetooth: Iso: Add BT_ISO_SDU_BUF_SIZE macro
Add the BT_ISO_SDU_BUF_SIZE which can be used to declare
the TX buffers for ISO, similar to the BT_L2CAP_SDU_BUF_SIZE
macro for L2CAP.

This also updates the ISO samples to use this as well
updating the SDU check to use
CONFIG_BT_ISO_TX_MTU/CONFIG_BT_ISO_RX_MTU without
subtracting the BT_ISO_CHAN_SEND_RESERVE to make the
API more clear.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-28 20:07:32 -04:00
Marc Herbert
3e0bc8c231 samples/audio/sof: remove zephyr_interface_library_named(sof_lib)
As this makes no difference, it's misleading so let's remove it to stop
being misled. I don't know why initial commit efa794dbc5 added it but
the build directory is strictly identical with or without this line.

The SOF code is included in the build thanks to CONFIG_SOF in prj.conf,
not this.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-28 20:03:15 -04:00
Jakub Rzeszutko
2b5723d455 shell: add init backend configuration
Each backend can configure separately features like colors on/off, VT100
handling and so on. This can be very handy for planned MQTT backend.
Shell will not send VT100 commands when VT100 is not enabled globally or
for particular backend.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-09-28 20:02:01 -04:00
Jonathan Hahn
a133bf8821 samples: sensors: add sample for i3g4250d gyro
Adds a sample for the ST I3G4250D gyroscope.

Signed-off-by: Jonathan Hahn <Jonathan.Hahn@t-online.de>
2021-09-28 19:44:26 -04:00
Carlo Caione
8f53f319cd reserved-memory: Fix layering violation
Move memory.h out of the way in a more "private" space
(include/linker/devicetree_reserved.h) to prevent polluting the
devicetree space.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-09-28 14:01:36 -04:00
Torsten Rasmussen
d800b4a4d7 drivers: gpio: remove unused GPIO selection
Fixes: #38403

Removing unneeded `imply GPIO` and `CONFIG_GPIO=y` occurrences where no
files are added to the gpio zephyr library.

Also removed `CONFIG_GPIO=y` occurences where this is handled by
defconfigs for the soc or board.

Selection of GPIO without selecting any drivers results in the warning:

> No SOURCES given to Zephyr library: drivers__gpio
>
> Excluding target from build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Torsten Rasmussen
8e64038559 drivers: net: adding NET_DRIVERS menuconfig
Fixes: #38403

Adding NET_DRIVERS menuconfig so that network drivers are grouped
together in its own menu entry under drivers, similar to most other
drivers.

This further has the advantages that `CONFIG_NET_DRIVERS` can be used
for testing to determine if network drivers has been selected.

This changed revealed a dependency loop where both `select` (for SLIP)
and `depends` (for PPP) which both depends on NET_DRIVERS` where in use
in the dependency tree for Qemu networking, especially NET_SLIP_TAP.

This is handled by defaulting `NET_DRIVERS` to `y` when building for a
Qemu target.
`SLIP` had a dependency to `!QEMU_TARGET || NET_QEMU_SLIP`. This is
changed so that SLIP prompt depends on `!QEMU_TARGET` which provides
full user control in hardware but makes the symbol promptless on Qemu
targets.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-09-28 12:13:23 +02:00
Fabio Baltieri
89df245b0d samples: modbus: update/fix samples.yaml configs
Update the sample.yaml files for the modbus samples:
- depends_on entries should just be space separated, drop the comma
- add the platform referenced in the documentation to platform_allow
- replace the deprecated dt_compat_enabled_with_alias with
  dt_enabled_alias_with_parent_compat

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Fabio Baltieri
64a2d97c03 samples: modbus: rtu_server: drop unused variable
This has been unreferenced since:

4ff616b647 modbus: rework interface configuration

This generates a compiler warning, but it went unnoticed because the
sample test is configured incorrectly and not running.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Fabio Baltieri
46ef9be075 samples: canopennode: fix the sample path
The sample code got moved in 613f1cde4a, update the old path to the
current one.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-09-27 21:54:56 -04:00
Iuliana Prodan
0b23984920 samples/subsys/audio/sof: add configuration for i.MX8QXP board
Add support for i.MX8X, which represents i.MX8QXP board.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-09-27 21:52:31 -04:00
Robert Lubos
eca98e37d4 samples: net: coap_server: Finetune sample parameters
Finetune coap_server sample parameters for better user experience.

Reduce the maximum retransmission count to release resources earilier in
case client is unreachable and no longer responds. Increase the maximum
number of pending retransmissions, along with the heap size (the buffers
for messages are allocated on a heap), to improve sample responsiveness,
in case multiple unreplied messages are pending retransmission.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-27 11:36:15 -04:00
Robert Lubos
15ba020343 samples: net: coap_server: Remove observer on notification timeout
In case no reply is received for notification message, remove the
corresponsding observer since it's no longer reachable, freeing slot for
another one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-27 11:36:15 -04:00
Robert Lubos
33677ef383 samples: net: coap_server: Fix retransmission mechanism
The retransmission handler only increased the retransmission count, w/o
sending the actual message again. Additionally, the next retransmission
time calculation was broken - it did not take into consideration the
time that has already passed since before retransmission, and re-applied
the entire timeout value.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-27 11:36:15 -04:00
Jamie McCrae
2af4861014 samples: ipc: rpmsg_service: Add support for BL5340
Add support for BL5340 to rpmsg_service sample

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-23 13:13:51 -04:00
Jamie McCrae
d460536a1b samples: ipc: rpmsg_multi_instance: Add support for BL5340
Add support for BL5340 to rpmsg_multi_instance sample

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-23 13:13:51 -04:00
Jamie McCrae
e61009a2f5 samples: ipc: ipc_service: Add support for BL5340
Add support for BL5340 to ipc_service sample

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-23 13:13:51 -04:00
Andrzej Głąbek
4212e95763 samples: boards: nrfx: Fix setting up of (D)PPI channel endpoints
There is a copy-paste error in this sample code that results
in a function for input events being called for an output pin.
By chance, this has no influence on the behavior of the sample,
as the function returns a register offset that for events and
tasks is the same for a given channel, but obviously the code
is confusing.
This is fixed by replacing the relevant part with more suitable
function calls, to also simplify the code a little.

On the occasion, also a remark is added about no button debouncing
used in the sample, to prevent users from being surprised by its
possible behavior.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-23 13:13:30 -04:00
Erwan Gouriou
34a67cf2ff samples/board/stm32: PM blinky: Enable CONFIG_DEBUG in CI
Enable CONFIG_DEBUG when test is run in CI.
This will allow DGB access in stop modes (and specially flashing)
and avoid potential issues when test in run in a test suite.

Note that on some targets (stm32wb for instance) openocd is able
to do the same operation, and which allows to reflash the target
even if switch was not enabled, but this could not be the case
on all targets.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-23 12:54:03 -04:00
Gerard Marull-Paretas
c58243d6ba samples: boards: nrf: battery: fix board in sample commands
The board name used in the zephyr-app-commands directive was the old
name for the Thingy52 board.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-23 08:38:44 -04:00
Gerard Marull-Paretas
652f25e094 samples: boards: nrf: battery: fix usage without voltage divider
The nRF battery sample claims that it works without the need of a vbatt
node (voltage divider). However, this was currently not possible because
the sample code did have no means to extract the necessary ADC details
(instance and channel) from Devicetree unless vbatt was present. Similar
to other ADC samples, the zephyr,user node is used to define io-channels
property in this case. The sample README has been updated with an
example of how measurement without a voltage divider can be achieved.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-09-23 08:38:44 -04:00
Gerhard Jörges
67151b930a drivers: ieee802154: remove ieee802154_radio_handle_ack() stub
When using the IEEE802154 radio interface in CONFIG_IEEE802154_RAW_MODE,
there is no way to handle ack frames because of the dummy implementation
of ieee802154_radio_handle_ack() in the ieee802154_radio header file.
Removed the dummy implementation from the header so you can/need to
implement it in the application.

samples: added implementation of ieee802154_radio_handle_ack() to
         wpan_serial and wpanusb sample

Signed-off-by: Gerhard Jörges <joerges@metratec.com>
2021-09-21 18:28:25 -04:00
Stephanos Ioannidis
9d7c9ffefd samples: tflite-micro: hello_world: Enable standard C++ library
The TensorFlow Lite module makes use of the features provided by the
standard C++ library (e.g. `#include <functional>`), so the standard
C++ library config must be enabled for it.

This used to work without `CONFIG_LIB_CPLUSPLUS=y` due to the bug
described in the issue #36644.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-09-21 11:39:18 -04:00
Dominik Ermel
6272d303c4 samples/littlefs: Remove FIXME with PRIxPTR usage
With "Incompatible (u)intptr_t type and PRIxPTR definitions",
https://github.com/zephyrproject-rtos/zephyr/issues/37718,
issue resolved the FIXME code is no longer needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-09-21 06:21:59 -04:00
Erwan Gouriou
123be4f13d samples/posix: eventfd: Prevent run in twister when SRAM below 32K
This test makes use of dynamic RAM allocation done on the leftover
SRAM. Similarly to test/posix/eventfd, limit this test execution on
platforms with at least 32K of RAM available.

Fixes #38601

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-20 19:48:34 -04:00
Gerson Fernando Budke
e5ef9ca7a5 samples: net: echo_server: Decrease buffer for atsamr21_xpro
From 2.4 to 2.7 the net samples pair echo-server/client increase the
SRAM requirements. This adjusts example features to free necessary SRAM
to run example.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-09-20 06:01:12 -04:00
Anas Nashif
aebb4b5ed6 samples: i2c: fram: use node label instead of alias
Add more coverage by not using aliases and directly use node label.

Fixes #38154

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-17 20:18:47 -04:00
Maciej Perkowski
efc3242140 bugfix: samples: display: Set ft800 sample to be build only
The sample from samples/drivers/misc/ft800/ causes twister to
timeout as it has no pass conditions defiend nor producess any
output that can be verified. What is more, it requires a shield
which is not reflected in the sample.yaml. This fix sets test harness
to display and adds an entry for the required fixture.

Fixes: #38536

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-09-16 06:59:27 -04:00
Carles Cufi
6de4747979 Bluetooth: Update terms in public API to spec v5.3
The Bluetooth Core Specification, version 5.3, has introduced multiple
changes to several widely-used terms in order to make them inclusive.
Update the public API to reflect this, excluding hci.h, which will be
done in a subsequent commit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-15 14:02:50 +03:00
Yong Cong Sin
dfb55e5353 subsys/mgmt/hawkbit: Warning if image is unconfirmed
Add a warning if the image is unconfirmed. Add a delay before rebooting
so that the user knows what happened.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
dc27d25c4d samples/subsys/mgmt/hawkbit: Update README
Update sample's README for better clarity.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Yong Cong Sin
8c51d39c9f samples/subsys/mgmt/hawkbit: Print build time
Print build time on boot to differentiate between update.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-09-14 12:28:40 -04:00
Maciej Perkowski
2b78e8b961 bugfix: sample: test: Add pass conditions to audio/dmic sample
Twister was failing for samples/drivers/audio/dmic with timeout
because there were no pass conditions defined. This patch sets
harness to console and adds regex entries to be checked.

Fixes: #38532

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-09-14 11:43:42 -04:00
Simon Guinot
d20466d525 samples: led_ws2812: fix dma property in nucleo_f070rb.overlay
Since commit 718c77a4cd ("dts: arm: stm32f0 soc serie has dma of type
V2bis"), the DMA DT cell of STM32F0 MCU has been fixed. It now has three
elements instead of five previously.

This patch fixes the dma property used in nucleo_f070rb.overlay
accordingly.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-09-13 11:55:51 -04:00
Daniel Leung
8580f63ad9 samples: philosophers: fix pointer type mismatch for stack fork
When using the stack fork type in the philosophers sample,
there were a few pointer type mismatch since the k_stack_*()
functions are using stack_data_t but the parameters are uint32_t.
So cast them to void pointer to suppress compiler warnings.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-09-09 19:06:38 -04:00
Carles Cufi
0552d329c8 samples: bluetooth: hci_uart: Fix command len calculation
Due to a historical error introduced during an hci_uart refactor, the
get_len() function was using the wrong HCI H4 packet identifier for
commands. Instead of using H4_CMD (0x01) it was trying to match
BT_BUF_CMD (0x00).

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-07 20:47:49 +02:00
Glauber Maroto Ferreira
2b7c0f4ad6 esp32s2: samples: counter: add alarm sample support
by adding esp32s2 board-specific config information.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-09-06 10:02:57 -04:00
Emil Gydesen
c17f28c3d6 Bluetooth: sample: Add ISO support to hci_uart
Add ISO support to the hci_uart sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-06 09:18:58 -04:00
Yuriy Vynnychek
d8f9cc6ffc samples: net: sockets: add tlsr9518adk80d board tests
Added tlsr9518adk80d board support to Echo Client/Server tests.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-09-03 09:58:52 -04:00
Yuriy Vynnychek
ead38a1b35 samples: openthread: fix build fail for tlsr9518adk80d board
- added missed UART1 dts configuration.
- added tlsr9518adk80d board to twister.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-09-03 09:58:52 -04:00
Mateusz Sierszulski
c09dfb3bf6 drivers: fpga controller: add shell support
This adds shell support for FPGA drivers.

Signed-off-by: Mateusz Sierszulski <msierszulski@internships.antmicro.com>
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2021-09-03 09:54:00 -04:00
Mateusz Sierszulski
a64ce1fc6b drivers: fpga controller: add eos_s3 fpga driver
This adds driver for EOS_S3 SoC FPGA.

Signed-off-by: Mateusz Sierszulski <msierszulski@internships.antmicro.com>
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2021-09-03 09:54:00 -04:00
Katsuhiro Suzuki
ffdd60675e samples: jesd216: Exclude hifive_unleashed and unmatched boards
The HiFive Unleashed and HiFive Unmatched boards do not enable the
SPI0 controller that the flash is connected to. This test will not
build on these platforms because SPI0 bus controller is missing.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-09-03 09:52:26 -04:00
Katsuhiro Suzuki
4f0c7141b3 samples: drivers: spi_flash: fix printf warning on 64bit environment
This patch fixes printf format specifier "%u" -> "%zu" for printing
an argument of size_t on 64bit environment.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-09-03 09:52:26 -04:00
Andrzej Głąbek
1518cc8337 samples: drivers: Add simple application showing how to use DMIC API
Add a very simple application intended to show how to use the Audio
DMIC API and also to be an aid in developing drivers to implement
this API.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-03 09:34:06 -04:00
Andy Ross
97fb8fa869 samples/net/sockets: Exclude intel_adsp boards
These are getting build failures due to some kind of devicetree
console definition missing.  These devices don't do networking, and
strictly don't even have a proper console device (logging is done via
a host mechanism).  Probably fixable.  Not worth the trouble.  Filter.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-09-03 07:19:34 -04:00
Nikolai Kondrashov
77ee1f02aa doc: Fix a few typos in docs/comments/messages
Fix two typos in documentation, one in a sample's comment, and one in a
sample's console message. Found while learning Zephyr and exploring the
sources.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
2021-09-03 06:06:59 -04:00
Emil Gydesen
bebfdaf88b Bluetooth: samples: Improve disconnect handling iso_connected_benchmark
Improve the disconnect handling in the sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Emil Gydesen
84ac32e32d Bluetooth: samples: Improve disconnect handling in central_iso
Improve the disconnect handling in the sample, and
avoid creating a new cig for each connection.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Emil Gydesen
891d838140 Bluetooth: samples: Fix iso_connected_benchmark disconnect
The disconnect handling of ACL connects in the sample was done
incorrect, and caused a call to bt_conn_unref with a NULL
pointer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-02 19:37:28 -04:00
Lingao Meng
34a1d676c9 samples: bluetooth: Fix scan filter
We should use no filter filter to process adv data
according to code comment above.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-09-02 19:35:26 -04:00
Christopher Friedt
650b111ba5 drivers: flash: Kconfig.sam: -depends on and +dfu sample exclude
The additional depends on SOC_FAMILY_SAM was redundant.

Add sam4l_ek to dfu sample exclude since it was failing on
arduino_due.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-02 13:23:47 -04:00
Bradley Bolen
bdc80ebe16 samples: tracing: Add a sample for tracing_user
The user tracing backend allows one to implement weak symbols to perform
user specific tracing, e.g gpio toggling or spi transactions.  This adds
a qemu sample that just does a simple printk for each of the traced
functions, but could be changed to do whatever function the user
desires.

Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
2021-09-02 06:54:35 -04:00
Gerson Fernando Budke
3d85dd8cdc samples: drivers: adc: Add sam0 boards overlays
Add sam0 boards overlays to demostrate how to configure io-channels.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-09-02 06:45:35 -04:00
Mahesh Mahadevan
8b3e15523e samples: websocket_client: Run only when netif is enabled
Add depends_on: netif to prevent running on boards that
do not have netif enabled

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-09-01 14:39:03 -04:00
Emil Gydesen
93bfe7a2c9 Bluetooth: ISO: Update BIS index to start from 0x01
The HCI spec defines the BIS index range as starting from
index 0x01. We had previously implemented it such that it
starts from 0x00, and then simply adding 1 to the index
when sending over HCI. However, this may cause issue with
other HCI, or other SIG defined specification, commands
and events, and thus it is probably simpler if we just
use the HCI defined range.

This commit disallows BIT(0) (representing the BIS
index 0x00) to be set, and removes the addition
of 1 when sending over HCI.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-09-01 10:57:07 -04:00
Waqas Mazhar
33d4ac43e6 samples: basic: blinky_pwm: Add support for nucleo_wb55rg platform
Create a board overlay file in the application directory to add
pwm-led0 entry over default device tree. Also, include instruction
in the README file that connection of external LED at pin PA8 is
required for the demo to work.

Signed-off-by: Waqas Mazhar <waqas.mazhar@planetinnovation.com.au>
2021-08-31 19:56:22 -04:00
Yong Cong Sin
9d2f8a1124 drivers: modem: gsm_ppp: Use DTS
Convert the gsm_ppp driver to use DTS.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-08-31 17:33:34 -04:00
Gerson Fernando Budke
b6c2ae8048 samples: philosophers: Enable thread awareness
Enable thread awareness by default on philosophers sample.  It shows
gdb debugging output using the feature as reference.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-08-30 13:18:04 -04:00
Iuliana Prodan
a5fdf26ca0 samples/subsys/audio/sof: add configuration for imx board
Add support for i.MX8, which represents i.MX8QM board.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-28 23:27:02 -04:00
Andrzej Kaczmarek
f353202eb7 Bluetooth: Controller: Fix DF for per adv chains scanning
This updates DF to properly receive CTE in per adv chains scanning.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2021-08-27 11:46:31 -04:00
Emil Gydesen
8490508b59 Bluetooth: ISO: Make ISO/ACL bt_conn pointers clear in ISO API
Update the name of the bt_conn pointers to make it clear
whether the connection pointers are ACL or ISO connections.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 11:46:07 -04:00
Emil Gydesen
ed46180ab8 Bluetooth: samples: Update iso parameter check in iso_broadcast_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Emil Gydesen
90eb48b111 Bluetooth: samples: Update iso parameter check in iso_connected_benchmark
Update the iso parameter value checks from using literals to
the defined #defines.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-27 09:34:43 -04:00
Carlo Caione
0c2dabb4b9 ipc: rpmsg_multi_instance: Rework instance tracking
This patch is the first step to make the rpmsg_multi_instance usable in
a multi-core scenario.

The current driver is using a local driver variable (instance) to track
the number of allocated instances. This counter is practically used to
allocate to the instance the correct portion of the shared memory.

This is fundamentally wrong because this is assuming that it does exist
only one single shared memory region to split amongs all the allocated
instances.  When the platform has more than one core this is obviously
not the case since each couple of cores are communicating using a
different memory region.

To solve this issue we introduce a new struct rpmsg_mi_ctx_shm_cfg that
is doing two things: (1) it's carrying the information about the shared
memory and (2) it's carrying an internal variable used to track the
instances allocated in that region. The same struct should be used every
time a new instance is allocated in the same shared memory region.

We also fix a problem with the current code where there is a race
between threads when accessing the instance variable, so this patch is
adding a serializing mutex.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-27 06:44:08 -04:00
Carlo Caione
66fb1bc2bc ipc: rpmsg_multi_instance: Use only rpsmg_mi_ctx_cfg for configuration
For the instance configuration the rpmsg_multi_instance code is
currently using a set of configuration info coming from two different
sources: the rpsmg_mi_ctx_cfg struct and Kconfig.

This is not only confusing but it's preventing to configure the
instances using information not coming from Kconfig (for example if we
want to configure the instance using DT).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-08-27 06:44:08 -04:00
Daniel Leung
fa3267165c samples: prod_consumer: don't reuse main stack for app_b
With demand paging, the main stack is not user mode capable
and it would fail k_thread_user_mode_enter() under
app_b_entry(). So create another thread and stack for app_b
as this stack can be used in user mode.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-26 21:16:22 -04:00
Piotr Pryga
50a2cdd75a samples: Bluetooth: df: Enable TX of mutliple CTEs in a per adv event
Since periodic advertising chains are available there is
a possibility to send multiple PDUs including CTE in
a periodic advertising event.

This commit enables such functionality in direction finding
transmitter sample.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-26 18:25:35 -04:00
Piotr Mienkowski
437f7f9d45 samples: enable support for Atmel SAM DAC driver
Enable support for Atmel SAM DAC driver on the following boards:
- sam_e70_xplained
- sam_e70b_xplained
- sam_v71_xult
- sam_v71b_xult

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-08-26 16:46:16 -04:00
Emil Gydesen
77509a31d5 Bluetooth: sample: Update default latency of iso broadcast benchmark
The default latency (0) is an invalid value (minimum is 5).
Set to 10 to match the connected ISO benchmark.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-26 09:12:16 -04:00
Dominik Ermel
d1c0eb1a51 samples: littlefs: Fix printk messages for native_posix_64
The formatting options, passed to the printk, caused warnings when
compiling for native_posix_64.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-26 06:53:28 -04:00
David Leach
d3cd0d2f9a drivers: adc: add LPADC driver support to mimxrt685 platform
Add LPADC support to the mimxrt685 platform.

Signed-off-by: David Leach <david.leach@nxp.com>
2021-08-25 18:02:00 -04:00
Hake Huang
cc760c5401 sample: usb: hid-cdc: add a sleep for cpu to response
add a sleep while the uart init is fail.
so cpu will have chance to output error message

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-08-24 16:37:44 -05:00
Johann Fischer
741ae93ce2 shell: remove Kconfig option CONFIG_UART_SHELL_ON_DEV_NAME
Follow up on commit bfd45e5b8c
("drivers: remove Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME")
Now we can also remove Kconfig option CONFIG_UART_CONSOLE_ON_DEV_NAME
since all UART drivers are converted to devicetree and we can just use
DEVICE_DT_GET(DT_CHOSEN(zephyr_shell_uart)).

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-24 17:15:58 -04:00
Toby Firth
893bfc0fc1 drivers: counter: added ctimer driver for lpcexpresso55s69
Added shim driver for the CTIMERs for the lpcexpresso55s69 board.

Fixes: #22705

Signed-off-by: Toby Firth <tobyjfirth@gmail.com>
2021-08-24 17:13:22 -04:00
Martí Bolívar
7355204f41 samples: lvgl: add min_ram to adafruit_2_8_tft_touch_v2 test
Commit c79b1a38aa ("samples: display:
Convert driver and lvgl sample.yaml to use depends_on") started using
depends_on in the sample YAML for a lvgl application instead of
platform_allow.

This breaks build testing with twister and overflow checking enabled
on more resource constrained platforms. The test case's .config
ends up with:

    CONFIG_LVGL_HOR_RES_MAX=320
    CONFIG_LVGL_VER_RES_MAX=240
    CONFIG_LVGL_VDB_SIZE=64
    CONFIG_LVGL_BITS_PER_PIXEL=24

And lib/gui/lvgl/lvgl.c, where we allocate a buffer of size:

    (CONFIG_LVGL_BITS_PER_PIXEL *
     ((CONFIG_LVGL_VDB_SIZE * CONFIG_LVGL_HOR_RES_MAX *
       CONFIG_LVGL_VER_RES_MAX) / 100)
     / 8)

Require 147456 bytes to build the sample, ultimately overflowing RAM
if you run something along the lines of:

    twister -T samples -p <constrained_platform> --overflow-as-errors

This is a reasonable test to be doing to make sure that sample RAM
requirements do not get too big for a subset of platforms that are of
interest, and it no longer works.

To fix it, add a min_ram line for this case so that we can still run
overflow tests on a large set of samples without fine-grained special
casing or creating an ever-growing list of platform excludes for this
test.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-24 15:40:06 -04:00
Emil Gydesen
fc33f6af3a Bluetooth: sample: Update iso_broadcast_benchmark to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen
1d1cd57c41 Bluetooth: sample: Update iso_broadcast to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen
76091850c5 Bluetooth: sample: Update iso_connected_benchmark to use new ISO API
Update the sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Emil Gydesen
23f3aa12ae Bluetooth: sample: Update central_iso to use new ISO API
Update the central_iso sample to use the new ISO API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-08-24 07:29:11 -04:00
Lauren Murphy
bdae9399be samples: tflite-micro: fix magic_wand
Fixes accelerometer_handler.cc to import correct header
with TfLiteStatus since c_api_internal.h file was deleted in
the new standalone tflite-micro repo.

Removes import of version.h in main_functions.cc to match
tflite-micro version.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Lauren Murphy
82f64e1f20 samples: tflite-micro: update hello_world
Updates tflite-micro hello_world sample code.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Lauren Murphy
6fd1b02496 docs, samples: tflite-micro: change tensorflow to tensorflow lite micro
Changes name of folder from tensorflow to tflite-micro and updates docs
to reference TensorFlow Lite Micro specifically instead of TensorFlow.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-08-24 07:26:08 -04:00
Johann Fischer
c179d83e72 drivers: uart_mcumgr: remove CONFIG_UART_MCUMGR_ON_DEV_NAME
Remove CONFIG_UART_MCUMGR_ON_DEV_NAME and use
DEVICE_DT_GET(DT_CHOSEN(zephyr_uart_mcumgr)).
Add usb.overlay, which contains chosen node and cdc-acm-uart node,
to smp_svr sample.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
43d214bf5b samples: sensortile_box: get chosen console device from devicetree
Add app.overlay which contains chosen node
Rework sample to get CDC ACM UART device from devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
f460848002 net: ot: rework NCP interface configuration
Rework NCP interface configuration and NCP sample. Remove
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_DEV_NAME and
CONFIG_OPENTHREAD_COPROCESSOR_SPINEL_ON_UART_ACM Kconfig
options in favor of chosen node zephyr,ot-uart usage.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
e1d5416df3 samples: shell: get CDC ACM UART device from devicetree
Add usb.overlay which contains chosen node and cdc-acm-uart node.
Change sample to get CDC ACM UART device from devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
0f5490a004 samples: usb: console: convert README to RST file
Convert README to RST file.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
c3f87d9247 samples: usb: console: get CDC ACM UART device from devicetree
Add app.overlay which contains chosen node and cdc-acm-uart node.
Rework sample to get CDC ACM UART device from devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
020843f249 samples: usb: get CDC ACM UART device from devicetree
Add app.overlay which contains cdc-acm-uart nodes.
Rework CDC ACM and HID samples to get CDC ACM UART device
from devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Johann Fischer
a9a512de66 samples: wpan_serial: get CDC ACM UART device from devicetree
Add app.overlay which contains  cdc-acm-uart node.
Rework sample to get CDC ACM UART device from devicetree.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-23 18:53:47 -04:00
Leonard Pollak
a98ba2ffe3 samples: drivers: removed old sample code for INA219
This removes the now stale sample code for the INA219

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2021-08-23 10:32:07 -05:00
Leonard Pollak
e8d34bdcdf samples: sensor: added sample app for INA219
This adds an example application for the TI INA219 Zero-Drift,
Bidirectional Current/Power Monitor with I2C Interface

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2021-08-23 10:32:07 -05:00
Yuriy Vynnychek
6a5fbc5972 samples: openthread: add tlsr9518adk board configuration
Added Telink B91 tlsr9518adk board support.

Signed-off-by: Yuriy Vynnychek <yura.vynnychek@telink-semi.com>
2021-08-20 06:23:24 -04:00
Torsten Rasmussen
1cccc8a8fe cmake: increase minimal required version to 3.20.0
Move to CMake 3.20.0.

At the Toolchain WG it was decided to move to CMake 3.20.0.

The main reason for increasing CMake version is better toolchain
support.

Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-08-20 09:47:34 +02:00
Martí Bolívar
77bda7f659 samples: clock_control_litex: drop DEVICE_GET_BINDING
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
330aa0477e samples: i2c_fujitsu_fram: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
799315d3c2 samples: kscan_touch: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
cb24ec674a samples: kscan: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
28ec4ed8dc samples: lcd_hd44780: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
cbc1e5d36b samples: led_apa102c_bitbang: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
7af8c1ef76 samples: led_pca9633: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
deab161825 samples: led_lp5562: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
169dc49b12 samples: led_lp503x: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Martí Bolívar
d8a8668df7 samples: led_lp3943: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-19 17:20:21 -04:00
Johann Fischer
976c5fee28 samples: usb-audio: add app.overlay and use zephyr_udc0
USB audio class samples are generic and can be built for any
board that supports USB device and isochronous endpoints.
Add app.overlay that uses reference to zephyr_udc0 and remove
board specific overlays.

Note: USB audio is still experimental and even though the sample can
be built for specific platform, it does not mean that it can be run
on it without issues.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-19 16:56:54 +02:00
Johann Fischer
e38e91ed16 Revert "samples: usb-audio: add app.overlay and remove board specific overlays"
This reverts commit e53371bbc0bc37d911884937199733f23c43fb21.
The "usbd0 aliases" approach has not proven to work.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-19 16:56:54 +02:00
Joakim Andersson
4a97fa310b Bluetooth: samples: Update periodic advertising data update rate
Update periodic advertising data update rate. The periodic advertiser
is configured with a periodic advertising interval of 2.4 seconds but
updating the data every second. This leads to many of the advertising
data values not being sent at all.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-19 10:20:14 -04:00
Yong Cong Sin
eaa29d9d71 subsys/mgmt/hawkbit: Prevent multiple instances of hawkbit_probe
Use a semaphore to prevent the hawkbit_probe from running more than once
at the same time since it reset the hawkbit context on entry and will
affect other running instance.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-08-18 20:10:21 -04:00
Yong Cong Sin
1409b90c90 subsys/mgmt/hawkbit: Fix typos
Fix multiple typos and make the sample's log output consistent
with the subsys.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Co-Authored-By: Sylvio Alves <sylviojalves@gmail.com>
2021-08-18 20:10:21 -04:00
Yong Cong Sin
442df37ac8 samples/subsys/mgmt/hawkbit: Add missing header
Add missing sys/reboot.h header to fix compilation warning.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-08-18 20:10:21 -04:00
Yong Cong Sin
96866a0262 samples/subsys/mgmt/hawkbit: Remove unused variable
Remove unused variable.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2021-08-18 20:10:21 -04:00
Daniel Leung
ab87df9f75 sensor: grove: fix cmake empty library warning
When there is no grove sensor driver enabled, cmake warns
that the library has no sources. Fix that by adding
a new kconfig to be used by CMake to selectively
include the grove directory.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-08-18 19:08:41 -05:00
Joakim Andersson
06034329dd Bluetooth: hci_uart: Add workaround for no command buffer available
Add workaround for no command buffer available when the host is
transmitting Host Number of Completed Packet Commands.
This command does not follow normal flow control of HCI commands and
the controller side HCI drivers that allocates HCI command buffers with
K_NO_WAIT can end up running out of command buffers.

Increase the command buffer count from 2 to 10 for the HCI uart driver
until the issue has a proper fix

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-18 12:17:36 +02:00
Martí Bolívar
ef54f3d5ce doc: samples: bluetooth: DFE fixes
The documentation for Bluetooth Direction Finding Extension (DFE)
samples has various issues:

- references to 'child' images, which do not exist in mainline zephyr

- invalid RST syntax: there are missing ` characters to end arguments
  to :zephyr_file: roles, creating unintelligible output

- incorrect RST usage:

   - using :zephyr_file: instead of :file: when referring to a file
     that the user must create, creating broken links to nonexistent
     files in the zephyr tree

   - using :code: instead of :kconfig: to refer to kconfig options,
     creating output without links to the help for those options

- redundant or duplicated information

- grammar, typos, various bits and pieces

Clean this up. As part of that, move various common bits and pieces of
information to the devicetree bindings index so they can just be
linked to from the sample docs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-08-17 17:52:43 -04:00
Martí Bolívar
f78d4be329 dts: fix 'grove,foo' compatibles by using 'seeed,grove-foo'
Rename:

- grove,light to seeed,grove-light
- grove,temperature to seeed,grove-temperature

The "grove" brand applies to a family of products by Seeed (sic):

https://www.seeedstudio.com/category/Grove-c-1003.html

Therefore we should use the existing vendor seeed.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:51:57 -04:00
Martí Bolívar
b4042154bf dts: fix 'colorway' compatibles
I can't find any reference anywhere showing that the manufacturer of
the LPD8803 or LPD8806 LED scripts is a company called 'colorway'.

Use 'greeled' instead; these seem to actually be manufactured by
GreeLed corporation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:51:57 -04:00
Martí Bolívar
98f43ba0be dts: fix max30101 compatible
It should be "maxim,max30101", because the vendor prefix for this
company is "maxim", not "max".

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-08-17 17:51:57 -04:00
Joakim Andersson
81614307e9 Bluetooth: Add workaround for no command buffer available
Add workaround for no command buffer available when the host is
transmitting Host Number of Completed Packet Commands.
This command does not follow normal flow control of HCI commands and
the controller side HCI drivers that allocates HCI command buffers with
K_NO_WAIT can end up running out of command buffers.

Increase the command buffer count from 2 to 10 for the affected drivers
until the issue has a proper fix.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-08-16 15:12:22 -04:00
Mateusz Sierszulski
9d62f8d8ac shell: add devmem load command
This commit adds a devmem load command for shell that allows
users to easily load arbitrary data into the device memory.

Signed-off-by: Mateusz Sierszulski <msierszulski@internships.antmicro.com>
Signed-off-by: Tomasz Gorochowik <tgorochowik@antmicro.com>
2021-08-13 10:13:36 -04:00
Kevin Townsend
1740aaeb9b doc: guides: Add a TF-M guide
This commit adds a high-level overview of Trusted Firmware-M,
describing the basic architecture and integration work with Zephyr.

Co-authored-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-08-12 10:03:57 -05:00
Lingao Meng
8e1682d1ea samples: conn_cb replace to const zsector
It is more efficient and saves part of RAM
by replacing it with static one dynamically.

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-08-11 13:42:28 +02:00
Chen Peng1
ce7ebb0821 tests: add a test to verify UEFI boot on x86_64 targets.
add a config CONFIG_QEMU_UEFI_BOOT to indicate whether
the qemu will use UEFI bootable method;
add a new test "sample.basic.helloworld.uefi" to verify
UEFT bootable method on qemu_x86_64 platform.

Signed-off-by: Chen Peng1 <peng1.chen@intel.com>
2021-08-11 11:46:13 +02:00
HaiLong Yang
88172bc918 samples: boards: stm32: add stm32 hsem ipm driver sample
Add a sample for stm32 hsem ipm driver.
Blinky led triggered by mailbox new message.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2021-08-09 16:11:28 +02:00
Dominik Ermel
7a82d03d40 samples/mgmt/smp_svr: Increase workqueue stack size
The addition of image number parsing, in mcumgr library, requires
increase in the stack size for the smp_svr to work.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-05 11:46:00 +02:00
Dominik Ermel
61c0cdf83c samples/mgmt/smp_svr: Add note on image selection for update
The commit adds chapter, to the documentation, that explains
how to select target image to upload, and how does the image number
maps to the DTS image defintion and the slot number.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-05 11:46:00 +02:00
Gerard Marull-Paretas
7ccc1a41bc pm: use actions for device PM control
Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
495672ab62 pm: cleanup pm control callback implementations
- Return -ENOTSUP if the requested state is not supported
- Remove redundant "noop style" functions.
- Use switch everywhere to handle requested state (not necessary in all
  drivers, but better take off with consistency in place after current
  changes).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
d41dadc569 pm: rename PM_DEVICE_STATE_SUSPEND to PM_DEVICE_STATE_SUSPENDED
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
56a35e5682 pm: converge to suspend state for low power modes
The difference between low power and suspend states is a thin blur line
that is is not clear and most drivers have used indistinctly. This patch
converges to the usage of the suspend state for low power, since
contrary to the low power state, it is used by both system and runtime
device PM. The low power state is still kept, but its future is unclear
and needs some discussion.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
11eef4d8c8 pm: device: remove pointer usage for state
Since the state is no longer modified by the device PM callback, just
use the state value.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
9e7d545bb4 pm: device: remove ctrl_command callback argument
The ctrl_command is not used anymore, so remove it from the callback
signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
da0ff4ae46 pm: device: remove usage of ctrl_command
The callback is now invoked to set the device PM state in all cases, so
the usage of ctrl_command is redundant.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Gerard Marull-Paretas
c2cf1ad203 pm: device: remove usage of local states
The device PM subsystem already holds the device state, so there is no
need to keep duplicates inside the device. The pm_device_state_get has
been refactored to just return the device state. Note that this is still
not safe, but the same applied to the previous implementation. This
problem will be addressed later.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-08-04 08:23:01 -04:00
Johann Fischer
8c592e4155 samples: wpanusb: return -ENOTSUP on unsupported device-to-host requests
Control pipe in wpanusb is used only for host-to-device requests.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
63707e304a samples: webusb: return -ENOTSUP on host-to-device control requests
The sample only supports device-to-host control requests.
Return -ENOTSUP on host-to-device control requests.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:05:44 -04:00
Johann Fischer
946964e374 samples: remove USB configuration option
Remove USB configuration option, replace it where necessary
with USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 19:00:12 -04:00
Johann Fischer
759dac513a samples: usb: use new USB framework header
Replace all macros and types with the new ones from
usb/usb_ch9.h header.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-03 13:20:07 +02:00
Abe Kohandel
dcaac1e7af bluetooth: ots: Make OTS Object Reads use POSIX parameter types
It is desirable to have the read and write like functions follow the
POSIX read and write parameter types.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-08-03 13:16:51 +02:00
Kumar Gala
b1b977dacf samples: i2s: echo: fix building on litex_vexriscv
There is no need to include nrf_clock_control.h so remove it as
this fixes a build issue when trying to compile this sample on
litex_vexriscv.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-08-02 19:00:07 -04:00
Bernhard Krämer
c2d98a08f8 board: arm: fix failing test
Add exclude for teensy boards on test
samples/subsys/usb/dfu/sample.usb.dfu

Signed-off-by: Bernhard Krämer <bdkrae@gmail.com>
2021-08-02 16:12:26 -05:00
Abe Kohandel
997bbcb000 bluetooth: ots: Add object write procedure
Add the ability to perform an OTS Write Procedure with only Patch
support configuration.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-07-31 23:16:11 -04:00
Carlo Caione
abb2321d6d ipc: Fix struct name
s/rpsmg_mi_ctx_cfg/rpmsg_mi_ctx_cfg/

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-30 20:06:14 -04:00
Carlo Caione
a9fc1d6c4d ipc: Make the IPM instance index starting from 0
In the current code the naming of the
CONFIG_RPMSG_MULTI_INSTANCE_?_IPM_{TX,RX}_NAME symbol is 1-based. While
this is not currently an issue, it could easily become such if the
symbol is programmatically used as part of a preprocessor enumeration
(for example when using DT_INST_FOREACH_STATUS_OKAY(...) & co).

To avoid trouble, just make the index starting from 0 instead than 1.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-30 20:06:14 -04:00
Andrzej Głąbek
069bac094d samples: boards: nrf: Add an nrfx peripheral resource sharing sample
Add a sample that shows how to use in Zephyr nRF peripherals that
share the same ID and base address. Such peripherals cannot be used
simultaneously, but it is possible to switch between them. However,
currently it is not possible with Zephyr APIs, only using nrfx drivers
directly. This sample shows how to realize such switching for selected
peripheral instances while using standard Zephyr drivers for others.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-07-30 20:03:49 -04:00
Greg Leach
42b05fa024 boards: add mcp7940n to bl5340_dvk
Adding mcp7940n and attached pins to board dts file

Signed-off-by: Greg Leach <greg.leach@lairdconnect.com>
2021-07-30 19:51:29 -04:00
Gerson Fernando Budke
62ba4723d4 drivers: serial: uart_sam0: Add pinctrl support
Add Atmel sam0 sercom[uart] pinctrl bindings and implements pinctrl at
driver level.  It changes all sam0 boards to use new feature and remove
pinmux driver dependency for sercom[uart].  The samples that require a
binding were update to keep consistency and avoid errors.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-07-30 14:37:20 -05:00
Gerard Marull-Paretas
70322853a8 pm: device: move device busy APIs to pm subsystem
The following device busy APIs:

- device_busy_set()
- device_busy_clear()
- device_busy_check()
- device_any_busy_check()

were used for device PM, so they have been moved to the pm subsystem.
This means they are now prefixed with `pm_` and are defined in
`pm/device.h`.

If device PM is not enabled dummy functions are now provided that do
nothing or return `-ENOSYS`, meaning that the functionality is not
available.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-30 09:28:42 -04:00
Martí Bolívar
39782901e7 treewide: fix overlays after TF-M NS rename
Some devicetre overlays do not reflect the recent rename to make NS
variants of boards with TF-M support have more consistent names; fix
it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-30 07:06:44 -04:00
Andrzej Głąbek
5dcc876e0b samples: drivers: Add I2S echo sample
Add a sample intended to show how to use I2S drivers in processing of
audio streams. The sample starts both the RX and TX streams and adds
a simple echo effect to the received audio signal.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-07-28 18:41:26 -04:00
Ioannis Glaropoulos
a3cf49fff2 samples: tfm_ipc: add test-variant for TF-M without BL2
We add a test variant in tfm_ipc test, to validate the
scenario where TF-M is built without BL2 (MCUboot). We
test this on QEMU only (MPS2 AN521).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos
3843bf655c samples: tfm_integration: adapt DTS overlays for STM32L562 board
Due to changes in flash_layout.h for STM32L562, in the current
TF-M module update, we need to modify the DTS overlay files in
the TF-M samples where the board is supported.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos
f91342cb32 samples: tfm_integration: disable regression tests sample for AN521
NS regression tests are hanging on qemu for AN521. The problem is
present in the upstream project as well (issue is filed) so disable
the tests for now on QEMU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Ioannis Glaropoulos
863022e477 samples: tfm_ipc: call sys_arch_reboot(..) directly
Switch to calling the sys_arch_reboot() API directly,
instead of going through the generic sys_reboot API.
This is to avoid locking the IRQs before the reset is
called, which is breaking the PSA call execution.

Also, align sample code to use the same secure service
(platform reset) to show case the PSA connect and close
APIs, instead of a random one (since the reset service
has to work to ultimately perform the system reset).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-28 19:38:35 +02:00
Arvin Farahmand
c1248164a4 samples: dsa: update to match new api
Update to DSA sample to use the new DSA API.

Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
2021-07-26 19:37:22 -04:00
Maksim Drachov
3f0394b830 samples: net: adjusted Kconfig settings for pocket and tcp samples
This change ensures a succesful built on both examples

Signed-off-by: Maksim Drachov <maksim.drachov@outlook.com>
2021-07-26 15:30:38 +02:00
Piotr Mienkowski
e7c630861a samples: counter/alarm: add support for Atmel SAM boards
Add support for sam_e70_xplained, sam_v71_xult based on TC0 counter.

Note: TC module is a 16-bit counter. Even with slow, 32768 Hz input
clock the time span counted by the driver is short.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-26 05:13:40 -04:00
Emil Gydesen
7d07a941fa Bluetooth: samples: Add ISO broadcast benchmark sample
Adds a sample that measures packet loss and BIG sync
statistics.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-25 08:56:00 -04:00
Thomas Stranger
bedfb00d02 samples: crypto: change config to run test sample.drivers.crypto.stm32
The test sample.drivers.crypto.stm32 was built only for the stm32 crypto
driver (build_only: true).
This commit changes the configuration to run the test and adds regex for
the supported modes.
Additionally integration_platform native_posix is removed from the
crypto.stm32 test configuration, such that stm32 targets built in CI.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
091df2b598 samples: drivers.crypto.stm32 test: use filter instead of allow list
This commit uses filter instead of allow list for the
sample.drivers.crypto.stm32 test case.
As a result the ci test is not only built on mikroe_mini_m4_for_stm32,
but also on lora_e5_dev_board, nucleo_wl55jc and stm32l562e_dk.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Thomas Stranger
035fefcd64 samples: drivers: crypto: add support for stm32 with aes peripheral
This commit adds support for stm32 socs with aes peripheral in the
crypto sample.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-07-23 16:25:27 -04:00
Emil Gydesen
3a6952e3e6 Bluetooth: iso: Compile conn.c for BT_ISO even without BT_CONN
If BT_ISO is enabled we now compile conn.c which contains a
lot of functionality used by BT_ISO, even for broadcast-iso
builds, i.e. builds that do not require BT_CONN.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-23 16:11:52 -04:00
Julia Hathaway
3ba485aad9 samples/hci_uart: doc: Fix reference to debug probes page
Changes reference link to the ST-Link debug probes section to match
new labeling.

Signed-off-by: Julia Hathaway <julia.hathaway@nxp.com>
2021-07-22 17:33:43 -04:00
Marek Pieta
573e70b474 samples: hci_rpmsg: Use release configuration by default
Change removes logs and assertions from default configuration.
They can be optionally enabled with debug_overlay.conf.
CONFIG_BT_BUF_CMD_TX_COUNT is increased to avoid dropping
HCI commands.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-07-22 22:42:22 +03:00
Leonard Pollak
50edb6f22c samples: sensor: Added example for SGP40 and SHT4X
This adds an example application for Sensirions SGP40 gas sensor
and SHT4X T/RH sensor.

The measured T/RH are used to make use of the on-chip T/RH compensation
of the SGP40.

Signed-off-by: Leonard Pollak <leonardp@tr-host.de>
2021-07-22 10:17:13 -04:00
Vinayak Kariappa Chettimada
ac82fbfad8 samples: Bluetooth: Option to have scanning in peripheral
Option to have continous scanning simultaneously while
advertising and multiple peripheral role is active.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Vinayak Kariappa Chettimada
fd3655352c samples: Bluetooth: Multiple central connections to peripherals
Application demonstrating Bluetooth Low Energy Central role
functionality by scanning for other devices and establishing
connection to upto 62 peripherals with a strong enough
signal.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Vinayak Kariappa Chettimada
4c6174d511 samples: Bluetooth: Mutiple peripheral identity
Added sample to demonstrate use of multiple identity and be
able to be connected to multiple times from same central
device.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-07-21 08:37:07 -04:00
Affrin Pinhero
f102750f7e samples/drivers: stm32l496g_disco: Enable ADC Sample
This commit enables ADC sample application to build and run on
stm32l496g_disco platform.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
2021-07-21 10:02:24 +03:00
Crist Xu
04ab2400e6 driver: adc: an adc driver for rt1170
reuse the lpc's lpadc driver for rt1170, modify the dts and add
some macro to shield some code of LPC series. Also add the
board support inside the tests/drivers/adc/adc_api/src/test_adc.c,
and a dts node:zephyr,user inside
samples/drivers/adc/boards/mimxrt1170_evk_cm7.overlay

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-20 13:15:58 -05:00
Simon Guinot
58d040ff2f samples: led_ws2812: add example for Everlight B1414
This patch adds a devicetree configuration example for the Everlight
B1414 LED controller.

An overlay for the nucleo_f070rb board is provided. It assumes that
a B1414 LED controller is connected to the PA7 pin (SPI 1 MOSI). The
WS2812 SPI driver is used.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-07-20 13:35:02 +02:00
Simon Guinot
4ada0bbd6e led_strip: ws2812: allow to configure channel mapping
Some devices compatibles with the WS2812 IC have a different channel to
color mappings (e.g. RGB, BGR, RGBW, etc).

This patch introduces the "color-mapping" required property for the
WS2812 DT binding and adds support to the ws2812_gpio and ws2812_spi
drivers. This new property allows to configure the color to channel
mapping of a WS2812 compatible LED strip controller from its DT node.

Since this property also allows to know if a white channel is available,
then this patch removes the "has-white-channel" property.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-07-20 13:35:02 +02:00
Marcin Jeliński
70393b3c44 samples: subsys: ipc: Add a sample for using IPC Service
Demonstating usage of IPC Service. Multi-instance RPMsg
was ued as a backed for IPC Service.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Marcin Jeliński
14272c2726 samples: subsys: ipc: Add a sample for using multi-instance RPMsg
Demonstating usage of multiple instance of RPMsg

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-07-16 21:43:39 -04:00
Glauber Maroto Ferreira
0cf0830ead esp32: drivers: interrupt_controller: review WDT interrupt usage
Review WDT interrupt allocation usage.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-07-16 07:19:28 -04:00
Glauber Maroto Ferreira
b6d61587c2 esp32: drivers: interrupt_controller: review Timer's interrupt usage
Review Timer interrupt allocation usage.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-07-16 07:19:28 -04:00
Fabio Baltieri
2e60836eca samples: lora, class_a: allow building on nucleo_wl55jc
Add nucleo_wl55jc to platform_allow for lora send/receive and class_a
samples. The board has a variation of the sx1262 driver, this should
allow to build test that code path.

Fix the existing config as well to specify the platforms on a single
line, as currently only the last entry is considered.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-07-15 21:30:28 -04:00
Carlo Caione
a168454814 samples: reserved_memory: Introduce sample application
Introduce sample application to test reserved-memory helpers.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2021-07-15 18:12:51 -05:00
Henrik Brix Andersen
09ad92645e samples: shields: lmp90100_evb: convert to using DEVICE_DT_GET_ONE()
Convert from using device_get_binding() to DEVICE_DT_GET_ONE().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-15 11:47:11 -04:00
Crist Xu
36e646f7b8 lpspi: the lpspi driver for rt1170
enable the  lpspi1 for the rt1170 evk board

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2021-07-15 07:50:31 -05:00
Michał Narajowski
29ae06dfac samples: Update Mesh opcode handlers
Add return values to opcode handlers and update message length
definitions.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2021-07-15 11:34:52 +02:00
Kumar Gala
629b270ac5 samples: jesd216: Exclude hifive1 board from sample
By default the hifive1 board doesn't enable the SPI controller that
the flash is on.  As such this test will not build on that platform
due to lack of a missing SPI bus controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-07-14 13:09:33 -04:00
Emil Gydesen
884ec71293 Bluetooth: samples: Add ISO connected benchmark sample
Add a sample that measures packet loss in a connected
ISO setup.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-14 08:35:56 -04:00
Ingar Kulbrandstad
3ec6411c7f Bluetooth: Mesh: Align capitalization for BT mesh
Align the capitalization of the term "Bluetooth Mesh" to Bluetooth mesh"
in the documentation. This is done to to match the new updated naming
convention done in Bluetooth SIG. In the upcoming spec versions, it its
used "Bluetooth mesh" with the lower case convention.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2021-07-13 11:23:54 -04:00
Gerard Marull-Paretas
26ad8376bd pm: remove callback from control function
The callback is not used anymore, so just delete it from the pm_control
callback signature.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Gerard Marull-Paretas
217e610d8f pm: remove redundant callback usage
the device PM callback is not used anymore by the device PM subsystem,
so remove it from all drivers/tests using it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-13 09:36:45 -04:00
Kevin Townsend
703021a78a boards: arm: nrf9160dk_nrf9160: Rename NS target
This commit updates the NS board variant from
`nrf9160dk_nrf9160ns` to `nrf9160dk_nrf9160_ns`
to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend
b8c9dc169e boards: arm: nrf5340dk_nrf5340: Rename NS target
This commit updates the NS board variant from
`nrf5340dk_nrf5340_cpuappns` to `nrf5340dk_nrf5340_cpuapp_ns`
to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend
15e8f635d8 boards: arm: v2m_musca_s1: Rename NS target
This commit update the NS board variant from
`v2m_musca_s1_nonsecure` to `v2m_musca_s1_ns` to maintain
consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend
ccc595836a boards: arm: v2m_musca_b1: Rename NS target
This commit update the NS board variant from
`v2m_musca_b1_nonsecure` to `v2m_musca_b1_ns` to maintain
consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend
257f6b532c boards: arm: mps2_an521: Rename NS target
This commit update the NS board variant from `mps2_an521_nonsecure`
to `mps2_an521_ns` to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Kevin Townsend
58638563b5 boards: arm: bl5340_dvk: Rename NS target
This commit update the NS board variant from `bl5340_dvk_cpuappns`
to `bl5340_dvk_cpuapp_ns` to maintain consistency across zephyr.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-07-10 12:44:02 -04:00
Krishna Mohan Dani
4268592dc2 samples/bluetooth: st_ble_sensor: Fixes the button activity notification
This commit fixes the button activity notification not working issue.
The right attribute(4) is used for the button service.
This has been tested on nucleo_wb55rg and disco_l475_iot1 platforms.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-07-09 17:40:22 +03:00
Anas Nashif
8581b6d1f0 tests: remove kernel tag from key tests/samples
Thos tests/samples are used to build any PR onl all available boards to
verify basic sanity. Having the kernel tag means they can get excluded
for random non-kernel changes causing regressions. so remove kernel tag
to keep them in all CI runs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-08 08:59:51 -04:00
Gerard Marull-Paretas
cc2f0e9c08 pm: use enum for device PM states
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.

All drivers and tests have been adjusted accordingly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-07-07 14:13:12 -04:00
Damian Krolik
bf3c6e7ba4 manifest: update openthread
Regular OpenThread upmerge to bring in a fix for a possible
infinite loop and support for DNS service subtypes.

Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
2021-07-07 07:47:52 -05:00
Andrzej Głąbek
ad0e3a40e8 samples: subsys: task_wdt: Minor corrections in config and doc
Use the actual minimum timeout used by the sample for task watchdog
channels (100 ms) as the configuration value for the fallback hardware
watchdog, to avoid unnecessary executions of the timer handler.

Add missing indentation in the documentation of the sample so that
the console output is rendered correctly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-07-07 07:44:22 -05:00
Sidhdharth Yadav
2022240fea samples: drivers: nucleo_l552ze_q: Configuring ADC sample application
This commit configures ADC sample application using overlay. The ADC
sample has been tested in nucleo_l552ze_q platform.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-07-06 18:03:22 -04:00
Sidhdharth Yadav
de35942887 samples: drivers: stm32l562e_dk: Configuring ADC sample application
This commit configures ADC sample application using overlay. The ADC
sample has been tested in stm32l562e_dk platform.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-07-06 18:03:22 -04:00
Anas Nashif
395b0c3a24 Revert "Bluetooth: samples: Add ISO connected benchmark sample"
This reverts commit 94338c1640.

This is currently failing in CI.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-07-05 21:56:09 -04:00
Piotr Pryga
c1cff75589 samples: Bluetooth: df_tx: Add information about nRF5340 to README.rst
Add information about support of nRF5340 SOC in the sample
README.rst.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-05 14:46:49 +03:00
Piotr Pryga
cd71b07d89 samples: Bluetooth: df: Move BLE controller conf into board specific file
Move configuration related with BLE controller into board specific file.
That is required to allow building the sample for nRF5340 where BLE
controller is not part of the sample image.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-05 14:46:49 +03:00
Piotr Pryga
8237c21c1a samples: Bluetooth: df_rx: Add information about nRF5340 to README.rst
Add information about support of nRF5340 SOC in the sample
README.rst.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-05 14:46:11 +03:00
Piotr Pryga
a25764b19c samples: Bluetooth: df_tx: Add config for support the nRF52820
Add required configuration and DTS overlay for support the nRF52820 SOC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-07-05 14:36:39 +03:00
Chris Pearson
52837aaa49 Bluetooth: samples: Correct "Heart Rate" comment
This is a simple comments fix. This sample code is for the
"Health Thermometer Service", but at one location the comments read
"Heart Rate Service".

The change replaces "Heart Rate" with "Health Thermometer".

Signed-off-by: Chris Pearson <ctpearson@gmail.com>
2021-07-05 14:33:27 +03:00
Abe Kohandel
d6314fa456 bluetooth: ots: Add object name write capability
Add the ability to perform a write on the object name GATT
Characteristic with a notification callback to the application
that the name has been written.

In order for this operation to work the memory backing the
object name must be modifiable. To prevent forcing the user
to always allocate 120 bytes for the name, the maximum name
length is changed from a define to a configuration parameter.

Signed-off-by: Abe Kohandel <abe.kohandel@gmail.com>
2021-07-02 22:22:24 -04:00
Krzysztof Chruscinski
8e4d9ae2e8 samples: shell: shell_module: Add shell bypass demo command
Add command which presents bypass functionality.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-07-02 13:35:18 -04:00
Sidhdharth Yadav
c7397f7a6d samples: drivers: nucleo_l552ze_q: Configuring DAC application
This commit configures DAC sample application using overlay to
build and run on nucleo_l552ze_q platform.

This has been tested in nucleo_l552ze_q platform.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-07-02 13:08:50 -04:00
Sidhdharth Yadav
d1c692afe7 samples: drivers: stm32l562e_dk: Configuring DAC application
This commit configures DAC sample application using overlay to
build and run on stm32l562e_dk platform.

This has been tested in stm32l562e_dk platform.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-07-02 13:08:50 -04:00
Emil Gydesen
94338c1640 Bluetooth: samples: Add ISO connected benchmark sample
Add a sample that measures packet loss in a connected
ISO setup.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-02 08:30:01 -04:00
Henrik Brix Andersen
4216b9f622 modules: canopennode: rename header and Kconfig options
Rename the top-level header file from <canbus/canopen.h> to
<canopennode.h>.

Rename CANopenNode related Kconfig options from CONFIG_CANOPEN* to
CONFIG_CANOPENNODE*.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Henrik Brix Andersen
613f1cde4a samples: modules: canopennode: move the CANopenNode sample to modules
Move the CANopenNode sample into the samples/modules directory.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-07-01 13:32:18 -04:00
Emil Gydesen
61847b6be0 samples: bluetooth: Adds central PAST sample
Adds a sample that demonstrates how to transfer a periodic
advertising sync from a device to another device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-01 13:21:31 -04:00
Emil Gydesen
bfa7315649 samples: bluetooth: Add peripheral PAST sample
Adds a sample of using (in this case subscribing) to periodic
advertising sync transfer (PAST).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-07-01 13:21:31 -04:00
Piotr Pryga
9fd079bb0d samples: Bluetooth: df_rx: Add config for support the nRF52820
Add required configuration and DTS overlay for support the nRF52820 SOC.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-06-29 17:07:20 -04:00
Gerard Marull-Paretas
9dfbdf1997 doc: use kconfig role and directive
Stop using :option: for Kconfig options.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-29 10:26:28 -04:00
Watson Zeng
2945ccb7e2 samples: compression: lz4: add TOOLCHAIN_HAS_NEWLIB filter
samples\compression\lz4 rely on CONFIG_NEWLIB_LIBC=y, let's
add TOOLCHAIN_HAS_NEWLIB filter for it.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-06-28 09:15:43 -04:00
Jordan Yates
be2e6a0850 samples: button: use gpio_dt_spec helpers
Convert pin setting and getting to `struct gpio_dt_spec` variants to
demonstrate usage of the new API.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-06-24 06:40:00 -05:00
Joakim Andersson
6eb7574076 Bluetooth: samples: Use bt_gatt_find_by_uuid in peripheral sample
Demonstrate use of bt_gatt_find_by_uuid in peripheral sample. This
avoids the magical array index.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-22 09:06:00 -04:00
Alexandre Bourdiol
0c78393de4 samples: subsys: fs: fat_fs: adafruit needs arduino_i2c dependency
Shield adafruit_2_8_tft_touch_v2 needs arduino_i2c dependency.
Fixes #36448

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-22 08:44:36 -04:00
Emil Gydesen
a1cf45b26e Bluetooth: ISO: Split connected and broadcast ISO Kconfig
Add a new Kconfig option, BT_ISO_UNICAST, to make it possible
either configure unicast only, broadcast only or both.

This results in some code being moved, but not modified, and
should not effect anything.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-06-22 08:21:00 -04:00
Erwan Gouriou
3e1443ccf9 scripts/pylib: expr_parser.py: Review dt_compat_enabled_with_label
Function used for filtering "dt_compat_enabled_with_label" was not
working as expected as it was not taking into account that we're
looking for a children/parent combination:
Provided "compat" with enabled status should be the one of the parent
of the node matching given label.

Function is then reworked to take this into account.
And to make it's usage clear:
- function name is changed to be clearer on the intention
- args order is reversed to be more logical wrt the intention

Users of the function are also updated to take the change into
account.

Fixes #36093

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-06-21 20:31:49 -04:00
Henrik Brix Andersen
588d22a755 drivers: ht16k33: convert keyscan driver from gpio API to kscan API
Convert the keyscan portion of the Holtek HT16K33 driver to adhere to
the kscan API instead of the GPIO API.

When this driver was introduced the kscan API was not present. The
keyscan driver was therefore implemented as a GPIO interrupt driver.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-06-18 11:22:40 +02:00
Ilya Tagunov
33faca671d samples: lorawan: class_a: increase stack sizes
Increase main and system workqueue stack sizes to avoid overflows
as the LoRaMac-node library is quite stack-hungry.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2021-06-18 11:22:03 +02:00
Thomas Stranger
d3692805f1 samples: drivers: eeprom: remove needless null pointer check
This commit removes a superfluous null pointer check.
The device is accessed via a label.
so in case it is not available a build error arises,
but the pointer won't ever be null.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-06-17 19:26:23 -04:00
Parthiban Nallathambi
588e0a69dc samples: lz4: fix typo about conflicting board
- change frdm_k64f to nrf52840dk_nrf52840 in README

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2021-06-16 16:23:45 -05:00
Kumar Gala
4e347d41ff tests/samples: Remove setting of CONFIG_DEBUG_OPTIMIZATIONS
CONFIG_DEBUG_OPTIMIZATIONS should not be enabled by default in
prj.conf for tests or samples.  Remove it from a few places that it
is.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-16 13:35:29 -05:00
Ioannis Glaropoulos
71993aa40d samples: tfm: minor doc style fixes
Minor documentation style fixes in
tfm_integration.rst file.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-16 12:08:07 +02:00
Ioannis Glaropoulos
20df3e8488 samples: tfm regression: add lpcxpresso55s69_ns in allowed platforms
Include the lpcxpresso55s69_ns board to the list of platforms
that support running the sample for the TF-M regression tests.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-16 12:08:07 +02:00
Hans Wilmers
a59d2a17bd samples: shell_module: use Kconfig setting SHELL_CMD_ROOT
If shell login is used, the root comamnd is now set using the new
Kconfig setting SHELL_CMD_ROOT.

Signed-off-by: Hans Wilmers <hans@wilmers.no>
2021-06-16 10:41:17 +02:00
Robert Lubos
ae2509c778 samples: net: sockets: big_http_download: Set RX/TX timeout on a socket
Configure a timeout for send/recv operations so that the sample can
recover in case the connection stalls (for instance due to IP address
change on an interface).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-16 10:40:54 +02:00
Jennifer Williams
b88559a31c sample: subsys: shell: shell_module: add config for timing at boot
Use of CONFIG_THREAD_RUNTIME_STATS was added to this sample, but
caused issue because the call to z_thread_mark_switched_in()
is using k_cycle_get_32() before the timer is initialized.
Enable CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS=y to
select hidden config CONFIG_TIMING_FUNCTIONS_NEED_AT_BOOT,
which calls to initialize the timer needed at boot for thread
runtime stats configuration.

Fixes #33275

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-16 11:03:11 +03:00
Rafał Kuźnia
be95692744 samples: boards: nrf: ieee802154: set RTC user channels
The CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT must be set for 802154_rpmsg
sample to properly allocate timers for nRF-802154 driver.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-15 09:45:58 +02:00
Robert Lubos
2e5839176b samples: net: sockets: http_get: Increase MBEDTLS_SSL_MAX_CONTENT_LEN
The Google server that the sample connects to sends a larger certificate
since recently. As the overall size of the message conveying the
ceritificate is ~4700 bytes now, current mbedTLS configuration did not
allow to reassemble the message and thus caused failure during the
handshake.

Fix this by increasing MBEDTLS_SSL_MAX_CONTENT_LEN parameter (with some
extra space for any future changes).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-14 21:49:00 -04:00
Henrik Brix Andersen
da906cca24 samples: sensor: mcux_acmp: convert to using DEVICE_DT_GET()
Convert from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-06-14 15:20:25 +02:00
Henrik Brix Andersen
ea1e47d0ef samples: display: cfb_custom_font: convert to using DEVICE_DT_GET()
Convert from using device_get_binding() to DEVICE_DT_GET().

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-06-14 07:04:36 -05:00
Henrik Brix Andersen
b99cce3506 samples: display: cfb_custom_font: remove obsolete board configuration
Remove obsolete reel_board configuration from the cfb_custom_font
sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-06-14 07:04:36 -05:00
Jukka Rissanen
ccd96c167a samples: net: txtime: Add Qbv and TXTIME configuration
Enable TXTIME for each queue. Add example for setting up Qbv
configuration options.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-06-14 07:00:10 -04:00
NavinSankar Velliangiri
c9aa260f0c samples: compression: lz4: lz4 sample application
This PR add sample application for minimal lz4 library.

lz4 library RFC requested here: #28535

Fixes: #26648

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-06-12 17:21:55 +02:00
Ioannis Glaropoulos
93c0eb94a3 samples: tf-m: remove CONFIG_TEST=y setting
Removing the CONFIG_TEST=y setting from the TF-M
integration samples prj.conf. TEST does not need
to be enabled in these samples.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-12 08:50:50 -05:00
Joakim Andersson
139035e0a2 Bluetooth: host: Use UUID encode macro for 128-bit UUIDs
Use UUID encode macro fro 128-bit UUIDs for readability. This makes
it easier to see which service you are working with as the
bt_uuid_to_str prints the 128-bit UUIDs in this format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-11 16:13:35 +02:00
Joakim Andersson
32508c6412 samples: Eddystone: Use UUID encode macro for 128-bit UUIDs
Use UUID encode macro fro 128-bit UUIDs for readability. This makes
it easier to see which service you are working with as the
bt_uuid_to_str prints the 128-bit UUIDs in this format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-11 16:13:35 +02:00
Krishna Mohan Dani
bfa650d708 samples/drivers: stm32f3_disco: Enable DAC Sample application
This commit enables DAC sample application to build and run on
stm32f3_disco platform. Updated documentation.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
2021-06-10 16:00:04 -05:00
Kumar Gala
b6781264d7 samples: drivers: remove entropy sample
This sample doesn't do anything interesting and we have
tests/drivers/entropy to can show how to call the API.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-10 08:07:19 -04:00
Devaraj Ranganna
4f0c52c2c5 samples: tfm_integration: docs: Fix incorrect sample name
The README.rst in `samples/tfm_integration/tfm_ipc` was incorrectly
referring to `psa_level_1`. README.rst has been updated to refer to
`tfm_ipc` example.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Devaraj Ranganna
ac9197b640 samples: tfm_integration: Rename sample psa_level_1 to psa_crypto
The example in folder `samples/tfm_integration/psa_level_1` contains
code that demonstrate usage of PSA crypto APIs in Zephyr rather than the
PSA levels. Therefore renaming the sample as `psa_crypto`.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Devaraj Ranganna
155ea1862b samples: tfm_integration: Enable PSA IPC mode
Enable PSA IPC mode in psa_level_1 sample.

Signed-off-by: Devaraj Ranganna <devaraj.ranganna@linaro.org>
2021-06-09 19:48:43 +02:00
Kevin Townsend
0d1fe4a161 samples: tfm_integration: Extend PSA cryptography demo
This commit extends the psa_level_1 sample's use of the PSA
Cryptography 1.0 API to demonstrate the following functionality:

- Generate a persistent key (secp256r1)
- Display the public key based on the private key above
- Calculates the SHA256 hash of a payload
- Signs the hash with the persistent key
- Verifies the signature using the public key
- Destroys the key

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-06-09 19:48:43 +02:00
Kumar Gala
45eca4ce10 samples: eeprom: Fix build issues with x_nucleo_eeprma2 sample
There are a number of platforms that the x_nucleo_eeprma2 eeprom sample
can't build on.  Also fix issue with missing include of <mem.h> header
to get DT_SIZE_* macros used by the overlay.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-09 11:51:14 -05:00
Erwan Gouriou
4319a5d68f samples/drivers/eeprom: Add fixture check on x_nucleo_eeprma2 config
sample.drivers.eeprom.shield.x_nucleo_eeprma2 sample variant
should be run in CI bench only if shield is present on board.
Add a harness_config to specify the fixture check

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-06-08 11:14:08 -05:00
Ioannis Glaropoulos
aa5e2eb720 samples: remove disabling AUDIT_LOG partition in samples with TFM_IPC
The AUDIT_LOG partition cannot be used in TF-M builds
with the IPC mode (CONFIG_TFM_IPC=y); we have added a
relevant dependency for this. So we can cleanup the
CONFIG_TFM_PARTITION_AUDIT_LOG=n from the configuration
files of the samples.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-06-08 04:51:51 -05:00
Kieran Mackey
a41fc5165a baords: bl5340_dvk: Add MCP4725 dac to bl5340_dvk_cpuapp dts file
MCP4725 is an I2C dac that was added with PR #33481. This can now be
added to the bl5340_dvk device tree.

Signed-off-by: Kieran Mackey <kieran.mackey@lairdconnect.com>
2021-06-07 09:00:28 -05:00
Thomas Stranger
c8e4d0716a samples: add eeprom sample
This commit adds a simple application to demonstrate the zephyr
eeprom interface.
It uses an eeprom to keep track of the number reboots.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-06-07 12:06:08 +02:00
Jordan Yates
cea80d0ccb samples: Bluetooth: peripheral: add MTU callback
Add a demonstration of the updated ATT MTU callback to the Bluetooth
peripheral sample.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-06-07 12:03:09 +02:00
Andreas Vibeto
75dccbbbc7 samples: tfm: Add PSA Protected Storage sample
Add sample showing PSA Protected Storage API usage

Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
2021-06-07 09:27:08 +02:00
Marcin Jeliński
02e8bb805b samples: bluetooth: periperal_hr: create minimal configuration
Create minimal configuration for the peripheral_hr. Which can
be used to build this sample for nRF52810 and nRF52811 targets.

Signed-off-by: Marcin Jeliński <marcin.jelinski@nordicsemi.no>
2021-06-04 16:26:56 -05:00
Rafał Kuźnia
9f3d34169f samples: net: Increase stack sizes for echo client/server
The echo client/server samples may require more stack
capacity on some platforms.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2021-06-04 16:20:27 -05:00
Alexandre Bourdiol
b317ef89b1 sample: drivers: led_ws2812: support nucleo_l476rg
Support nucleo_l476rg

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-06-04 16:17:38 -05:00
Gerard Marull-Paretas
45a6de6804 drivers: fix pm callback signature
For some reason a few drivers were not converted to the new device PM
callback signature. The reason may be because the device PM part is
compiled only when CONFIG_PM_DEVICE=y, a condition not enabled in CI by
default.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-04 08:16:49 -05:00
Erwan Gouriou
366a64cb1e samples/boards/stm32: PM Blinky: Rework README
Rework README to provide a correct and understandable status.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-06-02 16:50:02 -05:00
Robert Lubos
f6119965e2 samples: net: sockets: big_http_download: Update certificate
The Let's Encrypt X3 certificate is no longer in use, replace it with an
up-to-date certificate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-02 10:36:33 -05:00
Anas Nashif
ec5e3017ac boards: up_squared: remove 32bit variant
This board was created for the transition to all 64bit, it is not needed
anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-01 14:06:56 -05:00
Joakim Andersson
56c73eae39 Bluetooth: samples: Fix peripheral sample handling of string values
Fix peripheral sample handling of string values. The read callback
uses strlen to get the length of the current string value. Make sure
that the string value is always zero-byte terminated.

Fix multiple characteristics using the same storage for its value.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-31 17:41:12 +02:00
Alexey Brodkin
2b2a2cad68 samples: tensorflow: Fix sample path
Otherwise documentation mentions wrong path in the "west" options.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2021-05-27 14:40:12 -05:00
Casper Bonde
04dfcba792 Bluetooth: ISO: Add sequence number to ISO data packets
The sequence number is needed in the appliaction layer to detect lost
packets in the ISO stream in cases where the timestamp is not included.
(Sequence number is mandatory to include where timestamp is optional).
The API for the public metadata have been moved to a public header file.

As the size of the ISO meta data exceeds the default 4 octets net_buf
user_data the public ISO metadata have been moved into a seperate array.
The internal metadata is still stored in net_buf user_data.

This also fixed the user_data overflow on 32 bit systems, caused by
writing the ts into user_data on index 4 to 7, which is outside the 4
allocated bytes.

Signed-off-by: Casper Bonde <casper_bonde@bose.com>
2021-05-27 13:16:40 +02:00
Ioannis Glaropoulos
00e2bb0288 samples: tfm_integration: DT overlay doc fixes for stm32l562e_dk_ns
Minor documentation fixes for the DT overlay files for
stm32l562e_dk_ns board.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-26 18:58:15 -05:00
Ioannis Glaropoulos
d4ae6a9cf3 samples: tfm_ipc: update DT overlay for nucleo_l552ze_q_ns
Update overlay file for nucleo_l552ze_q_ns board,
since now the sample does not enable REGRESSION,
and thus regular TF-M flash layout for the board
is used.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-26 18:58:15 -05:00
Kevin Townsend
5fd7a52d4e samples: tfm_integration: tfm_ipc: Remove regression dependency
Removes the dependency on the external test service from the
CONFIG_TFM_REGRESSION_S test suite, instead
demonstrating how to make direct IPC calls to the CRYPTO
service that is available as a part of standard TF-M builds.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2021-05-26 18:58:15 -05:00
Piotr Mienkowski
a323a41fc2 sensor: qdec_sam: use compatible atmel,sam-tc-qdec
Change the drivers's compatible from atmel,sam-tc to atmel,sam-tc-qdec.
The atmel,sam-tc should be reserved for the future counter driver.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-05-26 18:13:10 -05:00
Flavio Ceolin
d67a5786bc pm: device_runtime: Change API behavior s/_sync/_async
Most APIs have the default synchronous and an asynchronous version
with the sufix _async because that is the most common use.

All devices in tree right now are using the synchronous version, so
just change it to be consistent with the rest of the system.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Flavio Ceolin
d325642892 pm: device_runtime: Get rid of atomic for state
Since we are using mutex to protect critical sections and mutexes are
reentrant, it is possible to get rid of atomic for the state because
we can lock the mutex in device_pm_callback.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Flavio Ceolin
69a34e5947 samples: device_pm: Fix harness
Changing from spinlock to mutex makes the running thread be preempted
and the workqueue ran. This changed the prints order in this sample.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Flavio Ceolin
ff1613c80f samples: device_pm: Fix condvar usage
Use pm_device_wait() to properly wait an operation to finish.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-26 10:56:55 -04:00
Emil Gydesen
bbf63d364e Bluetooth: Samples: Fix peripheral_iso print data
The sample would consequently try to print invalid data
the offset into the data was incorrect calculated to
always be at the end of the data, instead of at the
end of the data minus an offset.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-25 19:40:42 +02:00
Nick Ward
77ebfa9b60 doc: can: fix build commands
File prj.mcp2515.conf was previously removed from project as it was
made redundant.

Paths containing uppercase CAN were changed to lowercase.

Signed-off-by: Nick Ward <nick.ward@setec.com.au>
2021-05-25 09:40:27 -04:00
Gerson Fernando Budke
1a2804c307 samples: wifi: Fix mgmt conn req
When a WIFI driver is slow to get interface up the system not connect
to WIFI access point.  This add some tries to let driver be proper
initialize to allow accept connection request.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-05-25 07:37:24 -05:00
Maureen Helm
6866724aed samples: display: Limit lvgl sample execution to boards with shield
Similar to commit c6ff61220e, use a
harness config to limit execution of the adafruit_2_8_tft_touch_v2
sample variant to boards that have this shield attached.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-25 07:07:55 -05:00
Maciej Perkowski
87bb385134 tests: pwm: led: Fix pwm_led sample
The PR fixes the pwm_led sample:
- now test doesn't rely on any specific device name
- Logs which are scanned with regex in the test are printed
  only after a command passes (before failures were not
  affecting the test verdict)
- If 1 sec cycle is not supported appropriate info is printed
  and won't cause the test to failed
- Changed second "Turned off" msg so regex doesn't mix it with the
  the first one.

Fixes #35524

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-05-25 08:07:25 -04:00
Andy Ross
851d14afc8 kernel/sched: Remove "cooperative scheduling only" special cases
The scheduler has historically had an API where an application can
inform the kernel that it will never create a thread that can be
preempted, and the kernel and architecture layer would use that as an
optimization hint to eliminate some code paths.

Those optimizations have dwindled to almost nothing at this point, and
they're now objectively a smaller impact than the special casing that
was required to handle the idle thread (which, obviously, must always
be preemptible).

Fix this by eliminating the idea of "cooperative only" and ensuring
that there will always be at least one preemptible priority with value
>=0.  CONFIG_NUM_PREEMPT_PRIORITIES now specifies the number of
user-accessible priorities other than the idle thread.

The only remaining workaround is that some older architectures (and
also SPARC) use the CONFIG_PREEMPT_ENABLED=n state as a hint to skip
thread switching on interrupt exit.  So detect exactly those platforms
and implement a minimal workaround in the idle loop (basically "just
call swap()") instead, with a big explanation.

Note that this also fixes a bug in one of the philosophers samples,
where it would ask for 6 cooperative priorities but then use values -7
through -2.  It was assuming the kernel would magically create a
cooperative priority for its idle thread, which wasn't correct even
before.

Fixes #34584

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-05-24 23:38:16 -04:00
Lauren Murphy
f492636aa9 samples: tensorflow: remove requirements.txt from magic wand sample
Removes the requirements.txt from the training directory of the
magic wand sample as it is causing issues in CI. Updates README.md
to explicitly state the Python packages listed in requirements.txt.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-24 14:18:08 -04:00
Johann Fischer
fca499100d samples: usb-audio: add app.overlay and remove board specific overlays
USB audio class samples are generic and can be built for any
board that supports USB device and isochronous endpoints.
Add app.overlay that uses aliases and remove board specific overlays.

Note: USB audio is still experimental and even though the sample can
be built for specific platform, it does not mean that it can be run
on it without issues.

Fixes: #25313

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-05-21 18:16:25 -04:00
Martin Jäger
784e6847df samples: drivers: watchdog: Pause during debugging
Enable the option to pause the watchdog if the MCU is halted by a
debugger.

This fixes an issue with some Nordic MCUs (see #33509) where the board
could not be flashed anymore if a short watchdog timeout (<100 ms) was
used.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-05-21 05:00:07 -05:00
Lauren Murphy
f77d5c5c53 samples: tensorflow: change from file list to glob in cmakelists.txt
Changes CMakeLists.txt in TensorFlow samples from explicit file
list to a GLOB capturing src/* to make TensorFlow samples consistent
with other samples in tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy
e4b985b929 samples: tensorflow: fix documentation
Fixes documentation for samples that incorrectly state that TensorFlow
library requires the -fno-threadsafe-statics flag to compile.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Lauren Murphy
e6b8c50599 samples: tensorflow: add no-threadsafe-statics to compiler flags
Adds no-threadsafe-statics to compiler flags for gcc and arcmwdt.

The flag is required to compile the samples - the module can compile
without it.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-05-20 20:59:45 -04:00
Thomas Stranger
0388ebb6f6 samples: can: fix parenthesis for can_recover call
This commit fixes a single wrongly placed parenthesis in the can bus
sample.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-05-20 07:51:06 -05:00
Maureen Helm
c79b1a38aa samples: display: Convert driver and lvgl sample.yaml to use depends_on
Converts the display driver and lvgl sample.yaml to select boards for
the adafruit_2_8_tft_touch_v2 shield configuration by depending on the
arduino_{gpio,i2c,spi} features instead of using an explicit
platform_allow list. This will enable twister to automatically select
new boards that add support for Arduino ports.

The reel_board and reel_board_v2 are excluded due to a conflict between
display drivers (onboard display vs. shield display).

The ubx_evkannab1_nrf52832 board is excluded due to a conflict between
the arduino_spi and arduino_i2c ports, which cannot be used
simultaneously.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-19 08:14:25 -05:00
Henrik Brix Andersen
34904e567b boards: arm: lpcxpresso55s16: rename board definition
Rename the NXP LPCXpresso55S16 board definition from
lpcxpresso55s16_ns (non-secure) to lpcxpresso55s16 and remove TF-M
configuration options.

While the LPC55S16 does have Arm TrustZone support, there is no TF-M
support available upstream yet.

Fixes #35100

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2021-05-19 08:02:54 -05:00
Simon Guinot
df01148aeb drivers: led_pwm: fix device name fallback
If the label property is missing in a "pwm-leds" compatible DT node
(which is almost always the case), then the device name is now set to
DT_NODE_FULL_NAME instead of "LED_PWM_$inst" previously.

This allows applications to use the DEVICE_DT_NAME macro to retrieve
the device name instead of gessing an arbitrary string.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-05-19 11:56:01 +02:00
Dominik Ermel
2864ead3ec samples: littlefs: Fix sample attempting double mount
Fixes sample execution ending early with error, as it attempted
to mount the LittleFS partition second time, after it has already
been mounted by the auto-mount feature.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-05-18 16:58:53 -04:00
Hake Huang
437a5b6028 tests: flash: Enable flash driver and file system tests on mimxrt1060_evk
now the XIP feature can work in NXP RT series boards
so enable below cases on mimxrt1060_evk with XIP
tests/kernel/xip
tests/drivers/flash
tests/subsys/fs/littlefs
samples/shell/fs
samples/subsys/fs/littlefs

for tests/subsys/fs/littlefs:
need add --erase to erase the nor flash if you are using below partition
e.g. west flash --runner=pyocd --erase
&is25wp064 {
        partitions {
                compatible = "fixed-partitions";
                #address-cells = <1>;
                #size-cells = <1>;

                partition@310000 {
                        label = "large";
                        reg = <0x00310000 DT_SIZE_M(3)>;
                };
                partition@610000 {
                        label = "image-scratch";
                        reg = <0x00610000 DT_SIZE_K(128)>;
                };
                partition@630000 {
                        label = "small";
                        reg = <0x00630000 DT_SIZE_K(64)>;
                };
                partition@640000 {
                        label = "medium";
                        reg = <0x00640000 DT_SIZE_K(960)>;
                };
        };
};

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-18 11:19:15 -05:00
Erwan Gouriou
836dc911e0 samples/boards: stm32 pm blinky: Run with twister device testing
Add minimum harness and to get the sample passed when run using
twister.
Adding console validates uart init with DEVICE_RUTIME=y.

Additionally, clarify comment about DEBUG activation.

Fixes #35033

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-18 11:18:40 -05:00
Anas Nashif
6586d0f5c4 samples: lsm6dso: enable float printing
This sample requires float support from cbprintf.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-18 08:34:20 -04:00
Maureen Helm
e5f21a7234 samples: bluetooth: Convert peripheral_hr sample.yaml to use depends_on
Converts the Bluetooth peripheral_hr sample.yaml to select boards for
the frdm_kw41z shield configuration by depending on the arduino_serial
feature instead of using an explicit platform_allow list. This will
enable twister to automatically select new boards that add support for
an Arduino serial port.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-18 12:35:39 +03:00
Flavio Ceolin
178cfd094c samples: pm: Fix device pm sample
"child resuming" text is printed when dummy_device_pm_ctrl is
called. The driver is using the async api, this means that this call
will happen only when the worqueue runs what will happen only when
this thread blocks waiting on the conditional variable.

The last thing is, the dummy driver was putting the parent driver
asynchronously consequently the "parent suspending" message would just
print after "Device PM sample app complete". Just use the sync API to
get these messages printed in the expected order.

Fixes #35336

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-17 15:40:58 -04:00
Jukka Rissanen
56bb8a40e9 samples: net: gsm_modem: Add GSM mux compile test
Add a compile test for GSM muxing so that we catch possible
issues in the future.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-17 10:57:53 -04:00
Maureen Helm
19fd5835f7 samples: sensor: Fix logically dead code in bmg160 sample
Converts the bmg160 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 5832e588e3.

Fixes #35118
Coverity-CID: 235919

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-12 08:28:51 -05:00
Maureen Helm
53f21e170f samples: sensor: Fix logically dead code in adxl372 sample
Converts the adxl372 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 72795c3e6c.

Fixes #35119
Coverity-CID: 235932

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-12 08:28:51 -05:00
Jukka Rissanen
7c0ab58234 samples: net: txtime: Address length was not init
The sockaddr address length was not initialized properly
when receiving packets.

Coverity-CID: 232698
Fixes #35159

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-11 15:45:11 -05:00
Kumar Gala
581069942c samples: sensor: max17262: Fix NULL pointer dereference
If we don't get a dev pointer from device_get_binding() we should
not dereference it.  Just drop the name from the printk message
as in the future this is likely to use DEVICE_DT_GET().

Fixes #35112

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-11 10:47:39 -05:00
Ievgenii Meshcheriakov
c610a07735 samples: peripheral_ht: remove configurations for nrf5x boards
The required configuration is already selected by the Kconfig file for
all nrf devices that support TEMP peripheral.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2021-05-11 14:44:18 +03:00
Ievgenii Meshcheriakov
49300770f8 samples: peripheral_ht: use HAS_HW_NRF_TEMP to detect TEMP sensor presence
The TEMP sensor is not present in configurations like
nrf5340dk_nrf5340_cpuappns.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2021-05-11 14:44:18 +03:00
Torsten Rasmussen
5888428541 mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.

Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.

Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.

Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.

Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.

Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.

Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 15:24:23 -05:00
Ioannis Glaropoulos
c5b4094cfb modules: tf-m: do not expose TF-M NS interface include directories publicly
Instead of exposing publicly the TF-M NS interface include
directories, we include them when we build relevant projects.
This is required, as the TF-M include directories contains
psa crypto sources that are also provided by the mbedtls
crypto module. The downside of this solution is that the
TF-M includes need to be added explicitly in each application
that uses TF-M APIs.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
David Brown
aa5187ecde tls: Change some external symbols from Mbed TLS
In Mbed TLS:
    commit eccd88871767e2fba5f3a079cfdfcb77c376cf20
    Author: Gilles Peskine <Gilles.Peskine@arm.com>
    Date:   Tue Mar 10 12:19:08 2020 +0100

        Rename identifiers containing double-underscore

changes the name of a symbol we use.  As part of upgrading to newer
versions of Mbed TLS, change the name of the symbol we use.

A better fix would be to not use this symbol at all, and perhaps define
our own symbol the same way this internal symbol is defined within the
library.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-05-09 09:59:22 -05:00
Ioannis Glaropoulos
39c917788f Revert "mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE"
This reverts commit 1ad1acd7c9.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-09 09:59:22 -05:00
Eug Krashtan
0c4e9d29bb samples: sensor: Add stm32_temp sample application
Demonstating usage of STM32 temperature sensor.

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2021-05-08 10:18:09 -05:00
Torsten Rasmussen
1ad1acd7c9 mbedtls: kconfig: created MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.

Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.

Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.

Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.

Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.

Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.

Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-08 07:11:00 +02:00
Anas Nashif
4d994af032 kernel: remove object tracing
Remove this intrusive tracing feature in favor of the new object tracing
using the main tracing feature in zephyr. See #33603 for the new tracing
coverage for all objects.

This will allow for support in more tools and less reliance on GDB for
tracing objects.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 22:10:21 -04:00
Anas Nashif
63123ffb71 samples: philosopher: add thread names
If thread names are enabled, set them up so we can get nice tracing
output and know which thread is which.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 22:10:21 -04:00
Anas Nashif
270be80caa tracing: add empty test macros
Add support for new tracing macros in test backend. Move header from
sample into the subsystem and make it available for general testing with
any application.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-07 22:10:21 -04:00
Flavio Ceolin
0c607adb63 pm: device: Align state names with system states
Change device pm states to the same pattern used by system power
management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 18:35:12 -04:00
Flavio Ceolin
565014a1ec samples: stm32: Set device busy in the blinky sample
This sample turn on/off the LED every two seconds and then sleeps. When
the LED is on we don't want the system putting it down when goes to
sleep. So, just setting this device as busy.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 18:35:12 -04:00
Flavio Ceolin
c7f5270a01 pm: device: fsm_state -> state
Rename state variable.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 16:55:31 -04:00
Flavio Ceolin
8705c688e2 power: device_pm: Fix concurrence issues
The sync API was using k_poll_signal and in certain conditions is
possible multiple threads waiting on a signal leading to an undefined
behavior.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 16:55:31 -04:00
Flavio Ceolin
7eba310220 power: device: void *context -> uint32_t *state
The context parameter used across device power management is
actually the power state. Just use it and avoid a lot of
unnecessary casts.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-05-07 16:55:31 -04:00
Saurabh Jagdhane
d5e0e8b0f3 samples: fs: Enable littlefs sample for mimxrt685_evk.
Add mimxrt685_evk_cm33 board to the platform_allow list
for the littlefs sample application.

Signed-off-by: Saurabh Jagdhane <saurabh.jagdhane@nxp.com>
2021-05-07 15:44:19 -05:00
Akash Patel
241374eee5 samples: flash_shell: fix SHELL_CMD_REGISTER typo
help parameter inside of SHELL_CMD_REGISTER contained a typo

Signed-off-by: Akash Patel <akash.patel@nordicsemi.no>
2021-05-07 15:34:13 -05:00
Erwan Gouriou
da6727572d samples/boards/stm32: blinky: Limit execution on stm32 lptim enabled
Restrict sample execution in CI to boards that have
"st,stm32-lptim" enabled so we're sure it is a STM32 target.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-07 10:40:18 -05:00
Torsten Rasmussen
b671cf7279 cmake: tfm: support for custom CMake args when building TF-M
This commit allows a subsystem to specify additional CMake flags to be
given to the TF-M build.

The additional CMake flags can be provided through the TFM_CMAKE_OPTIONS
property on the zephyr_property_target.
Using the zephyr_property_target allows Zephyr modules to append extra
TFM_CMAKE_OPTIONS regardless of the CMake processing order.

It splits the ExternalProject_Add into a two step process with the CMake
invocation executed using add_custom_target() and the build process
using ExternalProject_Add(). The reason for this split is because CMake
generator expressions passed through ExternalProject_Add to CMake will
quoted so that `$<TARGET_PROPERTY:<tgt>,<prop>>` becomes
`"-DFOO=bar -DBAR=foo"` instead of `-DFOO=bar -DBAR=foo` which again
results in CMake failures.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-07 13:09:54 +02:00
Jamie McCrae
f4350a9303 boards: arm: Add Laird Connectivity BL5340 DVK platform
This adds initial support for the Laird Connectivity BL5340
development kit hardware

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-05-07 09:06:27 +02:00
Dominik Ermel
56c22355e4 samples/subsys/mgmt/smp_svr: Fix shell mgmt not working via serial
The Kconfig option SHELL_BACKEND_SERIAL had been defaulting to y,
causing shell to block mcumgr from processing serial input.

Fixes: #34670

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-05-06 16:35:14 -05:00
Kumar Gala
6d5d783a49 samples: mgmt: osdp: Fix compile issue
With the change to use GPIO_DT_SPEC_GET_OR a number of platforms
failed to build these samples.  This was due to the GPIO drivers not
being enabled by default.  Add CONFIG_GPIO=y to the prj.conf to fix
the issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-06 17:33:58 -04:00
Ioannis Glaropoulos
14d7fab4a0 samples: psa_leve1: do not re-initialize NS interface
TF-M NS interface is initialized by the TF-M module
code, so it does not need to be re-initialized in the
sample code.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-06 22:17:35 +02:00
Erwan Gouriou
c730603332 samples/boards: stm32: Add low power blinky sample
This sample demonstrates a low power blinky application.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-06 14:31:13 -04:00
Kieran Mackey
38ed9c885e drivers: dac: added driver for Microchip MCP4725
The MCP4725 is a single channel 12 bit DAC. It is controlled via I2C.

Signed-off-by: Kieran Mackey <kieran.mackey@lairdconnect.com>
2021-05-06 11:07:33 -05:00
Trond Einar Snekvik
1649f2fc4a samples: bluetooth: iso_receive: Convert to new k_work API
Converts the sample to the new k_work API, and introduces a blink
boolean to catch cancel failures.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-05-06 10:12:59 -05:00
Trond Einar Snekvik
27a4c91ac5 samples: bbc_microbit: pong: Convert to new k_work API
Converts the bbc_microbit pong sample to new k_work API.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-05-06 10:12:59 -05:00
Piotr Pryga
6c76b70af6 samples: Bluetooth: Add Direction Finding connectionless Rx sample
Add an application that uses Direction Finding API for reception
and sampling of CTE in connectionless mode (periodic adverising PDUs).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-05-06 16:27:16 +02:00
Alex Tsamakos
0b7e661a92 samples: add actinius_icarus_bee config in spi_flash and fs
Add configuration for the Actinius Icarus Bee in the spi_flash
and fs samples.

Signed-off-by: Alex Tsamakos <alex@actinius.com>
2021-05-06 15:03:32 +02:00
Joakim Andersson
6483e12a8a Bluetooth: Refactor bluetooth buffer configuration for simplification
Refactor and simplify the bluetooth buffer configurations to improve the
easy of configurations and eliminate invalid ones.
By moving configurations out of host and controller specific
configurations and into a common one it becomes easier to configure
the host and controller separately as the same configurations can be
used as would be for a combined build.

All HCI configurations are now given exluding the matching HCI header,
which eases the configuration as the application don't have to know the
different header sizes.
The BT_RX_BUF_LEN is split into ACL and Event, as well as the suprising
use of Command size.
BT_L2CAP_RX_MTU is removed as the stack does not support reassembling of
HCI ACL data to larger L2CAP PDUs. The application will have to set
ACL RX size and account for the L2CAP PDU header itself.
BT_EATT_RX_MTU was removed as it is only used for setting a different
default value for another option which leads to the stuck kconfig symbol
problem.

The configurations can be updated according to the table below:

** New configuration         | ** Old configuration
All configurations
BT_BUF_ACL_RX_SIZE           | BT_L2CAP_RX_MTU + 4
BT_BUF_ACL_RX_SIZE           | BT_RX_BUF_LEN - 4
BT_BUF_EVT_RX_SIZE           | BT_RX_BUF_LEN - 2
BT_BUF_CMD_TX_SIZE           | BT_RX_BUF_LEN - 3
BT_BUF_CMD_TX_COUNT          | BT_HCI_CMD_COUNT
BT_BUF_EVT_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_RX_BUF_COUNT
BT_BUF_ACL_RX_COUNT          | BT_ACL_RX_COUNT
BT_BUF_EVT_DISCARDABLE_SIZE  | BT_DISCARDABLE_BUF_SIZE - 2
BT_BUF_EVT_DISCARDABLE_COUNT | BT_DISCARDABLE_BUF_COUNT
Controller-build
BT_BUF_ACL_TX_SIZE           | BT_CTLR_TX_BUFFERS_SIZE
BT_BUF_ACL_TX_COUNT          | BT_CTLR_TX_BUFFER
HCI-bridge
BT_BUF_ACL_TX_SIZE           | BT_HCI_ACL_DATA_SIZE
BT_BUF_ACL_TX_COUNT          | 6

Fixed invalid configurations setting either BT_L2CAP_RX_MTU or
BT_CTLR_DATA_LENGTH_MAX larger than BT_RX_BUF_LEN could lead to buffer
overruns.

Fix advertising report max data length calculation.
This always used the BT_DISCARDABLE_BUF_SIZE macro but this feature
can be turned off and advertising reports will be allocated from the RX
buffer in that case. Also controller-build does not have this buffer
(in hci_raw.c). Also the wrong HCI header was used in the calculation,
HCI event header should have been used instead of HCI ACL header.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-06 14:56:18 +02:00
Joakim Andersson
25f1ac2679 Bluetooth: samples: Update periodic_sync to new delayable work API
Update the periodic sync sample to use the new delayable work API
for blinking the LED.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-05 19:44:09 -04:00
Joakim Andersson
3554f83408 Bluetooth: samples: Update eddystone sample to new delayable work API
Update the eddystone sample to use th enew delayable work API for the
idle timer.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-05 19:44:09 -04:00
Joakim Andersson
fab281fc00 Bluetooth: samples: Update central_iso sample to new delayable work API
Update the central_iso sample to use the new delayable work API for
sending ISO data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-05-05 19:44:09 -04:00
Anas Nashif
b3c107a432 samples: device_pm: include device_runtime.h
include the now relocated device_runtime.h.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-05 19:07:09 -04:00
Gerard Marull-Paretas
56f1a8ce98 pm: rename PM_DEVICE_GET/SET_POWER_STATE to PM_DEVICE_STATE_GET/SET
Adjust name to be consistent with device PM naming conventions.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
7988ab4a26 pm: rename device_set/get_power_state to pm_device_set/get
Make name consistent with other device PM APIs.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
dbf46b3815 pm: rename device_pm_cb to pm_device_cb
Prefix all device PM functions/data structures with pm.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
2c7b763e47 pm: replace DEVICE_PM_* states with PM_DEVICE_*
Prefix device PM states with PM.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
b287725d41 samples: replace power/power.h with pm/pm.h
Replace old header with the new one.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
c524075780 pm: runtime: rename API with pm_device prefix
Use `pm_device_*` prefix for the device runtime PM API. This adds the
API to the `pm` namespace, making it clear part of the PM subsystem.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
f69759d34a pm: rename CONFIG_PM_DEVICE_IDLE to CONFIG_PM_DEVICE_RUNTIME
Make naming clear on the purpose of this option.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Gerard Marull-Paretas
605a3d1a8a samples: pm: move to pm folder
Adjust naming to make things more consistent.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-05 18:35:49 -04:00
Martí Bolívar
14a1145324 doc: samples: restore :maxdepth: 2
Commit 09ba258b05 changed the maxdepth
of the entire samples toctree to 4 from 2 while making a fix to the
tensorflow docs.

Unfortunately that makes the docs index page for the samples too long,
as there are a lot of samples. It's better to just link each one by
one and let the user click to the one they want to find out
information on building and running the sample. Since the individual
README for each sample is usually quite short; it's not a lot of
scrolling, and the per-sample toctree is already available in the
sidebar anyway.

Fix this issue with the index page by restoring the original maxdepth.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 18:32:15 -04:00
Martí Bolívar
fdce0ec893 doc: samples: bme280: fix missing end of sentence
Looks like I forgot to finish a sentence. There's nothing really
special besides the top level requirement for an enabled node which is
mentioned at the top of the page. Add a reference to the bindings
index while we're here to make it clearer what such nodes contain.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 16:52:00 -05:00
Erwan Gouriou
37d2227412 samples/drivers/watchdog: stm32: Configure bus using device tree
Move bus configuration to device tree.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-05 16:51:02 -05:00
Martí Bolívar
673b4b4394 samples: nvs: fix flash device access
Get the correct flash device from the storage partition node.
The current code is relying on the invalid assumption that the
chosen zephyr,flash-controller node is the device which contains
the storage partition.

Reported-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
e30cfa42d4 samples: ms5837: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
5832e588e3 samples: bmg160: drop device_get_binding
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
aacab5e866 samples: tmp112: various cleanups
Add a real README, convert the device getter to DEVICE_DT_GET_ANY,
and enable assertions to make debugging easier on new users.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
2c793f72ae samples: fxas21002: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
36bd4cbcf2 samples: fdc2x1x: drop device_get_binding/DT_INST
Use DEVICE_DT_GET/DT_COMPAT_GET_ANY_STATUS_OKAY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
363a1d6c84 samples: lis2dh: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
37f0ca0229 samples: mcp9808: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
e98f61c191 samples: max30101: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
72795c3e6c samples: adxl372: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
fff2644189 samples: button: devicetree cleanups
Use a gpio_dt_spec, dropping device_get_binding. This in turn lets us
write everything in a single main() without sacrificing readability
since the LED is optional.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
7e1877e2b2 samples: threads: devicetree cleanups
Use a gpio_dt_spec, GPIO_DT_SPEC_GET_OR, and DT_PROP_OR.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
c0c471b8f2 samples: jesd216: drop device_get_binding/DT_INST
Use DEVICE_DT_GET/DT_COMPAT_GET_ANY_STATUS_OKAY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
eb270fa3f9 samples: led_lpd8806: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
1dbf6f7827 samples: led_ws2812: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
5062a16c64 samples: peci: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
62a1f4e40a samples: led_apa102: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
3c181e0496 samples: entropy: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
bb20b05cf3 samples: spi_fujitsu_fram: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
2f576b9ada samples: lora: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
5992afae4f samples: can: devicetree cleanups
Replace DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL with DEVICE_DT_GET on the
chosen node itself.

This is causing a build error in CI for the waveshare_open103z board
because it disables CAN by default in favor of USB. Throw in an
overlay reversing that decision for the sake of this sample to keep
things building. (Though the build previously succeeded, the
device_get_binding() call would simply have failed.)

Replace the LED access with GPIO_DT_SPEC_GET_OR. This changes the
semantics slightly so that the simulated LED implemented via printk()
is run if either the node is missing or the pin cannot be configured,
instead of just running when the node is missing. An unready LED port
when the node is defined still returns early from main.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
bb46d8b0fa samples: nvs: various cleanups
Replace device_get_binding with DEVICE_DT_GET(). Fix and clean up
error handling and debug printing during initialization.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
8d0974a929 samples: ipm_imx: drop device_get_binding
Use DEVICE_DT_GET.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
e5d916c82d samples: ipm_mcux/remote: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
1309467cdb samples: ipm_mcux: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
03952d738b samples: ipm_mhu_dual_core: drop device_get_binding/DT_INST
Use DEVICE_DT_GET_ANY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
486d41527a samples: task_wdt: drop device_get_binding/DT_INST
Use DEVICE_DT_GET and DT_COMPAT_GET_ANY_STATUS_OKAY.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
429fec477b samples: osdp/control_panel: drop device_get_binding
Use GPIO_DT_SPEC_GET_OR.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
1afe7f4117 samples: osdp/peripheral_device: drop device_get_binding
Use GPIO_DT_SPEC_GET_OR.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
baf93a1821 samples: dac: move HW config to /zephyr,user
Require board overlays to configure the sample in the /zephyr,user
node, and access the device with DEVICE_DT_GET instead of
device_get_binding(). Update the documentation and move existing board
configuration to overlays.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Martí Bolívar
c48bcaae0a samples: hid-mouse: various cleanups
Use the new GPIO_DT_SPEC_GET_OR() macro to clean up the node detection
code by eliminating conditional compilation. This increases code
coverage on platforms where not all the devicetree nodes are
available.

Clean up some whitespace while we're at it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-05-05 20:46:43 +02:00
Magdalena Kasenberg
d0e0af74da Bluetooth: Add option to log btsnoops over RTT
There is a choice to log btmon logs over UART or RTT.
You can choose number of RTT buffer, set its name and size.

Replaced CONFIG_BT_DEBUG_MONITOR with CONFIG_BT_DEBUG_MONITOR_UART
for UART usage and CONFIG_BT_DEBUG_MONITOR_RTT for RTT.

Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
2021-05-05 16:03:38 +02:00
Matija Tudan
d2c503f202 sensor: add MAX17262 fuel gauge driver and sample application
The MAX17262 is an ultra-low power fuel-gauge IC which implements the
Maxim ModelGauge m5 algorithm. The IC monitors a single-cell battery
pack and supports internal current sensing for up to 3.1A pulse
current. The IC provides best performance for batteries with 100mAhr
to 6Ahr capacity.

Signed-off-by: Matija Tudan <mtudan@mobilisis.hr>
2021-05-05 15:54:29 +02:00
Øyvind Rønningstad
c08d0a3629 samples: tfm_integration: Remove setting of QEMU file
This is done elsewhere now.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-05-05 15:36:32 +02:00
Shubham Kulkarni
0719973436 esp32: Add SPIRAM test application
Adds application to test SPIRAM

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-05-05 08:46:35 -04:00
Maureen Helm
05a68b1604 samples: fs: Extend littlefs sample to mimxrt1060_evk board
Adds the mimxrt1060_evk board to the platform_allow list for the
littlefs sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-05 08:44:00 -04:00
Maureen Helm
b1cd3e8ed6 samples: mgmt: Extend smp_svr sample to mimxrt106x_evk boards
Adds mimxrt1060_evk and mimxrt1064_evk boards to the platform_allow list
for the smp_svr sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-05-05 08:44:00 -04:00
Emil Obalski
74867e727c samples: sensor: Align bmm150 sensor name
Align sensor name to fit what could be found in most board
dts files.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2021-05-05 12:42:01 +02:00
Gerard Marull-Paretas
ebfe9be01f doc: fix devicetree lexer warnings
Some warnings for invalid DT syntax have been fixed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-04 22:42:15 -04:00
Gerard Marull-Paretas
aa0b02bf75 doc: use pygments devicetree language support
Since Pygments 2.7.0 devicetree syntax is supported, so there is no need
to use a custom lexer. Version 2.9.0 introduces a fix that is required
for some devicetree snippets.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-05-04 22:42:15 -04:00
YouhuaX Zhu
2dc693bbed tests: pytest: add an example for pytest
In this example, python test case get the running directory by handling
the "--cmdopt" option passed by pytest.

Signed-off-by: YouhuaX Zhu <youhuax.zhu@intel.com>
2021-05-04 19:08:18 -04:00
Kumar Gala
1004d55653 samples: adxl372: switch i2c interface on frdm_k64f
Switch to using I2C0 as this I2C controller on the FRDM-K64F is actually
configured (pinmux) for use and is available on an arduino header if
someone would wire up an adxl372 to it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-04 13:03:00 -05:00
Vinayak Kariappa Chettimada
775c0deadf samples: Bluetooth: Add Synchronized Receiver sample
Add an application that initializes Bluetooth Subsystem,
starts scanning for Periodic Advertising, establishes
Periodic Advertising Sync, receives Periodic Advertising
reports, receives BIGInfo reports and creates BIG sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-04 16:58:38 +02:00
Vinayak Kariappa Chettimada
46700dfc49 samples: Bluetooth: Add ISO Broadcaster sample
Add an application that initializes Bluetooth Subsystem,
creates an Extended Advertising set, starts Periodic
Advertising and creates BIG to demonstrate ISO Broadcaster
functionality.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-05-04 16:58:38 +02:00
Armando Visconti
812b3abff7 samples/shields/x_nucleo_iks02a1: Review README file for microphone
Review README file adding some more comments and removing
hints which are no longer needed.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-05-04 08:33:46 -05:00
Daniel Leung
2c5cf6b243 samples: logging/dictionary: fix long double compilation error
The cbprintf packaging needs CONFIG_CBPRINTF_PACKAGE_LONGDOUBLE
to be enabled to work with long double. So #ifdef that inside
CONFIG_FPU.

Also add to the sample.yaml to enable testing with FPU and
long doubles.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-04 07:36:55 -04:00
Guennadi Liakhovetski
0a801aa1dd ADSP / SOF: don't force uniprocessor mode
Allow SMP processing for SOF on ADSP. Note, that after this
SOF will build with SMP support enabled on all cAVS versions,
but secondary cores will remain disabled unless an SMP
topology is loaded by the host.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-03 17:13:01 -04:00
Anas Nashif
6df4405cca doc: fix typos
Fix various typos in the docs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-30 16:03:08 -04:00
Jordan Yates
e7368e1940 samples: lorawan: class_a: downlink cb
Add an example downlink callback to the LoRaWAN sample.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-04-30 13:05:10 -05:00
Lukasz Maciejonczyk
083465b793 samples: openthread: Add test configuration for coprocessor sample
Coprocessor sample was lacked of test configuration which makes
buildkite/zephyr to fail. This commit fixes it by providing test
configuration for this sample.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-04-30 12:58:31 -05:00
Lukasz Maciejonczyk
4500862af1 net: openthread: Init NCP after USB communication is established
The device has sent RESET_POWER_UP message before the communication
with the host hadn't been established. It could be observed with
pyspinel which displayed `Framing error`.

This commit fixes the bug by initializing NCP after the host stated
is ready to communicate.

This commit reverts initialization the USB stack into function
otPlatUartEnable to be consistent with others OpenThread platforms.
OpenThread co-processor samples are not affected by #27071 as they use
USB for SPINEL communication with host and not for UART console.

Note:
When co-processor communicates by USB CDC ACM and it is hard reset
(what is happening in current Zephyr OpenThread platform)
the connection needs to be properly handled by the host.

For posix platform used together with RCP it was implemented in:
https://github.com/openthread/openthread/pull/6454

and for NCP:
https://github.com/openthread/wpantund/pull/492 .

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-04-30 12:58:31 -05:00
Lauren Murphy
09ba258b05 docs: rearrange toc
Fix index.rst and README.rst to put TensorFlow samples under
External Module samples next to Nanopb sample to avoid 4-level
indentation in the sidebar.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
14e6d1cf5d samples: add tensorflow magic wand sample train scripts
Adds training scripts to TensorFlow Magic Wand sample.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
83a036d738 samples: add tensorflow magic wand sample
Adds Tensorflow Magic Wand sample to tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
42e2a9ed21 samples: add tensorflow hello world sample train scripts
Adds training scripts to TensorFlow Hello World sample.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Lauren Murphy
cb4d28a066 samples: add tensorflow hello world sample
Adds Tensorflow Hello World sample to tree.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2021-04-29 08:35:57 -04:00
Gerard Marull-Paretas
d5fc40e748 samples: out_of_tree_driver: remove usage of device_pm_control_nop
Replace usage of deprecated device_pm_control_nop with NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:40:00 -04:00
Gerard Marull-Paretas
c1dd09819b samples: prod_consumer: remove usage of device_pm_control_nop
Replace usage of deprecated device_pm_control_nop with NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:40:00 -04:00
Gerard Marull-Paretas
6610c0ce59 samples: net: virtual: remove usage of device_pm_control_nop
Remove usage of deprecated device_pm_control_nop with NULL.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:40:00 -04:00
Gerard Marull-Paretas
f163bdb280 power: move reboot functionality to os lib
Reboot functionality has nothing to do with PM, so move it out to the
subsys/os folder.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-04-28 20:34:00 -04:00
Daniel Leung
ae55a73b7a samples: logging: add a sample app for dictionary-based logging
This adds a sample application on dictionary-based logging.
The README file includes instruction on how to run the log parser
to generate human readable log messages.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-04-28 22:25:42 +02:00
Øyvind Rønningstad
02226e120e samples: tfm_ipc: Add reboot to sample
To test/showcase rebooting through TFM.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-28 18:54:50 +02:00
Watson Zeng
a79a1e1718 boards: hsdk: dts: remove ili9340 from hsdk dts
remove ili9340 from hsdk dts, as it's not a part of hsdk board,
it's a shield device.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2021-04-28 10:53:52 -04:00
Henrik Brix Andersen
d6318075b7 boards: arm: twr_ke18f: Add pinctrl dts properties
Add pinctrl-0 properties for configuration of UART, I2C, SPI, FTM,
DAC, ADC, ACMP, and PWT peripherals. These settings are based on what
is defined in the board/pinmux.c file.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-04-27 08:43:23 -05:00
Peter Bigot
6c4312605c drivers: flash: jesd216: improve support for address size selection
Add a helper function to decode the address byte support data from the
SFDP BFP.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-27 14:21:15 +02:00
Ioannis Glaropoulos
cf631fe034 samples: rpmsg_service: use mps2_an521_remote target for remote core
When building and running the rpmsg_service sample on MPS2 AN521
use the mps2_an521_remote target to build the Zephyr image
for the remote core.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-27 13:40:42 +02:00
Ioannis Glaropoulos
7725699030 samples: openamp: use mps2_an521_remote target for remote core
When building and running the openamp sample on MPS2 AN521,
use the mps2_an521_remote target to build the Zephyr image
for the remote core.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-27 13:40:42 +02:00
Jukka Rissanen
1771cee065 samples: net: socket: txtime: Simple app for SO_TXTIME
This application shows how to use SO_TXTIME option, which can be
used to specify the time when the network packet should be sent
out by the network device driver.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-27 12:02:19 +03:00
Flavio Ceolin
e2d25bf031 samples: nrf: system_off: Remove unnecessary sleep
pm_power_state_force no longer requires the idle thread to run.
Just removing the following k_sleep for two reasons, first it is
not necessary, second it tests that pm_power_state_force works
as it should.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-26 08:21:30 -04:00
Flavio Ceolin
51c2013520 samples: ti: system_off: Remove unnecessary sleep
pm_power_state_force no longer requires the idle thread to run.  Just
removing the following k_sleep for two reasons, first it is not
necessary, second it tests that pm_power_state_force works as it
should.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-04-26 08:21:30 -04:00
Jukka Rissanen
9f2fa87e05 net: Remove support for CONFIG_NET_CONTEXT_TIMESTAMP option
This option was only able to collect statistics of transmitted
data. The same functionality is available if one sets the
CONFIG_NET_PKT_RXTIME_STATS and/or CONFIG_NET_PKT_TXTIME_STATS
options.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-26 10:46:43 +03:00
Jukka Rissanen
6d7f4e0b50 samples: net: socket: packet: Fix memory leak
The conn_raw_input() in connection.c will clone the incoming
packet so that it is possible to receive socket data in
multiple packet sockets. This is all fine except that if the
socket is never calling recv(), then the cloned net_pkt is never
processed and we will have a memory leak.

What this all means in practice, is that we should call recv()
for every packet socket in order to flush the socket for any
incoming data even if the socket is just sending data.

Fixes #34462

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-23 15:15:14 -05:00
Krzysztof Chruscinski
c313474cb0 shell: uart: Add TX disabling in uninitialization
Uninitialization of uart transport was missing disabling of TX
interrupt. It had to be done by the user before using uart.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-23 15:00:21 +02:00
Anas Nashif
9c1a85c140 samples: gdbstub: increase kobject text area
With 512 we are failing when building with LLVM..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-22 07:42:58 -04:00
Anas Nashif
c78350505e samples: net: syslog: remove case without newlib
Newlib is being always enabled here, the config does not stick.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-22 07:42:58 -04:00
Andreas Vibeto
e1a6820e4c samples: Add sample for executing TF-M regression tests
Use kconfigs to enable Secure and Non-Secure domain tests

Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
2021-04-21 23:18:30 +02:00
Andreas Vibeto
0cf2753fa3 CMakeLists.txt: Add support for TF-M Non-Secure regression tests
Add new kconfigs
Include the ns-app built by TF-M build system for regression tests
Update tfm_ipc sample to use new kconfig

Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
2021-04-21 23:18:30 +02:00
Jan Müller
383700b635 samples: hci_spi: Add net_buf headroom for hci_spi
We need 1 byte of headroom for the SPI HCI protocol.
This is not added automatically on the slave side of the SPI connection.

Signed-off-by: Jan Müller <jan.mueller@nordicsemi.no>
2021-04-21 10:09:04 +03:00
Martí Bolívar
15f9ae0e0b dts: nrf: revert i2c sda-gpios, scl-gpios changes
These changes turn out to have been incompatible with the way pinctrl
drivers are going to work, so we need to go back to what we had before
until we can agree on a better approach.

Squash of the following reverts:

Revert "boards: nrf: fix deprecated I2C properties"

This reverts commit 2a4ac9ac02.

Revert "samples: switch nrf overlays to sda-gpios, scl-gpios"

This reverts commit 01bb08e7d8.

Revert "boards: nrf: switch to sda-gpios, scl-gpios"

This reverts commit 17a66304c4.

Revert "i2c: nordic: switch to phandle arrays for pinmux"

This reverts commit 821c03a14a.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-04-20 18:32:04 +02:00
Øyvind Rønningstad
ef5ed3f88b samples: Add a sample for running PSA tests
Use the Kconfigs in TFM to enable the different suites.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-04-20 16:13:40 +02:00
Peter Bigot
20f502288a samples: mesh_badge: conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Be aware that this does not address architectural errors in the use
of the work API.

Fixes #34097

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:13:19 +02:00
Johann Fischer
2075cf1cf0 samples: intel_s1000_crb: remove unused and wrong implemented callbacks
This sample has implemented USB HID class callbacks that
actually have no function and should not return 0.
Remove unused and wrong implemented callbacks.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-20 15:06:35 +02:00
Anas Nashif
8a8c681393 portability: move cmsis api samples/tests
Move all sampels and tests of CMSIS OS APIs into samples/subsys and
tests/subsys.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Anas Nashif
3b3e858c50 portability: move cmsis api headers
Move cmsis OS api headers under include/portability. Those are not
libraries and only serve to provide a level of abstraction using the
CMSIS OS APIs to existing Zephyr interfaces.

Removed one level and put them directly under include/portability.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-20 08:45:05 -04:00
Guillaume Paquet
d3d789d7ee boards: arm: Add RAK4631 Wisblock Core LPWAN board
Add rak4631 board from RAKWireless based on nrf52840 and SX1262.
Board Documentation is completed

Signed-off-by: Guillaume Paquet <guillaume.paquet@smile.fr>
2021-04-19 11:01:24 -04:00
Krzysztof Chruscinski
f1bb20f6b4 logging: Adapt logger to support both versions
Adapted to be able to switch between v1 and v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Krzysztof Chruscinski
ba1aa75c66 logging: Refactor in preparation for logging v2
Refactor and cleanup in preparation for v2.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-04-19 10:59:23 -04:00
Peter Bigot
50cf28adb4 samples: boards: nrf: clock_skew: update k_work API
Trivial transformation for a periodic task.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-19 08:16:13 -05:00
Paul He
d61f3a7562 samples: metairq_dispatch: use name msgdev.h instead of main.h
Normally main.c file doesn't have a header, beacuse it doesn't need to
be declared to other modules.

And in this sample it makes more sense to use name msgdev.h instead of
main.h as the header file for msgdev.c.

Signed-off-by: Paul He <pawpawhe@gmail.com>
2021-04-19 10:32:39 +02:00
Kumar Gala
c05ba3517b samples: civetweb: websocket_server: Fix build issue
The sample uses generate_inc_file_for_target for some "webpages" that
get included.  However, the directory that the generated files are
put into: ${ZEPHYR_BINARY_DIR}/include/generated/web_page isn't
created and thus the build fails.

Add a simple 'file(MAKE_DIRECTORY ..)' to create the dir.

Fixes #34345

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-17 07:47:42 -04:00
Anas Nashif
bc747e7167 tracing: remove cpu_stats in favor of thread runtime stats
Removing CONFIG_TRACING_CPU_STATS in favor of
CONFIG_THREAD_RUNTIME_STATS which provides per thread stats. The same
functionality is also available when Thread analyzer is enabled with the
runtime stats enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-16 15:31:24 -04:00
Ioannis Glaropoulos
88ae27fa16 samples: psa_level1: add nucleo_l552ze_q_ns to allowed platforms
Add nucleo_l552ze_q_ns boards to the list of platforms
that can build and run the psa_level1 tf-m integration
sample. We add a dts overlay as well.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-16 13:33:32 +02:00
Ioannis Glaropoulos
735f40b330 boards: do not force TF-M isolation level 2 for STM32L562/L552 boards
We do not need to force TFM Isolation Level 2 for the
STM32 board that can build with TM-M. We remove the
respective Kconfig setting. We also remove the Kconfig
overlay for STM32L562 board in the psa_level1 sample,
which was used for forcing Isolation Level 1; this is
not needed any more.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-04-16 13:33:32 +02:00
Peter Bigot
28a7309017 samples: led_sx1509b: update to new work API
All this needs is a basic periodic submission.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-15 10:44:08 -05:00
Johann Fischer
5540fa0028 samples: mesh_badge: increase mesh loopback buf count
Similar to commit 24f34b1913
("Bluetooth: Mesh: Demo: Increase loopback buf count")'

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-04-15 17:18:27 +02:00
Peter Bigot
55c4db9c4c samples: boards: nrf: clock_skew: calculate corrected reference
The sample showed the error between the two clocks, but did not show
how to use the skew to reconstruct one clock from the other and the
resulting error.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-04-15 13:05:16 +02:00
Kumar Gala
6b8fa2a85e arm: nxp: kinetis: Remove explicity setting of pincfg to GPIO
Remove board code and a few associated samples/tests that explicitly
call pinmux_pin_set() to set a given pin as GPIO.  This is handled as
part of gpio_mcux_configure() so we don't need to do it again.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-15 12:25:05 +02:00
Pieter De Gendt
40c25b931d samples: modules: nanopb: fix encode buffer size
A bug was introduced when encoding/decoding moved to separate
functions where sizeof no longer had the correct argument.

The size of the encode buffer is passed to the encode function.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-14 14:45:26 -05:00
Azizah Ibrahim
d9fa9c6e1c Bluetooth: samples: Remove workqueue stack configuration
Fixed value used is too low causing overflow in nrf53.  Use default
value instead.

Signed-off-by: Azizah Ibrahim <azizah.ibrahim@nordicsemi.no>
2021-04-14 18:19:32 +02:00
Peter Bigot
188cb2cb7c net: Conversion of k_work API
Replace all existing deprecated API with the recommended alternative.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-14 07:07:40 -04:00
Jose Alberto Meza
11cb2e5ec6 samples: drivers: espi: Ensure sample code thread exits
Fix #32457 by decreasing iterations on failure too.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-04-13 18:29:35 -04:00
Henry Wang
35f52fd31a sample: mpu: skip the MPU test for Armv8-R AArch64
The functionality of the MPU depends on userspace, which has not
been implemented on AArch64. Therefore we skip that case for now.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
2021-04-13 07:47:44 -04:00
Kim Bøndergaard
48f5e746c8 samples: display: Added support for sitronix_st7735r
Requires a ST7735R based LCD

Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
Signed-off-by: Kim Bøndergaard <kibo@prevas.dk>
2021-04-12 16:42:00 -04:00
Kumar Gala
3b84b645db samples: flash_shell: Fix Coverity issue 220540
Fix possible Uninitialized 'ret' value.

Fixes #34001

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-12 07:32:39 -04:00
Thomas Stranger
ef021c7b1f tests: watchdog: enable wwdg for nucleo_g431rb and nucleo_f091rc
The stm32 wwdg driver was currently tested only on disco_l475_iot1.
Additionally add nucleo_f091rc, such that one board with an CM0 core is
tested. And add nucleo_g431rb, that one board is included that has
newer register mapping and a 128 prescaler.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-04-09 13:23:38 +02:00
Kumar Gala
70fc8bd38a samples: sensor: add integration_platforms
Add one integration_platforms based on platform_allow to ensure these
tests get coverage in CI.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-04-09 06:50:47 -04:00
Erwan Gouriou
c6ff61220e samples/subsys/fs: fat_fs: Limit test execution on boards with shield
Limit adafruit_2_8_tft_touch_v2 sample variant execution to the boards
that have this shield available.

In order to run the test in CI bench, add the following in
twister map.yml file on matching board:
  fixtures:
  - fixture_shield_adafruit_2_8_tft_touch_v2

For instance:
- connected: true
  fixtures:
  - fixture_shield_adafruit_2_8_tft_touch_v2
  id: 0673FF323535474B43171415
  platform: nucleo_f429zi
  product: STM32 STLink
  runner: openocd
  serial: /dev/ttyACM0


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-04-08 16:37:01 +02:00
Maureen Helm
17a699e9e7 boards: arm: Configure SDMMC disk driver default on i.MX RT boards
Configures i.MX RT boards to enable SDMMC by default when disk drivers
are enabled.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-04-08 16:36:35 +02:00
Emil Gydesen
42da370df5 Bluetooth: Use ATT FIRST/LAST attribute handle defines where applicable
Change to use the BT_ATT_FIRST_ATTTRIBUTE_HANDLE and
BT_ATT_LAST_ATTTRIBUTE_HANDLE instead of the literal values where
applicable.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-04-08 16:35:57 +02:00
Pieter De Gendt
b6979736ca modules: nanopb: introduce new module
Add the nanopb library and generator tools as a module.
Nanopb is a small code-size Protocol Buffers implementation in ansi C.
It is especially suitable for use in microcontrollers,
but fits any memory restricted system.

Nanopb home: https://jpa.kapsi.fi/nanopb/

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-04-08 14:57:55 +02:00
Carles Cufi
1a37d501b0 Bluetooth: ISO: Add missing reason to disconnected callback
The ISO disconnection callback now comes with a reason parameter.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-04-07 23:23:34 +02:00
Armando Visconti
36eceba7e4 drivers/sensor: lsm6dso: move int-pin in DTS binding
Take the int-pin information (i.e. what pin between INT1
and INT2 the drdy is attached to) directly from DT.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-04-06 15:34:01 +02:00
Trond Einar Snekvik
d24810cc27 Bluetooth: Mesh: Provisioner sample: Permit 16 nodes
Ups the CDB_NODE_COUNT config to fit 16 nodes, to make the sample more
usable for general mesh testing.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-04-06 16:19:13 +03:00
Trond Einar Snekvik
1034d5689f Bluetooth: Mesh: Provisioner sample: Blocking self-configuration
Adds blocking operation to the self configuration step by waiting for
the status response. This ensures that the provisioner is fully
configured, and reduces the number of loopback buffers required for the
self-configuring.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-04-06 16:19:13 +03:00
Trond Einar Snekvik
0a58fae7a8 Bluetooth: Mesh: Provisioner sample: Cooperative thread
Runs the Provisioner sample's main thread in a cooperative priority to
avoid calling the Bluetooth APIs from a preemptive thread.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-04-06 16:19:13 +03:00
Trond Einar Snekvik
40f3d44fb4 Bluetooth: Mesh: Make provisioner sample bind the AppKey to all models
Instead of only configuring the Health Server model of the provisioned
device, the Provisioner will instead walk the target's composition data,
and bind each model to the same AppKey. This allows the provisioner to
be used with the base mesh sample, and demonstrates the new composition
data page 0 API.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-04-06 16:19:13 +03:00
Maureen Helm
3eb0d116f5 samples: fat_fs: Build with adafruit_2_8_tft_touch_v2 shield
Adds a new sample configuration to build the fat_fs sample with the
adafruit_2_8_tft_touch_v2 shield and SDMMC SPI driver in CI. It has been
tested with frdm_k64f and mimxrt685_evk_cm33 boards, but should work
with any board that supports Arduino SPI and Arduino GPIO features.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-04-02 18:44:48 -04:00
Jukka Rissanen
6eef4ac390 samples: net: echo-server: Add capture overlay file
Add an overlay-capture.conf file that can be used to allow network
packet capturing in this sample app.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-02 07:24:06 -04:00
Jukka Rissanen
2e613a4af5 samples: net: capture: Network packet capture app
A simple application that allows you to use net-shell to
configure network packet capturing. The captured packets are
sent to external systems for processing. This can be used
for debugging network protocols.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-04-02 07:24:06 -04:00
Anas Nashif
5fa12073cb drivers: remove what appears to be code from comments
Some tools consider this as commented code because of the ifdef, so
remove that and fix a coding guideline violation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-01 05:34:17 -04:00
Anas Nashif
0ec3774bde userspace: rename _is_user_context -> k_is_user_context
This functions is being called across the tree, no reason why it should
not be a public API.

The current usage violates a few MISRA rules.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-04-01 05:34:17 -04:00
Kumar Gala
a5ea06d53f samples: usb: dfu: exclude platforms sample can't be built on
Several platforms don't have flash drivers and these platforms the DFU
sample will not build or even pass Kconfig on.  Exclude them until they
have flash driver support.

Fixes #33422

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-31 09:33:58 -05:00
Erwan Gouriou
2493030cd3 samples/tfm_integration: Fix warnings in stm32 boards overlays
Unit name should not have leading 0s.
Unit name should not use caps.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-30 19:19:59 +02:00
Erwan Gouriou
ceca94704c samples: psa_level_1: Enable on stm32l562e_dk_ns
Add minimum configuration changes to allow stm32l562e_dk_ns
to run psa_level_1 sample

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-03-30 19:19:59 +02:00
Emil Gydesen
a71fec83bd Bluetooth: samples: Add central ISO sample
Adds a sample of setting up and using an ISO central as
a source of ISO data. This will periodically send ISO
data to a connected ISO peripheral with varying sizes.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-29 13:51:44 -04:00
Emil Gydesen
ea48757a9a Bluetooth: samples: Add peripheral ISO sample
Adds a sample of setting up and using an ISO server as
a sink for incoming ISO data.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-29 13:51:44 -04:00
Andrzej Puzdrowski
c5cc990cb3 samples/tree-wide: remove flash_write_protection_set() usage
This patch removes scenario which was testing deprecated
API behaviors. Needed as As flash_write_protection_set() was
deprecated and became no-operation.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-03-29 13:43:55 -04:00
Martí Bolívar
876cb75c8a samples: hci_spi: clean up
Move to the newer device getters and clean up the documentation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
8e0f631ef4 samples: st_ble_sensor: clean up
This sample is a bit messy; clean it up.

Remove unused includes, add missing include guards, clean up the
separation of responsibilities between main.c and the button and LED
helper files by moving code around, and replace the now-outmoded
device_get_binding() calls with GPIO_DT_SPEC_GET().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
0b4d3286bb samples: mesh: clean up
Drop device_get_binding() for microbit, using a gpio_dt_spec instead.
Rename the 'button' global to 'button_work' since it's a k_work
related to the button and does not actually represent the button
itself.

Fix a typo in the docs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
0af09a5772 samples: mesh: bbc_microbit SRAM improvements
Save a bit more SRAM on bbc_microbit by tuning some Kconfigs.

Mark some arrays const to try to avoid stack allocating them while
we're here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
1dde940f86 samples: periodic_sync: drop device_get_binding()
Use a gpio_dt_spec instead.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
b5ca2e0ec3 samples: hci_uart: drop device_get_binding()
Use DEVICE_DT_GET on the chosen node directly.

The only in-tree board using the Kconfig option is rv32m1_vega_ri5cy.
It already sets the chosen node in the application overlay, albeit
incorrectly, so just fix it there and remove the now-redundant Kconfig
setting. That in turn triggers other build errors for this board, but
they don't seem to be related to this sample.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Martí Bolívar
a68629f9a3 samples: peripheral_ht: drop device_get_binding()
Use DEVICE_DT_GET_ANY instead of hard-coding a device label property.
As far as I can tell from in-tree drivers, "TEMP_0" is nRF specific
and refers to nodes with compatible "nordic,nrf-temp", so use that and
clean up the driver Kconfig while we're here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-29 16:33:51 +02:00
Jukka Rissanen
64b7a11ccc samples: net: echo-server: Add tunneling interface support
Add support for IP tunneling with overlay-tunnel.conf file.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Jukka Rissanen
68835f1006 samples: net: virtual: Simple app for creating virtual interfaces
The app does not do much but shows how virtual network interfaces
support can be used.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-29 07:40:24 -04:00
Øyvind Rønningstad
6fa608b191 modules: tf-m: Add zephyr native NS interface and logging function
To allow using TFM NS interface without enabling
CMSIS_RTOS V2 support. And to allow using TFM NS
code that uses logging.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-03-26 18:35:11 +01:00
Trond Einar Snekvik
e1656eef0c Bluetooth: Mesh: Add some actual behavior in sample
Populates the onoff server stubs in the Bluetooth Mesh sample, and
implements generic LED based hardware support to include more boards.

Fixes #31031.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2021-03-26 18:22:19 +02:00
Øyvind Rønningstad
869978ab0d tfm: Fix TFM_BOARD for MUSCA_B1
Also add it to tfm_ipc so it is built by CI

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-03-26 11:20:10 -05:00
Sidhdharth Yadav
38c2411651 samples/drivers: nucleo_f429zi: Enable DAC sample application.
This commit enables DAC sample application for nucleo_f429zi.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-03-26 08:32:31 -04:00
Maureen Helm
556da6f99d samples: display: Build NXP boards with adafruit_2_8_tft_touch_v2 shield
Now that we can use the adafruit_2_8_tft_touch_v2 shield with
mimxrt685_evk_cm33 and frdm_k64f boards, start building the display
driver and lvgl samples for these boards in CI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-03-26 08:25:30 -04:00
Øyvind Rønningstad
41eedf8ae5 tfm: Adapt to changes upstream
Rename lib.
Disable AUDIT_LOG in regression sample because of a bug upstream.
Update stm32l562e_dk_ns overlay.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-03-26 09:32:56 +01:00
Flavio Ceolin
9fd4ea91b7 coccinelle: Remove extra semicolon
coccicheck --mode=patch --cocci=semicolon.cocci

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-03-25 11:35:30 -05:00
Eugeniy Paltsev
8311d27afc ARC: Kconfig: cleanup CPU_ARCEM / CPU_ARCHS options usage
Don't allow user to choose CPU_ARCEM / CPU_ARCHS options
but select them when exact CPU type (i.e. EM4 / EM6 / HS3X/ etc)
is chosen.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-03-25 07:23:02 -04:00
Krzysztof Chruscinski
1f1ff8d3c8 samples: shell_module: Add shell_uart_release command
shell_uart_release command shows how shell can be uninitialized and
release transport resources (uart) and reinitialized at runtime.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-25 07:08:40 -04:00
Pete Skeggs
1fcf7687dd shell: sample: add login example
Using the new obscured user shell input feature,
provide examples of using it in login and logout commands.

Signed-off-by: Pete Skeggs <peter.skeggs@nordicsemi.no>
2021-03-24 05:44:14 -04:00
Johann Fischer
98ce8dcfdc samples: mass: add SD card support
Add SD card support to USB MSC sample.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-23 12:16:01 +01:00
Johann Fischer
5c7787c912 doc: update disk access docu regarding SD card support
This patch removes sdhc_api references since such API
does not actually exist. SD card controller drivers
use disc driver interface. Accordingly, the SDHC documentation,
which actually describes how to connect a SD card via SPI
and has little to do with SD host controller (SDHC),
is also moved to disk access page and adapted.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-23 12:16:01 +01:00
Johann Fischer
f205e94f9e include: move disk_access.h to storage
Zephyr already has a directory for storage API relevant headers.
Move disk_access.h header to include/storage where it fits better
structurally.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-23 12:16:01 +01:00
Johann Fischer
5070186f63 tests/boards/samples: fixup after sdmmc driver relocation
Fixup configuration.
Remove obsolete SDHC SPI configuration.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-23 12:16:01 +01:00
Anas Nashif
5d6c219210 drivers: device: do not reuse tag name 'device'
Do not reuse tag name (misra rule 5.7).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-22 19:48:14 -04:00
Jukka Rissanen
0af89fc4ec net: Remove legacy TCP stack
Remove legacy TCP stack as it is replaced by the new TCP2 stack.
The TCP2 stack has been the default stack since 2.4 release.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-22 13:06:54 -04:00
Mateusz Syc
2cbaf01b3a samples: subsys: mgmt: smp_svr: Possible download log file from flash FS
Added ability to downlaod log file from flash with LittleFS
using mcumgr.

Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
2021-03-22 13:04:23 -04:00
Johann Fischer
90d7322d8c sample: hid: fixup harness config regex
Fixup outdated harness config regex.

Fixes: #33542

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-22 10:40:25 -04:00
Hubert Miś
1a86820876 samples: FT800 demo application
This patch adds a new sample application demonstrating basic
usage of FT800 display controller including touchscreen events.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
2021-03-19 19:05:53 +01:00
Anas Nashif
a518f48796 clock: renmae z_timeout_end_calc -> sys_clock_timeout_end_calc
Do not use z_ for internal APIs, z_ is for private APIs within one
subsystem only.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-19 11:22:17 -04:00
Johann Fischer
dcbadd24c2 samples: rtu_server: rework LED configuration
Follow modern way to configure LEDs GPIO using
struct gpio_dt_spec and GPIO_DT_SPEC_GET.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
fc7ffab2cd samples: modbus: add TCP to serial line gateway
Add TCP to serial line gateway.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
e6d4b28592 samples: add MODBUS TCP server sample
Add MODBUS TCP server sample.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
4ff616b647 modbus: rework interface configuration
Use commot parameter structure to configure server
or client interfaces.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
699b2cdf9b modbus: remove RTU from configuration and headers
Remove RTU from configuration and headers

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
ed0629f623 modbus: rename MODBUS RTU API to common MODBUS API
Rename MODBUS RTU API to common MODBUS API.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
b0518d6100 modbus: get interface index according to interface name
Add function to get Modbus RTU interface index according
to interface name. This can be used to clearly identify
interfaces in the application.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
d0ff35b88d modbus: add DE/nRE gpios properties to samples and test
Add DE/nRE gpios properties to samples and test.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
fef70aa494 samples: add Modbus RTU client sample
Add Modbus RTU client sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2021-03-19 15:50:21 +01:00
Johann Fischer
48d1b4b697 samples: add Modbus RTU server sample
Add Modbus RTU server sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2021-03-19 15:50:21 +01:00
Marcin Niestroj
064c6ef830 libc: minimal: implement time() API
Implement time() API by using clock_gettime(CLOCK_REALTIME, ...).

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2021-03-19 09:56:53 -04:00
Johann Fischer
5ebb4214c9 samples: hid: set boot interface Protocol Code
Update sampele to show how to set boot interface Protocol Code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 09:51:21 -04:00
Michał Grochala
023491e683 doc: bluetooth: Fix a typo in the nRF5340 note.
Fix a typo in the note box, which brakes a reference.

Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
2021-03-19 10:47:37 +01:00
Yestin Sun
46cab056bc boards: stm32l562e_dk: Enable TF-M IPC application
This commit enables the TF-M IPC sample application on stm32l562e_dk
board.
It provides device tree flash partition as an overlay in order to
configure and flash the bl2, secure/non secure firmwares.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2021-03-18 23:23:39 +01:00
Dean Weiten
567afc0371 samples: drivers: dac: add Ronoth Lodev to supported boards
The Ronoth LoDev in an open source board which uses
the AcSIP S76S, which itself contains an STM32L073.

Signed-off-by: Dean Weiten <dmw@weiten.com>
2021-03-18 08:48:30 -05:00
Sidhdharth Yadav
8ce99a8602 samples/drivers: nucleo_f767zi: Enable DAC sample application.
This commit enables DAC sample application for nucleo_f767zi.

Signed-off-by: Sidhdharth Yadav <sidhdharth.yadav@hcl.com>
2021-03-18 10:21:12 +01:00
Piotr Mienkowski
d697d26bf0 samples: sensor: Add simple quadrature decoder demo
Add simple application to demonstrate quadrature decoder sensor.

Tested on Atmel SMART SAM E70 Xplained board.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-03-18 10:20:17 +01:00
Carles Cufi
d2465d6268 debug: Move away from openocd and make it generic
The exported structures that were originally introduced for OpenOCD have
since then been reused for other debugger plugins, including PyOCD and
Segger J-Link.

Rename the Kconfig option and the implementation from openocd to debug
thread info, so that it reflects the fact that this is no longer
specifically tied to OpenOCD.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-03-17 14:43:01 -05:00
Glauber Maroto Ferreira
ca758c84a8 esp32: nvs: add NVS support using fixed partitions
Add NVS support to ESP32 using fixed partitions defined on DT

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-03-17 14:38:23 -05:00
Michał Grochala
fcad510105 doc: samples: bluetooth: Add a note about nRF5340.
Document that for any Bluetooth sample to work on the nRF5340 device,
the additional application for the nRF5340 network core is required:
hci_rpmsg.

Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
2021-03-17 16:39:13 +02:00
Igor Knippenberg
066be0a45e samples: sensor: fdc2x1x: Add FDC2X1X sample application
This sample application periodically reads raw data from the FDC2X1X
sensor in polling mode or optionally with data ready trigger.
It is able to read the 12-Bit and 28-Bit, as well as the 2-Channel
and 4-Channel versions (FDC2112, FDC2114, FDC2212, FDC2214).
The 4-channel versions are chosen through devicetree properties.
The default is FDC2112.

Signed-off-by: Igor Knippenberg <igor.knippenberg@gmail.com>
2021-03-17 11:35:17 +01:00
Johann Fischer
6a2a26024a samples: hid: filter subsequent USB_DC_CONFIGURED events
Filter subsequent USB_DC_CONFIGURED events.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
352f63d98b samples: hid: adjust LOG level
Adjust LOG level to hide repeating debugging outputs.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
84e55414ad samples: hid: rework USB HID sample report descriptor
HID report descriptor in the sample has unnecessarily output report
which is not used anywhere. This patch removes unnecessary report.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Johann Fischer
0bf67d2c6e samples: hid: rework USB HID sample report and on_idle callback
HID sample has on_idle callback implementation present in the code,
but has not turned on USB_DEVICE_SOF and so does not have
corresponding code in sample self and class/hid/core.c covered.
Also on_idle implementation in HID sample has not taken into
account send_report() which also calls hid_int_ep_write().
This patch enables USB_DEVICE_SOF and revises both on_idle and
the regular report function.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-17 11:34:42 +01:00
Emil Gydesen
e90ec2df44 Bluetooth: services: Adds directory listing object to OTS
The directory listing object is an internal object which
content is the aggregation of all the metadata of all objects
(including the directory listing object itself). The client
can read this value to get a list of all objects with names,
lengths, and other metadata.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-03-17 11:30:07 +01:00
Cezar Burlacu
91ab6bf8d6 samples: can: shell send fix
This fixes the limitation of sending an extended CAN frame.
Because the default value of `CONFIG_SHELL_ARGC_MAX` is 12 the maximum
number of bytes for an extended CAN frame is 7.

Increasing it to 13 to allow all 8 bytes to be sent from the shell.

Tested on nucleo_f767zi.

Signed-off-by: Cezar Burlacu <cezar@embeddedp.ro>
2021-03-17 11:25:50 +01:00
Peter Bigot
d7049b57d5 samples: microbit: pong: update work API usage
Use the reschedule solution as there may be cases where a newer
deadline should supersede an older one.

The implementation has no locking and so has data races between the
handler and external events.  Emit a console diagnostic in one case
where the race can be detected.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-16 19:58:12 -04:00
Johann Fischer
896c29f494 sample: dfu: remove platform_allow
Remove platform_allow and allow sample to be build on
compatible platform only.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-15 10:15:44 -04:00
Martin Jäger
2857c2e984 samples: subsys: task_wdt: add sample application
The sample demonstrates how to use the task watchdog in different
threads.

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-03-15 12:24:54 +01:00
Henrik Brix Andersen
5b87cca98b samples: shields: lmp90100_evb: rtd: use newlib sqrt when available
Avoid using local sqrt() approximation when newlib is enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Henrik Brix Andersen
e51e980f8b samples: shields: lmp90100_evb: rtd: mark constants as const
Mark the constant coeffiecients used in the RTD resistance to
temperature conversion as const.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Henrik Brix Andersen
0449e086c6 samples: shields: lmp90100_evb: rtd: improve readability, fix off-by-one
Improve the readability of the LMP90100-EVB RTD sample by adding
comments and further definitions instead of magic values within the
code.

This furthermore fixes an off-by-one error for the maximum ADC value
used in the formula for calculating the resistance of the RTD (8388607
vs. 8388608).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-03-15 10:24:16 +01:00
Krzysztof Chruscinski
7e125fe7e4 logging: Add backend parameter to the init function
Added backend parameter to the backend init interface function.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-12 09:24:54 -05:00
Ryan Chu
c5db0bdafe samples: nrf5340: Trigger fatal error in an assertion handler
Trigger BT_ASSERT with message to inform kernel when encountering an
unrecoverable condition in order to dump all pending logging messages.

In this change, the log level is configured by CONFIG_BT_LOG_LEVEL

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2021-03-11 13:20:16 +01:00
Diwakar C
ddfb1316ee driver: peci: Add supported peci response codes
Add supported peci response codes 0x80 (Out of resources timeout)
and 0x81 (Resources required to service the command are in low
power state).

Signed-off-by: Diwakar C <diwakar.c@intel.com>
2021-03-10 17:12:05 -05:00
Martí Bolívar
51f55b437f twister: replace dt_compat_enabled_with_alias filter
Originally added in 7733b94224.

This filter is not well-formed. It's meant to match nodes like
/leds/led_0 in this DTS:

/ {
	aliases {
		led0 = &led0;
	};

	leds {
		compatible = "gpio-leds";
		led0: led_0 {
			gpios = <...>;
			label = "LED 0";
		};
	};
};

Uses look like this:

    filter: dt_compat_enabled_with_alias("gpio-leds", "led0")

But notice how the led_0 node doesn't have compatible "gpio-leds";
it's actually the *parent* node that has that compatible.

Replace this with a new filter, dt_enabled_alias_with_parent_compat(),
which is used like this:

    filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds")

This has a name and argument order that makes the meaning of the
filter clearer.

Replace in-tree users with the new filter.

Deprecate the old filter and warn about its use using the standard
logging module.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-10 15:09:09 -05:00
Robert Lubos
d9c7214fab samples: net: lwm2m_client: Add an example use of the validation cb
Add an example usage of the validation callback to the lwm2m_client
sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-03-10 14:55:22 -05:00
Jukka Rissanen
6526b5b232 samples: net: civetweb: Avoid using mbedtls
Civetweb does not work properly with mbedtls if Posix APIs
are enabled. For example time function prototypes are not found
by the mbedtls module if we enable mbedtls in the sample.

Disable TCP ISN RFC6528 support because of this for civetweb
samples, as setting that option will pull in mbedtls and
we get a compilation warning because time() is not declared
by any header file that mbedtls is including.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-03-10 16:08:46 +01:00
Anas Nashif
bcec7029fd samples: move lorawan to subsys/lorawan
lorawan has its own susbsystem, so move this sample under subsys/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
f3ec9bac04 samples: move architecture specific samples to arch/
smp and mpu are architecture specific samples and do not apply to
majority of support platforms, so move them to arch/.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
8a2ec3674f doc: fix top samples doc index
Those areas have now moved under subsys/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
f988f618c1 samples: move cpp samples into subsys/cpp
CPP is a subsystem, so move this sample application where it belongs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
04c225601a samples: portability: fix project name
Minor fix in the cmake file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
6882b5d912 sampels: move display into subsys/display
This should align with subsys/display which we do not have yet. Plan is
to move lib/gui into subsys/display.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
af0a7f7ccb sampels: move audio into subsys/audio
Move samples under subsys/audio. We still do not have this as a
subsystem, but it is on the horizon.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
a221d5326a sampels: move video into subsys/video
Move video samples under subsys/video.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
cd1c2ab6ba samples: move testing -> subsys/testsuite
Move testsuite related items under subsys/testsuite.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
77284152f1 samples: move debug samples under subsys/debug
debug is a subsystem, so move debug samples under samples/subsys/debug.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Anas Nashif
364c0bee31 samples: move kernel samples into one folder
Move kenrel samples into one directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-09 17:48:18 -05:00
Guðni Már Gilbert
6c3674cd4a samples: net: mdns_responder: Fix coverity resource leak issue
Avoid resource leak by closing socket when there is an error.

Coverity-CID: 215381
Fixes #33094

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-09 13:10:48 +02:00
Guðni Már Gilbert
7713d347a2 samples: net: mdns_responder: Fix coverity issue
Check return value if sendto() fails.

Coverity-CID: 215391
Fixes #33093

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
2021-03-09 13:10:48 +02:00
Ruth Fuchss
0b55037d63 doc: direction_finding: fix space in file link
The line break inside the :zephyr_file: directive causes a space
to be inserted into the link to the file, which means the link
does not work.

Signed-off-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2021-03-09 04:54:46 -05:00
Kumar Gala
b9ed2d33fd drivers: spi: Remove unused Kconfig symbols
Remove SPI_[0-8] and SPI_[0-8]_OP_MODES Kconfig symbols as no driver
uses them anymore.  We also cleanup board and sample code to remove
use of these symbols.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-09 04:53:46 -05:00
Krzysztof Chruscinski
b82a662866 samples: logging: logger: Explicitly enable deferred mode
Some boards prefers immediate mode (native_posix) but this sample is
intended to use deferred mode. Add explicit setting.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-03-09 08:58:02 +01:00
Andy Ross
3d81464194 tests: samples: Add targetted platform_excludes for intel_adsp_cavs15
This platform has a tiny handful of remaining tests that fail.  We
will track them as issues, but let's exclude them from integration
testing to allow full runs to complete.  Often a hung device in one
test will break an entire twister run.

Tests with known (and tracked) failures:

  samples/application_development/external_lib
  samples/posix/eventfd
  samples/userspace/hello_world_user
  tests/kernel/fatal/message_capture
  tests/net/socket/socketpair
  tests/portability/cmsis_rtos_v2

These tests never fail in isolated testing, but are reliable timeouts
when run in sequence in a big twister run.  It's possible that the bug
here may be in twister or the flash/serial scripts:

  tests/crypto/tinycrypt
  tests/subsys/logging/log_immediate
  tests/subsys/logging/log_output

See: #32836

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Andy Ross
881c800736 samples/posix/gettimeofday: Filter out INTEL_ADSP
This platform has a newlib which is inexplicably missing a
_gettimeofday_r symbol.  Just filter the test there.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-03-08 19:25:25 -05:00
Anas Nashif
1ce264ecdc samples: userspace: enable shared_mem on x86_64
was excluded due to now resolved issues, so re-enable test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-03-07 10:36:21 -05:00
Martí Bolívar
0d9da124cd samples: mesh_demo: rework error and device handling
The board specific interface in this sample is not handling errors.
Fix that by making board_init() return a negative error code or zero.

Rework the bbc_microbit specific board file by handling errors
appropriately and avoiding device_get_binding() to move some device
configuration errors to build time.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-06 09:13:00 -06:00
James Harris
b10428163a kernel: sem: add K_SEM_MAX_LIMIT
Currently there is no way to distinguish between a caller
explicitly asking for a semaphore with a limit that
happens to be `UINT_MAX` and a semaphore that just
has a limit "as large as possible".

Add `K_SEM_MAX_LIMIT`, currently defined to `UINT_MAX`, and akin
to `K_FOREVER` versus just passing some very large wait time.

In addition, the `k_sem_*` APIs were type-confused, where
the internal data structure was `uint32_t`, but the APIs took
and returned `unsigned int`. This changes the underlying data
structure to also use `unsigned int`, as changing the APIs
would be a (potentially) breaking change.

These changes are backwards-compatible, but it is strongly suggested
to take a quick scan for `k_sem_init` and `K_SEM_DEFINE` calls with
`UINT_MAX` (or `UINT32_MAX`) and replace them with `K_SEM_MAX_LIMIT`
where appropriate.

Signed-off-by: James Harris <james.harris@intel.com>
2021-03-05 08:13:53 -06:00
Kumar Gala
4f0eaad283 samples: subsys: ipc: Remove references to v2m_musca
Remove stale references to v2m_musica in the ipc samples as the board
support for v2m_musca has been removed.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-05 07:23:23 -06:00
Joakim Andersson
bd97359a53 Bluetooth: samples: Remove unnecessary main stack configuration
Remove unnecessary main stack configuration in bluetooth samples.
The HCI power control sample does not need to set the main stack this
low, and setting it causes restriction on what the application can
change in menuconfig. A change in the entropy driver causes stack
overflow.
The HCI uart sample sets the main stack to the default size.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-03-04 14:27:57 +01:00
Jennifer Williams
62c7f82a0d samples: basic: blinky_pwm: fix bad path in README
The README gives as example the command to build
the sample with west. The path of the sample as
stated does not exist. This fixes it to blinky_pwm.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-03-04 11:29:53 +03:00
Andrzej Głąbek
75135e87d9 boards: nrf9160dk: Add support for newer revisions (0.14.0+) of the DK
Use the multiple board revisions feature to provide support for the new
hardware possibilities available in nRF9160 DK starting from v0.14.0.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-03-04 11:25:22 +03:00
Andrzej Głąbek
71223ad0d0 boards: nrf9160dk: Move board control configuration to devicetree
Use devicetree instead of Kconfig to configure the board control
switches in nRF9160 DK:
- add binding for the switches that provide optional signal routings
  on this board
- add binding for the GPIO interface that can be used for communication
  (e.g. UART based) between the nRF9160 and the nRF52840 on the DK,
  and add GPIO mapping for this interface so that its lines can be used
  without caring about of actual pin numbers on both sides
- add binding for one GPIO line chosen from the above interface that is
  to allow the nRF9160 to reset the nRF52840
- update accordingly dts files and board specific code for both board
  definitions associated with the DK
- introduce .dtsi files that can be included from dts overlays in order
  to facilitate the use of the above GPIO interface; modify the overlay
  in the hci_uart sample to provide an example of use of those files

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-03-04 11:25:22 +03:00
Kumar Gala
f0f8d9f3b5 samples: eventfd: set integration_platforms to mps2_an385
Set integration_platforms on these samples to just mps2_an385.
This should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 18:15:02 -05:00
Kumar Gala
97bca832d1 samples: crypto: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:22:24 -06:00
Kumar Gala
dd8de28c6d samples: userspace: set integration_platforms to mps2_an385
Set integration_platforms on these samples to just mps2_an385.
This should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:14:33 -06:00
Kumar Gala
e65c84e5bd samples: logging: set integration_platforms
Set integration_platforms on these samples to a single platform, we
prefer native_posix, than a qemu platform mps2_an385 and finally a
hardware platform.

For the 'basic' sample we use native_posix, for the 'rtt' we use
frdm_k64f ad we need a hardware platform that supports 'rtt', and for
the 'usermode' we utilize 'mps2_an385' as we can run in QEMU.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:12:59 -06:00
Kumar Gala
6eb6c88554 samples: console: set integration_platforms to mps2_an385
Set integration_platforms on these samples to just mps2_an385.
This should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:12:30 -06:00
Kumar Gala
59fd4bfdfd samples: app_dev: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-03 09:11:53 -06:00
Glauber Maroto Ferreira
c344d0d74d esp32: drivers: counter: add support for general-purpose counters
Adds support for ESP32 general-purpose Counters

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2021-03-03 13:02:02 +01:00
Kumar Gala
d521129c4f dma: Kconfig remove unused kconfig symbols
All dma drivers are devicetree based now so we can remove the last
bits of Kconfig associated with the old driver style.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 20:28:35 -06:00
Mikkel Jakobsen
5cdbe07b53 samples: drivers: dac: add support for frdm_k22f board
Add support for the NXP FRDM-K22F development board to the DAC driver
sample.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-03-02 16:27:47 -06:00
Kumar Gala
774ea5ad5b samples: board: nrf: battery: Convert to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the io-channels/adc controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 11:28:30 -06:00
Kumar Gala
77bca9bc1e samples: sensor: set integration_platforms to frdm_k64f
Set integration_platforms on these samples to just frdm_k64f.
This should be sufficient to make sure these tests build.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 07:03:42 -06:00
Martí Bolívar
01bb08e7d8 samples: switch nrf overlays to sda-gpios, scl-gpios
I only see one sample with an overlay using the now legacy sda-pin and
scl-pin properties. Move it to the new style.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Martí Bolívar
840ba45c74 samples: ccs811: fix nrf51_ble400.overlay whitespace
Use tabs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-03-01 16:59:56 +01:00
Jakub Rzeszutko
99d064e881 shell: sample: add getopt
Modify an example by adding command that is using shell_getopt funtion.
Extent sample.yaml with getopt configuration.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-03-01 09:50:32 -05:00
Johann Fischer
9f3b60ab60 samples: intel_s1000_crb: replace deprecated HID macros
Replace deprecated HID macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Johann Fischer
65678bb1d4 samples: hid: convert to use new common HID macros
Convert to use new common HID macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Armando Visconti
79c709bf02 drivers/sensor: ism330dhcx: Move INT_PIN Kconfig attr into DT
Convert ism330dhcx INT_PIN attribute from Kconfigs to Device
Tree binding properties. Here int-pin has been defined as
enum with two possible values: 1 and 2.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-02-28 16:47:15 -05:00
Jordan Yates
aeac33a7a2 samples: lorawan: class_a: add datarate callback
Add an example callback implementation that prints out the new maximum
payload given the updated datarate.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2021-02-28 16:36:57 -05:00
Jack Rosenthal
ea9866dc86 shell: add an option for minimal default configuration
The default shell configuration has heavy flash and memory requirements,
requiring project maintainers to set many configuration options to "n"
to keep flash and memory requirements within reason.

This adds a new configuration option, CONFIG_SHELL_MINIMAL, which will
disable flash and memory heavy options by default, and allow project
maintainers to select/imply only the options they want.

On a quick test from an ARM board I'm working on, enabling this option
cut flash space requirements by ~8 KB, and memory requirements by ~1 KB.

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
2021-02-27 10:26:33 +01:00
Kumar Gala
2dce6bff7f samples: shell_module: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.
This should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-26 07:28:46 -06:00
Johann Fischer
01a0a6a6e5 samples: shell_module: add shell support over CDC ACM
Add shell support over CDC ACM.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-26 08:10:36 -05:00
Sylvio Alves
7fe8b710a8 wifi: esp32: add board wifi station sample
add esp32 wifi station  board example

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-02-25 17:00:20 -05:00
Kumar Gala
ca3bf282b6 samples: condition_variables: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-25 10:36:02 -05:00
Piotr Pryga
8ed26a0927 samples: Bluetooth: Add DF connectionless Beacon sample application
Add an application that uses Direction Finding API for
transmission of CTE in connectionless mode (periodic adverising PDUs).

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-25 14:53:27 +01:00
Kumar Gala
e8224c3a08 samples: servo_motor: Convert to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the pwm controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-24 15:46:18 -06:00
Kumar Gala
1ca6828db9 samples: basic: Convert to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the pwm controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-24 13:45:46 -06:00
Pavlo Hamov
51e386e8d1 samples: watchdog: Add cc32xx support
add DTS bindings and board overlay

Signed-off-by: Pavlo Hamov <pasha.gamov@gmail.com>
2021-02-24 08:35:27 -06:00
Lingao Meng
db2f871fa9 samples: bluetooth: Fix SRAM overflow with bbc:microbit
`arm-zephyr-eabi/bin/ld: region `SRAM' overflowed by 19 bytes`

Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
2021-02-24 10:56:26 +01:00
Jukka Rissanen
d090de7a0d samples: net: echo-server: Add netmask setting to VLAN config
We need to set a proper IPv4 netmask to each VLAN interface
so that IPv4 source address selection will work properly.
If we do not do this, then the network interface could be
selected incorrectly for the VLAN interfaces which could then
mean that the packet might get dropped by the target device.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-02-24 09:45:09 +02:00
NavinSankar Velliangiri
e61c9caa7d samples: subsys: fs: littlefs: Enable Nordic QPSI driver
Add overlay and enable Nordic QPSI driver to support bmd_345_eval

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-02-23 16:31:41 -06:00
NavinSankar Velliangiri
d56e820f76 samples: drivers: jesd216: Enable Nordic QPSI driver
Enable Nordic QPSI driver for nordic board.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-02-23 16:31:41 -06:00
Martí Bolívar
d090751c3d samples: bme280: provide generic arduino I2C and SPI support
Adjust the documentation and devicetree overlays so the sample can be
built for any board with an Arduino I2C and SPI pinout, defaulting I2C
and SPI to y to make it easier to switch between the two without
requiring a pristine build.

The user has to choose an appropriate overlay or have a sensor built
in to the board.

Use the newly introduced DEVICE_DT_GET_ANY() in main.c to ask for a
bosch,bme280 without worrying over the details or exposing
DT_DRV_COMPAT-based functionality that is really meant for drivers.

Remove the no-longer-needed board specific overlay for nRF52840 DK;
this is covered by the generic Arduino overlays now.

Fix the datasheet link while we're here.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-02-23 10:34:19 -05:00
Piotr Pryga
5bfb9fb81e samples: Bluetooth: add nrf52833dk_nrf52833 board in per. adv. samples
Add support for nrf52833dk_nrf52833 board in periodic_adv and
periodic_sync samples.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-02-23 12:36:11 +01:00
Bosch Sensortec
a56bd0092b samples: sensor: bmi270 added sample for bmi270
Added sample for the BMI270 IMU driver

Signed-off-by: Bosch Sensortec <github@bosch-sensortec.com>
2021-02-22 17:58:00 -05:00
Ioannis Glaropoulos
c4bedf30cc samples: tfm integration: rename qemu targets after refactor
Now that we have consolidated tf-m signing, the combined
binary is always named tfm_merged, so we need to modify
the QEMU targets in the tfm-integration samples.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-21 18:44:18 +03:00
Øyvind Rønningstad
5137135ead boards: Consolidate all TFM signing code
Place the new signing code in the TFM module CMakeLists.txt.
Make some small tweaks and add a sentence to the docs.

In the process, make a few changes to the signing code:
- Change some names of files created.
- Minimize the number of files created.
- Use hex files instead of bin files. This is so we don't need to know
  the offset when creating hex files from bin files.

Also add signing for MCUBOOT_IMAGE_NUMBER=1 based on the code from the
v2m_musca_b1 board, though, this board does not build with =1 now
because of (I assume) some flash aliasing which places the S and NS
images 0x10000000 apart, where the manual algorithm places them next to
each other. It builds with =2, though.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-02-21 18:44:18 +03:00
Kumar Gala
49f1e22a13 samples: portability: set integration_platforms to native_posix
Set integration_platforms on these samples to just native_posix.  This
should be sufficient to make sure these tests build and run.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-19 18:49:54 -05:00
Pavlo Hamov
9fa62b810b samples: adc: add cc32xxsf_launchxl support
Add support for cc3220sf_launchxl, cc3235sf_launchxl boards

Signed-off-by: Pavlo Hamov <pasha.gamov@gmail.com>
2021-02-19 10:43:58 -06:00
Erwan Gouriou
2179e068ea samples/driver: watchdog: wwdg sample should run with west
A different configuration is applied when running this test
using west or using twister.
Both will use the disco_l475_iot1 overlay, but the extra config
for clock bus tunning is applied only when using twister and
samples is failed when run with west.
Move this extra config from sample.yaml to board .conf file so
it is applied in both cases.

Fixes #32376

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-19 05:25:52 -06:00
Andy Ross
686b9fff5e samples/synchronization: Clean up SMP CPU pinning example
There was some code to demonstrate the cpu_mask API here, but it was
asymmetric (only thread B was pinned) and assumed exactly two CPUs.

Start both threads pinned to CPUs 0 and 1 from an external main, and
predicate the pinning on there actually being more than one SMP CPU.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-02-18 12:04:49 -05:00
Piotr Szkotak
feccb8f59f samples: boards: nrf: ieee802154: Optimize power on nRF53
Add an overlay disabling UART in the prj.conf.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2021-02-18 15:24:30 +03:00
Peter Bigot
bdba2e63f6 samples: nrf: system_off: add RAM retention example for nRF52
Add an object to retain data across both reboots and entry to
SYSTEM_OFF.  This only works on nRF52, since nRF51 and nRF53 require
different low-level operations to configure RAM retention.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-17 14:34:31 +01:00
Gerard Marull-Paretas
a0a8a47fcd samples: sensor: add MAX6675 sample application
Add a sample application to test MAX6675 cold-junction-compensated
K-thermocouple to digital converter.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-17 14:33:29 +01:00
Kumar Gala
942916e691 arm: nxp: kinetis: Rework device_get_binding for pinmux
Switch to use DEVICE_DT_GET instead of device_get_binding for pinmux
device.  As part of this change drop the "label" property from
the pinmux devicetree node and update the binding and dts files to
reflect that.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-16 16:45:02 -06:00
Jose Alberto Meza
93a8f5f10e samples: boards: mec15xxevb: pm: Enable PECI and KSCAN drivers
Enable PECI and KSCAN drivers to evaluate any side-effect
in LPM entry/exit and power consumption.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-02-16 15:45:56 +03:00
Kumar Gala
464d82618f arm: Remove Musca-A SoC/board support
Remove support for the Musca-A board.  This board is rarely used, few
are available and superceded by Musca-B and Musca-S.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-15 21:04:23 +03:00
Johann Fischer
77dfc215a3 samples: hci_usb: disable USB_DEVICE_BLUETOOTH_VS_H4
Default to standard mode and disable
USB_DEVICE_BLUETOOTH_VS_H4 extension.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-15 08:27:19 -05:00
Scott Worley
4bf9db6916 samples: drivers: espi: Add simple SAF tests
Update sample espi driver test to exercise some SAF functionality
based on the limited hardware available. Note the SAF test will
erase a section of the flash. SAF tests are enabled for the EVB only.

Signed-off-by: Scott Worley <scott.worley@microchip.com>
2021-02-15 08:22:01 -05:00
Steven Daglish
e38466155b sensor: mcp9808: Add new overlay board for nucleo_l053r8 board
Introduce a dts board overlay on the nucleo_l053r8 board as this
board was used for testing addition of resolution setting on the
mcp9808 sensor driver.

Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
2021-02-15 08:13:17 -05:00
Steven Daglish
a3def30587 sensor: mcp9808: Added dts resolution to nucleo_l031k6 board overlay
MCP9808 sensor driver now uses DTS to change the resolution of the
sensor.

Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
2021-02-15 08:13:17 -05:00
Jedrzej Ciupis
2d4c13459e samples: boards: Add tests section to 802154_rpsmg sample
This commit adds tests section to sample.yaml file of the
ieee802154/802154_rpmsg sample.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Czeslaw Makarski
560c78c388 samples: 802154_rpmsg: Add SL fault handler
This commit adds the nRF IEEE 802.15.4 Service Layer Fault Handler
to the 802154_rpmsg sample.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Czeslaw Makarski
12bc964c9b samples: 802154_rpmsg: Remove redundant kconfig
This commit removes the obsolete hardcoded kconfig in the
802154_rpmsg sample.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Flavio Ceolin
86a624e2a2 power: Remove PM_STATE_LOCK option
Simplify pm subsystem removing PM_STATE_LOCK option. Constraints API is
small and is a key component of power subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-02-15 08:08:36 -05:00
Flavio Ceolin
3f87c5a0f4 power: Rename constraint API
Replace pm_ctrl_* with pm_constraint.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-02-15 08:08:36 -05:00
Gerard Marull-Paretas
68344cd87c samples: boards: stm32: add backup SRAM sample
The sample illustrates how to define and use a variable in the backup
SRAM.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-15 08:04:24 -05:00
Ioannis Glaropoulos
2573f4b99c tests: remove nrf5340 PDK boards from test .yml files
Remove references to the nRF5340 PDK boards
from samples and tests .yml files.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-15 07:59:43 -05:00
Dominik Ermel
4d0fb2ca88 samples/subsys/mgmt/mcumgr/smp_svr: Limit logging from mcuboot_util
Fixes problem where UART DFU mage uploads via mcumgr get interrupted
by the mcuboot_util logs, causing uploads stuck and fail on time-out.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-02-14 18:38:37 -05:00
Jose Alberto Meza
d38d913452 samples: drivers: espi: Showcase OOB Rx asynchronous handling
Add example to handle OOB host responses asynchronously.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-02-14 18:22:47 -05:00
Jose Alberto Meza
9c6e81665b samples: drivers: espi: Remove magic number
Define macro for number of times the temperatures will
be retrieved.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-02-14 18:22:47 -05:00
Maciej Perkowski
3e1badaaac samples: tests: Fix sample.boards.nrf.nrfx test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:58:25 -05:00
Maciej Perkowski
0fb58735f1 samples: tests: Fix usb.audio.headset test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:57:31 -05:00
Maciej Perkowski
ce776f0c7e samples: tests: Fix usb.audio.headphones_microphone test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:57:31 -05:00
Peter Bigot
7ab81edba9 samples: driver: watchdog: rework how callback support is handled
Nordic watchdog does support a callback, but it has a time limit that
is too tight for the way this sample uses it.  Add infrastructure to
bypass using the callback in this sample.

Also add more diagnostics explaining the status of callback use in the
sample.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-09 13:43:55 -05:00
Andrzej Puzdrowski
c7a626fc6c samples/subsys/usb/mass: Add fs_dir_t type variable initialization
The commit adds initialization of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Andrzej Puzdrowski
9111438db5 samples/subsys/fs: Add fs_dir_t type variable initializations
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-02-05 07:32:20 -05:00
Ioannis Glaropoulos
b6a4db3766 samples: rpmsg_service: do not run test for nrf5340 in CI
We cannot automatically flash both master and remote images
to nRF5340 application and network core, this needs to be
done separately. We therefore, cannot execute the test on
nRF5340, so we switch to make the test build-only on this
platform. We also make nrf5340_cpuapp an integration
platform for the given sample.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-02-04 14:41:41 -05:00
Andrei Emeltchenko
89a253b052 edac: Use Device Tree values for BDF and PCI VID
Start using DTS values for PCI Vendor ID and PCI BDF. For the PCI
Device ID we do not use DTS since this would require changing overlay
for different SKU board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-02-04 09:37:42 -05:00
Øyvind Rønningstad
b49292634f tfm_ipc: Fix regex in sample.yml
Remove missing printout, and add the last line of printout.

Note that it's not possible to run this on hardware using Twister as of
now, since west flash will not flash tfm_s.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-02-03 11:07:30 -05:00
Øyvind Rønningstad
25bc05e174 tfm_integration: Add tfm tag in sample.yml
To easily differentiate the samples.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-02-03 11:07:30 -05:00
Carles Cufi
1454730faa Bluetooth: samples: hci_uart: Add overlays for nRF5340
Add overlays for the current nRF5340 DK boards:

- nrf5340dk_nrf5340_cpuapp
- nrf5340dk_nrf5340_cpunet

Fixes #29440.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-02-03 10:22:18 -05:00
Johann Fischer
5b8d79fe9a sample: usb: exlude native_posix platform
Exlude native_posix platform from USB samples but
add build-only test case.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-03 08:37:38 -05:00
Johann Fischer
070ee4bf37 samples: cdc_acm_composite: fix format specifier
Use %zu format specifier for size_t.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2021-02-03 08:37:38 -05:00
Johann Fischer
806e3c7d3f samples: usb: remove unnecessary GPIO dependency
Remove unnecessary GPIO dependency.

Fixes: #29034

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2021-02-03 08:37:38 -05:00
Peter Bigot
fcaf14a6e4 samples: sht3xd: fix unchecked failure mode
Failure to configure the trigger should cause the application to fail.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-02 16:46:55 -05:00
Kumar Gala
6defabebad drivers: can: Fix building with socket_can_generic.h
socket_can_generic.h makes some assumptions that are not always valid
for various drivers with regards to numbering.  To clean this up we
add defines for SOCKET_CAN_NAME_0 and SOCKET_CAN_NAME_2 in addition to
SOCKET_CAN_NAME_1.

We also move struct socket_can_context into the drivers themselves
since they know best how many CAN interfaces are getting supported and
what naming/number convention they'd have.

Additionally, this also exposes a few other build issues with the
can_mcux_flexcan driver that get fixed.

Finally, we remove the platform_allow from samples/net/sockets/can
since it is no longer needed.

Fixes #31733

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-02-02 16:46:28 -05:00
Hubert Miś
77c68aa070 net: coap: clean up token usage in samples and tests
This patch replaces magic numbers with COAP_TOKEN_MAX_LEN value and
removes unnecessary castings of token buffer type.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-02 14:03:01 -05:00
Hubert Miś
22687c34e3 net: coap: define default CoAP version
RFC 7252 (CoAP) specifies value of the Version (Ver) field in the
protocol header to value 1. This patch defines value of the Version
field to make packet initialization easier. All samples and tests
are updated to use the new COAP_VERSION_1 field when initializing
a CoAP packet.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-02-02 14:03:01 -05:00
Joakim Andersson
dc1dcb74b1 Bluetooth: samples: Fix stack overflow in TX power control samples
Fix stack overflow in the TX power control sample.
Current stack usage with 0.11.1 zephyr toolchain was at 100% stack
usage of the DYN TX stack.

Fixes: #31433

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-02-02 08:18:28 -05:00
Erwan Gouriou
dda473e890 samples/drivers/watchdog: Update for stm32 window watchdog
Similarly to what was done for watchdog test,
update watchdog sample to be compatible with stm32 window watchdog
and enable testing by twister.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-02-02 08:15:51 -05:00
Guennadi Liakhovetski
3af94e7172 SOF: cAVS 1.5 needs reset-vector.S in the main image
APL ADSP doesn't boot with reset-vector.S in the bootloader,
move it over to the main application binary.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-02-01 14:47:31 -05:00
Detlev Zundel
8410a8cfa8 samples: display: lvgl: Fix README.rst
The commands still refer to the old directory name 'gui' instead of
'display'.

Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
2021-02-01 12:33:00 -05:00
Rubin Gerritsen
fc140d8616 samples: bluetooth: Remove useless default_conn
The connection object is not used.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2021-02-01 08:38:54 -05:00
Erwan Gouriou
95712bd498 samples/drivers/adc: Few fixes for use with twister
Add some changes to adc sample to enable valid verdict generation
using twister:
-Replace 'single_line' keyword with correct 'one_line'
-Remove parenthesis from the sample output to enable regex verdict
-Add timeout to save time in execution

Additionally, add support for disco_l475_iot1.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-29 16:57:04 -05:00
Joakim Andersson
a0d62f03a0 Bluetooth: host: Remove deprecated scan filter duplicate params
Remove the deprecated scan filter duplicate enum values and parameter.
This was deprecated for the 2.3.0 release.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-01-29 12:53:10 -05:00
Dominik Ermel
44ee6fd6b3 samples: fs: Extend littlefs sample to native_posix and qemu_x86
Adds native_posix and qemu_x86 the platform_allow list for the
littlefs sample application.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-01-29 08:04:51 -05:00
Dominik Ermel
f144dea3c7 samples: littlefs: Add fs_file_t type variable initializations
The commit adds initializations of fs_file_t variables in preparation
for fs_open function change that will require fs_file_t object, passed
to the function, to be initialized before first usage.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-01-29 08:04:51 -05:00
Vincent Wan
41a726dac8 samples: cc13x2_cc26x2: system_off: force soft off state
In the last step of the example, the system should go into soft off
state in order to match the original intent in the example to go
into the hardware's SHUTDOWN mode.

Fixes #31727

Signed-off-by: Vincent Wan <vanti.coder@gmail.com>
2021-01-28 08:15:55 -05:00
Peter Bigot
48e6358c6d samples: cmsis_rtos_v1: philosophers: skip qemu_leon3
SPARC systems take a huge penalty in stack usage due to register window
saves.  A recent patch reverted SPARC-specific increases to various
stack sizes, causing this test to fail.

Other platforms are excluded because of stack limits, so do that here
too.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-27 09:05:21 -05:00
Andrzej Puzdrowski
cb6e2a6a9f samples/subsys/mcumgr/smp_svr: disable log over shell
Mcumgr-cli application doesn't accept log on the communication
channel. Since #30370 was merged log messages are generated from
MCUBOOT_UTIL by default. That made `mcumgr image upload` failing.

Patch disables logging via shell which cure the issue.
It is not necessary if another application on the host intercepts
log messages (like picocom can).

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-27 08:06:36 -05:00
Katrin Gartenmeister
0bc3b9ddc4 doc: corrected Bluetooth sample documentation
Bluetooth Tx power must be given in dBm instead of dB.
Signed-off-by: Katrin Gartenmeister <katrin.gartenmeister@grandcentrix.net>
2021-01-26 19:16:28 +02:00
Eduardo Montoya
80c0f3fbb6 net: openthread: configure required masterkey
After the latest upmerge, OpenThread requires explicit configuration
of the Master Key. This commit adds a Kconfig symbol that can be
used to setup its value. By default no Master Key is configured and
OpenThread generates a random one.

The Sockets Echo samples are configured with a fixed key with this
commit.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2021-01-26 07:29:10 -05:00
Jukka Rissanen
6136965251 samples: net: syslog: Add info how to manually start net backend
If CONFIG_LOG_BACKEND_NET_AUTOSTART is disabled, then the syslog
network backend is not started automatically. This option is
enabled by default but it might be that application needs to
start the backend manually if the network is slow to start or
some special routes needs to be set by the application.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-01-26 07:12:14 -05:00
Hubert Miś
759f7454d8 net: coap: define max token length
This patch introduces COAP_TOKEN_MAX_LEN definition in coap.h file.
This definition replaces magic number across CoAP protocol
implementation and CoAP samples.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-01-26 06:17:41 -05:00
Krzysztof Chruscinski
7f08061f0c logging: Revamp menuconfig
Clean up logging menuconfig by grouping configuration into
sections like: mode, processing configuration, backends.

Additionlly, removed LOG_ENABLE_FANCY_OUTPUT_FORMATTING which is no
longer in use.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-01-26 06:15:42 -05:00
Henrik Brix Andersen
7b9b3cfe5a samples: canbus: canopen: mass-erase flash prior to running sample
Mass-erase the flash prior to running the sample to ensure the storage
partition can be initialized correctly.

Fixes: #30477

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-24 21:22:25 -05:00
Martin Jäger
0520ec814b samples: drivers: adc: add ADC example
This sample shows how to use the ADC API. Depending on the support of
sequential reads in the driver, 1 or 2 channels are read and printed.

A devicetree overlay is necessary to specify the used ADC channel(s).

Signed-off-by: Martin Jäger <martin@libre.solar>
2021-01-23 08:27:46 -05:00
Andrei Gansari
6055f25b13 samples: mpu_test: support for lpc flash driver
Adds support for legacy LPC IAP flash driver.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-23 08:01:00 -05:00
Maureen Helm
a8d3c8e142 samples: flash_shell: Run on boards without zephyr,flash-controller
The flash shell can now build when there isn't a chosen
zephyr,flash-controller available, so we can simplify the filter to
apply this sample to more boards.

Two STM32 H7 board configurations are excluded because the flash driver
isn't supported yet on the M4 core.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-01-22 11:11:54 -05:00
Maureen Helm
cce08a46c4 samples: fs: Extend littlefs sample to mimxrt1064_evk
Adds the mimxrt1064_evk board to the platform_allow list for the
littlefs sample application.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-01-22 11:11:54 -05:00
Flavio Ceolin
321ce7fb77 power: Use substate-id in pm subsystem
Change subsystem to use struct pm_state with substate-id instead of
using only the power state category.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
d21808b0b1 power: Remove residency and states from Kconfig
Residency time and power states are defined using device tree now.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin
579f7049c7 power: Move pm subsystem to new power states
Migrate the whole pm subsystem to use new power states information
from power_state.h and get states and residency properties from
device tree.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Andrei Emeltchenko
e33e5a7b57 edac: tests: Include sample.subsys.edac only for ehl_crb
Fixes twister build.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-01-21 08:34:07 -05:00
Andrei Emeltchenko
297d2eeb48 samples: edac: Add EDAC shell sample application
Add EDAC shell application demonstrating EDAC API usage. Can be used
for verification of the functionality with error injection mechanism.
Sample is also included in the twister tests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2021-01-21 08:34:07 -05:00
Anas Nashif
d0dd2ac5d3 samples: cmsis_rtos_v2: increase stack
Need more stack for some platforms and architectures.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 16:45:31 -05:00
Peter Bigot
08f4ce4efb samples: boards: nrf: add clock_skew
Provide a demonstration of using the timeutil skew infrastructure to
measure the relative error of the two clock sources on Nordic boards.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 16:38:56 -05:00
JuHyun Kim
a8722a9e65 samples: sensor: sample app of ICM42605 motion sensor
Sample appication of TDK Invensense ICM42605
motion sensor.

Signed-off-by: JuHyun Kim <jkim@invensense.com>
2021-01-20 10:41:04 -06:00
Peter Bigot
6ae2374eea samples: drivers: gpio: remove stray board file
Remove UP Squared support for the gpio sample that was merged after
the sample itself was removed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 09:15:53 -05:00
Vitaliy Gribko
75847b7a5e samples/net/mqtt_publisher: undefined reference to z_impl_sys_rand32_get
Add missing random options to prj.conf file.

Fixes #31414

Signed-off-by: Vitaliy Gribko <vitaliy69@gmail.com>
2021-01-20 13:20:54 +02:00
Lukasz Majewski
9e5ae8f0a3 dsa: config: sample: Add SHELL support via RTT to DSA sample's prj.conf
Due to the routing, the ip_k66f board can only use RTT to export
console. With this change the SHELL is enabled to get access
to network commands (like ping).

To use it with RTT from Segger:
-------------------------------

On HOST (terminal 1):
./JLink_V664/JLinkRTTLogger -Device MK66FN2M0XXX18 -RTTChannel 1 \
-if SWD -Speed 4000 ~/rtt.log

On HOST (terminal 2):
nc localhost 19021

(19021 is the port number for the Segger RTT server)

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-20 10:03:42 +02:00
Lukasz Majewski
814f5fa717 dts: overlay: Provide local-mac-address nodes as dts overlay
The 'local-mac-address' nodes are helpful for assessing if the LLDP like
example of DSA switch works correctly.

As those are used only for testing (or when user explicitly needs them),
those are added as DTS overlay to DSA example.

The 'local-mac-address' properties will be visible when one assess the
LLDP response from ip_k66f board (each LAN port has different IP
assigned).

Example output from 'tcpdump -v -i eth0':
-----------------------------------------
       Chassis ID TLV (1), length 7
          Subtype MAC address (4): 00:00:12:13:00:37 (oui Unknown)
        Port ID TLV (2), length 7
          Subtype MAC address (3): 00:00:12:13:00:37 (oui Unknown)
        Time to Live TLV (3), length 2: TTL 120s
        System Name TLV (5), length 13: ip_k66f LAN:3
        End TLV (0), length 0


Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-20 10:03:42 +02:00
Lukasz Majewski
ca6ac1306a samples: net: Provide DSA example to handle LLDP MGNT packets on ip_k66f
This patch brings simple example on per DSA port LLDP filtering based on
MAC address of received packet.

Each lan1, lan2 and lan3 ports handle separately LLDP packets going into
them.

Nonetheless, the K66F ENET handles correctly all other packets types -
to be more specific - ICMP, TCP/IP.

Setup -> ON HOST:

Configure/start the lldpd daemon (debian 10) on host to use
MAC 01:80:c2:00:00:03:
(lldpd -ddd & ) && sleep 2 && \
lldpcli configure lldp agent-type nearest-non-tpmr-bridge

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-20 10:03:42 +02:00
Hubert Miś
13aa4b2f9e net: coap: define Content-Format option values
CoAP protocol defines registry of Content-Format option values.
This patch adds this enumeration to coap header file to make it
available to all applications using CoAP protocol. It modifies
code using CoAP service to use new enumeration.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-01-19 16:07:20 -05:00
Hubert Miś
2674828ad4 samples: ipc: RPMsg Service sample
This patch adds a new sample presenting usage of RPMsg Service
subsystem.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-01-19 22:07:09 +01:00
Hubert Miś
5548917e69 bluetooth: hci: rpmsg: Use RPMsg Service
This patch modifies Bluetooth HCI RPMsg drivers and samples to use
RPMsg Service instead of configuring OpenAMP directly in the driver
or the sample.

Co-authored-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2021-01-19 22:07:09 +01:00
Eugeniy Paltsev
71025dd2d5 samples: cpp_synchronization: fix 'main' signature
'main' function should retun 'int' and not 'void'. Otherwise
some picky compilers (like ARC MWDT) would warn about that.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2021-01-19 11:06:38 -05:00
Anas Nashif
930789dbe7 samples: kernel: add condition variable samples
Add a few samples for using condition variables..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-19 08:55:47 -05:00
Robert Lubos
538e19ee2e net: coap: Rework pending retransmission logic
Introduce retransmission counter to the coap_pending structure. This
allows to simplify the retransmission logic and allows to keep track of
the number of remaining retranmissions.

Additionally, extend the `coap_pending_init()` function with `retries`
parameter, which allows to set the retransmission count individually for
each confirmable transaction.

Fixes #28117

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-01-18 23:22:37 -05:00
Peter Bigot
855b39ecbd samples: drivers: jesd216: add support for Nordic QSPI driver
Remove the overlay and set up to enable the QSPI variant.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-18 16:58:09 -05:00
Peter Bigot
5fd3246a62 drivers: flash: jesd216: add support for DW16 decoding
DW16 provides information on mechanisms to enter and exit 4-Byte
address modes, returning the device to reset state, and how to
manipulate the values in the first status register.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-18 16:58:09 -05:00
Peter Bigot
52545411d2 drivers: flash: jesd216: add support for DW15 decoding
DW15 provides information on entry and exit from QSPI modes.  In
particular, it specifies whether and how the status register must be
updated for this feature.

Add a JESD216 devicetree property for the Quad Enable Requirements
value.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-18 16:58:09 -05:00
Peter Bigot
3911380c54 samples: jesd216: fix bound on BFP DW parsing
DW indexes start from 1, so the proper upper bound includes the value
of len_dw.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-18 16:58:09 -05:00
Xinrong Han
a1450d31a7 samples: sensor: mcp9808: add error checks in trigger_handler()
Validate that sensor_sample_fetch() and sensor_channel_get() are on
success.

Fixes #29945

Signed-off-by: Xinrong Han <hanxr19@mails.tsinghua.edu.cn>
2021-01-18 16:56:57 -05:00
Erwan Gouriou
23bb56820e samples/drivers: led_pwm: Fixes for device testing
Modify led_pwm sample in order to make it usable in device testing:
- Remove parenthesis from the logs as they prevent use of regex
- Add a harness_config multiline regex in order to enable verdict
generation
- Update README

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-18 19:11:43 +01:00
Alexander Kozhinov
c0fe1e6dbd samples: subsys: canbus: canopen: README.rst
add notice for boards without storage

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2021-01-18 19:11:33 +01:00
Kim Bøndergaard
fd63c5ff1f samples: drivers: display: Support for all solomon_ssd16xxfb based displays
Currently the following shields will thus be supported

	waveshare_epaper_gdeh0154a07
	waveshare_epaper_gdeh0213b1
	waveshare_epaper_gdeh0213b72
	waveshare_epaper_gdeh029a1

Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
Signed-off-by: Kim Bøndergaard <kibo@prevas.dk>
2021-01-18 19:07:53 +01:00
Armando Visconti
d2e8b0cc6e drivers/sensor: iis2dlpc: Move drdy_int info into DT
The IIS2DLPC drdy interrupt can be routed to either INT1 or
INT2 pin. Currently the selection is done by Kconfig configuration.
This commit is instead moving it into Device Tree as 'drdy-int'.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-01-18 09:21:00 -06:00
Robert Lubos
78c77da578 samples: net: lwm2m_client: Remove unused objects
Since the additional objects are only added for compilation, enable
them in sample.yaml instead, so that they get built by the CI. Remove
them from the actual sample, as they obfuscate the sample purpose and
the objects visible from the server perspective.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-01-18 11:59:50 +01:00
Emil Gydesen
69d8b0a0b4 drivers: bluetooth: hci: Add support for ISO packets in rpmsg
This adds supports for ISO packets so then can be transmitted and
received with rpmsg driver.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2021-01-15 11:39:09 -05:00
Xinrong Han
3c6ffaf7e2 samples: drivers: dac: src: add error check of dac_write_value()
Validate that dac_write_value() succeeds.

Fixes #30205

Signed-off-by: Xinrong Han <hanxr19@mails.tsinghua.edu.cn>
2021-01-15 11:38:39 -05:00
Robert Lubos
7628eb51f1 samples: net: lwm2m_client: Remove nrf52dk_nrf52832 from the allowlist
BLE and LwM2M grew in terms of RAM usage so that the sample does not
fit into nRF52832 anymore in the default configuration. This cause
twister to report an error when overflows errors are enabled.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-01-15 10:57:01 -05:00
Erwan Gouriou
ee199eed10 samples/subsys: littlefs: Add disco_l475_iot1
Add disco_l475_iot1 as build platform for this sample

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-15 10:29:30 -05:00
Erwan Gouriou
e2ff107cf2 samples: spi_flash: Add compatibility with st,stm32-qspi-nor
Enable using st,stm32-qspi-nor compatible driver for this
sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-01-15 10:29:30 -05:00
Andy Ross
e956639dd6 kernel: Remove CONFIG_LEGACY_TIMEOUT_API
This was a fallback for an API change several versions ago.  It's time
for it to go.

Fixes: #30893

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-01-14 21:33:16 -05:00
Fabio Baltieri
fe746f9693 samples: ipsp: add a debug config build example
Add an example referring to the (already existing) prj_dbg.conf config.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri
a01b5b0d9a samples: ipsp: stop registering mcast addr
The IPSP example code is explicitly registering the all local-link nodes
address (ff02::1). This is currently already registered by the normal
IPv6 stack at interface initialization, so doing it in the application
is redundant.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Fabio Baltieri
f6fbf1ffe8 samples: ipsp: increase the maximum multicast addr count
This sample is trying to register four multicast addesses:

uart:~$ net iface
...
IPv6 multicast addresses (max 8):
        ff02::1
        ff02::1:ff01:c41e
        ff02::1:ff00:1
        ff02::1

Increasing CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT to 4 to make neighbor
discovery work correctly.

Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
2021-01-14 16:57:07 +02:00
Kumar Gala
3befd7d45f cleanup: rename sanitycheck references to twister
Cleanup references to sanitycheck that should now be twister.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-14 07:50:52 -06:00
Guennadi Liakhovetski
ca0e5df219 xtensa: don't build and run the reset handler twice
Currently Zephyr links reset-vector.S twice in xtensa builds:
into the bootloader and the main image. It is run at the end
of the boot loader execution and immediately after that again
in the beginning of the main code. This patch adds a
configuration option to select whether to link the file to the
bootloader or to the application. The default is to the
application, as needed e.g. for QEMU, SOF links it to the
bootloader like in native builds.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-13 18:17:40 -05:00
Peter Bigot
e017441ca0 boards: remove has-be32k from SPI NOR mtd nodes
Use of this property has no effect since it was by SFDP erase data in
Zephyr 2.4.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-13 11:58:37 -06:00
Andrzej Głąbek
253d2470f2 samples/boards/nrf/nrfx: Make the sample usable on all nRF SoCs
Conditionally use either DPPI or PPI channel in the sample so that
it can be built for all nRF SoCs. Update documentation accordingly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-01-13 08:03:06 -05:00
Andrzej Głąbek
d855d47288 drivers: crypto_nrf_ecb: Convert to use devicetree
Convert the driver so that it creates its instance basing on DT.
Remove no longer needed Kconfig option CRYPTO_NRF_ECB_NAME.
Also update accordingly the crypto sample.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-01-13 12:57:13 +01:00
Henrik Brix Andersen
5f35ee74b9 samples: canbus: canopen: mark program download test as build-only
Mark the CANopen sample with program download support as build-only
since it depends on MCUboot being flashed to the board prior to the
generated application firmware image.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-12 11:59:19 -06:00
Anas Nashif
67d8738790 samples: audio: sof: add cavs25
We are now able to build cavs25.
add all board to integration platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-11 16:13:25 -05:00
Guennadi Liakhovetski
2a6c70ab19 cavs_v25: switch over to Tigerlake H configuration
Tigerlake H has less RAM and fewer cores. Both should be
supported, selectable at the board level. For now use the H
configuration as more readily available for testing.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
Guennadi Liakhovetski
daab673426 sof: remove superfluous and duplicate code
1. SOF doesn't have to be built in .bin format
2. don't include soc.c and soc_mp.c twice in cmake
3. remove an unused mailbox.h header

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:10:23 -05:00
NavinSankar Velliangiri
a7135bca17 samples: sensor: bq274xx: Read all gauge channel individually.
Read all the remaining gauge channel individually.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-01-11 08:04:25 -06:00
NavinSankar Velliangiri
4c0b32405d samples: sensor: bq274xx: Read Gauge Channel Individually
Read sensor channel individually.
Fixes #28383.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2021-01-11 08:04:25 -06:00
Karsten Koenig
f06fec0ef7 drivers: can: mcp2515: Remove MCP2515 specifics
CAN_MCP2515_MAX_FILTER is not needed anymore and was probably just a
misunderstanding. Aligned it with the other CAN drivers.
This also was the last difference in the mcp2515 specific config for the
can sample, so that can be deleted as well.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2021-01-10 16:06:47 -05:00
Andrei Gansari
99faca36fe samples: openamp: update docs with lpc55s69
Updates .yaml and README with new boards support for
lpcxpresso55s69.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-10 15:38:54 -05:00
Andrei Gansari
a67d50848e samples: ipm_mcux: update docs with lpc55s69
Updates .yaml and README with new boards support for lpcxpresso55s69.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-10 15:38:54 -05:00
Andrei Gansari
0816cd45df samples: openamp: add lpc55s69 support
Adds support for lpcxpresso55s69_cpu0 in openamp sample. Some changes
made to the sample.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-10 15:38:54 -05:00
Andrei Gansari
8a94ea112b samples: ipm_mcux: add lpc55s69 support
Adds multicore support for lpcxpresso55s69 board.
Documentation to be updated in a later commit.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2021-01-10 15:38:54 -05:00
Jonathan Rico
167985f420 samples: bluetooth: Merge common hci_uart configs
Currently a lot of common kconfig options are being set in
board-specific overlays.
This commit puts them in the main prj.conf.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2021-01-10 15:34:51 -05:00
Erik Robstad
1feb49fd22 drivers: Dev. spec. PWM functionality for SX1509B
Add device specific functions for initiating
and controlling PWM output pins.

Signed-off-by: Erik Robstad <erik.robstad@nordicsemi.no>
2021-01-08 15:52:42 +01:00
Anas Nashif
c078eb9f3b samples: audio: sof: add filter
Build only for relevant platforms.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-08 07:49:19 -05:00
Flavio Ceolin
2b49266861 power: Add notifier API
Get rid of weak functions adding a new API to register an object to
receive notifications when the system changes power state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-07 12:40:19 -05:00
Steve Winslow
476e9e80d1 samples: net: Fix vlan error message in samples
This fixes an incorrect error message log statement for IPv4 vs.
IPv6 in several net samples.

The error message is in a portion of the files dealing with IPv4
bring-up. If the address is invalid, it logs the invalid address;
however, the IPv4 statement incorrectly refers to ipv6_addr. This
PR corrects it to output ipv4_addr as expected.

Signed-off-by: Steve Winslow <steve@swinslow.net>
2021-01-07 09:52:21 -06:00
Frank Li
d7c2f8a40a samples: video: Add OV7725 video capture sample
Add the ov7725 senser example,
which can run normally on mm_swiftio.

Signed-off-by: Frank Li <lgl88911@163.com>
2021-01-06 08:33:38 -06:00
Martí Bolívar
5f926ed09a boards: nordic: remove unnecessary nrfjprog.py args
The --nrf-family argument has been unnnecessary since 6628a16
(" runners: nrfjprog: boilerplate and recover rework").

Remove a few stragglers that are still using it, to avoid it being
copy/pasted into other board definitions.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-01-06 07:54:55 -06:00
Liam Girdwood
efa794dbc5 samples/audio: Add Sound Open Firmware
Adds the Sound Open Firmware project, built as a Zephyr application,
under samples/subsys/sudio/sof.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-01-06 07:53:46 -06:00
Thomas Stranger
fbb0327d3e boards: nucleo_g071rb: enable dac driver
Add DAC definitions for this board and add it to the dac sample.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2021-01-04 17:52:05 -05:00
Jan Gnip
d584a6251e samples/subsys/settings: fixed typo in readme
Fixed typo in readme file for the sample

Signed-off-by: Jan Gnip <jarynznosa@gmail.com>
2021-01-04 10:34:35 -06:00
Andrzej Puzdrowski
e0512ce954 samples/subsys/mgmt/smp_svr: increase fs support stack size
Commit https://github.com/zephyrproject-rtos/zephyr/commit/0a018db0f
increases worqueue stack size for overlay-fs.conf
exclusively.
overlay-bt.conf also need to be updated as enables mcumgr FS
command set as well.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-04 10:24:29 -06:00
Peter Bigot
a1885602bc samples: littlefs: use DT-defined mount information
Extend the nrf52840dk_nrf52840 sample overlay with a fstab entry for a
littlefs file system on the storage partition.

This eliminates the need for application configuration of the file
system parameters and mount data.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-12-27 18:16:20 +01:00
David Vincze
79cac4e58d arm: V2M Musca-S1: Add Musca-S1 SoC and board support
Musca-S1 is a Cortex-M33 based SoC. It's similar to the
Musca-B1, but among other things the embedded flash has
been replaced with embedded MRAM (eMRAM) memory.

The Musca-S1 files have been created based on the Musca-B1
SoC and board files.

Add the Musca-S1 board to the list of allowed platforms
for the TF-M integration examples.

Change-Id: I4f517d28d0a5b8c4a3fc3fab73adb5519acfc3c2
Signed-off-by: David Vincze <david.vincze@linaro.org>
2020-12-20 13:03:49 -05:00
Puranjay Mohan
4111cfd73c samples: sensor: tmp116: Add sample code for tmp117
Add sample code which demostrates the use of the offset
register offered in the TMP117.
Also add information about tmp117 in README.

Signed-off-by: Puranjay Mohan <puranjay12@gmail.com>
2020-12-20 13:02:21 -05:00
Kumar Gala
e2e882ab3e samples: convert DEVICE_AND_API_INIT to DEVICE_DEFINE
Convert samples to DEVICE_{DT_}DEFINE instead of DEVICE_AND_API_INIT
so we can deprecate DEVICE_AND_API_INIT in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-19 20:05:40 -05:00
Rafał Kuźnia
3bf526beea net: openthread: add shell dependency to OPENTHREAD_SHELL
This commit replaces the 'select SHELL' statement with
'depends on SHELL' in OPENTHREAD_SHELL config option.

This ensures, that shell will not be implicitly enabled
when OpenThread stack is built.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2020-12-18 12:56:33 -05:00
Kumar Gala
b1e4913a8a boards: arm: nxp: kinetis: Convert pinmux to new DT based names
Convert board pinmux code to utilize pinmux port information from
devicetree and not Kconfig.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-12-18 07:52:52 -06:00
Henrik Brix Andersen
185168a32a samples: sensor: add sample for demonstrating the NXP MCUX ACMP driver
Add a sample for demonstrating the usage of the NXP MCUX Analog
Comparator (ACMP) sensor driver. The sample currently only supports the
NXP TWR-KE18F development board.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-12-17 08:54:33 -06:00
Alexander Wachter
05275ecf6e drivers: can: rework zcan_frame and zcan_filter
Reordering of the struct elements to match the Linux format.
The __packed() is not necessary anymore.
std_id and ext_id is merged to id in the frame and filter.
Additionally, the frames are ready for CAN-FD.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Alexander Wachter
8b6c1bd4b7 drivers: can: Rework can_configure API
The previous API can't change the sampling-point and only allowed
bitrates that fit the time segments.
The new API allows for shifting the sampling-point and adjusts the
number of time quantum in a bit to all more possible bitrates.
The functions to calculate the timings are moved to the can_common file.
They can be used for all drivers.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-12-17 11:07:53 +01:00
Anas Nashif
bf4ce568ab sample: tagoio_http_post: add net harness to testsuite
This sample can't be tested on HW without having a network setup.

Fixes #30476

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-16 12:49:58 -05:00
Anas Nashif
b3475162ed samples: http_server: fix test filters
Adapt filter and make it depend on network interface being available.

Fixes #30472

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-16 12:49:58 -05:00
Watson Zeng
7a3f9c4e39 tests: add filter for some tests using newlib
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-12-16 08:57:40 -05:00
Anas Nashif
802d214582 debug: analyzer: add support for thread runtime stats
Add thread runtime statistics to the thread analyser.

With CONFIG_THREAD_RUNTIME_STATS enabled:

Booting from ROM..*** Booting Zephyr OS build zephyr-v2.4.0-2330-g77be0e93e65b  ***
thread_a: Hello World from cpu 0 on qemu_x86!
Thread analyze:
 thread_b            : STACK: unused 740 usage 284 / 1024 (27 %); CPU: 0 %
 thread_analyzer     : STACK: unused 8 usage 504 / 512 (98 %); CPU: 0 %
 thread_a            : STACK: unused 648 usage 376 / 1024 (36 %); CPU: 98 %
 idle 00             : STACK: unused 204 usage 116 / 320 (36 %); CPU: 0 %
thread_b: Hello World from cpu 0 on qemu_x86!
thread_a: Hello World from cpu 0 on qemu_x86!
thread_b: Hello World from cpu 0 on qemu_x86!
thread_a: Hello World from cpu 0 on qemu_x86!
thread_b: Hello World from cpu 0 on qemu_x86!
thread_a: Hello World from cpu 0 on qemu_x86!
thread_b: Hello World from cpu 0 on qemu_x86!
thread_a: Hello World from cpu 0 on qemu_x86!
Thread analyze:
 thread_b            : STACK: unused 648 usage 376 / 1024 (36 %); CPU: 7 %
 thread_analyzer     : STACK: unused 8 usage 504 / 512 (98 %); CPU: 0 %
 thread_a            : STACK: unused 648 usage 376 / 1024 (36 %); CPU: 9 %
 idle 00             : STACK: unused 204 usage 116 / 320 (36 %); CPU: 82 %
thread_b: Hello World from cpu 0 on qemu_x86!

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-14 13:00:47 -05:00
Anas Nashif
7009012d67 samples: shell: enable thread runtime stats
Enable runtime stats in the shell sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-14 13:00:47 -05:00
Øyvind Rønningstad
7356cb2e45 tfm_integration.rst: Document executable file target properties
Add a section about executable files produced by the build, as well as
how to access them.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-12-14 11:24:16 +01:00
Jan Van Winkel
aa514a7be2 samples: lvgl: Removed reel_board overlays
Removed reel_board specific config and dts overlay.

Configurations are moved to reel_board defconfig.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-12-14 11:22:06 +01:00
Gerson Fernando Budke
b0bd14b5fa samples: mgmt: updatehub: Update documentation
Update documentation using west enhancements and add sections related to
newer overlays.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
87516a611f samples: mgmt: updatehub: Add OpenThread support
Add OpenThread overlays.  This allows users to evaluate UpdateHub using
Thread Network.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
1468a3b04e samples: mgmt: updatehub: Add BLE IPSP support
Add Bluetooth Low Energy IPSP overlays.  This allows users to evaluate
UpdateHub using BLE with IPSP supported by Zephyr.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
ff32b7df0f samples: mgmt: updatehub: Add IEEE-802.15.4 support
Add IEEE 802.15.4 overlays.  This allows users to evaluate UpdateHub
using 6lowPAN.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
c37c41bca9 samples: mgmt: updatehub: Add modem support
Add MODEM and Arduino header overlays.  This allows users to evaluate
UpdateHub using any MODEM supported by Zephyr which supports UDP and
PPP connection.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
5907fce327 samples: mgmt: updatehub: Add wifi support
Add WIFI overlay and connection request.  This allows users to evaluate
UpdateHub using any WIFI supported by Zephyr which supports UDP.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
ab2f8729a5 samples: mgmt: updatehub: Add network management
Add support to Network Management in UpdateHub sample.  This allows
start application based on network events, independent of the media
type selected by users.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Gerson Fernando Budke
450330420e mgmt: updatehub: Kconfig: Drop NET_CONFIG_SETTINGS option
Remove NET_CONFIG_SETTINGS Kconfig option. The net settings should
be enabled from now at project config or at any overlay. This is
necessary to allow better control when application should start.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-12-14 11:21:06 +01:00
Maik Vermeulen
4cfd2a1943 net: lwm2m: Added execute arguments support
A dedicated LwM2M execute callback type has been implemented which
supports execute arguments. The lwm2m engine, lwm2m_client sample and
lwm2m objects have been updated accordingly. Also the API change has
been documented, and the lwm2m engine reference has been updated.

Fixes #30551.

Signed-off-by: Maik Vermeulen <maik.vermeulen@innotractor.com>
2020-12-13 15:39:08 -05:00
Jan Van Winkel
8676bca3b7 samples: lvgl: ci: Build for native_posix
Updated lvgl sample.yaml file to build the lvgl sample during
sanitycheck for the native_posix board with the dummy display driver and
Kscan disabled.

Using the dummy display driver and disabling Kscan removes the
dependency towards the availability of libdsdl2 on the host system.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-12-11 08:20:12 -06:00
Ioannis Glaropoulos
859d269182 samples: tfm_integration: remove DTS overlays for nRF5340
Remove the DTS overlay files for nRF5340 DK and PDK,
since the SRAM partition changes are matching the
default SRAM partitioning in these boards.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-12-11 11:23:26 +01:00
Anas Nashif
5e4222749a power: pm_force_power_state -> pm_power_state_force
Rename API to be more consistent with guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Anas Nashif
e0f3833bf7 power: remove SYS_ and sys_ prefixes
Remove SYS_ and sys_ from all PM related functions and defines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Anas Nashif
dd931f93a2 power: standarize PM Kconfigs and cleanup
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Jukka Rissanen
1e61d3eb9b samples: net: syslog: Add Docker based testing support
Allow the sample to be run against a rsyslog listener running
inside Docker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-09 15:56:44 +02:00
Andy Ross
fcd392f6ce kernel: subsys: lib: drivers: Use k_heap instead of z_mem_pool wrappers
Use the core k_heap API pervasively within our tree instead of the
z_mem_pool wrapper that provided compatibility with the older mempool
implementation.

Almost all of this is straightforward swapping of one alloc/free call
for another.  In a few cases where code was holding onto an old-style
"mem_block" a local compatibility struct with a single field has been
swapped in to keep the invasiveness of the changes down.

Note that not all the relevant changes in this patch have in-tree test
coverage, though I validated that it all builds.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-12-07 21:50:14 -05:00
Andy Ross
0c15627cc1 lib: Remove sys_mem_pool implementation
This has been replaced by sys_heap now and all dependencies are gone.
Remove.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-12-07 21:50:14 -05:00
Andy Ross
e7436f7c55 samples/userspace/prod_consumer: Use a sys_heap
This code used a sys_mem_pool directly.  Use a new-style heap instead
to do the same thing.

(Note that the usage is a little specious -- it allocates from the
heap but doesn't appear to fill or check any data therein, just that
the heap memory can be copied from the two memory domains.  It's
unclear exactly what this is trying to demonstrate and we might want
to improve the sample to do something less trivial.)

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-12-07 21:50:14 -05:00
Andy Ross
c770cab1a3 kernel: Make thread resource pools into sys_heaps
The k_mem_pool allocator is no more, and the z_mem_pool compatibility
API is going away.  The internal allocator should be a k_heap always.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-12-07 21:50:14 -05:00
Andy Ross
6965cf526d kernel: Deprecate k_mem_pool APIs
Mark all k_mem_pool APIs deprecated for future code.  Remaining
internal usage now uses equivalent "z_mem_pool" symbols instead.

Fixes #24358

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-12-07 21:50:14 -05:00
Pawel Czarnecki
748e7b6d75 samples: drivers: clock control: add sample
This adds a sample application for testing
the LiteX clock control driver.

Signed-off-by: Pawel Czarnecki <pczarnecki@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-12-06 12:35:16 -05:00
Jukka Rissanen
cc528d37c2 net: syslog: Make sure CONFIG_LOG_IMMEDIATE is not set
The immediate logging option cannot be used with network logging
support CONFIG_LOG_BACKEND_NET as that would cause the generated
rsyslog messages to be malformed. The UDP packets would only have
one byte payloads which is not correct. So make sure that user is
not able to select a configuration with immediate mode and network
logging.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-04 15:46:42 +02:00
Andrei Gansari
42523a39e3 samples: tfm_integration: lpc55s69 documentation
Update sample documentations to reflect the new way to flash
lpcxpresso55s69 boards with TFM.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-12-04 15:06:56 +02:00
Ioannis Glaropoulos
3f3dbea454 samples: bluetooth: hci_rpmsg: change the allowed platform to nRF5340 DK
We have deprecated nRF5340 PDK so change the platform
to nrf5340 DK.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-12-04 10:21:00 +02:00
Vinayak Kariappa Chettimada
bae2c58cc2 samples: Bluetooth: Add LED indications to PA Sync sample
Add LED blinking while scanning for Periodic Advertising,
and LED ON when Periodic Advertising Sync is established.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-12-03 13:54:25 -05:00
Vinayak Kariappa Chettimada
56d3ad6d49 samples: Bluetooth: How to test periodic advertising
Added documentation in per_adv and per_sync samples on how
to test Periodic Advertising and Periodic Advertising
Synchronization.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-12-03 13:54:25 -05:00
Vinayak Kariappa Chettimada
dcabeccfbb samples: Bluetooth: Add BLE Periodic Advertising Sync sample
Add an application that initializes Bluetooth Subsystem,
starts scanning for Periodic Advertising, establishes
Periodic Advertising Sync and receives Periodic
Advertising Reports.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-12-03 13:54:25 -05:00
Vinayak Kariappa Chettimada
ebdcdf3289 samples: Bluetooth: Add BLE Periodic Advertising sample
Add an application that initializes Bluetooth Subsystem,
creates an extended advertising set, and starts Periodic
Advertising functionality.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-12-03 13:54:25 -05:00
Henrik Brix Andersen
9121b24269 samples: drivers: flash_shell: do not enable CONFIG_SERIAL
Do not enable CONFIG_SERIAL explicitly in the flash_shell sample. Leave
it up to the board definition to enable a suitable shell backend if
CONFIG_SHELL is enabled.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-12-02 23:20:32 -05:00
Henrik Brix Andersen
db25454e0e samples: flash_shell: skip boards without zephyr,flash-controller
Adjust the sanitycheck filter of the flash shell sample to also depend
on the board having a chosen zephyr,flash-controller devicetree node (as
this is what is referenced in flash_shell.c).

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-12-02 23:20:32 -05:00
Erwan Gouriou
83ea7180cf samples/shields: x_nucleo_iks01a3: Add config for stm32mp157c_dk2
Shield x_nucleo_iks01a3 could be used with board stm32mp157c_dk2,
but it requires not using the irq-gpio pin.
Provide a specific configuration for this board that does not make
use of this pin, sot set all sensors' triggers mode to NONE.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-12-02 13:17:30 -06:00
Erwan Gouriou
c7f26e99f1 samples/shields: x_nucleo_iks01a3/02a1: Default use of prj.conf
By default, prj.conf is the CONF_FILE file use by any application.
Use the file when it is not the case and remove the line that sets
it in CMakeLists.txt as this is not required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-12-02 13:17:30 -06:00
Evgeniy Didin
7371f97097 Samples: Add SMP pktqueue application
This sample application simulates a network router with several
interfaces which performs IP Header Validation(calculation
of CRC16 header checksum). Each interface is represented
by sender queue(initialized with packet headers) and receiver queue.
Every header first is fetched from sender queue, than the header
CRC16 is calculated, and finally if hashsum is correct
the header is stored in receiver queue.
Each interface is can be processed independently by multiple threads.

This application can be used for testing the correctness
of synchronization mechanisms on multi-core systems.

Signed-off-by: Evgeniy Didin <didin@synopsys.com>
2020-12-02 07:09:21 -05:00
Johann Fischer
cec040503b samples: mass: rework disk and fs configuration
USB MSC sample has been expanded over time. Config overlays
for RAM disk and flash disks were added. Board specific overlays
followed. It was overlooked that they forced a specific
configuration for the nrf52840dk_nrf52840 board,
even if it was not explicitly desired
(for example RAM-disk). This also caused strange behaviour
during automatic MSC USB3CV tests (which explicit selects RAM-disk)
so that nrf5340dk_nrf5340_cpuapp board passed test
but nrf52840dk_nrf52840 failed.

Rework disk and file system configuration, and initialization
code, allow to use FAT file system on top of RAM disk.

This sample can be built with none or one of two supported
file systems, LittleFS or FATFS. Disk subsystem can be flash
or RAM based. LittleFS only works with flash disk.
There are four useful possibilities:
- RAM disk without any file system for testing (default)
- RAM disk with FAT file system
- flash disk with FAT file system
- flash disk with LittleFS
Flash disk configurations is only available (as before) for
nordic,qspi-nor compatible, but only need the device tree overlay
per platform without a config overlay.

This path also revises test cases.
Remove invalid "flash" tag from depends_on key.
Remove unnecessary gpio tag and exclude native platform.

Resolves: #26275

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2020-12-02 11:50:11 +01:00
Jukka Rissanen
9028ecbc56 samples: net: zperf: Allow DHCPv4 or manually set addresses
If user has enabled DHCPv4, then allow to use its address instead
of giving error if static address cannot be set. Similar fix for
IPv6, so allow user to manually set an IPv6 address.

Because DHCPv4 has already set the IPv4 address to the network
interface, then zperf might not be able to add the pre-configured
address to it. So instead of returning immediately, try to use the
IP address that is already in the network interface. This way we
avoid this error print.

  uart:~$ zperf udp download 5001

  Setting IP address 2001:db8::1
  Setting destination IP address 2001:db8::2
  Cannot set IPv4 address 192.0.2.1
  Unable to set IP
  Setting destination IP address 192.0.2.2

  Cannot set IPv4 address 192.0.2.1
  Unable to set IPv4
  Binding to 192.0.2.1
  Cannot bind IPv4 UDP port 5001 (-2)

In this example, the network interface already had a proper and working
IPv4 address 192.168.0.2 in it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-01 16:32:07 +02:00
Jukka Rissanen
77a74414d1 samples: net: zperf: Convert to use usec directly
Currently the code uses hw cycles and tries to convert them
to usec. I noticed some failures with this, for example the test
duration was sometimes missed meaning that instead of testing 5
seconds, we bailed out after 2 sec etc. After the kernel k_timeout_t
changes, which added APIs to support usec accuracy, we can use usec
and ticks here. This simplifies the code a bit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-12-01 16:32:07 +02:00
Jakub Rzeszutko
e2f8bfdc8d shell: example: prj_minimal config update
Deactivate all features that are not absolutely needed to run
the shell.

Used CONFIG_CBPRINTF_NANO library to save 1020B.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-11-30 16:03:01 -06:00
Dominik Ermel
25ac7e03a6 samples: mgmr: smp_svr: Extend sample sanity check configurations
Configurations for additional smp_svr sanity builds have been added
to limit possibility of getting not compilable smp_svr sample.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-11-30 15:48:59 +01:00
Peter Bigot
f13eb90705 samples: nrf: battery: fix reference to ADC node
The sample referenced the ADC through an alias that either never
existed or (more likely) has since been removed.  Use the node label
instead.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-27 20:26:45 -05:00
Erwan Gouriou
82c614ac9d boards: Fix 2 liners copyright
Convert 2 lines copyright before this new format starts creating
the new in vogue style.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-11-26 13:51:04 +01:00
Trond Einar Snekvik
24f34b1913 Bluetooth: Mesh: Demo: Increase loopback buf count
Increases the loopback buffer count to 8 in the mesh demo to give it
enough room for buffering the configuration messages in the
initialization step. As these messages are sent in a non-blocking
manner, they'll all be queued up for execution before any of them is
processed.

Fixes #30207.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-26 13:04:22 +01:00
Jukka Rissanen
41b7e5da7b samples: net: zperf: Fix timeout value for native_posix
In native_posix, the code calls k_busy_wait() but with wrong
value (k_timeout_t instead of int).

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-25 18:27:40 +02:00
Gerson Fernando Budke
bc4361db0d samples: net: cloud: tagoio_http_post: Fix sample name
The current name Socket TagoIO HTTP Client still refering to directory
samples/net/sockets.  Rename to TagoIO IoT Cloud HTTP Sample to reflect
better the application sample intention.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-24 23:41:25 -05:00
Gerson Fernando Budke
822070d8c6 samples: net: cloud: tagoio_http_post: Force pinmux config
There are some hardware combinations (board/shields) that report the
error undefined initialization levels used at link phase.  Add pinmux
Kconfig at project configuration to fix the issue.

Fixes #30029.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-24 23:41:25 -05:00
Jukka Rissanen
533aaed7a0 samples: net: echo-server: Print receive statistics periodically
Print receive statistics of how many KiB we receive / sec.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-24 15:02:45 +02:00
Alexander Kozhinov
e35e8913f9 samples: net: civetweb: Refractor code structure
move all CivetWeb samples to one directory
add directory with CivetWeb common includes
update cmake files
move civetweb sample folder to samples/net

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-11-24 12:59:00 +02:00
Maureen Helm
17695ce9d9 samples: tracing: Extend the SystemView configuration to more platforms
Extends the Segger SystemView configuration for the tracing sample to
more platforms that support Segger RTT, not just nrf52840dk_nrf52840.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-20 12:54:09 -06:00
Maureen Helm
ca6ed09e2b samples: tracing: Extract SystemView configuration into separate file
Extracts the Segger SystemView configuration for the tracing sample from
sample.yaml into a separate file. Increases the idle thread stack size
to fix overflows observed on i.MX RT boards. Removes
CONFIG_USE_SEGGER_RTT=y which is selected by CONFIG_SEGGER_SYSTEMVIEW.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-20 12:54:09 -06:00
Jukka Rissanen
e8472f941a samples: net: dumb_http_server_mt: Fix the OK/FAIL status check
The test script http-get-file-test.sh will send a POST to inform
whether the test was ok or not. This is needed so that we can
test the TLS functionality properly, earlier use of netcat would
not do TLS handshakes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen
c5ac79c91b samples: net: coap-server: Use IPv4 instead of IPv6
The Docker tests expect IPv4 so use that only in the coap-server.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen
725a65afec samples: net: echo-client: Fix the return code in Docker tests
The pass/fail return code was not returned to the caller in
Docker based testing so the runner script did not know if the
sample test passed or not.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen
b751740bfa samples: net: mqtt: Fix the return code in Docker tests
The pass/fail return code was not returned to the caller in
Docker based testing so the runner script did not know if the
sample test passed or not.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen
d1901d6a2f net: scripts: Make test runner script fully generic
Move actual test cases from the run-sample-tests.sh script to
the network samples directory that are supported by Docker based
testing. Each network sample directory that supports Docker testing,
will contain docker-test.sh script that is sourced by the runner
script. The docker-test.sh script will run the test as needed and
then return return value to the runner script.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 16:07:59 +02:00
Jukka Rissanen
6e54f5462c samples: net: Adjust the thread priorities
If networking pre-emptive thread priorities are enabled,
then use the proper macro to enable them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-20 12:57:29 +02:00
Tomasz Wojno
a43db40da3 Samples: Fix printf in MPU6050 example
Removed whitespaces in format specifiers.

Signed-off-by: Tomasz Wojno <tomek.wojno@gmail.com>
2020-11-19 12:37:30 -05:00
Shihao Shen
90f0a1d6af samples: drivers: add platform filtering for led pwm
The sanity check on this sample gives timeout failure
on reel board because of bad filtering. Because the
sample does not adopt ztest framework, sanitycheck in
our daily test will report this as failure, which lowers
our passrate but this is not a sample with errors.

Signed-off-by: Shihao Shen <shihao.shen@intel.com>
2020-11-19 12:36:03 +01:00
Markus Becker
638b5f389f net: openthread: OpenThread RCP mode integration into Zephyr
* Add RCP library.
* Conditionally remove non required libraries not required for RCP.
* Drop :option: marker for CONFIG_OPENTHREAD_NCP_SPINEL_ON_UART_ACM

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-11-19 12:34:14 +01:00
Yestin Sun
f6b9edf85c samples: sensor: add sample application for lsm6dso
Add sample application for sensor lsm6dso. This sample has been
tested on stm32l562e_dk board, where lsm6dso is connect to I2C bus.

Signed-off-by: Yestin Sun <sunyi0804@gmail.com>
2020-11-18 14:33:52 -05:00
Martin Åberg
a5fd0d5c0b samples: tracing: use TEST_EXTRA_STACKSIZE
Take TEST_EXTRA_STACKSIZE into account when sizing the stack for the
tracing sample tasks.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-18 10:31:26 +01:00
Henrik Brix Andersen
b54677b289 samples: drivers: counter: alarm: add support for the Xilinx AXI Timer
Add support for the Xilinx AXI Timer IP to the counter alarm sample.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-11-17 19:30:20 -05:00
Maureen Helm
3452ecba57 samples: sensor: Enable fxos8700 magnetic vector magnitude function
Enables the magnetic vector magnitude function in the fxos8700 sensor
sample application to ensure it builds in CI.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-17 16:51:50 -05:00
Maureen Helm
cb98e9aa11 drivers: sensor: Convert fxos8700 power mode Kconfigs to dts property
Converts fxos8700 power mode options (normal, low noise low power, high
resolution, low power) from Kconfigs to an optional device tree
property.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-17 16:51:50 -05:00
Gerson Fernando Budke
bfd0f16e0c samples: drivers: at45: Refactor to allow any board
The sample is currently to tied to nrf9160dk_nrf9160 board.  Refact to
allow build with board and select between device power management on or
off.  Move nrf9160dk_nrf9160.overlay to proper boards directory and add
nrf9160dk_nrf9160.conf to set the correct device.  Device PM needs SYS
PM be implemented and is an specific configuration and for those boards
that have it implemented user can add overlay-pm.conf to enable the
feature.

Fixes #28094.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-17 16:44:03 -05:00
Martin Jäger
0d64d6668d samples: boards: pine64_pinetime: add sample.yaml
This adds the board to CI so that compile issues will be detected in
the future.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-11-17 16:37:28 -05:00
Martin Jäger
87caab43fc samples: boards: pine64_pinetime: Fix main.c
Constify device pointer and remove legacy int types to make it compile.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-11-17 16:37:28 -05:00
Peter Bigot
56048bb500 samples: add FP formatting to all samples that require it
Samples that include floating-point format specifications may need
cbprintf FP support.  Make sure it's available.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-17 14:44:59 -06:00
Martí Bolívar
8ea9941fe3 samples: led_ws2812: force SPIM on nRF52-DK
The WS2812 SPI driver needs the pixel data to be clocked out on time,
with no gaps between SPI frames. This makes the nordic,nrf-spi
compatible unsuitable for use, since the corresponding driver doesn't
use EasyDMA to clock out the tx buffers.

Force the arduino_spi node in the DT to SPIM mode by setting its
compatible to nordic,nrf-spim. On nRF52832, this driver is disabled by
default due to Product Anomaly Notice (PAN) 58.

We happen to not be affected by PAN 58 in this instance, because we
never read data over the SPIM, only write it. So it's safe to enable
the SPIM driver. This requires a board-specific Kconfig fragment for
nRF52-DK to enable CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58.

Fixes: #29877
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-11-17 10:24:33 -06:00
Øyvind Rønningstad
a28da5118d tfm: Configure TFM via Kconfig instead of Cmake
Add Kconfig options that will be used by the module
to call the function with the desired parameters.
Refactor the tfm_integration samples and
the supported boards.

Update west.yml to bring in Cmake changes that use the new KConfigs.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-11-17 14:39:52 +02:00
Jukka Rissanen
c75fc93f29 samples: net: dumb_http_server_mt: Add connection mgr support
Start the listeners after the "connected" event from connection
manager has been received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
eaebfd9a91 samples: net: dumb_http_server_mt: Quit if client says so
If the client sends OK or FAIL, then it means that we are run
under a test system and we should stop running and exit so that
the test runner (scripts/net/run-sample-tests.sh) can report
success or failure.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
f0edf73809 samples: net: dumb_http_server_mt: Add support for large file
If user sets CONFIG_NET_SAMPLE_SERVE_LARGE_FILE then the sample
will return 100KB file. By default 2KB file is returned.
This is used by the Docker based testing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
b31f1e3dc7 samples: net: gptp: Add support for running the sample X seconds
This feature is used by scripts/net/run-sample-tests.sh script
which connects the Zephyr gPTP sample to Linux gPTP daemon running
on a Docker container.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:15:37 +02:00
Hubert Miś
9ec8aec794 samples: boards: nrf: ieee802154: New serialization sample
A new sample exposing IEEE 802.15.4 radio controller using serialization
over IPM drivers.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2020-11-17 09:56:25 +01:00
Øyvind Rønningstad
cb3ec9d759 Kconfig.tfm: Improvements and fixes
Make it easier to add TF-M in an app by selecting and implying the
necessary configs so the app doesn't have to specify the configs itself.
Remove unneeded configs from the prj.conf files in the tfm samples.

Also, fix case in key file name.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-11-13 21:23:57 +02:00
Steven Daglish
698b0a652e sample: sensor: mcp9808: add nucleo-l031k6 overlay to samples
The Nucleo-L031K6 development board has been tested with the MCP9808
sample code and works as expected.

Signed-off-by: Steven Daglish <s.c.daglish@gmail.com>
2020-11-13 10:01:06 -06:00
Ioannis Glaropoulos
4d536647e1 samples: tfm_integration: support TF-M samples on nRF5340 DK
Add support for nRF5340 DK in the TF-M integration
samples (nrf5340dk_nrf5340_cpuappns build target).
Add the required DTS overlays needed for the samples
to build and run successfully.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-11-13 16:09:04 +01:00
Jukka Rissanen
8ab3dc256c samples: net: http_client: Allow Docker based testing
Add support for CONFIG_NET_SAMPLE_SEND_ITERATIONS option so that
this sample can be run multiple times against HTTP(s) server
that is running inside a Docker container.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-13 07:25:27 -05:00
Stephane Dorre
83b77bd52c samples: Adapt Pinetime sample program
Adopt latest Zephyr syntax
Improve project configuration
Improve sample code

Signed-off-by: Stephane Dorre <stephane.dorre@gmail.com>
2020-11-11 13:28:11 +01:00
Rafa Couto
ce9947c243 boards: pinetime_devkit0 basic sample.
Basic sample program that uses the one led and button from the Pinetime.
Led will turn on everytime the button is pushed.

Signed-off-by: Rafa Couto <caligari@treboada.net>
2020-11-11 13:28:11 +01:00
Brian Bradley
77be47c2fc samples: add support for shell management in mcumgr sample
The shell management feature must be enabled using the provided overlay

Signed-off-by: Brian Bradley <brian.bradley.p@gmail.com>
2020-11-11 13:17:02 +01:00
Henrik Brix Andersen
df51a8a5c7 samples: canbus: canopen: add configuration for devices with no storage
Add CANopen sample configuration file for devices with no
storage/settings support.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-11-10 15:44:25 -06:00
Andrzej Głąbek
be02edb050 drivers/flash/nrf_qspi_nor: Add support for nRF53 Series SoCs
Improve the way the nrf_qspi_nor driver configures the SCK frequency,
to properly support QSPI also on nRF53 Series SoCs that use a different
base clock frequency (96 MHz).
Add also a relevant configuration in the spi_flash sample so that it
can run on the nRF5340 DK.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-11-10 21:01:37 +02:00
Kumar Gala
5e97d779bb device: convert DEVICE_INIT to DEVICE_DEFINE or SYS_DEVICE_DEFINE
Convert handful of users of DEVICE_INIT to DEVICE_DEFINE or
SYS_DEVICE_DEFINE to allow deprecation of DEVICE_INIT.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-11-10 08:38:09 -06:00
Alexander Kozhinov
7f0d5ba652 samples: net: sockets: README.rst
change ip addresses

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-11-10 16:24:53 +02:00
Alexander Kozhinov
a2ca3b5ef5 samples: net: civetweb: prj.conf
change IP addresses

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-11-10 16:24:53 +02:00
Jordan Yates
daa783ae1a samples: Bluetooth: use indication destroy cb
Update the `peripheral` and `peripheral_ht` samples to use the
indication `destroy` callback to determine when the indication has
completed, instead of using the value callback of the first active
connection.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Jordan Yates
ffab099eb9 Bluetooth: add destroy callback to indication
Adds a `destroy` callback to the `struct bt_gatt_indicate_params` which
is used to signify to the application that the indication operation has
completed and the struct instance can be freed/destroyed.

This is required as the number of indication value callbacks that will
be triggered is not known by the caller when the `conn` parameter is
`NULL`.

Tracking when this callback should be run is mananged by a private
reference counter inside the struct.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Jordan Yates
170f17e0e7 Bluetooth: indication callback signature update
Update the signature of the `bt_gatt_indicate_func_t` callback type by
replacing the attr pointer with a pointer to the
`bt_gatt_indicate_params` struct that was used to start the indication.

This allows the callback to free the `bt_gatt_indicate_params` instance
if it was allocated from storage, while still allowing the
`bt_gatt_attr` value to be accessed through `params->attr`.

Allocating the `bt_gatt_indicate_params` instance from storage is
desirable as multiple indications can be queued, however each instance
must be valid until the callback is run.

Implements API update from #29357

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-11-10 11:21:46 +01:00
Christopher Friedt
0fc80cf79f net: dns: enable dns service discovery for mdns responder
This change enables support for DNS service discovery
(RFC 6763) in the mdns_responder service and sample app.

Fixes #29429

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-11-09 16:15:02 -08:00
Maksim Masalski
b2bd0a0608 samples: add capture output for the mec15xxevb_assy6853 pm sample
To make it runnable in the sanitycheck necessary to add
capture output, because that sample runs infinite period of time
and can not finished by itself. To avoid timeout error
in the sanitycheck I added capture output for a several times.
Also added one more tag to describe that it is a power
management sample.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-11-09 16:08:04 -06:00
Nicolas Royer
86c5cf18db samples: userspace: syscall_perf
The goal of this sample application is to measure the performance loss
when a user thread has to go through a system call compared to a
supervisor thread that calls the function directly.

Signed-off-by: Nicolas Royer <nroyer@baylibre.com>
2020-11-09 15:37:11 -05:00
Alexandre Mergnat
c9a3fca1e4 samples: userspace: hello_world
This sample print a hello world message through a user thread.

Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
2020-11-09 15:37:11 -05:00
Trond Einar Snekvik
ad2fd44d7a Bluetooth: Mesh: Encapsulate feature config
Moves mesh feature configuration to a separate module, deprecating the
bt_mesh_cfg_srv structure. The initial values for the features should
now be enabled through KConfig, where new config entries have been added
for each feature.

This removes the upward dependency on the config server from the core
stack, and makes the config server a pure frontend for the configuration
states, as all spec mandated behavior around the feature states is now
encapsulated.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-09 11:23:34 +02:00
Christopher Friedt
ec0e737b0c drivers: ieee802154: cc13xx_cc26xx: sub-ghz support
This change adds IEEE 802.15.4g (Sub GHz) support for the
cc1352r.

The 2.4 GHz radio and the Sub GHz radio are capable of
operating simultaneously.

Fixes #26315

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-11-09 10:25:24 +02:00
Robert Lubos
7127f0a742 net: lwm2m: Notify the application on network error
Add a simple backoff mechanism between consecutive registration attempts
in case of registration failures. Finally, notify the application in
case the registration failed several times.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-11-06 12:58:14 +01:00
Andrew Boie
7a1a0aac44 x86_64: disable shared_mem test until bugs fixed
re-enabling this test was premature, it still crashes very often
due to two known issues affecting x86 64-bit. Filter out for
every 64-bit x86 platform until those bugs are solved, which
will reduce CI failure noise.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-11-05 09:33:40 -05:00
Gerson Fernando Budke
0d216924d5 samples: net: cloud: Introduce TagoIO IoT cloud http post
Introduce TagoIO IoT Cloud HTTP post client example.  This explorer
Zephyr network resources to demonstrate an end to end application.
The TagoIO allows that any user can test on a easy way Ethernet, WIFI
and Modem (PPP) with BSD sockets.  The example provides overlays to
configure WIFI and Modem.

The application consists an a pseudo temperature sensor that sends
periodically data to TagoIO IoT Cloud platform.  The data can be
visualized on a web browser dashboard, cellphone or tablet.  The
steps to configure TagoIO are described on the example documentation.

Special Variables:
 - CONFIG_TAGOIO_DEVICE_TOKEN   DEVID  token generated by TagoIO
 - CONFIG_TAGOIO_HTTP_WIFI_SSID SSID   when using WIFI
 - CONFIG_TAGOIO_HTTP_WIFI_PSK  PASSWD when using WIFI
 - CONFIG_MODEM_GSM_UART_NAME   UART   label when using MODEM
 - CONFIG_MODEM_GSM_APN         APN    when using MODEM

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-11-04 09:06:23 +02:00
Maureen Helm
1cf89dcdfb boards: samples: Enable fat_fs sdhc sample on mm_swiftio board
Enables the fat_fs sample on the mm_swiftio board by adding a
board-specific Kconfig overlay, and adding sdhc to the list of
board-supported features.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-03 10:35:49 -06:00
Robert Lubos
92d94cb325 samples: net: lwm2m_client: Increase log_strdup buffer count
The sample was producing quite a few `<log_strdup alloc failed>`
warnings when running in default configuration on qemu_x86. Increase the
log_strdup buffer count to prevent that.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-11-03 16:24:21 +01:00
Robert Lubos
7e355bd053 samples: net: lwm2m_client: Update docs with bootstrap information
Add bootstrap section to the documentation, explaining how to configure
the Leshan Demo Bootstrap Server locally and run the sample.

Update the download link for the Leshan Demo Server, according to the
upstream Leshan documentation.

Fix bullet list with Leshan security parameters.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-11-03 16:24:21 +01:00
Robert Lubos
23fb69d0ac samples: net: lwm2m_client: Add bootstrap overlay file
Add overlay-bootstrap.conf which allows to easily configure the sample
to use the bootstrap server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-11-03 16:24:21 +01:00
Gerson Fernando Budke
393201194e samples: net: wifi: Enable inventek es-WIFI shield tests
The es-WIFI driver is used by Inventek's es-WIFI shields. This enables
wifi sample to build all variations to ensures that dependencies are
meet.

Signed-off-by: Gerson Fernando Budke <gerson.budke@atl-electronics.com>
2020-11-03 11:05:43 +01:00
Alexander Kozhinov
a142e7b18c samples: civetweb_websocket_server: init project
initialize this project by adding corresponding project files

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-11-02 20:20:00 +02:00
Ryan Holleran
99530e68e5 samples: sensor: fxos8700: Add frdm_k22f as a compatible platform
The frdm_k22f has the FX0S8700CQ placed. Add the frdm_k22f to the
FXOS8700  sample application.

Signed-off-by: Ryan Holleran <rhollerar@gmail.com>
2020-11-02 10:29:41 -06:00
Henrik Brix Andersen
5803ee1e81 samples: display: cfb_custom_font: add support for ssd1306fb
Add support for the Solomon SSD1306FB device to the CFB custom font
sample.

Convert sample to use DT_LABEL() for obtaining the device label instead
of hardcoding it.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-11-02 09:40:00 +01:00
Emil Obalski
312429be3c usb: samples: Add Extension descriptor to webUSB sample.
WebUSB sample is using BOS descriptor. Because of that
the bcdUSB field of device descriptor is set to 0x0210.
This requires for the BOS descriptor to have LPM support.
LPM support use additional descriptor that the HOST can
read by requesting BOS desc. The descriptor is called
Extension descriptor and is specified in `USB Link Power
Management ECN` document considered a part of USB 2.0
spec.

This patch adds missing part of the BOS descriptor and
fixes issue with webUSB sample not passing i'LPM L1 Suspend
Resume Test' from USB3CV test tool.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-10-30 15:56:13 +01:00
Emil Obalski
7a252b90dc usb: samples: Register BOS capabilities before USB enable.
BOS descriptor capabilities shall be registered before the USB
is enabled.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-10-30 15:56:13 +01:00
Trond Einar Snekvik
bf58c4e3a8 Bluetooth: Mesh: light_vnd sample: Remove button text
Removes text from the readme of the onoff_level_lighting_vnd_app
claiming buttons control the LEDs before provisioning, as it's not
accurate.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-10-29 14:12:05 +02:00
Ehud Naim
c58c8b1257 net: buf: change avail_count variable to atomic type
using CONFIG_NET_BUF_POOL_USAGE monitor avail_count,
this variable should be protect.
Protecting it by using atomic variable

Signed-off-by: Ehud Naim <ehudn@marvell.com>
2020-10-28 18:45:11 +02:00
Simon Guinot
6499ecb179 samples: drivers: add test sample for the PWM LED driver
This sample allows to test the led-pwm driver. The first "pwm-leds"
compatible device instance found in DT is used. For each LEDs attached
to this device (child nodes) the same test pattern (described below) is
executed. The LED API functions are used to control the LEDs.

Test pattern:

For each PWM LEDs (one after the other):

- turn on
- turn off
- increase the brightness gradually up to the maximum level
- blink (0.1 sec on, 0.1 sec off)
- blink (1 sec on, 1 sec off)
- turn off

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2020-10-28 10:44:46 -05:00
Lingao Meng
5374245dd6 Bluetooth: Mesh: split prov.c into two separate modules
Currently all provisioning procedure into common source
files call `prov.c`, that will not compile separately.

Add `BT_MESH_NODE` to control whether nodes are supported
and device provisioning is supported, this will be used in
provisioner role.

Add more provisioner OOB authentication method.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-28 12:53:09 +02:00
Ioannis Glaropoulos
792bec2be8 boards: arm: remove non-existing doc link from partition definitions
In the flash partition definitions for ARM boards,
the link to the legacy partition macros does not
exist any more. The commit cleans up the partition
definition by removing this link.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-27 15:01:19 -04:00
Steve Winslow
4143d79498 samples: smp: pi: Fix path in build instructions
This fixes the documentation instructions for building the SMP Pi
sample program, which incorrectly listed an underscore instead of
a path separator slash.

Signed-off-by: Steve Winslow <steve@swinslow.net>
2020-10-26 17:25:37 +01:00
Jukka Rissanen
c0d636aedf samples: net: echo-server: Set handler thread name
It is useful to see the name of the handler thread for debugging
purposes so set it when starting the handler thread.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-26 11:03:03 -05:00
Andrew Boie
5376d44df7 Revert "samples: shared_mem: exclude qemu_x86_64"
This reverts commit d55a09ff05.

This is no longer necessary. The linked issue is closed.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 12:14:12 +01:00
Andrew Boie
7e9b136aa9 samples: shared_mem: re-use default memory domain
Saves quite a bit of memory on MMU-based systems which manage
page tables at the memory domain level.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 12:14:12 +01:00
Andrew Boie
449278c779 samples: shared_mem: rename domain structures
Names like dom0, dom1, part0, part1, etc., don't tell us
much of anything.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 12:14:12 +01:00
Andrew Boie
495f1cffd5 samples: prod_consumer: re-use default mem domain
Memory domains can be very expensive to instantiate. Demonstrate
how the default memory domain can be re-purposed for an
application, much like how the main thread already is.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-26 12:14:12 +01:00
Siddharth Chandrasekaran
c529b6fa8f mgmt/osdp: Split CP and PD samples into dedicated directories
Split CP and PD samples into dedicated directories as the difference
between the two are expected to grow with time. Also, do some
refactoring.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-10-21 17:36:16 +02:00
Siddharth Chandrasekaran
d6437c1aa1 mgmt/osdp: CP: Unify osdp_cp_send_cmd_*() as osdp_cp_send_command()
Minimize number of exported methods by unifying all osdp_cp_send_cmd_*()
as osdp_cp_send_command().

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-10-21 17:36:16 +02:00
Stephane D'Alu
9ee2aff917 nrf52840_mdk: support qspi flash
Added support for installed MX25R64 QSPI NOR flash.

Signed-off-by: Stephane D'Alu <sdalu@sdalu.com>
2020-10-21 17:34:26 +02:00
Trond Einar Snekvik
686dd43563 Bluetooth: Mesh: Add build of provisioner sample to CI
Adds a test case listing in sample.yaml of the mesh_provisioner sample,
building on qemu and the Nordic nRF51 DK to ensure that the provisioner
role is built in PRs.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-10-21 09:07:43 -04:00
Maksim Masalski
56c02e535d samples: change name for the mec15xxevb_assy6853 pm sample
Power management sample for that board has very
confusing name that should be changed to something
more understandable.
Current name sample.board.sample.board.mec15xxevb_assy6853
I suggest to have new name
sample.board.power_management.mec15xxevb_assy6853

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-10-21 07:58:03 -05:00
Marcin Niestroj
0b7e232c99 samples: lorawan: class_a: fix selection of activation type
LORAWAN_ACT_* should be assigned instead of LORAWAN_CLASS_*. Previously
used LORAWAN_CLASS_A has the same integer value as LORAWAN_ACT_OTAA, but
update code with the latter to use the proper type.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-10-21 08:33:39 -04:00
Parthiban Nallathambi
4db35e0384 sensor: bq27421: fix available platform in README
bq27421 is available only on nrf9160_innblue22

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2020-10-21 08:32:15 -04:00
Patrick K. Moffitt
2e0b86a01b samples: sensor: bme680: Add overlay for adafruit_feather_nrf52840
The overlay file defines an i2c interface for the
Feather nRF52840 Express and the Adafruit BME680.

Also adds the platform to the test build configuration.

Signed-off-by: Patrick K. Moffitt <patrick@moffitt.com>
2020-10-21 06:47:59 -05:00
Jacek Ozimek
81400cd239 samples: sensor: bme280: Add overlay
Add an overlay and test for the Adafruit
Feather M0 Basic Proto.

Signed-off-by: Jacek Ozimek <jacek.ozmk@gmail.com>
2020-10-21 06:46:52 -05:00
Jukka Rissanen
e2f13276cd samples: net: gsm: Add suspend/resume shell commands
Add commands to suspend or resume the GSM modem. These commands
might not be enough as at least the SIMCOM 808 modem requires
that the modem is reset when it is resumed, and this application
does not do any reset atm.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-10-21 00:08:39 +03:00
Ioannis Glaropoulos
966015f503 samples: tfm_integration: tfm_ipc: add nucleo_l552ze_q_ns to the list
Add nucleo_l552ze_q_ns board to the allowed list of platforms
for the tfm_ipc sample. This allows the sample to be built for
the nucleo_l552ze_q_ns platform by sanity check.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
a19fbca4aa samples: tfm_integration: psa_level_1: fix sample name in .yaml
Fix the name of the sample in the .yaml file so it matches
the sample directory, and does not collide with tfm_ipc.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
7fdea78d75 samples: tfm_integration: fix requirements for building TFM binaries
In the samples' documentation we update the requirements
for building TF-M binaries according to the latest upstream
TF-M documentation.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
a814f47c0c samples: tfm_integration: fix build & flash guides for all platforms
Add documentation on how to build and run the TF-M integration
samples on nRF platforms.

The arm-none-eabi-gcc does not need to be on the PATH anymore
for building and running the tfm_ipc sample on nucleo so remove
the note from the sample docs.

Fix some paths for TFM binaries for the LPC board as well.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
5e4902d505 samples: tfm_integration: tfm_ipc: adapt nucleo_l552ze_q_ns overlay
This commit adapts the DTS overlay for nucleo_l552ze_q_ns
board, to comply with the changes applied in the flash
layout of the TF-M build.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
7e82dba130 samples: tfm_integration: adapt CMakeLists.txt to new TF-M build system
Changes required in TF-M integration samples CMakeLists.txt
files due to the new upstream TF-M build system. In brief,
configuration related to PSA API (IPC), Regression, and
Isolation level needs to be passed, now, directly, not
via invoking a given TF-M CMake configuration.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
eea78b1ea9 boards: arm: Add support for TF-M in nRF9160 DK
Adding support for TF-M in the Nordic nRF9160 DK.
Allow the TF-M integration samples to be built and
executed for nRF9160 DK.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
e2dc8982be boards: arm: Add support for TF-M in nRF5340 PDK
Adding support for TF-M in the Nordic nRF5340
Application MCU.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Ioannis Glaropoulos
c9fd62a2ea boards: arm: update board definitions due to new TF-M build system
TF-M related information in the relevant board definitions
needs to be updated in the wake of the new TF-M Build
system.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-10-19 21:08:34 +02:00
Anas Nashif
ad8caa65e8 samples: synchronisation: run thread_b on cpu 0 in SMP mode
Always run thread_b on CPU 0 by setting cpu_mask if on SMP system.

Run this with CONFIG_SCHED_CPU_MASK=y set on an SMP system.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-19 10:57:15 -04:00
Anas Nashif
c916411239 samples: synchronization: show cpu
Show which CPU were are running on systems with SMP enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-19 10:57:15 -04:00
Peter Bigot
260b327d2f samples: bluetooth: display source address in beacon console output
Users testing beacon capability will likely want to see the beacons in
a sniffer tool.  Switch to an advertising mode that uses a persistent
known address, and display that address on the console output.

This also demonstrates techniques to retrieve the advertising address
where one is known.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-10-15 22:22:16 +03:00
Armando Visconti
d5c5a59e6e samples/shields: x_nucleo_iks01a2: Add shub mode sample
The x_nucleo_iks01a2 shield supports both standard (Mode 1) and
sensorhub (Mode 2) modes through proper dip switch selection.
For more information please refer to:
 https://www.st.com/en/ecosystems/x-nucleo-iks01a2.html

This commit moves the original (Mode 1) support under 'standard'
directory and adds the Mode 2 support into 'sensorhub' directory.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-10-14 08:41:41 -05:00
Martí Bolívar
8165008f44 dts: remove legacy macro support
The legacy macros were first deprecated in Zephyr v2.3. Now that
Zephyr v2.4 has been released, that makes two releases where these
macros have been deprecated, so it's OK to remove them.

This leaves support for legacy binding syntax in place. Removing that
is left to future work.

We need to update various pieces of documentation related to flash
partitions that never got updated when the new API was introduced.
Consolidate this information in the flash_map.h API reference page,
since that's really where users will run into it. This also gives us
the opportunity to improve this documentation.

Adjust a couple of kconfigfunctions.py and sanitycheck bits to use
non-legacy edtlib APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-09 08:45:38 -05:00
Armand Ciejak
ac31c4e458 eth: mcux: Get rid of CONFIG_ETH_MCUX_*
Use node's status in device tree instead.

Signed-off-by: Armand Ciejak <armand@riedonetworks.com>
2020-10-09 11:50:50 +02:00
Jakub Rzeszutko
f812e9463d shell: shell example update
Updating shell example to present usage of dictionary commands.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2020-10-08 10:12:25 -04:00
Manivannan Sadhasivam
0ea457e0dc samples: lorawan: Add Class-A LoRaWAN sample application
This sample application shows how to configure an end node in Class-A
mode and to send data to network server via gateway.

Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
2020-10-08 12:15:38 +02:00
Paul Sokolovsky
71baf21d51 samples: sockets: big_http_download: Increase stack size to 2.5K.
Testing the sample with Zephyr SDK 1.14 (vs 1.13) with qemu_x86
showed that it consistently crashes on 2th-4th iteration. Avoid
bite-sized increase this time, and dump stack considerably to
avoid constant need to update it.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-10-07 13:08:44 +03:00
Robert Lubos
f7a5638871 net: lwm2m: Make bootstrap optional
Currently, after `CONFIG_LWM2M_RD_CLIENT_SUPPORT_BOOTSTRAP` is enabled,
the LwM2M engine will initiate bootstrap procedure on each run. This
approach limits the flexibility of the application, as it's not always
necessary to go over the bootstrap procedure (for instance, the
application may decide to store the security object obtained during the
bootstrap in flash, and restore it on boot).

Fix this by introducing an additional `flags` parameter to the
`lwm2m_rd_client_start()` function, which provides information whether
to run bootstrap in the current session or not.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-10-06 12:01:13 +03:00
Emil Obalski
c96cbde8c5 usb: mass: Fix main thread stack size overflow.
After HW stack protection option was globally enabled for
nRF SoCs turned out main stack size is too small for
USB mass storage sample. Increase to avoid overflow.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-10-05 14:53:32 -05:00
Kumar Gala
8ddd7f0f23 drivers: sensors: itds: Remove dts defaults
We should not be using defaults for enum properties, this should be
required: true instead.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-02 11:46:57 +02:00
Xavier Chapron
824f423e54 misc: Replace assert include and calls by sys/__assert.h equivalent
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-10-02 11:42:40 +02:00
Mulin Chao
be217e4a3a drivers: eSPI: add eSPI driver support for NPCX7 series.
In npcx7 series, all of them support the Intel Enhanced Serial
Peripheral Interface (eSPI) Revision 1.0. This specification provides a
path for migrating host sub-devices via LPC to a lower pin count, higher
bandwidth bus. In addition to Host communication via the peripheral
channel, it provides virtual wires support, out-of-band communication,
and device mastering option over the Chipset SPI flash.

Becisdes introducing eSPI device in npcx7, this CL also includes:

1. Add eSPI device tree declarations.
2. Add npcx7-espi-vws-map.dtsi to present the relationship between eSPI
   Virtual-Wire signals, eSPI registers, and wake-up input sources.
3. Zephyr eSPI api implementation.
4, Add OOB (Out of Band tunneled SMBus) support.
5. Add configuration files for eSPI test suites.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-10-02 11:33:15 +02:00
Kiril Petrov
8100a4a7c8 lwm2m_client: update README.rst to include OpenThread info
Update README.rts to include OpenThread info.

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2020-10-02 09:22:29 +03:00
Kiril Petrov
39231ef490 lwm2m_client: add working config for OpenThread
It's copy of openthread conf from samples/net/sockets/echo_client,
but requires increasing of main stack size to avoid crash.
Also fixes building if CONFIG_LWM2M_DTLS_SUPPORT is enabled #28787.

Signed-off-by: Kiril Petrov <retfie@gmail.com>
2020-10-02 09:22:29 +03:00
Jan Pohanka
c737cca7be net: mqtt: fix sample to use zsock_ functions
Use zsock_ variants of socket functions in mqtt sample application.

Signed-off-by: Jan Pohanka <xhpohanka@gmail.com>
2020-10-01 17:35:45 +03:00
Erwan Gouriou
ee3dab3082 boards: nucleo_l552ze_q_ns: Use dts flash partitioning.
Provide device tree flash partition in order to configure
and flash non secure binary.
Flash partitioning depends on TFM configuration and use case,
so it is provided as an overlay in the sample it is used.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-01 15:43:28 +02:00
Paul Sokolovsky
601e00376b samples: sockets: dumb_http_server: If send() fails, print errno
Helps with debugging TCP stack issues.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-10-01 15:46:51 +03:00
Alexander Kozhinov
c28ffbb2eb samples: net: civetweb: reduce RAM usage
adjust configuration so that civetweb uses less memory
fixes #21179

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-09-30 14:32:58 +03:00
Gerard Marull-Paretas
cd68e5819f drivers: display: ili9340: remove old hardcoded configurations
Remove Adafruit/Seeed TFT hardcoded settings. Note that undocumented
ILI9340/1 settings have been removed (maybe Seeed is using another ILI
variant?).

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-29 14:18:05 -05:00
Jakub Rzeszutko
005103739c shell: examples cleanup
Remove obsolete include of the shell_uart.h file.
It is sufficient to include the shell.h file.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
2020-09-29 10:48:47 +02:00
Daniel Leung
e37f819da7 samples: cmsis_rtos_v1: philosophers: skip up_squared
The up_squared board suffers the same issue as qemu_x86_64
where a bigger stack is needed but CMSIS has a limit on
how big the stack can be. This results in stack overflow.

So exclude up_squared in samples.yaml.

Fixes #28552

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-24 13:20:32 -05:00
Alexander Kozhinov
594e780756 samples: hello_world: cmake warning
fixes following cmake warning:
CMake Warning at ../../kernel/CMakeLists.txt:54 (message):
  Single threaded mode (CONFIG_MULTITHREADING=n) is deprecated

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-09-24 07:25:47 -04:00
Carles Cufi
28cb9dab64 kernel: Deprecate CONFIG_MULTITHREADING
Deprecate the Kconfig option for the time being. Unless a contributor
volunteers to take over the work to maintain the option, it will be
removed after 2 releases.

Relates to #27415.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-23 15:50:32 -05:00
Gerson Fernando Budke
5576432cd3 samples: net: echo_server: Decrease buffer for atsamr21_xpro
From 2.3 to 2.4 the net samples pair echo-server/client increase the
SRAM requirements. Since CI doesn't build all combinations, (even for
a release like 2.4.0-rc1) the problem was detected only now.  Decrease
buffers for atsamr21_xpro on both echo_server/client sample pair.

Fixes #28341.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-09-22 16:15:10 -05:00
Anas Nashif
2718a23781 samples: synchronisation: handle empty thread name
In some cases we were returning empty thread names, so make sure we
check for the thread names correctly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Anas Nashif
74576a0515 samples: tracing: print out useful information
Instead if printing the line number, output the context (thread,
semaphore, mutex, ..) and the ID of the event where applicable.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-20 21:27:55 -04:00
Daniel Leung
4a9ee68e12 samples: basic/minimal: disable memory pool when MT=n
This adds the option to disable kernel memory pool when
multithreading is also not enabled. This saves some
code space.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-19 05:49:13 -04:00
Maureen Helm
ef908a2b91 samples: subsys: Add sdhc fixture to fat_fs sample
Adds a fixture to the fat_fs sample so it only runs on boards that have
an sdhc card inserted.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-18 14:39:46 -05:00
Maksim Masalski
f08f9d6410 samples: exclude mec15xxevb_assy6853 in espi sample when sanitycheck
ESPI is supported in MEC15 chips but similar to PECI, I2C, eSPI bus
testing requires another device to act as eSPI host.
While this sample can be run in EVB the HW connection to a eSPI host
(Intel RVP) is not documented/supported.

Mark as not supported in that HW only in Modular card
(which setup is documented)

Also remove duplicate definition of the "depends_on: espi"
in the end of the sample.yaml file

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-09-17 16:13:51 -05:00
Anas Nashif
2164a7d0dc samples: display: add fixture
Add fixture so this test only runs on devices that have a display
connected.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-17 07:10:03 -04:00
Emil Obalski
464d9130d5 samples: mgmr: smp_svr: Build samples in CI.
This commit allows the CI to build the samples for nRF devices.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-17 10:56:57 +02:00
Emil Obalski
6a56710aae samples: mgmt: smp_svr: Add Serial over USB CDC_ACM overlay.
This patch adds overlay for USB serial backend over CDC_ACM
device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-17 10:56:57 +02:00
Ryan Erickson
1faeab4d54 boards: add Pinnacle 100 DVK
Add Laird Connectivity Pinnacle 100 modem.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Peter Bigot
6186b65555 samples: sensor: lps22hh: replace platform filter with fixture
Remove reference to a specific board, since that board doesn't have
this sensor.

Add a dependency on presence of a devicetree node that will be
required to build the driver.

Add a fixture that identifies the specific sensor required to run the
sample.  This should be added as a side effect of specifying the
shield (though this is not currently done, it must be added in the
device description).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 09:05:41 -04:00
Anas Nashif
4fa08decc1 tests: usb: add fixture requirement
The test for this sample requires a usb connection to a secondary port,
output is not captured on the default usb port.

Fixes #28154

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-14 18:37:17 -05:00
Eug Krashtan
36128bde19 samples: net: sockets: Fix for multicast filtering
After adding 'Multicast group filtering' (commit b7b73d0) server should
join CoAP IPv6 multicast group to accept multicast CoAP messages.

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-09-14 10:27:50 +03:00
Henrik Brix Andersen
2ddb80da58 samples: canbus: canopen: fix argument to CO_delete()
The CANopenNode stack function CO_delete() takes a void
*CANdriverState argument. This maps to a pointer to a struct
canopen_context in Zephyr.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-09-10 16:14:06 -05:00
Anas Nashif
994374ec51 samples: shell: fs: require keyboard harness
The test for this sample requires special setup and keyboard
interactivity.

Fixes #28153

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-10 15:55:02 -05:00
Paul Sokolovsky
e11eff7c8f samples: net: echo*: Increase stack size
Increase stack size to 1200 for echo and echo_async sample apps
(following a similar increase done to echo_async_select previously).
With default stack size, the apps no longer run (crash QEMU) with
Zephyr 2.4-pre.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-09-09 09:53:22 -04:00
Robert Lubos
a6eb556941 samples: net: mqtt: Increase connect timeout
The default timeout used (500 ms) turns out to be too small for certain
servers (test.mosquitto.org), rendering it impossible to connect (the
TCP connection was closed before the actual Connect ACK response
arrived). Increase the connect timeout to cover this case.

Fixes #28181

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-09 15:46:24 +03:00
Robert Lubos
c18f15f694 net: mqtt: Remove unused defines from the sample and tests
APP_TX_RX_TIMEOUT and APP_NET_INIT_TIMEOUT were not used in any way
in the sample and test apps.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-09 15:46:24 +03:00
Emil Obalski
ced6e606b2 usb: intel: Fix the sample, update to recent API change.
HID API has changed and now all usb HID callbacks require
pointer to device as a first parameter. This patch is fixing
regression issue.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-09 08:26:19 -04:00
Maksim Masalski
d7468bf836 samples: Add fixtures for samples interacting with keyboard and mouse
Two samples require interacting with keyboard and mouse, and that
means necessary to provide correct fixture before run of that samples
in sanitycheck system. To skip or run the sample according to the
provided fixture in map-file necessary to add fixture definitions
into sample.yaml files

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-09-08 17:24:38 -04:00
Peter Bigot
fb151e81ec samples: shell: fs: fix partition reg
A change to the previous partition resulted in the unit address being
inconsistent with the reg property.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-08 14:05:23 +02:00
Richard Osterloh
e917c6c0bc samples: sensor: Add VCNL4040 sample
Add sample to show usage of VCNL4040 sensor driver

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-09-04 13:03:12 -05:00
Andrei Gansari
217560d8e1 samples: tfm_integration: BL2 configurable
Make BL2 configurable via Kconfig.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari
b8b31f9a76 samples: tfm_integration: lpc55s69 support
Adds documentation on how to run TFM samples on LPCxpresso55S69 board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Andrei Gansari
097125f469 samples: tfm_integration: BL2 configuration
Configure build variable BL2 depending on board configuration. BL2 is
set to True by default. BL2 enabled building TFM with MCUboot.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-09-04 10:36:42 -05:00
Gerson Fernando Budke
7b8643e373 samples: net: updatehub: Increase shell stack
When running shell commands updatehub alloc data from shell stack.
Increase shell room stack to avoid shell issues.  Memory tuning
should be performed accord with available resources.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-09-04 17:32:29 +02:00
Kamil Piszczek
391730891b samples: bluetooth: adding peripheral_ots sample
Added a Bluetooth Peripheral sample that demonstrates how to use
GATT Object Transfer Service.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-09-04 17:06:17 +02:00
Alexander Falb
402a352279 tests/samples: add samples for Serpente board
Add the supported features section to  serpente.yaml and overlay files
to the corresponding tests and samples.

Signed-off-by: Alexander Falb <fal3xx@gmail.com>
2020-09-04 09:25:02 -05:00
Emil Gydesen
9c5db74a6e Bluetooth: Remove _gatt_ infix for Device Information Service (DIS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Emil Gydesen
8d7b5ebd7a Bluetooth: Remove _gatt_ infix for Heart Rate Service (HRS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Emil Gydesen
b4a8229db6 Bluetooth: Remove _gatt_ infix for Battery Service (BAS)
The _gatt_ infix was determined to be unnecessary as
GATT is implied by it being a Bluetooth service.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2020-09-04 15:38:44 +02:00
Peter Bigot
1d026703c4 samples: posix: gettimeofday: incorporate libc time API tests
Use time(), localtime_r(), and asctime() to confirm that the
declarations required for these (newlib) libc functions are made
available in CONFIG_POSIX context.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-04 14:46:43 +02:00
Emil Obalski
0d8bd579a5 usb: hid: All hid_ops callbacks get device pointer.
This commit extends USB hid API callbacks by adding
'const struct device *dev' parameter. If the application
configured more than one HID device then it must specify
separate hid_ops for each device as its unable to determine
for which device the callback was called.

This patch makes it possible to have only one hid_ops within
the application and the application is aware for which device
the callback was called because of explicit device pointer.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-04 12:27:44 +02:00
Marin Jurjevic
d3f21af047 samples: drivers: Update sample overlay with sector size values
Updated overlay file for spi_flash_at45 sample on nrf9160 devkit.

Signed-off-by: Marin Jurjevic <marin.jurjevic@hotmail.com>
2020-09-04 11:58:22 +02:00
Siddharth Chandrasekaran
ee99c34fb6 mgmt/osdp: Refactor struct osdp_cmd members for readability
Some of the names used in `struct osdp_cmd` where directly as in the
specification. Initially it appealed to keep them like that but with
time, a little more consistent naming of members helps if you haven't
read the specification document very recently.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran
4c9b0ae928 samples: mgmt/osdp: Add CP Sample
Add a OSDP CP mode sample that sends out a periocic command to a
connected PD. It also demosnstrates key press and card read callback
registration.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran
9aa24d85a2 samples: mgmt/osdp: Scope PD sample for upcoming CP sample
Make changes to PD sample so a CP sample can be added in future along
with it.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Gerard Marull-Paretas
52d2448717 samples: display: lvgl: add information for buydisplay shield
Add information for Buydisplay 2.8" TFT shield on README and add the
shield to tests list.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-03 16:36:50 -05:00
NavinSankar Velliangiri
1007e56c29 sample: mgmt: hawkbit: Add Hawkbit FOTA sample
Hawkbit FOTA sample with polling and Manual mode

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-09-03 22:13:52 +02:00
Emil Obalski
c5b96cce6c usb: samples: audio: Add samples to sanitycheck
Add nrf5340dk_nrf5340_cpuapp platform to build in sanitycheck.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski
0728949948 samples: usb: Audio samples support for nRF53
This patch adds support for USB Audio class samples for
nRF5340dk.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski
d86c43fbb0 samples: usb: Software RNG for nRF53
nRF53 application core does not have RNG peripheral.
Software implementation must be used instead.
This patch adds config overlay for hid-cdc nRF5340 sample.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Martin Jäger
81c7daea5b boards: nucleo_f091rc: Enable DAC driver
Also add this board to DAC driver sample

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-09-03 14:46:03 -05:00
Martin Jäger
7958fe4633 boards: nucleo_g431rb: Enable DAC driver
Also add this board to DAC driver sample

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-09-03 14:46:03 -05:00
Jan Van Winkel
7422a6868a samples: lvgl: ci: Build for native_posix_64
Added, build only, native_posix_64 board to sample.yaml file.
This will cover both compilation of the SDL display driver and
kscan driver.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-09-03 14:07:15 -04:00
Jennifer Williams
e7eb428b01 samples: add missing sample.yaml files
Some samples were without sample.yaml. This adds
them.

Fixes #27813

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-09-03 09:49:28 -04:00
Krzysztof Chruscinski
0617e1aebd samples: bluetooth: hci_uart: Improve RX path
Receiver part reworked to not block in interrupt and rely on assumption
that uart_fifo_read is capable of reading incoming data from the HW.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-03 10:45:43 +02:00
Robert Lubos
b700c2a0ba samples: net: sockets: Increase FD count for TLS echo samples
Given that TLS/DTLS socket now creates an underlying TCP/UDP socket, the
FD consumption is increased in echo_client and echo_server.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-09-03 11:00:01 +03:00
Flavio Ceolin
179e184e30 samples: debug: Add a simple gdbstub sample
Sample example built with gdbstub enabled. Two serials are used, one for
normal output and another one that is used talk with gdb in the host
machine.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00
Henrik Brix Andersen
aab95f09f2 samples: drivers: spi_flash: add support for arty_a7_arm_designstart_m3
Add support for running the JEDEC SPI NOR flash sample on the ARM
Cortex-M3 DesignStart FPGA reference implementation.

Special care is needed to avoid overwriting part of the FPGA
configuration bitstream, which is stored in the onboard QSPI flash.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-09-02 15:02:03 +02:00
Tomasz Bursztyka
9a0fe24ae9 samples: Fix device instance const qualifier loss
Keep the device pointer locally.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Tomasz Bursztyka
8d0a3f3b5c subsys: canopen: Add a wrapper to avoid passing device to CO_init
Add a dedicated structure instead.

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Tomasz Bursztyka
e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Gerard Marull-Paretas
c8cca16c20 samples: subsys: usb: mass: add support for Adafruit feather nRF52840
Add configuration and overlay files for Adafruit feather nRF52840.
README has also been updated and improved. Documentation related to
littlefs has been moved to an independent section as it could apply to
any sample.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-02 11:36:22 +02:00
Anas Nashif
ec1a8377ab samples: intel_s1000: fix timeout variable
Fix timeout vairable on sample that was missed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-01 21:25:52 -04:00
Krzysztof Chruscinski
c2122313c3 samples: bluetooth: hci_uart: Improve TX path
Improved TX path to use uart_fifo_fill instead of uart_poll_out

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-09-01 13:57:27 +02:00
Fabio Utzig
53fd5ff236 doc: update function references to use :c:func:
Following the change to use the C domain for parsing, update all
existing :cpp:func: references to :c:func:. Remove the parentheses as
well, if used, because they are not needed, this is already known to be
a function, and how it is displayed in the documentation later is a
semantic decision done by the output builder.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Trond Einar Snekvik
db0e559b74 Bluetooth: Mesh: Reduce microbit memory consumption
Trims the default memory configuration for the BBC Microbit in mesh
samples to ensure that it fits.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-08-30 17:09:59 +03:00
Jose Alberto Meza
e3eb9bedec samples: drivers: espi: Showcase how to handle lenghty boot initializations
Add sample where a fictious lenghty operation is required before a more
elaborate handshake is perform with eSPI master.
This requires sending SLAVE_BOOT_DONE virtual wire explicitly.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-08-30 08:22:11 -04:00
Jukka Rissanen
d8b0c28072 samples: net: mdns_responder: Add IPv4 gateway setting
IPv4 packets might not get routed out if IPv4 gateway is missing
so add it here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-28 17:43:36 +02:00
Jukka Rissanen
781da8d540 samples: net: mdns_responder: Add readme file
A readme file describing the usage was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-28 17:43:36 +02:00
Simon Guinot
53cbe5ff29 samples: drivers: add test sample for TI LP503x LED drivers
This sample controls up to 12 LEDs connected to a LP503x driver.

First, for each LED information is retrieved using the led_get_info
syscall and printed in the log messages. Next, from an infinite loop, a
test pattern (described below) is applied to all the LEDs simultaneously
(using the led_write_channels syscall) and then to each LED one by one
(using the led_set_{brightness,color} syscalls).

Test pattern:

 For each color in red green blue white yellow purple cyan orange:
  - set the color
  - turn on
  - turn off
  - set the brightness gradually to the maximum level
  - turn off

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2020-08-28 15:04:35 +02:00
Peter Bigot
b33cde6c5d samples: mgmt: updatehub: add label directive
This sample was missing a label to place it in generated documentation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-28 12:54:40 +02:00
Peter Bigot
9e6d041b12 samples: scheduler: metairq_dispatch: add label directive
This sample was missing a label to place it in generated documentation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-28 12:54:40 +02:00
Peter Bigot
75f82dc09a samples: fix reStructuredText target directives
Without the leading underscore these are comments.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-28 12:54:40 +02:00
Peter Bigot
e81e88e52e samples: spi_flash: add README
Basic example of basic flash API use when selecting a serial flash
memory.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-27 12:39:43 -04:00
Peter Bigot
77aa89bcb5 drivers: flash: remove W25QXXDV driver
The spi_flash_w25qxxdv driver has been superseded by the generic
spi_nor driver for over a year.  The only non-refactoring change to
the W25Q driver in the last 18 months was done to support a backport
to 1.14.

All devices supported by spi_flash_w25qxxdv driver are expected to be
supported by the spi_nor driver, using the standard `jedec,spi-nor`
devicetree compatible.  No in-tree devicetree files make use of this
driver.

Remove the confusion about which driver to select by removing the
unmaintained redundant driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-27 17:39:21 +02:00
Jeremy LOCHE
15c69a8bbc samples: bluetooth: ipsp: add net config auto init
Add CONFIG_NET_CONFIG_AUTO_INIT=y to enable the bluetooth
device network interface.

Due to #27405 feature PR allowing application to init the network
whenever it wants, IPSP sample stopped initing the
bluetooth network.

The IPSP sample was not updated to enable
CONFIG_NET_CONFIG_AUTO_INIT in prj.conf
and didn't call net_config_init_app(...)
as suggested in the feature PR.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-08-27 15:59:20 +02:00
Peter Bigot
9eedb36b68 samples: fxos8700-hid: remove unnecessary check for flags cell in gpios
Also clean up the devicetree node checking logic.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-27 15:59:03 +02:00
Peter Bigot
0b286d7304 samples: remove unnecessary check for flags cell in gpios
The devicetree helper macro now provides zero when the cell is not
present.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-27 15:59:03 +02:00
Anas Nashif
dca317c730 sanitycheck: inclusive language
change whitelist -> allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-27 07:04:07 -04:00
Nolwenn Violette
fb88b0aafc sample: tfm_ipc: Add nucleo_l552ze_q support
This commit adds the signing commands and the configuration required
to build a non secure image for a nucleo_l552ze_q.

Signed-off-by: Nolwenn Violette <nolwenn.violette01@st.com>
2020-08-27 12:02:16 +02:00
Ryan Erickson
2ce87da252 net: lib: lwm2m: add new sensor objects
Add generic, humidity and pressure sensor objects.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-08-27 11:01:09 +03:00
Jukka Rissanen
0bac136604 samples: net: socket: packet: Add SOCK_DGRAM support
If user has enabled SOCK_DGRAM support for AF_PACKET type, then
use that in the packet sample application instead of SOCK_RAW.
This simplifies the application as we do not need to handle
the Ethernet frame when sending or receiving the packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-27 10:56:06 +03:00
Gerard Marull-Paretas
4f86a9a2d5 lib: gui: lvgl: align all Kconfig object names
Align all Kconfig option names with LVGL names. The followed rule:
LV_(.*) -> CONFIG_LVGL_(.*).

Also replaced LVGL boolean configuration entries using if/else/endif
with direct IS_ENABLED macro.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-08-26 15:32:59 -05:00
Pawel Sagan
132b35c3ad samples: drivers: i2s: Add LiteX I2S sample
This commit adds the LiteX I2S devices usage example with:
 - i2s rx and tx initialization,
 - i2s rx and tx configuration,
 - i2s rx receiving,
 - i2s tx sending.

An application is a simple sound loopback - it allows to connect
a music source and a receiver such as headseat and listen to it.

Signed-off-by: Pawel Sagan <psagan@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2020-08-26 08:17:42 -04:00
Henrik Brix Andersen
01c6862ad7 samples: usb: mass: add usb_device dependency
Make the flash-backed USB mass storage sample depend on usb_device and
flash instead of just flash.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-08-26 12:32:27 +02:00
Henrik Brix Andersen
5210b82bd6 samples: drivers: spi_flash: add support for arty_a7_arm_designstart_m1
Add support for running the JEDEC SPI NOR flash sample on the ARM
Cortex-M1 DesignStart FPGA reference implementation.

Special care is needed to avoid overwriting part of the FPGA
configuration bitstream, which is stored in the onboard QSPI flash.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-08-26 12:32:27 +02:00
Eug Krashtan
c6bb8b191d samples: net: coap: Wildcard sample
Additional resources to illustrate wild card usage.

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-08-26 12:31:00 +02:00
Jamie McCrae
94721b316f samples: sensor: sm351lt: Add new SM351LT sensor sample
Adds sample for SM351LT sensor and outputs to console.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2020-08-25 15:29:00 -05:00
Gerson Fernando Budke
46234a0463 samples: mgmt: updatehub: Fix gen privkey inc
When try build updatehub using overlay-dtls.conf system fail with
cannot create privkey.der.inc file, permission denied.  Add missing
gen_dir cmake definition. Update updatehub sample test config to
run missing dtls build test.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-08-25 16:46:01 +02:00
Joakim Andersson
5880f3d74f Bluetooth: UUID: Use BT_UUID_16_ENCODE to set UUIDs in adv data
Use BT_UUID_16_ENCODE to set UUIDs in advertising data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-25 16:09:22 +03:00
Carles Cufi
65d4e177ca samples: bluetooth: hci_uart: Add a config for the nRF51 dongle
Add both .conf and .overlay files for the nRF51 dongle, which is still
used and was missing configuration files.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-08-25 15:16:11 +03:00
Jose Alberto Meza
b46d1f3cba samples: drivers: espi: Use non-default frequency.
Use non-default frequency 25MHz and Quad mode to ensure
frequency configuration is taking effect.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-08-25 09:32:29 +02:00
Flavio Ceolin
0aaae4a039 guideline: Make explicit fallthrough cases
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-08-24 20:28:47 -04:00
Anas Nashif
390537bf68 tracing: trace mutex/semaphore using dedicated calls
Instead of using generic trace calls, use dedicated functions for
tracing sempahores and mutexes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-24 13:21:12 +02:00
Henrik Brix Andersen
8b94d67dc8 samples: drivers: jesd216: check return value of flash_sfdp_read()
Check the return value of flash_sfdp_read() and print error message if
not successful.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-08-24 11:06:48 +02:00
Peter A. Bigot
ea8432b92e samples: jesd216: update output to reflect recent bug fix
An off-by-one error calculating the number of parameter headers caused
a third table to not be displayed.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:46 -04:00
Peter A. Bigot
c04c40a34e samples: jesd216: fix printf argument to match format
The relative offset will always be small so downcast it to avoid
cross-platform size differences.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-21 13:57:46 -04:00
Jukka Rissanen
3e1491de26 samples: net: echo-client: Add userspace support
Allow echo-client to run in user mode for testing purposes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-21 14:45:35 +03:00
Gerard Marull-Paretas
82e58a0707 boards: arm: adafruit_feather_nrf52840: add support for QSPI flash
Add DT entry for the embedded QSPI NOR flash (GD25Q16) in the Adafruit
nRF52840 feather. Also added support for the spi_flash sample, which has
been used to verify the device.

NOTE: Device seems to fail when using high clock frequencies (e.g.
maximum QSPI frequency). It may be due to PCB layout issues.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-08-19 15:43:57 -05:00
Jukka Rissanen
db2b5dbaf9 samples: net: gptp: native_posix: Set 1ms clock accuracy
Instead of unknown clock accuracy, set it to 1ms for native_posix
boards. This looks better in TSN monitor.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen
acb8956bb7 samples: net: gptp: Enable GM support by default
As we support grand master, enable it by default so things
get tested properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen
fe638d23fc net: native_posix: gptp: Add multiport support
Add gPTP multiport support to native_posix Ethernet driver.
This means that the driver is able to create more than one
network interface and enable gPTP to each of them. This requires
that net-tools is updated as it contains configuration file
for network interfaces in host side.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:47:09 -04:00
Jukka Rissanen
4223a2e685 samples: net: sockets: Create a test for socket offloading
Create a test of socket offloading. Build the test for
cc3220sf_launchxl board.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-19 12:42:40 -04:00
Fabio Utzig
0aaee6dcf5 sample: smp_svr: add shell overlay
Add overlay that includes only the shell transport of mcumgr, without
bringing in BLE as well. This can be used as an alternative for the
serial transport. The `smp_svr` README was updated accordingly.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-19 09:52:21 -04:00
Dominik Ermel
cefebbec39 samples: flash_shell: Fix overwriting return value
Value of ret has been overwritten by flash_write_protection_set
before it could be returned from do_write_unaligned, which could
lead to reporting success when error code should have been returned.

Fixes #27641, Coverity-CID: 212142
Fixes #27642, Coverity-CID: 212143

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-08-19 15:01:50 +02:00
Jose Alberto Meza
459b0df9fb samples: drivers: espi: Convert espi sample to devicetree
Update sample driver test to use dts instead of kconfig.
Fix #22344

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-08-18 14:22:10 -04:00
Ningx Zhao
fa04a4d488 samples: derives/peci can't run at EVB board
Add a tag at sample.yaml to exclude the platform mec15xxevb_assy6853
because of unsupported. Refer github issue #27576.

Signed-off-by: Ningx Zhao <ningx.zhao@intel.com>
2020-08-18 14:20:49 -04:00
Jukka Rissanen
9b9ce0e529 samples: net: socket: packet: Refactor to allow flooding
Create two threads, one for receiving packet socket data and
the other for sending raw Ethernet frames.
Add flood option where it is possible to stress test the IP
stack. Flooding is disabled by default.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-08-18 10:45:27 -04:00
Robert Lubos
4c64429a97 samples: net: Make echo_client/echo_server wait for IP to be ready
The samples shall wait for IPv4/IPv6 to be ready before starting
operation.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-08-18 15:06:17 +03:00
Peter Bigot
e86e6fa769 samples: jesd16: correct interpretation of NPH field
A zero value in the NPH header indicates one parameter header.
Increase the upper bound to process the last provided table.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-18 09:27:30 +02:00
Peter Bigot
bb86e1958c samples: jesd16: fix overlay cs-gpios settings
GPIO CSn active level transitioned from default active-low to
devicetree defined since the last time this sample was verified,
requiring the flags parameter in devicetree to be updated.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-18 09:27:30 +02:00
Peter A. Bigot
506f02e89e samples: drivers: jesd216: support JESD216 API
Demonstrate use of the JESD216 API as a utility to display the
discoverable parameters.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-08-17 13:38:14 -04:00
Christian Taedcke
61415581a5 samples: net: syslog: Add configs for ipv4- and ipv6-only
This checks if the net logger backend compiles if either ipv4 or ipv6 is
enabled.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-08-14 18:51:28 -04:00
Christian Taedcke
29caf10800 samples/drivers/spi_flash: add some efr32 boards
The boards efr32_radio_brd4104a, efr32_radio_brd4250b and
efr32mg_sltb004a have an on-board nor flash. It is already present in
the device tree, only the driver needs to be enabled.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-08-14 10:23:56 -05:00
Kumar Gala
d2b0735c12 build: Fix usage of hardcoded zephyr.{elf,bin,hex}
Its possible to rename the executable we build via the Kconfig symbol
CONFIG_KERNEL_BIN_NAME.  So we really should use ${KERNEL_ELF_NAME},
${KERNEL_BIN_NAME} and ${KERNEL_HEX_NAME} variables instead of hardcoded
zephyr.elf, zephyr.bin, and zephyr.elf.

This fixes an build issue with
tests/misc/test_build/buildsystem.kconfig.utf8_in_values on
up_squared_adsp and lpcxpresso11u68 platforms.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-08-14 13:33:49 +02:00
Emil Obalski
c6f7d87142 samples: openthread: Call usb_enable() by the app.
This commit updates openthread sample to call usb_enable() from
the application.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Emil Obalski
57084f32a1 samples: zperf: usb: Enable USB by the application.
This commit allows let build zperf sample with overlay-netusb.conf.
USB subsystem must be enabled by the application.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Emil Obalski
3758a3d4f9 samples: tracing: Enable USB by the application
usb_enable() must be called by the application.
The application may want to register usb_dc_status_callback
and trace usb status codes (usb_dc_status_code).

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Emil Obalski
80a89ef799 console: usb: Remove obsolete Kconfig option.
This patch removes unused Kconfig option from console
subsystem. If application wants to wait until the console
port is connected, enabled and ready to receive data
it should use uart_line_ctrl_get() API function and
check for DTR flag.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Emil Obalski
b552e60765 samples: usb: Make USB console samples call usb_enable()
usb_enable() must be called once by the application.
The application may want to register usb_dc_status_callback
and trace usb status codes (usb_dc_status_code).

After this patch all pre APPLICATION messages will be dropped
as USB console device is enabled in the application.

Application waits for console device until its ready by checking DTR
flag - uart_line_ctrl_get(). This function could be dropped but then
some log messages that were generated before USB device is ready
could also be dropped.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Siddharth Chandrasekaran
0ae2f2f2f8 samples: mgmt/osdp: Add new OSDP PD sample
This commit adds a PD sample for drivers/osdp. It receives OSDP commands
and prints a message to console.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-08-13 11:48:28 +02:00
Emil Obalski
27f207694c usb: hid: Allow to send data only if CONFIGURED.
USB device shall be able to send only in CONFIGURED state.
Zephyr USB HID device class allows to send the data no matter
of the USB state what is wrong. Attempting to write to endpoint
buffer in state != CONFIGURED may lead to driver error.

This patch introduces state tracing for USB HID class and
allows to send data using hid_int_ep_write() class API
only if the device remains in CONFIGURED state.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:45:31 +02:00
Kumar Gala
d8b2df7338 samples: canbus: isotpfix: Add testing fixture
Add a fixture since we need at least two boards connected for this test
to run correctly w/real hardware.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-08-12 16:07:42 -05:00
Tomasz Bursztyka
98d9b01322 device: Apply driver_api/data attributes rename everywhere
Via coccinelle:

@r_device_driver_api_and_data_1@
struct device *D;
@@
(
D->
-	driver_api
+	api
|
D->
-	driver_data
+	data
)

@r_device_driver_api_and_data_2@
expression E;
@@
(
net_if_get_device(E)->
-	driver_api
+	api
|
net_if_get_device(E)->
-	driver_data
+	data
)

And grep/sed rules for macros:

git grep -rlz 'dev)->driver_data' |
	xargs -0 sed -i 's/dev)->driver_data/dev)->data/g'

git grep -rlz 'dev->driver_data' |
	xargs -0 sed -i 's/dev->driver_data/dev->data/g'

git grep -rlz 'device->driver_data' |
	xargs -0 sed -i 's/device->driver_data/device->data/g'

Fixes #27397

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-08-11 19:30:53 +02:00
Kumar Gala
c5496e8e7b samples: nvs: Do full chip erase when flashing
Add for various flash runners (pyocd, nrfjprog, and dfu-util) to do a
full chip erase.  This is needed for the sample to pass in sanitycheck
on real hardware.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-08-11 09:39:49 -04:00
Alexander Kozhinov
5423b80163 samples: net: sockets: civetweb
change project name to meaningfull one
add board name to system info

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-08-08 22:12:16 -04:00
Marcin Niestroj
aad7e7b512 samples: nrf: onoff_level_lighting_vnd_app: build with mcumgr
There is an additional prj_smp_svr.conf configuration file provided,
which builds an image with mcuboot support. Enable it in sample.yaml,
so sanitycheck can detect build failures in future.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-06 11:54:54 +02:00
Marcin Niestroj
d7d1c4a58f samples: nrf: onoff_level_lighting_vnd_app: fix build with mcumgr
There is an optional mcumgr enabled prj_smp_svr.conf configuration
file. Using it results in following errors:

  .../src/smp_svr.c:12:10: fatal error: mgmt/buf.h: No such file or \
  directory
     12 | #include <mgmt/buf.h>
        |

Fix include paths to keep sample buildable with mcumgr enabled.

Fixes: c200b1c5e6 ("mgmt: Move mcumgr into its own folder")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-06 11:54:54 +02:00
Joakim Andersson
1d66c1e491 Bluetooth: host: Use CONFIG_BT_L2CAP_RX_MTU always to set L2CAP RX MTU
Remove dependency on CONFIG_BT_ACL_FLOW_CONTROL and use
CONFIG_BT_L2CAP_RX_MTU always to set L2CAP RX MTU.
The ATT MTU is set from two different KConfig options depending
on if CONFIG_BT_ACL_FLOW_CONTROL is enabled, which makes it
a confusing option and hard to provide a conf file that
supports multiple board configurations.

This changes the behavior when CONFIG_BT_ACL_FLOW_CONTROL and
CONFIG_BT_BUF_RX_LEN was used to set the L2CAP RX MTU, and by
extension the ATT MTU.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-06 11:46:48 +02:00
Joakim Andersson
6e2ffd28d0 samples: smp_svr: Fix configuration when BT_HCI_ACL_FLOW_CONTROL is on
Fix smp_svr Bluetooth configuration for when BT_HCI_ACL_FLOW_CONTROL
option has been enabled. In this case the CONFIG_BT_L2CAP_RX_MTU
is used instead of CONFIG_BT_RX_BUF_LEN to set the RX MTU.
This lead to a negotiated MTU of 23, which is not supported by
the SMP_SVP protocol.

Removed the board specific configuration files as these are just
duplications of the overlay-bt.conf or overlay-bt-tiny.conf and
the readme specifies how these should be used.

Reduced the TX MTU to end up with the same value as the RX MTU,
CONFIG_BT_RX_BUF_LEN - 4 (HCI ACL header) - 4 (L2CAP header).

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-06 11:46:48 +02:00
Andrei Gansari
66f454acd4 samples: flash_shell: remove obsolete command function
Removes 'flash' command function that displays the command's subset.
Command's subset will still be displayed in current code.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-08-05 15:30:20 -04:00
Andrei Gansari
87eeb64370 samples: flash_shell: print 16 bytes of flash
On large memory areas printing 8 bytes/line is not enough.
Increased printing 16 bytes per line.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-08-05 15:30:20 -04:00
Andrei Gansari
19975af460 samples: flash_shell: unaligned and pattern write
Adds unaligned and pattern write functionality.
The reason this was added is chips with large pages, e.g. 256 can't be
normaly writen via shell, thus the need to write a pattern with any
length to a memory area.
The unaligned write command allows writing a data frament in any place
in memory, the data backup, protection, erasing and writing is
automaticaly handled. This makes it easier to test all flash controller
functionality in one command, also write any persistent data to any
flash address.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-08-05 15:30:20 -04:00
d5e1753eb6 boards: arm: document and enable the DAC for the Arduino Zero
The previous commits added the SAM0 DAC driver.  Now document and
enable it, including enabling it in the DAC sample.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-08-04 16:08:48 -05:00
Corentin Dorothée
37aca482e9 samples: hci_spi: Fix cmd_hdr and acl_hdr usage
Fixes #27266.
cmd_hdr and acl_hdr local structs were read but never written.
Causing unpredictable errors in bt_tx_thread such as :
"Invalid HCI CMD packet length" in hci.c:2280
or Imprecise data bus errors on nrf52810.

cmd_hdr and acl_hdr are now filled with the received data
from SPI Master.

Signed-off-by: Corentin Dorothée <corentin.dorothee@gmail.com>
2020-08-04 17:53:18 +02:00
Robert Lubos
b9caaf217e net: lwm2m: Fix Security and Server object instance matching
A proper way to match a Security object instance with a Server object
instance is via Short Server ID resource. Both coupled object instances
should carry the same value of this resource in order to me considered
matched.

This was not implemented in the LwM2M library and it was incorrectly
assumed that the Security object instance index corresponds to the
Server object instance index. While such apporach works is simple
scenario, it might yield incorrect results when bootstrap is used.

Fix this, by verifyng the Short Server ID resource in the Secuirty
instance used, and finding a matching Server instance. The server object
instance is stored for future use in the engine.

Additionally, remove an extra Server object instance that was created
when the bootstrap procedure was used. Since the boostrap Security
object instance does not have the corresponding Server object, it's
enough to have a single Server instance.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-08-04 16:29:40 +02:00
Martí Bolívar
5be0d00d41 treewide: remove unnecessary DT GPIO/PWM flags checks
Now that the relevant APIs generalize properly for bindings without
flags, we can remove some special case checks from the tree.

I couldn't find any more, but I did this kind of quickly, so it's
possible I missed some.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-04 07:35:26 -05:00
Gerson Fernando Budke
70ff1d73c4 samples: updatehub: Move from net to subsys:mgmt folder
Zephyr introduced subsys/mgmt folder for MCU management. Move UpdateHub
sample to its correspondent folder at sample/subsys/mgmt folder.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-08-03 16:33:06 +02:00
Eug Krashtan
a6ea1cffc9 boards: dts: Fix broken link in comment
Update broken hyperlink in comment to current location

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-07-31 09:00:32 -05:00
Carles Cufi
c200b1c5e6 mgmt: Move mcumgr into its own folder
In order to be able to add more entries under 'subsys/mgmt', move the
current contents of it, which relate exclusively to MCUMgr, to its own
folder.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-07-31 08:46:53 -05:00
Mahesh Mahadevan
209084e745 MXRT600: Add I2C support
Enable I2C access to FXOS7000 sensor on the mxrt685_evk board

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-07-31 08:23:20 -05:00
Dominik Ermel
cac07629bf subsys/fs: Add open flags parameter to fs_open
The fs_open has been extended with support for open flags.
Currently supported flags are:
  FS_O_READ -- open for read
  FS_O_WRITE -- open for write
  FS_O_CREATE -- create file if it does not exist
  FS_O_APPEND -- move to the end of file before each write

The FAT FS and LittleFS front-ends within the Zephyr has also been
modified to utilize the flags.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-30 16:33:18 +02:00
Anas Nashif
eee3ffc7b9 tests/samples: enable for integration testing
Limit execution in CI when using --integration option of sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif
3335767cd8 samples: pi: add integration support
Limit execution in CI when using --integration option of sanitycheck.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif
7e30c4bcdc samples: bluetooth: cleanup prj*.conf
Remove commented out options

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif
4fef7bf362 samples: cpp_synchronization: filter for integration
Enable sample for integration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif
0c5810a1a2 samples: hello_world: filter for integration
Enable sample for integration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Anas Nashif
f0d436c3c2 samples: philosophers: enable for integration testing
Enable sample for integration.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-30 08:00:03 -04:00
Tomasz Bursztyka
42b1d76d80 samples: Apply IPM callback signature change where relevant
Applications using IPM callbacks get the imp device instance pointer
now through the callback. Which help to clarify a bit the code here and
there as well.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:51:51 +02:00
Tomasz Bursztyka
7d1af02410 uart: Fix uart_irq_callback_set usage
It was already using uart_irq_callback_user_data_set below, now it also
uses uart_irq_callback_user_data_t as callback type, so let's normalize
the callbacks.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:43:12 +02:00
Tomasz Bursztyka
701869fc48 uart: Fix uart_irq_callback_user_data_set usage
Now providing the struct device * to the callback.

Fixes #26923

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-07-30 09:43:12 +02:00
Joakim Andersson
bda438a6ee Bluetooth: hci_uart: Update buffer sizes for extended advertising API
Update hci_uart sample configuration for buffers to work with the
extended advertising HCI commands and events.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-28 19:24:22 +02:00
Joakim Andersson
32cda7411b Bluetooth: samples: hci_uart: Update main stack size nrf5 boards
Continuation of abafd8eb22 which missed to update the
board configuration for nrf9160dk_nrf52840.

Update main stack size for nrf5 boards. This is to support an
alternative hci_driver that has a higher stack size usage in hci driver
open. Measured stack usage in this case to 808/1024.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-28 19:24:22 +02:00
Joakim Andersson
522acd0834 Bluetooth: hci_uart: Fix nrf51_blenano board configuration
Fix the nrf51_blenano board configuration which does not build,
exceeding the SRAM with over 2k bytes.
Align the configuration with the same options used to make the
bbc_microbit board build for nrf51 with 16K SRAM.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-28 19:24:22 +02:00
Joakim Andersson
f1058a782c Bluetooth: samples: Set name on HCI TX threads in HCI samples
Set name on HCI TX threads in HCI samples to make it easier to debug
stack size usage with CONFIG_THREAD_ANALYZER.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-28 19:24:22 +02:00
Gerard Marull-Paretas
4cfe4d64d5 samples: display: lvgl: add note about LOG_STRDUP settings
Add a note to warn users about the need to adjust
CONFIG_LOG_STRDUP_BUF_COUNT and/or CONFIG_LOG_STRDUP_MAX_STRING when
deferred logging is enabled.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-07-27 15:06:22 +02:00
Gerard Marull-Paretas
5df0ad3194 lib: gui: lvgl: update to v7.0.2
Update LVGL to version 7.0.2. Notable changes in v7 include:

- New drawing system (note that it uses much more ROM than previous
  versions)
- New style system
- Some objects have been renamed (current changes do not align yet
  Zephyr Kconfig settings with LVGL)
- New fonts with more sizes (e.g. Montserrat, replacing Roboto)
- Theme changes (most have been removed, default is now Material)

Note that constant defaults have been aligned with LVGL.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-07-27 15:06:22 +02:00
Vincent Wan
dd5c33361b samples: net: socket_echo_select: add support for TI CC32xx
TI CC32xx does not support binding the same port to multiple sockets,
but instead uses the IPv6 socket to handle both IPv4 and IPv6
connections. This commit modifies the sample to reflect this.
In addition, Kconfig options are overridden in order for the sample
to take advantage of wifi and socket offloading on this platform.

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-07-27 13:28:06 +02:00
Filip Zajdel
33eabf6fc7 drivers: counter: Add native_posix counter hardware model and driver
Adds native_posix hw counter model and the counter driver.
Functionality is needed by software which is tested
on native_posix and has dependency on counter.
Hardware model was developed similarly to HW timer model.
The counter driver wraps HW counter functions and exposes
basic functionalities: starting, stopping, setting and cancelling
single channel alarms.
Code was tested against: tests/drivers/counter/counter_basic_api.

Signed-off-by: Filip Zajdel <filip.zajdel@nordicsemi.no>
2020-07-27 13:25:50 +02:00
Jose Alberto Meza
2e0284c248 samples: drivers: espi: Update OOB transaction test
Ensure multiple OOB transactions can be perform back-to-back
Check OOB transaction response length matches is as expected.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-07-26 09:02:35 -04:00
Anas Nashif
093fbc28cb samples: remove useless nfc sample
This sample is nothing more than just a special setup of UART for some
nfc, has nothing specific to nfc and might be misleading, so removing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-24 07:50:33 -04:00
Kumar Gala
49d32fbb67 samples: adxl362: Fix building sample with sanitycheck
Tweak sample.yaml so we at least build this sample on one platform.

Fixes #16790

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-22 10:26:54 +02:00
David Leach
1b192df030 samples: drivers: Fix unitialized spi_cfg in spi_fujitsu_fram sample
Fixes #19670

Signed-off-by: David Leach <david.leach@nxp.com>
2020-07-22 09:59:51 +02:00
Vincent Wan
0d2f5a788a samples: sockets: echo_async: add IPv6 support for TI CC32xx
On TI CC32xx, the same port number cannot be bound to different
sockets. Instead, when an IPv6 socket is bound it can handle both IPv4
and IPv6 connections.

Signed-off-by: Vincent Wan <vwan@ti.com>
2020-07-21 15:08:56 +02:00
Anas Nashif
1fbbfc819a tests/samples: add tags to some tests
Some tests/samples had no tags, fill those..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-20 17:44:16 -04:00
Piotr Szkotak
a6b0a3a263 net: openthread: make diag compile
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2020-07-20 14:40:29 +03:00
Saravanan Sekar
820d17110d samples: sensors: wsen_itds: add sample to test accel sensor
Add a sample to demonstrate and test the Wurth Elektronik WSEN-ITDS
accel sensor. Sample code covers accel and die temperature functions.

Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
2020-07-20 12:45:56 +02:00
Gerson Fernando Budke
0dbef20149 boards: shields: esp_8266: Add std headers overlay
The current shield version shows different configuration, including
disabling default ethernet and wifi interfaces.  To allow easy
connection from standard headers, this add two new shield designations.
The existing boards overlays and defconfig were updated.

The documentation was update to reflect changes. A new supported
variations section helps to understand what shield variation user need
select to build their own system.

This changes requires changes on esp32 offload tests to reflect new
esp_8266 shield designations. Sam4e_xpro was keeped as the only one
with dedicated overlay and both frdm_k64f and disco_l475_iot1 were
moved to use standard arduino r3 header using extra args.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-17 11:38:28 +02:00
Gerson Fernando Budke
7b4bdf3bc7 samples: net: echo_server: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
a9780f34a3 samples: net: echo_client: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
ebd1d5478b samples: net: echo_client: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_client be equal to
echo_server configs and remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
3f5eb6f0e6 samples: net: echo_server: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_server run again and
remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
d167205916 samples: net: echo_server: Rem unnecessary configs
The sam4e_xpro and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
4f107a7705 samples: net: echo_client: Rem unnecessary configs
The sam4s_xplained and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Alexander Kozhinov
830f72b91c samples: net: sockets: big_http_download: Extend progress metrics
extended download progress metrics to Bytes, KiB and MiB
separate number of download iterations for INF and numeric case

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-11 14:56:13 +04:00
Jared Wolff
11966acdd3 boards: arm: nrf: Adding Circuit Dojo nRF9160 Feather definitions.
Adding the Circuit Dojo nRF9160 Feather device tree definitions.
Both secure and non secure targets.

Signed-off-by: Jared Wolff <hello@jaredwolff.com>
2020-07-10 17:56:00 +02:00
Peter Bigot
9dc7640ede spi-device: set CS gpio flags for all devices that had none
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level.  Update all cs-gpios properties to specify
active low.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Krzysztof Chruscinski
a7725aef0e samples: subsys: logging: logger: Fix performance showcase
Sample tries to estimate maximum number of messages that can be
logged. It was using two system cycles and counting number of
messages logged in that window. It did not take into account the
fact that clock frequency may vary and logging speed also varies
(especially if LOG_IMMEDIATE is enabled). Presented results may
be faulty and misleading.

Fix is attempting to adjust window size to increase precision of
the measurement.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-09 11:27:22 +02:00
Henrik Brix Andersen
fea4774e72 samples: canbus: canopen: add test case with program download support
Add a test case for building with program download support enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-08 23:24:17 -04:00
Flavio Ceolin
c4f7faea10 random: Include header where it is used
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Simon Glass
7f251a7d08 board: arm: google_kukui: Add a sample for kukui
It is useful to use kukui with a shell to test out its features., Add a
sample for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-08 19:21:40 -04:00
Christian Taedcke
f00f434aea samples: sensor: ccs811: Add board efr32mg_sltb004a
The ccs811 sensor is connected to exclusive i2c pins CCS811_I2C.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-08 15:31:03 -05:00
Emil Obalski
4f42b4413b usb: Correct logging level in Audio class.
Configuration file was left unchanged after development
of USB Audio class. Deleted configs should never be present.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-07-07 19:28:14 -04:00
Alexey Markevich
2d8e71ba0c samples: net: google_iot_mqtt: fix CONFIG_CLOUD_CLIENT_ID value
According to
https://cloud.google.com/iot/docs/how-tos/mqtt-bridge#configuring_mqtt_clients
MQTT client ID format.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-07-07 16:26:51 -04:00
Peter Bigot
1688f8c740 samples: nrf: system_off: show how to disable deep sleep
Due to a long standing difference of requirements enabling deep sleep
will by default cause any application that delays for an unbounded
period to power down.  On Nordic doing so turns the system off.  Show
how to prevent this from happening while still allowing deep sleep
states to be available for the application's controlled use.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-07 15:06:08 +02:00
Andreas Sandberg
ba330ec765 drivers: lora: Prepare Kconfig for additional radios
Add a new configuration option, LORA_SX12XX, that is shared for all of
the LoRaMAC-node-based radio drivers. By default, the appropriate
driver for the LoRa radio in the device tree is included is included
in the build.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-02 08:32:37 -04:00
Jui-Chou Chung
403cf0a27c file system: storage: Update the indentation
Update the indentation for shift operator.

Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
2020-07-02 08:25:33 -04:00
Jui-Chou Chung
959e4644fd file system: storage: Fix the memory size output
In fat_fs example, if we choose a large size SD card to connect with,
the result of memory size calculation coule be wrong due to the missing
brace for manipulating operator priority.

Fixes #26266.

Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
2020-07-02 08:25:33 -04:00
Marek Porwisz
311dd73517 samples: openthread: remove redundant configuration options
Some of the settings are no longer needed in the sample as OpenThread
configuration manages it by itself.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-06-30 07:48:08 -04:00
Christian Taedcke
b5fb9497b6 samples/drivers/spi_flash: fix sample regex
The sample.yml regex did not match the implementation anymore.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-06-28 23:51:23 -04:00
Marcin Niestroj
f4896adaa8 samples: lora: don't select NEWLIB_LIBC
This option should be selected by default, as right now LORA=y selects
REQUIRES_FULL_LIBC.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-06-27 08:19:05 -04:00
Andrzej Głąbek
a10edd538e samples/drivers/spi_flash_at45: Improve test case descriptions
Instead of whitelist, use a filter that checks if a required
"atmel,at45" compatible node is present.
Add a build-only test case to be used by CI and provide a harness
configuration so that execution of the sample can be also verified.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Andrzej Głąbek
c195085959 samples/drivers/spi_flash_at45: Update nrf9160_pca10090 board name
This sample still used the old name of the nrf9160dk_nrf9160 board,
both in documentation and sample.yaml. Because of the latter, this
sample was not picked up by sanitycheck, what resulted in compilation
errors in the spi_flash_at45 driver not caught by CI.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-06-25 19:33:41 +02:00
Peter Bigot
5ea2eaa765 samples: usb: mass: do application configuration before usb starts
USB access to the flash device is not synchronized with the
application, so if the application needs to create a new file system
USB may read configuration state that is incorrect.  Wait until the
the application is done with the flash before starting USB.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-24 09:46:56 -04:00
Jukka Rissanen
db9dca059e samples: net: echo-server: Add userspace support
Allow echo-server to start TCP/UDP threads in user mode for
testing purposes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-23 18:17:15 +03:00
Alexey Markevich
7b2b957cbd samples: net: google_iot_mqtt: remove unused definition
Remove unused definition.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Alexey Markevich
079f158451 samples: net: google_iot_mqtt: use sntp_simple
Simplify overall scenario using sntp_simple to keep main MQTT logic more
clear. Also, remove related code which was used only by the old SNTP
code, e.g. show_addrinfo().

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-23 00:32:57 +03:00
Henrik Brix Andersen
5e2e1ab3ea samples: shields: x_nucleo_iks0xax: exclude lpcxpresso55s16_ns board
Exclude the NXP LPCXpresso55S16 board from the X-NUCLEO-IKS0xAx
samples, since the rely on having Arduino Uno header A3 available.

On the LPCXpresso55S16, A3 is connected through a resistor (R63) which
is not mounted by default.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2020-06-19 15:18:16 +02:00
Maciej Perkowski
0e41830728 samples: posix: eventfd: bugfix for regex check
Bugfix for regex adding "\\" before "(" and ")" for proper regex parsing

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-06-19 15:17:37 +02:00
Tomasz Konieczny
c73578f37a logging: enhanced external logsystems
Introduced interface for efficient logging from external logsystems:
Added handling of vaargs and automatic strdup to macros intended
to be used in logging interface function. Fast path to less then 4
arguments to speed up the execution. Made log_count_args external,
if external logsystem cannot count arguments.

Signed-off-by: Tomasz Konieczny <tomasz.konieczny@nordicsemi.no>
2020-06-17 17:08:12 +02:00
Maciej Perkowski
8b07ec1143 samples: posix: eventfd: Add harness in sample.yaml verifing the output
The sample does not provide a way to verify its operation
and causes fails on nrf platforms. Added regex checks in sample.yaml
so the sample can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2020-06-17 07:51:46 -04:00
Paul Sokolovsky
28af4bfb58 samples: posix: eventfd: Use full, not nano, Newlib.
printf() in this sample uses formatting codes not supported by
Newlib Nano.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-06-17 12:23:00 +02:00
Alexey Markevich
bf9aaa4b34 samples: net: google_iot_mqtt: fix subscription qos initialization
Callback used mqtt_publish_qos1_ack but mqtt_subscribe called with
default 0 value (MQTT_QOS_0_AT_MOST_ONCE)

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-17 13:03:51 +03:00
Håkon Øye Amundsen
13cf241ee6 cmake: docs: Fix 'test_relocation' -> 'code_relocation'
Incorrect name used for sample in two places.
This commit fixes these issues.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-06-17 09:40:47 +02:00
Markus Becker
df38b0911c net: openthread: Add config for NRF52840 DK OpenThread NCP
New config file to build an OpenThread NCP for the NRF52840-DK
via CDC-ACM USB on the connector J3 (labelled 'nRF USB').

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-06-17 08:57:55 +03:00
Jukka Rissanen
6cec40e8cf samples: net: mqtt: Add userspace support to mqtt_publisher
Allow mqtt_publisher sample application to be run in user mode.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-06-17 08:56:27 +03:00
Oleg Zhurakivskyy
f419a655bb samples: net: sockets: tcp: Enable CONFIG_THREAD_NAME
In order to follow threads by name, enable CONFIG_THREAD_NAME
in the configuration.

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-06-15 16:38:38 +03:00
69b76d7305 samples: zperf: fix an unaligned access in the UDP uploader
zperf takes a potentially unaligned netowrk packet, casts it to a
struct, and then dereferences the fields.  This causes a crash on
cores that don't support unaligned access such as the Cortex-M0+.

Use the UNALIGNED_GET helper instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-06-15 10:30:35 +03:00
Flavio Ceolin
636d6cd9cd samples: application_development: Fix for userspace
This samples was defining a syscall but the whole machinery to this
work was missing.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-06-13 16:37:58 -04:00
Ilya Tagunov
3dc6ee048d boards: nucleo_l073rz/l152re: use node labels in DAC samples and tests
Use node labels instead of aliases to select ADC and DAC instance
in samples and tests.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Ilya Tagunov
30e15de442 samples: drivers: dac: Add Nucleo-L152RE board
Enable DAC samples for Nucleo-L152RE board.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Paul Sokolovsky
c22f403a97 samples: posix: eventfd: Add sample.yaml for CI builds
Also, add prj.conf options to make the sample builds on more
platforms. Finally, update the sample source to print explicit
"Finished" message, to let user know that the processing is done.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-06-11 09:47:08 -04:00
Krzysztof Chruscinski
1b4b9386e5 sys: util: Added separator to FOR_EACH_ macros
Added separator (e.g. comma or semicolon) parameter to FOR_EACH_ family.
Separator is added between macro execution for each argument and not at
the end.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:58:13 +02:00
Gerson Fernando Budke
ce26bb5365 samples: coap_server: Refactor to use coap_get_option_int
Small clean-up to use coap_get_option_int.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-06-09 21:25:11 +03:00
Krzysztof Chruscinski
fe7ffc034e samples: bluetooth: hci_uart: Fix conf file name
Conf file was not renamed after board renaming.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-09 19:06:16 +02:00
Krzysztof Chruscinski
43cad10f73 drivers: serial: nrf: Remove flow control configuration from kconfig
Removed flow control configuration from Kconfig and updated samples
to use device tree for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-09 19:06:16 +02:00
Simon Glass
f895cf4d9c samples: fade_led: Correct the sample name in the docs
The docs do not match the directory this sample is in. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-06-09 10:24:43 -05:00
Peter A. Bigot
0a018db0ff samples: subsys: mgmt: smp_svr: increase fs support stack size
The upload command invokes lfs_stat() on the destination file which
overflows the stack.  Adding 256 bytes seems to make it work.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-06-09 14:57:28 +02:00
Reto Schneider
0b4b3ae4dd cmake, 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 multiple projects
"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, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Alexey Markevich
b9f6e33afb samples: net: google_iot_mqtt: fix log typo
Wrong port number logged.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Alexey Markevich
d6d5ae170a samples: net: google_iot_mqtt: log actual error
Error logging was using the wrong variable.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Kumar Gala
d00d0f1266 samples/tests: Convert use of %ll{u,d} to PRI{u,d}64
Move to using PRIu64/PRId64 instead of %llu/%lld since on
native_posix_64 the uint64_t/int64_t type is defined in terms of 'long
int' and not 'long long int'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala
a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Carles Cufi
8beda01c0f doc: reference: Update overview for 2.3
Update the API overview page by looking at the changes in include/ since
the last release.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-05 20:36:16 +02:00
Peter Bigot
1af0428c3d samples: usb: mass: set storage device for FatFS
Left unset it becomes the first partition, which is not what's used
for littlefs, and specifically isn't on the external flash for
nrf52840dk_nrf52840.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-05 17:44:39 +02:00
Peter Bigot
d32b4bd210 samples: usb: mass: fix to support FatFS on external file system
The flash interface header needs to be available regardless of
selected filesystem implementation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-05 17:44:39 +02:00
Christopher Friedt
fb9f6a482f samples: sockets: socketpair: mitigate negative index
Fixes #25780
Coverity-CID: 210612

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt
9cc82a036a samples: sockets: socketpair: check return of pthread_create
Fixes #25737
Coverity-CID: 210585

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt
fb21b2f0b7 samples: sockets: socketpair: check return value of send
Fixes #25736
Coverity-CID: 210583

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Vincent Wan
99a9aa4f7d samples: cc13x2_cc26x2: system_off: fix documentation formatting
Fix minor formatting issue in README to fully display console output.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-29 15:05:18 +02:00
Marc Herbert
2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Johann Fischer
8f4df1784a samples: usb: update PID in the samples documentation
Update PID and SerialNumber in the samples documentation.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-05-27 14:15:52 +02:00
Johann Fischer
3ce80c4d7a samples: wpanusb: assign next free sample PID
Assign next free sample PID to wpanusb sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-05-27 14:15:52 +02:00
Christopher Friedt
2710c188ad samples: sockets: socketpair: sample application and docs
Support for the socketpair(2) system call was recently
added for 2.3.0 .

This change adds a sample application that demonstrates
how it can be used.

Fixes #25527

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-27 14:14:04 +02:00
Emil Obalski
44c153380b usb: doc: Add note about cdc+dfu Windows OS exception.
Add a note for composite (CDC+DFU) device overlay.
Composite device CDC+DFU may not work with Windows OS host.
Windows OS does not send reset after DFU_DETACH request
(does not re-enumerates) and thus make it unable for
the device to restart in DFU mode.

For more details refer to #23337.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-27 13:48:40 +02:00
Peter Bigot
24c1be3896 samples: nrf: system_off: demonstrate use of device pm to reduce power
Currently system power management does not automatically control
device power, and this example demonstrates high current draw due to
the UART being enabled.  Enable device power management and
demonstrate how to manually turn off greedy devices.

Also remove the 60 s delay that confirms we successfully turned off
the residency policy; that's not directly relevant to the purpose of
the sample.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-25 16:25:33 +02:00
Kumar Gala
2ef135dc23 samples: usb: audio: Fix building off sample with sanitycheck
The USB audio samples when added didn't have any tests: sections in the
sample.yaml so they would never get build on any platform as part of
sanitycheck.  Add the tests: section and limit the samples to build on
nrf52840dk_nrf52840 as that was the intended platform these samples
where initially developed for.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-21 16:55:27 +02:00
Paul Sokolovsky
8af7187255 samples: net: echo_async_select: Use read()/write() if possible
If build with full POSIX API, use read()/write() instead of
recv()/send() calls for sockets.

We have read()/write() support for a while, but no samples/tests
actually performed at least a build test for it (so it will be
done now).

Fixes: #25407
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-20 15:37:23 +02:00
Daniel Leung
ec9a413983 boards: x86: make up_squared default to x86_64
This makes the up_squared board default to x86_64.
This also adds a new board, up_squared_32, for when 32-bit
is desired.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-19 19:19:51 +02:00
Martí Bolívar
6bc17e3211 samples: various servo_motor fixes
Though there were issues with this sample before e959386bd2 ("samples:
servo_motor: cleanups and changes"), that commit introduced further
bugs. This happened because the new pwm-servo alias that commit
switched to wasn't provided by any boards, so it wasn't built in CI.

Before that, however, the recommendation to use bbc_microbit in the
sample documentation was also buggy in a couple of ways:

    1. bbc_microbit doesn't have the pwm-0 alias the sample
       previously required, so it didn't build on that board

    2. the documentation's comment to use pin 0 on the edge connector
       is wrong; PWM channel 0 is wired to GPIO P0.0 on the SoC,
       which is actually pin 21 on the connector

Fix it all up.

Tested on bbc_microbit. I verified the pinout and also made sure that
the sample correctly generates pulses from 700 to 2300 usec.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-19 17:27:07 +02:00
Alexandre Bourdiol
507ebecffc sample: drivers: counter: alarm: adapt test to driver change
Due to counter driver implementation change
"driver/counter/counter_ll_stm32_rtc.c: Add 1 tick to alarm"
It is necessary to adapt sample test (sanitycheck)
to take into consideration 1 tick precision/tolerance.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-19 14:48:49 +02:00
Gerson Fernando Budke
ac117c8d63 samples: net: updatehub: Add sample.yaml file
Add missing sample.yaml file to enable CI build tests. Local tests can
be executed executing sanitycheck:

./scripts/sanitycheck -l --testcase-root samples/net/updatehub

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-05-18 11:12:31 +02:00
Gerson Fernando Budke
dc84dd5db5 samples: net: wifi: Enable esp32 offload tests
The esp32 offload driver is used by shield esp_8266. This shield
doesn't have tests enabled to ensures that dependencies are ok.
This enables wifi sample to validate shield esp_8266 on CI and
consequently esp32 offload driver.

Fixes: #25386

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-05-16 19:56:06 +02:00
Joakim Andersson
a8583ae1d9 samples: drivers: lcd_hd44780: Add readme
Add readme for lcd_hd44780 sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
6c6c03d60c samples: driver: flash_shell: Add readme
Add readme to flash_shell driver sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
2d21eb97d0 samples: drivers: i2c_fujitsu: Change readme to rst format
Rename README.txt to README.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
e01958e447 samples: drivers: entropy: Change readme to rst format
Rename README.txt to READMED.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
798f9c4c67 samples: drivers: current_sensing: Change README to rst format
Rename README to README.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
a7b8295428 samples: drivers: crypto: Change README to rst format
Rename README.txt to README.rst and convert to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
ef467c831c samples: drivers: Change drivers.rst to find all samples readme file
Change toc depth to find all samples readme file for driver folder.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
54ce249548 samples: cpp_synchronization: Change sample description to rst format
Rename README.txt to README.rst and change format to rst.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
44bcf98962 samples: boards: intel_s1000_crb: Rename to README.rst
Rename the sample .rst files to README.rst to be consistent with other
samples.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
7e04752f99 samples: out_of_tree_driver: Add readme to out of tree sample
Add reade to out of tree sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
f5ec251c8f samples: external_lib: Add readme to external library sample
Add readme to external library sample

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson
54e28678a3 samples: code_relocation: Add readme for code relocation sample
Add readme for code relocation sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Christoph Reiter
05f1b97d13 doc: fix board name in DPS310 sample
The rename of the nrf52 boards was missed in the sample documentation.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-15 17:17:46 +02:00
Wentong Wu
72227574d8 timer: remove QEMU_TICKLESS_WORKAROUND
Qemu icount mode enabled, remove QEMU_TICKLESS_WORKAROUND.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Christoph Reiter
c8a30ecacc sensor: add sample for Infineon DPS310
Add an example on how to use the DPS310 sensor.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-14 11:02:29 +02:00
Peter Bigot
0a07a29c74 boards: fix misleading size for partition
The length field for the MCUBOOT slot partitions in Nordic platforms
has always had an extra leading zero suggesting it's a 40-bit value,
being stored in a 32-bit field.  Remove the incorrect leading zero to
reduce misunderstanding of the field.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-13 21:25:29 +02:00
Kumar Gala
ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Martí Bolívar
f83ecb7bc6 samples: hid-mouse: cleanups
Similar cleanups as done to other samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
59e63845d1 samples: hid-cdc: cleanups
Similar cleanups to other samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
8970e13f63 samples: lwm2m_client: cleanups
Make this code access the common led0 sample alias in the usual way.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
6c3fb76698 samples: mesh_badge: remove dead code
PULL_UP is not used. The sw0 flags are read directly in
configure_button().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
d42ef5e5da samples: bbc_microbit: cleanups
Clean up the board specific samples:

- Do not hard-code the i2c0 device label in the line follower sample.
- Miscellaneous docs cleanups.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
c58db0c995 samples: threads: cleanups
Align the docs and source code with other changes done to the basic
samples.

Use numbers 0 and 1 to refer to the LEDs consistently. This matches
the generic devicetree aliases used by Zephyr, instead of using USR1
and USR2, which are specific to 96b_carbon.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
e959386bd2 samples: servo_motor: cleanups and changes
Align the sample with changes made to other basic samples.

Move away from 'pwm-0' as a devicetree alias, requiring applications
to define a 'pwm-servo' alias. We are getting rid of the aliases that
just bounce through to node labels as soon as we can, might as well
get the applications ready now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
a0f940ae04 samples: rgb_led: cleanups
Align this sample with the changes made to the other basic samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
b6e4e9f991 samples: minimal: cleanups
Touch up the README while we're looking at the basic samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
0156b6c185 samples: fade_led: cleanups and fixups
Align the sample and its documentation with the other basic samples.

Adjust the fade algorithm so that it looks better and takes less time
to verify by taking 2.5 seconds instead of 10.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
bfb1040612 samples: rename blink_led to blinky_pwm
The difference between "blinky" and "blink_led" is not clear.
This rename makes it more obvious that "blinky_pwm", well,
blinks an LED using PWM.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar
aab2252817 samples: blink_led: cleanups and fixups
Align this sample's source code and documentation with other basic
samples.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Input data sstream is passed to output data stream.

For more details refer to README.rst.

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

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

Input data stream is passed to output data stream.

For more details refer to README.rst.

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

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

Closes #24187.

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

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

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

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

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

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

Fixes #22421

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Also mention overlays as a way to get this working.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Mark Olsson <mark@markolsson.se>
2020-04-24 09:49:46 -05:00
Mark Olsson
6b593a51d2 samples: drivers: kscan: Add sample for touch panel drivers
Simple sample to test touch panel drivers.
Outputs a message to the console on every touch event.

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

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

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

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

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

Fixes: #21088

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

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-04-22 22:21:54 +02:00
Peter Bigot
cc3ccef40d samples: nrf: battery: add documentation
Provide a description of the sample and how it works with different
power supply source configurations.

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

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

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

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

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

Signed-off-by: Sven Herrmann <sven.herrmann@posteo.de>
2020-04-22 17:39:31 +02:00
Johann Fischer
c15d27fb6d samples: wpan_serial: relax wait-for-dtr loop
Relax wait-for-dtr loop and give CPU resources to
low priority threads like logging.

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

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-04-22 17:37:27 +02:00
Erwan Gouriou
81f27c2265 boards: stm32: Use dt API for serial peripheral configuration
Replace use of Kconfig UART_X symbols by calls to DT API.
Clean driver from symbols definitions

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

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

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

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

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

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

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

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

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

fixes #24442

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

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

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2020-04-20 15:42:26 +02:00
Martí Bolívar
aea96bca25 samples: watchdog: devicetree updates
Move to the new devicetree API and stop using DT_WDT_0_NAME fixup
macros. All existing in-tree SoCs with fixup names are still supported
here via compatible. The watchdog0 alias is also still supported.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-04-17 16:09:07 -05:00
Flavio Ceolin
b41583d7d5 samples: espi: Follow API changes
Change the sample to follow espi API changes to pass structs by
reference.

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

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

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

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

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

Signed-off-by: Bjarne Steinsbo <bjarne@gmail.com>
2020-04-15 13:15:29 -05:00
Peter Bigot
45f126f871 coccinelle: re-run timeout conversion semantic patch
This fixes a variety of K_THREAD_DEFINE issues that were missed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-04-15 08:28:57 -05:00
Erwan Gouriou
9985713fd0 samples/drivers/led_*: Remove usage of CONFIG_I2C_X on stm32 boards
Remove usage of Kconfig symbols I2C_X and rely on overlay
to enable i2c instances in samples for stm32 boards

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Richard Osterloh <richard.osterloh@gmail.com>
2020-04-13 11:53:59 -05:00
Parthiban Nallathambi
25d58193d0 samples: sensor: bq274xx: Add BQ27421 sample application
Add bq274xx sample with reading and showing all
possible values from the sensor.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-04-13 11:50:41 -05:00
Kumar Gala
43a7d26603 drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro
Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL.  We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.

This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h.  Also
remove any other stale ENTROPY related defines in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-13 09:14:21 -05:00
Anas Nashif
b90fafd6a0 kernel: remove unused offload workqueue option
Those are used only in tests, so remove them from kernel Kconfig and set
them in the tests that use them directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-12 18:42:27 -04:00
Anas Nashif
acc0e9025d samples: philosophers: evaluate variables coming from command line
The variables passed by sanitycheck and west were being ignored because
cmake knows nothing about them.

Fixes #24178

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

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

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

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-04-10 07:48:33 -04:00
Robert Lubos
073ec8d4aa net: mqtt: Refactor because of timeout overhaul
Align MQTT with timeout API changes.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-09 21:58:42 +03:00
Paul Sokolovsky
8eac618cba samples: big_http_download: Add automated-CI friendly sanitycheck config
This application was initially intended to be a manual, interactive
sample, run by a user. However, it's also a useful real-world
integration test, to be run in automated CI systems. So, provide
a config suitable for such a usage: use local host machine as a
server (to not depend on availability and characteristics of an
Internet connection), and have a concrete completion criteria
(by limiting number of iterations; given that performance of TCP
is not to be not too high, limit it to just 1 for now).

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

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

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

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

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

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

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

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-09 16:57:30 +02:00
Kumar Gala
35cad0884a dts: soc: atmel: sam: cleanup node labels to match SoC docs
Update dts files to use node labels that match Atmel SoC docs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-09 09:02:19 -05:00
Maureen Helm
4219b63949 samples: sensor: Add lpcxpresso55s69 to fxos8700 accel-only test
The lpcxpresso55s69 board has an mma8652 accelerometer which is
compatible with the fxos8700 driver in accel-only mode. Now that this
board has an i2c driver, include it in the platform whitelist.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-09 08:52:13 -05:00
Jukka Rissanen
88d1d43842 samples: net: zperf: Refactor because of timeout overhaul
Convert to use k_timeout_t

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

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

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

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

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

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

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen
0a8991773b samples: net: dumb_http_server_mt: Fix K_THREAD_DEFINE() call
Convert to use k_timeout_t

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen
5cf75fe091 net: websocket: Refactor because of timeout overhaul
Mention in websocket API documentation that the timeout value
is in milliseconds. Check timeout values properly using K_TIMEOUT_EQ()
macro.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen
1b04d44247 net: http: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.
Clarify the documentation of the timeout parameter that it is
in milliseconds.

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

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Jukka Rissanen
a49741ff66 net: dns: Refactor because of timeout overhaul
Use k_timeout_t internally, no change to user API.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-04-09 16:07:03 +03:00
Torsten Rasmussen
b5af13cbe8 samples/sensor/sensor_shell: removed deprecated set_conf_file
The samples/sensor/sensor_shell sample was introduced after deprecation
of set_conf_file and thus was not adopted to the new recommended board
conf file overlay.

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

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

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

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

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

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-04-06 15:21:45 +02:00
Carles Cufi
0f9b3626c1 boards: nrf52_pca20020: Rename to thingy52_nrf52832
The board name for the Thingy:52, so far known as nrf52_pca20020, is
renamed to thingy52_nrf52832.  Its documentation and all references to
its name in the tree are updated accordingly. Overlay and configuration
files specific to this board are also renamed, to match the new board
name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi
233d6c87e6 boards: nrf52840_pca10059: Rename to nrf52840dongle_nrf52840
The board name for the nRF52840 Dongle, so far known as
nrf52840_pca10059, is renamed to nrf52840dongle_nrf52840. Its
documentation and all references to its name in the tree are updated
accordingly. Overlay and configuration files specific to this board are
also renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi
6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Gerard Marull-Paretas
cf2131d7f9 boards: nucleo_h743zi: add pwm support
Enables PWM support using the built-in red LED. Tested with:

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

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

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

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-04-03 12:52:06 -05:00
Andrzej Głąbek
0b300da221 tree-wide: Remove assignments to Kconfig options unused in nRF drivers
Kconfig options that enable I2C and SPI instances are no longer used
in nRF drivers. Remove all assignments done to these options in related
board definitions, samples, and tests.

For nrf52_pca20020, also no longer needed setting of default values
for GPIO_SX1509B* options is removed (now the gpio_sx1509b driver is
enabled by default when a corresponding devicetree node is enabled).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Andrzej Głąbek
97b07b943a drivers/serial/Kconfig.nrfx: Choose driver type basing on DT compatible
Remove prompts from Kconfig options `UART_x_NRF_UART*` that select
the type of nrfx driver (for UART or UARTE peripheral) to be used
for a given instance. This prevents the options from being modified
from configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding UART node in devicetree.

This eliminates the need of changing both the "compatible" property in
devicetree and the Kconfig option selecting the driver type when a user
wants to switch between UART and UARTE for a given instance.

Since all `UART_x_NRF_UART*` options are made "hidden" by this commit,
all their occurrences in configuration files are removed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Andrzej Głąbek
cb0cb3f2e8 drivers/spi/Kconfig.nrfx: Choose driver type basing on DT compatible
Remove prompts from Kconfig options `SPI_x_NRF_SPI*` that select the
type of nrfx driver (for SPI, SPIM, or SPIS peripheral) to be used
for a given instance. This prevents the options from being modified
in configuration files.
Instead, make one of these options selected by default according to the
"compatible" property set for the corresponding SPI node in devicetree.

This eliminates the need of changing both the "compatible" property in
devicetree and the Kconfig option selecting the driver type when a user
wants to switch between SPI, SPIM, and SPIS for a given instance.

Since all `SPI_x_NRF_SPI*` options are made "hidden" by this commit,
all their occurrences in configuration files are removed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-04-03 14:47:32 +02:00
Christian Taedcke
1bf5d24638 samples: drivers/entropy yaml regex fix
The last regex in the yaml file did not match when executing the test on
an embedded target. The expected two spaces are not present at the
beginning of the line.

Fixes #23919

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-04-03 08:00:38 -04:00
Robert Lubos
1fb418df4c net: ieee802154_radio: Allow to specify TX mode
Even though radio driver can report in its capabilities that it does
support CSMA CA, there's no way in the driver to select how the frame
should be transmitted (with CSMA or without). As layers above radio
driver (Thread, Zigbee) can expect that both TX modes are available, we
need to extend the API to allow either of these modes.

This commits extends the API `tx` function with an extra parameter,
`ieee802154_tx_mode`, which informs the driver how the packet should be
transmitted. Currently, the following modes are specified:
* direct (regular tx, no cca, just how it worked so far),
* CCA before transmission,
* CSMA CA before transmission,
* delayed TX,
* delayed TX with CCA

Assume that radios that reported CSMA CA capability transmit in CSMA CA
mode by default, all others will support direct mode.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-04-03 14:07:41 +03:00
Peter Bigot
ecf3bdb5b3 coccinelle: re-run timeout conversion semantic patch
Run the int_literal_to_timeout Coccinelle script to fix places where
it is clear that an integer duration is being passed where a timeout
value is required.

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

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

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

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-04-02 11:07:45 +03:00
Johan Hedberg
a03a54f00c net: samples: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Johan Hedberg
7d4682e302 Bluetooth: samples: Fix timeout passed to k_sleep()
Use the appropriate K_SECONDS() macro to pass a timeout to k_sleep().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-04-01 20:03:15 +03:00
Kumar Gala
a44f4cf484 samples: sensor: sht3xd: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-03-31 08:08:29 -05:00
Kumar Gala
f8f044249c samples: boards: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:14:21 -05:00
Kumar Gala
d8432ce8da samples: drivers: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:12:30 -05:00
Kumar Gala
d711e7b7d8 samples: sensor: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-31 07:09:33 -05:00
Kumar Gala
7e10e6dd3d samples: ipc: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-30 17:05:56 -05:00
Kumar Gala
91656efa4b samples: shields: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-30 17:05:30 -05:00
Kumar Gala
7a0ee9d3cb samples: bluetooth: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-30 17:03:35 -05:00
Kumar Gala
3d2eb34e8e samples: lwm2m_client: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h
DT_INST macro APIs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-30 16:40:01 -05:00
Gerson Fernando Budke
5f5919a900 lib: updatehub: Fix buffer sizes
The MAX_PAYLOAD_SIZE must reflect the size of COAP_BLOCK_x. This is
necessary becase BLOCK size represents max payload size. The current
value create inconsistencies for coap lib. The same way,
MAX_DOWNLOAD_DATA must allocate sufficient space for MAX_PAYLOAD_SIZE
plus all space for coap header etc.

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

The board known earlier as nrf52840_pca10056 is now named
nrf52840dk_nrf52840.

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

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

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

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

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

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

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

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

Here's the code reduction we see:

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

On the remote side we see a 828 byte reduction:

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

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

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

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

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

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

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

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-03-27 14:48:30 +02:00
Andrzej Głąbek
4253eae005 boards: nrf52840_pca10056: Rename board to nrf52840dk_nrf52840
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-03-27 09:14:08 +01:00
Kumar Gala
91ab377716 samples: openamp: Fix cmake warning
Fix the following CMake Warning:
  implicitly converting 'string' to 'STRING' type.

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

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

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

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

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

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

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

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

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

Fixes: #22643
Coverity CID :208206

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #23148.

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

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

Fixes #18378
CID#203537

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

Also restart the scan role in this case.

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

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

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

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

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

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

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

Fixes: #19643
Fixes: #22317

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes: #17852

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #22510.

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

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

Fixes: #22478

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

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

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

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

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

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

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-02-05 12:00:36 +01:00
Tomasz Bursztyka
a40e9d3762 drivers/wifi: Switch WINC1500 to new GPIO API
Use new API to configure and interact with GPIOs.  Move GPIO
initialization from sample into driver.  The existing physical/line
level control has been kept rather than converting to logical level
signals.

Also improve error messages.

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Tested on frdm_k64f.

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

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

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

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

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

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

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

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

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

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

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

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

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

led_ws2812 sample changes:

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

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

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

GPIO driver specific changes:

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

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

SPI driver specific changes:

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #22388

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

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

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

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

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

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

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

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

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

Fixes #22259

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

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

Including the following fixes from the review:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

Fixes #21846.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

reserve conn commit: 46bf20036a

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

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

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

Related to #20017

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

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

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

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

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

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

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

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

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

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

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

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

This fixes #15278.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The documentation was updated referencing the atsamr21_xpro board.

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

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

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

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

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

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

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

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

These configuration files all enable UART_CONSOLE, which selects
CONSOLE_HAS_DRIVER.

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

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

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

Just use minimal logging which synchronously logs
everything.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #21384.

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

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

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

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

    source "$(ZEPHYR_BASE)/Kconfig.zephyr"

in samples. Just

    source "Kconfig.zephyr"

works.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Fixes #16482

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 12:37:31 +01:00
Siddharth Chandrasekaran
bf45e32fec samples: crypto: Add AES ECB mode sample
Add sample for AES ECB mode with FIPS-197 ECB test vetors

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Siddharth Chandrasekaran
e21164cfb0 samples: crypto: Refactor variables for clarity
Rename global variable ciphertext used in cbc_mode() to
cbc_ciphertext and move it closer to cbc_mode(). Also, move
global variable iv into cbc_mode() to be consistent with
other *_mode() methods.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2019-12-18 22:10:29 +01:00
Peter Bigot
50a54f4a4a samples: sensors: isl29035: add sample
Add a sample to demonstrate and test the Renesas/Intersil ISL29035
light sensor driver.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-18 15:07:02 -06:00
Kwon Tae-young
94e419c624 samples: i2c_scanner: support output like i2c_detect
Supports output in the same format as the i2c_detect command.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-18 21:54:43 +01:00
Nick Ward
537f3332f0 samples: bluetooth: peripheral_hr: Fix advertising UUID16 service list
CTS UUID was used instead of DIS UUID

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-12-18 21:46:51 +01:00
Ulf Magnusson
b292f7643b kconfig: Remove assignments to promptless SOC_FAMILY_NRF symbol
SOC_FAMILY_NRF has no prompt. Assignments in configuration files have no
effect on symbols without prompts. A prompt means the symbol is
user-configurable.

SOC_FAMILY_NRF is instead enabled indirectly through being selected by
other symbols.

Detected through some work-in-progress improved error checking.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-18 14:42:58 +01:00
Mateusz Holenko
3cd0bf17f2 samples: philosophers: Disable networking
When networking is selected, building the test
fails with:
error: static assertion failed: "Too many traffic classes"

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-12-18 10:35:15 +02:00
Paul Sokolovsky
feac5c1c45 Revert "samples: sockets: Don't open the socket if the test protocol is enabled"
This reverts commit da0f3311ff. It was
clearly intended to be a debugging aid when developing TCP2, not
intended for mainline. This fixes building this sample on POSIX
systems with Makefile.posix.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-12-17 18:09:19 +02:00
Jukka Rissanen
51fc680ba2 samples: net: google_iot_mqtt: Do not compile by sanitycheck
The sample needs key.c file but that cannot be generated by
sanitychecker. So disable compilation by sanitycheck.
Eventually we should make it possible to compile the sample
using some pre-defined values so that the sample will not
bit-rot but that is for later.

Fixes #21450

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-17 15:44:55 +02:00
Andrei Stoica
f72d5577f9 Bluetooth: samples: Added dynamic Tx power ctrl sample (#17731)
This commit provides a sample dummy application demonstrating
the usage of the added dynamic Tx power control over the HCI
commands and HCI interfaces.

Signed-off-by: Andrei Stoica <stoica.razvan.andrei@gmail.com>
2019-12-17 12:29:57 +01:00
Ravi kumar Veeramally
523a88ea4f samples: net: cloud: Move cloud based samples
MQTT Azure and Google IoT samples are based on cloud
infrastructure. It would be nice to place all cloud
based samples in one single folder.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-17 08:33:52 +02:00
Alberto Escolar Piedras
a6f6179cd9 samples/userspace/prod_consumer: Fix main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Alberto Escolar Piedras
0b8678a2b0 samples & tests: Correct main() type
The application main() in Zephyr is defined as having a prototype:
void main(void), as expected by the kernel init (bg_thread_main).

So, correct the different samples and tests that were defined
otherwise.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-12-16 11:27:56 +01:00
Ravi kumar Veeramally
f1a1e5382e samples: net: mqtt: Add a sample to connect to Azure
This samples demonstrates how to connect to Azure Cloud
IoT hub which is based on MQTT protocol. User has to
create an account in Azure Cloud and provide those details
using Kconfig options. This sample first acquires DHCPv4
address and opens a secure connection with Azure cloud.
Then opens a MQTT connection and publish messages randomly.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-12-16 11:42:06 +02:00
Emil Obalski
797d463d82 usb: samples: Do not depend remote wakeup on SoCs
Remote wakeup for Nordic SoCs should always be enabled.
Thus do not depend it for each SoC. Instead depend it on
chosen driver.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-15 10:29:13 -05:00
Andrew Boie
a15a47d856 samples: shared_mem: 64-bit fixes
We don't need this cast, just use %p format code.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Vincent Wan
f1c0eb915b samples: http_get: connect without TLS by default on cc3220sf_launchxl
The example should work on the cc3220sf_launchxl by following the same
flow as on other boards, ie. by connecting with plain http by default
and use TLS only when an overlay is specified. We update the
configuration for cc3220_launchxl to not use TLS by default and the
README to point users to the right overlay file to use.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-12-12 10:53:26 -06:00
Ulf Magnusson
984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Vikrant More
5af5407570 samples: mesh: nrf52: added some preprocessor directive
Added some preprocessor directive so that code get compile
for some more nRF52 boards which has only one LED & one button.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More
b80b359955 samples: mesh: nrf52: minor improvement in MOVE msg handlers
Changes in MOVE message handler are  as per Mesh Model
Specification which says:

"Upon receiving a Generic Move Set message, the Generic Level
Server shall respond with a Generic Level Status message.
The target Generic Level state is the upper limit of the
Generic Level state when the transition speed is positive,
or the lower limit of the Generic Level state
when the transition speed is negative."

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More
102d402fc5 samples: mesh: nrf52: added some more macros support
Added some more macros support.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00