Commit graph

9378 commits

Author SHA1 Message Date
Oliver Barta
c17b102c65 samples: basic: fade_led: add support for rpi_pico board
PWM device needs to be enabled and configured on rpi_pico board.

Signed-off-by: Oliver Barta <o.barta89@gmail.com>
2023-01-02 13:03:46 +01:00
Oliver Barta
5ad6a7989f boards: rpi_pico: avoid conflicting use of LED
led0 and pwm_led0 are both referring to the same LED. The usage is
mutualy exclusive, as only one pin muxing can be applied.

Disabling child nodes is currently neither supported by gpio-leds device
nor by pwm-leds device. We need to disable either of the devices
completely for correct operation.

Please note that even if disabling of child nodes would be supported, the
devices would be empty anyway, as both have only one singe LED defined at
the moment. Therefore we can completely disable one of the devices in any
case.

Fixes: b876ad9d6f ("boards: arm: rpi_pico: add pwm bindings to
  devictree")
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
2023-01-02 13:03:46 +01:00
Oliver Barta
e24bfc53a6 samples: drivers: led_pwm: fix divider setting for rpi_pico
The fractional part of the divider value is a 4 bit value.

Fixes: 91f659d70a ("samples: led_pwm: add overlay for rpi_pico board")
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
2023-01-02 13:03:46 +01:00
Oliver Barta
681d44b773 samples: drivers: led_pwm: enable immediate logging mode
The default deferred logging mode is not appropriate here. The LOG_INF
messages "Turned on", "Turned off", ... indicate the current state and
should be printed immediately to keep log output in sync with actual
LED state.

Signed-off-by: Oliver Barta <o.barta89@gmail.com>
2023-01-02 13:03:46 +01:00
Oliver Barta
c1852bebeb samples: basic: blinky_pwm: fix divider setting for rpi_pico
The fractional part of the divider value is a 4 bit value. Setting it to
255 leads to an overflow in pwm_rpi_get_clkdiv(). This has resulted in a
slight deviation from the reported timing, which is btw. printed in nsec.

Fixes: c5cb0d1a3b ("samples: blinky_pwm: Fix sample for rpi_pico")
Signed-off-by: Oliver Barta <o.barta89@gmail.com>
2023-01-02 13:03:46 +01:00
Trent Piepho
8c8d41c32f samples: drivers: uart: Detect missing FIFO mode in echo_bot
Print an error message if the UART doesn't support FIFO mode or FIFO
mode is not enabled.

Previously the sample would run with no errors, but wouldn't receive or
echo any data.

Signed-off-by: Trent Piepho <tpiepho@gmail.com>
2022-12-31 18:24:32 +01:00
Piotr Jasiński
48df1a2f2e samples: add debug monitor sample
Implemented a sample that shows configuration and basic usage of monitor
mode debugging feature.

Signed-off-by: Piotr Jasiński <piotr.jasinski@nordicsemi.no>
2022-12-28 12:00:46 +01:00
Jay Vasanth
4dc2d766c7 samples: mec15xxevb: pm: update test clk out config
CONFIG_SOC_MEC1501_TEST_CLK_OUT is removed from mec15xx SOC,
hence remove this configuration in mec15xxevb power management
sample and add board overlay with right configurations.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-12-28 10:43:03 +01:00
Jay Vasanth
0727421862 samples: drivers: clock_xec: Add MEC172x and MEC152x clock driver sample
MEC172x and MEC152x sample demonstrating clock control driver.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-12-28 10:43:03 +01:00
Bartosz Bilas
62eecf9142 samples: basic: button: use gpio_is_ready_dt
Switch to using the dedicated `gpio_is_ready_dt`
function instead of the raw `device_is_ready`.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-12-28 10:38:01 +01:00
Bartosz Bilas
135817c44d samples: basic: blinky: use gpio_is_ready_dt
Switch to using the dedicated `gpio_is_ready_dt`
function instead of the raw `device_is_ready`.

Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
2022-12-28 10:38:01 +01:00
HaiLong Yang
d850bec2c8 samples: drivers: adc: add gd32l233r_eval board
adc sample support gd32l233r_eval board.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2022-12-28 10:37:52 +01:00
Francois Ramu
d75292feea samples: sensor: vbat of the stm32u5x channel 14 on ADC4
Enable the channel14 of the ADC4 of the stm32U5x
to measure the vbat voltage with internal on channel 14
of the ADC4 on the nucleo board or disco kit.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-12-27 15:33:06 +01:00
Gerard Marull-Paretas
9c27fabba3 samples: shields: npm6001_ek: remove dead assignment
The voltage gets assigned by regulator_get_voltage, code was likely a
copy&paste from set voltage command.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Gerard Marull-Paretas
ffdf85ed30 samples: shields: npm6001_ek: add support to query mode
Add a new command to query the regulator operating mode.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Marek Matej
4a64919c36 samples: driver: adc: Add ESP32 boards support files
Add example code to cover single-shot ADC for ESP32, S2, C3 chips.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-23 23:45:05 +00:00
Marek Matej
937ea00e7a drivers: adc: esp32: Add support for single-shot conversion
Allow single-shot adc conversion on all supported targets.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-23 23:45:05 +00:00
Dominik Ermel
db34adf9c3 mgmt/mcumgr: Standardise MCUmgr Kconfig names
Standardise Kconfig options for MCUmgr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-22 12:36:34 +01:00
Hubert Miś
55fdd76a1e samples: ipc: icmsg_me: use nocopy functions
Update one of the threads in the icmsg_me sample to use ipc_service
nocopy functions in both host and remote applications.

Signed-off-by: Hubert Miś <hubert.mis@gmail.com>
2022-12-22 11:07:44 +01:00
Kamil Gawor
d0e21fe6a6 ipc: Enable ICMSG multiendpoint role by default
This commit enables the initiator or the follower
role for the ICMSG multi-endpoint backend
depending on dts by default.
It is needed when BT_RPMSG transport for HCI is used.

Signed-off-by: Kamil Gawor <Kamil.Gawor@nordicsemi.no>
2022-12-22 11:07:44 +01:00
Daniel DeGrasse
71e95ae29d samples: drivers: adc: fixup ADC sample support for LPADC
Fixup ADC sample support for boards with LPADC present. This ADC only
supports an external reference voltage, which is a board-specific value.
Add reference voltage values for all supported boards.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-22 11:04:42 +01:00
Jamie McCrae
17e7ca70a9 samples: boards: nrf: mesh: onoff: Remove MCUmgr files
This application does not actually seem to use MCUmgr
functionality, therefore remove it.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-22 11:03:04 +01:00
Jamie McCrae
b4b6346cdc mgmt: mcumgr: Make Bluetooth and UDP transport init automatic
This moves the UDP and Bluetooth initialisation for MCUmgr to be
performed automatically with the new hander registration feature.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-22 11:03:04 +01:00
Jamie McCrae
d7557102c0 mgmt: mcumgr: Add iterable section to register MCUmgr handlers
This replaces the requirement for applications to manually
register MCUmgr handlers by having an iterable section which
then automatically registers the handlers at boot time.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-12-22 11:03:04 +01:00
Emil Gydesen
4e3205d238 Bluetooth: Audio: Add packing to unicast group create
Add the ISO packing field when creating a unicast group.

This refactors the structure of the unicast group create,
as it now takes both the packing as a group parameter, as well
as an array of stream-specific parameters.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-22 10:59:16 +01:00
Erwan Gouriou
66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Mateusz Sierszulski
85a90d7448 samples: drivers: counter: support alarm sample in counter_gecko_stimer
This commit adds sample support for the counter_gecko_stimer
driver.

Signed-off-by: Mateusz Sierszulski <msierszulski@antmicro.com>
2022-12-20 22:50:19 +01:00
Grixa Yrev
2a992c65c0 net: websocket: new receiving algorithm
websocket_recv_msg() is reworked with using fsm. Now the function
return 0 when payload is empty, -ENOTCONN if socket close. Receiving
empty ping and sending empty pong were added in tests.
Fixes #52327

Signed-off-by: Grixa Yrev <grixayrev@yandex.ru>
2022-12-20 17:05:12 +00:00
Lars Knudsen
081b83531b Bluetooth: has: Make HAS registration dynamic
This changes HAS registration to be dynamic and let's the
application set Hearing Aid Type and binaural features.

Often, devices are flashed with generic firmware with some
features stored post factory production, requiring
the settings to be moved from compile time to run-time.

This change will increase the RAM usage as the GATT
service is moved from ROM to RAM.

Signed-off-by: Lars Knudsen <larsgk@gmail.com>
Co-author: Soren Engquist <soren@engquist.dk>
2022-12-20 17:04:45 +00:00
Andriy Gelman
1bd34d89f9 samples: drivers: adc: Add xmc45_relax_kit overlay
Adds xmc45_relax_kit overlay to run the sample.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-12-20 14:17:23 +01:00
Steffen Jahnke
a4d67d3c85 sensor: amg88xx: fix sensor sample
Since logging with printk() was updated in commit  c5a40e3,
the amg88xx sample dropped around 60 of the messages after
sampling. Increasing log buffer size will fix this issue.

Signed-off-by: Steffen Jahnke <steffen.jahnke@eu.panasonic.com>
2022-12-19 18:18:48 +01:00
Johann Fischer
eb6207707a samples: usb: shell: extend new USB support sample by host support
Extend new USB support sample to include experimental host support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-16 13:21:12 +01:00
Emil Gydesen
f4ff8f2230 samples: Bluetooth: ISO broadcast receiver pa_interval check move
Move the check for the pa_interval to before we start
parsing the data for the name, as that is more optimized.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-16 11:05:24 +00:00
Gerard Marull-Paretas
460f2d04fa samples: shields: npm6001_ek: add utility to test regulators
Add a utility sub-shell to test all regulators embedded in the nPM6001
PMIC.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-16 11:26:47 +01:00
Armin Brauns
c1cc2c4a26 modules: lvgl: change mentions of "LittleVGL" to "LVGL"
The project was renamed to LVGL with release 7.0.0, from 2020-05-18.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-12-16 09:31:41 +01:00
Marek Matej
ac0cbe3c4e samples: esp32: temp: CPU die temperature sample
Add die temperature measure sample for ESP32 targets
esp32s2_saola, esp32c3_devkitm.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-15 18:21:39 +01:00
Reto Schneider
c646a5576a net: zperf: Fix SO_RCVTIMEO dependency
Since 6c30c9ac47 (samples: net: zperf:
Rewrite upload part to use sockets), zperf uses SO_RCVTIMEO in UDP mode,
hence must depend on/enable support for it.

Without SO_RCVTIMEO support, zperf fails like this:
> nb_packets=47   delay=188964    adjust=-13
> setsockopt error (109)
> setsockopt error (109)
> -
> Upload completed!
> LAST PACKET NOT RECEIVED!!!
> Statistics:             server  (client)
> Duration:               0 us    (10.19 s)
> Num packets:            0       (50)
> Num packets out order:  0
> Num packets lost:       0
> Jitter:                 0 us
> Rate:                   0 Kbps  (9 Kbps)

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-12-15 17:14:26 +01:00
Robert Lubos
f33072a725 samples: net: sockets: net_mgmt: Update flash requirement for twister
The net_mgmt sample enables a lot of features, resulting in pretty large
image sizes for various platforms (~200k). At the same time, the
sample.yaml for the sample did not specify minimum flash requirement for
the sample, causing flash overflows during build in certain cases.
This commit fixes this by setting a reasonable flash requirement for the
sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-12-15 14:32:30 +00:00
Tomasz Moń
21975231e2 usb: device: cdc_acm: Prevent recursive logging loop
Allow enabling CDC ACM logging only if CDC ACM is not used as logging
backend. This prevents endless recursive logging loop, especially
visible when minimal footprint logging is enabled.

Fixes: #52981

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-12-15 14:54:24 +01:00
Dinesh Kumar K
4eb1a34cac samples: sensor: Added sample for grow_r502a fingerprint sensor
Added sample application for grow_r502a fingerprint sensor

Signed-off-by: Dinesh Kumar K <dinesh@linumiz.com>
2022-12-14 18:44:29 +01:00
Emil Gydesen
5102950adc sample: Bluetooth: Add PA interval check in iso broadcast benchmark
Verify that the peridic advertising interval is non-0 to
ensure that the remote device is actually advertising
with peridic advertising enabled.

This fixes an issue where per_interval_ms would be set to 0,
causing bt_le_per_adv_sync_create to fail to invalid values.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-12-14 15:00:13 +01:00
Marcin Niestroj
2d3365200c settings: file: drop CONFIG_SETTINGS_FILE_DIR
There is already CONFIG_SETTINGS_FILE_PATH, which is set to full file path,
while CONFIG_SETTINGS_FILE_DIR is required to be set to its parent
directory. This is redundant, as parent directory path can be easily found
out either during runtime or optionally during buildtime by CMake.

CONFIG_SETTINGS_FILE_DIR was actually introduced recently after Zephyr 3.2
release as a replacement of deprecated CONFIG_SETTINGS_FS_DIR. This means,
that there is no need to deprecate it for 3.3 release and dropping it
should be fine. Adjust 3.3 release notes accordingly, so that
CONFIG_SETTINGS_FILE_PATH will be used directly.

This patch stops using deprecated CONFIG_SETTINGS_FS_DIR. There is actually
no value in respecting it, as setting anything other than parent directory
of CONFIG_SETTINGS_FS_FILE makes no sense.

There is actually one use of CONFIG_SETTINGS_FILE_DIR in file backend
tests, to derive directory for files containing tested settings.
CONFIG_SETTINGS_FILE_PATH is not used there, so it makes little sense to
derive directory name from it. Instead, just use hardcoded "/settings"
subdirectory, as this was the default value of CONFIG_SETTINGS_FILE_DIR.

Deriving parent directory can be done either in runtime or in
buildtime (e.g. using some helper CMake function). Doing it in runtime
however allows to create directory recursively (which this patch actually
implements), e.g. for some more nested FS tree structure. Additionally it
will simplify migration of settings configuration from Kconfig to
device-tree (yet to be developed feature).

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-12-14 14:11:03 +01:00
Marek Matej
85b879594d samples: board: esp32: DAC sample code
Sample code demonstrate the DAC on ESP32 and ESP32-S2

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2022-12-13 16:29:38 +00:00
Erwan Gouriou
13acbf1b68 samples: blinky_pwm: Add nucleo_l476rg support
Enable use of nucleo_l476rg on this sample using a dedicated overlay.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-13 10:01:11 +00:00
Francois Ramu
444ddfe268 samples: Use immediate logging mode in nvs sample
Applying same fix as for watchdog relmated samples
in https://github.com/zephyrproject-rtos/zephyr/pull/52949/
Switching to the immediate logging mode, not by just disabling the
LOG_PRINTK option.Do not direct printk to logging subsystem in the sample.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-12-13 17:20:38 +09:00
Johann Fischer
a01fbd0731 sample: usb: shell: add keybord harness string
Add keybord harness string to sample.yaml file.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-12 15:00:20 +01:00
TOKITA Hiroshi
e965db984d samples: counter: alarm: add support for GD32 boards
Add support for boards that implements the GD32 SoCs.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-12-12 10:08:12 +01:00
Andrzej Głąbek
7d5c9fa7a9 samples: Use immediate logging mode in watchdog related samples
Starting with commit b9b43a0eb772a464bba13833d11e3a31fbf4e09e, printk()
messages are handled by the logging subsystem. This can cause trouble
in watchdog related samples if the deferred logging mode is used (and
currently it is by default), because those samples are ended by a reset
and some messages may not get a chance to be outputted.
Since the same problem concerns also the ordinary logging messages that
may be produced during execution of the samples, this commit fixes it
by switching to the immediate logging mode, not by just disabling the
LOG_PRINTK option.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-12-10 09:45:02 +01:00
Daniel DeGrasse
1ff8fb927f samples: ipc: openamp: Enable openamp sample for iMX.RT1160 EVK
Enable the openamp sample for RT1160EVK. CM4 core has a custom DTS
overlay to use LPUART2 for console information, and use a secondary GPT
timer for the system tick.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Daniel DeGrasse
10714466c3 samples: ipc: openamp: Enable openamp sample for iMX.RT1170 EVK
Enable the openamp sample for RT1170EVK. CM4 core has a custom DTS
overlay to use LPUART2 for console information, and use a secondary GPT
timer for the system tick.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-12-05 19:54:37 +01:00
Xinyang Tan
535f5a6c04 shell: support setting help string for each entry in a dictionary command
Add support for setting the help description for each entry in a dictionary
command. Currently the syntax string alone may not provide sufficient
description of its entry. This commit also helps keep the help messages
consistent with existing style.

Signed-off-by: Xinyang Tan <xinyang.tan@delve.com>
2022-12-05 18:40:46 +01:00
Gerard Marull-Paretas
e7c659fb29 samples: shields: npm6001_ek: fix build
Commit ff3aaa6ef3 moved some getopt
declarations to unistd.h. Update sample to include the header, so that
we can access optarg.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-05 18:21:31 +01:00
Franciszek Zdobylak
9b4aa2d553 samples: fs: Add sample using fs_mkfs function
Provide a demo which uses newly added fs_mkfs function.

Signed-off-by: Franciszek Zdobylak <fzdobylak@internships.antmicro.com>
2022-12-05 15:36:00 +01:00
Glauber Maroto Ferreira
2ad13a50a7 soc: esp32: add light sleep sample code
Add light sleep sample code.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Glauber Maroto Ferreira
f6705220ff esp32: samples: power management: add deep sleep sample
Add deep sleep sample code with support for the
following wake-up sources:

- Timer
- EXT0/EXT1: IO under RTC domain
- GPIO (ESP32-C3 only)

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-12-05 15:09:53 +01:00
Anas Nashif
37c4110104 samples: jesd216: fix integration platforms
Fix integration platforms to match what is allowed (platform_allow).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-12-05 14:55:00 +01:00
Andrzej Puzdrowski
0e8005e860 sample/drivers/jesd216: spi-nor config for nrf52840dk
Added configuration which allows to test the sample using SPI_NOR
driver instead of NRF_QSPI driver.
SPI_NOR driver is generic, so nice to add possibility to check
how it is working.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-12-05 12:11:29 +01:00
Chris Friedt
ff3aaa6ef3 posix: getopt: move declarations to unistd.h
Declarations for `getopt()` should be in `<unistd.h>`
according to the spec. The extended versions `getopt_long()`
and `getopt_long_only()` are declared in `<getopt.h>`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-12-04 14:51:52 +01:00
Madhurima Paruchuri
fa738b0f74 usb-c: Generate USB-C connector VIF policies XML file
Generates XML file containing VIF policies by reading the device tree
using EDT.pickle generated during build
This script writes a subset of general and sink-pdo VIF policies in
output file
This script gets invoked during build if enabled through kconfig
The generated XML containing USB-C VIF policies could be used by
USB PD/Type-C analysers/testers to understand USB-C properties and
perform tests accordingly

Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com>
2022-12-02 08:46:04 -06:00
Johann Fischer
dc26a617d7 samples: usb: console: enable optional new USB device support
Add code and configuration to enable new USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00
Johann Fischer
13766dd417 samples: cdc_acm: enable optional new USB device support
Add code and configuration to enable new USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00
Johann Fischer
f5ef4c4288 samples: usb: add shell sample for new USB support
The sample enables new experimental USB device support
and the shell function.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-12-02 12:55:18 +01:00
Jay Vasanth
06fde72092 samples: drivers: led: Add sample for Microchip XEC LED driver
Add a sample program demonstrating the LED driver for Microchip's
XEC microcontrollers. The sample can be built for MEC152x and
MEC172x.

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-12-02 11:31:50 +01:00
Chris Friedt
4d906d944b Revert "posix: getopt: move declarations to unistd.h"
This seems to have caused build failures in spite of CI being
green in PR 52653.

This reverts commit fc92eb1b37.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-12-02 14:09:37 +09:00
Chris Friedt
fc92eb1b37 posix: getopt: move declarations to unistd.h
Declarations for `getopt()` should be in `<unistd.h>`
according to the spec. The extended versions `getopt_long()`
and `getopt_long_only()` are declared in `<getopt.h>`.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-12-01 15:52:47 -05:00
Armin Brauns
52dfd528b8 samples: syslog_net: use utility function for backend init
log_backend_init() does the exact same thing, but shorter.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-12-01 09:48:42 +01:00
Armin Brauns
b923f962aa samples: syslog_net: correctly late-initialize log backend
log_backend_activate() does not assign the backend id (backend->ctx->id),
which is required for runtime filtering.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-12-01 09:48:42 +01:00
Jamie McCrae
cb50f2fb16 samples: external_lib: Add building on windows support
Adds support for building the external_lib sample application on a
windows host operating system.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-30 16:35:40 +01:00
Gerard Marull-Paretas
e0c8de1e39 drivers: regulator: fixed: simplify implementation
Remove regulator-fixed-sync specialization, create a single driver that
is always synchronous. The asynchronous part is rarely/never used, so
let's keep things simple for now.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-30 15:49:30 +01:00
Manuel Arguelles
cc70daacdf samples: counter: support System Timer on s32z270dc2_r52
Enable counter alarm sample on s32z270dc2_r52 boards, using the first
System Timer Module instance.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-11-30 11:29:39 +01:00
Anas Nashif
ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Gerson Fernando Budke
5c773ae45e samples: drivers: counter: alarm: Add support to TFM
Add cmake rules to allow build boards with TFM enabled.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-29 13:40:27 +00:00
Krzysztof Chruscinski
b53a8e5fea samples: tfm_integration: psa_firmware: Improve logging handling
Remove redundant initialization and add logs flushing before
the reboot.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-11-29 10:46:26 +01:00
Francois Ramu
b839a0f9db samples: drivers: jesd216 jedec ID and SFDP from octo-flash
This adds the support jedec configuration to run
the jedec  sample application. So target boards can display
the content of the octo-NOR flash
of the stm32u585 and stm32l562 or stm32h735 disco boards.
The sfdp-bfp table is provided as example (overlay file),
to run this sample on the stm32l562e_dk platform.
It has to be defined in the deviceTree "in cases were runtime
retrieval of SFDP data is not desired."

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-29 09:32:22 +00:00
Emil Gydesen
ae11b5879b Bluetooth: Audio: Remove bt_vcp from vol rend API
Remove the struct bt_vcp pointer from the volume
renderer API, as there is only ever a single
Volume Renderer instance on a device.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
c82af2885e Bluetooth: Audio: Split vol_ctlr and vol_rend callback structure
Split the `bt_vcp_cb` struct into separate structure for
the volume controller and the volume renderer.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
7f69b866f0 Bluetooth: Audio: Specify bt_vcp_vol_rend API
The VCP server, known as the volume renderer, has a
more explicity bt_vcp_vol_rend API naming scheme now.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
ce2b8f9fe1 Bluetooth: Audio: Rename VCS to VCP
Renames almost all occurences of VCS to VCP, as we want to
use the profile as the namespace for volume control.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
aaac86dada Bluetooth: Audio: Rename vcs.h to vcp.h as well as the Kconfig file
Rename vcs.h to vcp.h to better detail what the
file contains, as it is more than just VCS. This also
renames the Kconfig file.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 17:43:40 +01:00
Emil Gydesen
d8e7a0db42 samples: Bluetooth: Increase subgroup count for broadcast audio sink
Imcrease the supported number of subgroups to 2 as well as the number of
streams to 2, so that it matches the default configuration of the
broadcast audio source sample.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-28 14:38:25 +01:00
Andrei Emeltchenko
55843e7d77 samples: net: Add qemu_x86_64 to platform_allow
Allow to build for qemu_x86_64 platform.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-11-28 13:19:51 +01:00
Théo Battrel
e458f5aae6 Bluetooth: Use Zephyr standard log system instead of bluetooth/common/log
The `bluetooth/common/log.h` and `bluetooth/common/log.c` files have been
removed. Files that were using them have been updated to use
`zephyr/logging/log.h` instead.

Those replacement have been done consequently:
- `/BT_DBG/LOG_DBG/`
- `/BT_ERR/LOG_ERR/`
- `/BT_WARN/LOG_WRN/`
- `/BT_INFO/LOG_INF/`
- `/BT_HEXDUMP_DBG/LOG_HEXDUMP_DBG/`
- `/BT_DBG_OBJ_ID/LOG_DBG_OBJ_ID/`

Also, some files were relying on the `common/log.h` include to include
`zephyr/bluetooth/hci.h`, in those cases the include of `hci.h` has
been added.

For files that were including `common/log.h` but not using any logs,
the include has been removed and not replaced.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
2022-11-25 17:08:36 +01:00
Fabio Baltieri
2f2eba7517 samples: chre: exclude qemu_leon3
This test used to only run on native_posix due to the test filter until
e478a4e850 was merged. Now it's running on all platforms but it's failing
on qemu_leon3 for some address alignment issue.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-11-24 16:37:49 +01:00
Fabio Baltieri
80e3d68691 samples: chre: use CONFIG_LOG_MODE_MINIMAL
The sample depends on the log output to check for a successful run. This
means that with a small enough log buffer we could lose messages and
fail the run, as it's happening right now on qemu_cortex_m0.

Switching to CONFIG_LOG_MODE_MINIMAL to avoid the problem in the first
place.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-11-24 16:37:49 +01:00
Emil Gydesen
292db21a18 Bluetooth: Audio: Use svc_inst instead of bt_csip for set_member
Use the service instance struct instead of the more generic
`bt_csip` for the CSIP set member API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Emil Gydesen
87f86cebe2 Bluetooth: Audio: Rename bt_csip to bt_csip_set_member
Renamed remaining structs and functions that are not
for the set coordinator to use the set member CSIP
role name.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Emil Gydesen
93b3944a51 Bluetooth: Audio: Rename CSIS to CSIP
Renamed the coordinated set implementation to use the
profile (CSIP) name instead of the service (CSIS) name, as
the former is more general.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:48 +01:00
Emil Gydesen
22002b8717 samples: Bluetooth: Increase timeout for broadcast audio source
Increase the time between resets from 30s to 120s.
This make it easier to properly use, while still get
the chance to test the stop functionality.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 15:23:36 +01:00
Emil Gydesen
40e3930ebd Bluetooth: Audio: Broadcast source subgroup and BIS codec support
Updates the broadcast source API to create subgroups and
to set BIS specific codec configuration

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-11-24 10:21:36 +01:00
Francois Ramu
819cb95438 boards: arm: stm32l562e_dk includes the sdfp table for its octoflash
Moving the SDFP table property from the sample to the device tree
of the stm32l562e_dk disco kit.
The MX52lm51245 Nor octoflash mounted on this boarddoes not
provide its own internal SFDP parameters.
With this patch, the SFDP table is given by the board DTS.
So that the stm32 ospi driver can initialized the  NOR octoflash
correctly with the parameter from that property instead of
relying on the nor octoflash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-24 09:37:07 +01:00
Marcin Niestroj
daee6cb4a9 settings: file: change FS (or file system) wording to File
Currently there is inconsistency in repository file names, APIs, Kconfig
options and documentation around file / file-system backend for settings
storage, as both "file" and "FS (file system)" are used. As an example,
there is `CONFIG_SETTINGS_FS` Kconfig option, but the file that implements
this settings backend is called `settings_file.c`. Another example are
names of static functions that implement settings storage API:
`settings_file_load()`, `settings_file_save()` and
`settings_fs_storage_get()`.

This backend is actually storing all settings in a single file, so it makes
sense to use "File" as the name of backend, instead of a more general
"FS" (which would make sense if several files would be used to store
settings).

Fix inconsistency in used wording in the tree and unify it to "settings
file backend". This naming is more precise to how the implementation looks.
It will also make it easier to grep through the codebase and analyze
existing code.

Deprecate settings_mount_fs_backend() function and all Kconfig options
starting with `CONFIG_SETTINGS_FS`.

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-11-24 09:36:31 +01:00
Andrzej Głąbek
1ef35090d0 samples: modules: chre: Flush log messages after initialization
On targets where POST_KERNEL initialization routines, executed after
the logging thread has started, take significant amount of time,
log messages produced during CHRE initialization may collide with
printk messages output by the sample. Prevent this by flushing all
log messages right after the initialization is performed.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-11-23 17:22:16 +00:00
Anas Nashif
cffe98d9de crc: Make the build of crc function dependent on a Kconfig
Add CONFIG_CRC for building CRC related routines.
CRC routines are now being built for each application, whether used or
not and are add in the build system unconditionally.

Keep CONFIG_CRC enabled by default for now and until all users have
converted to use the new option.

Partial fix for #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-23 13:30:00 +01:00
Francois Ramu
d24f3b9baa samples: drivers: jesd216 jedec ID and SFDP from octo-flash
This adds the support jedec configuration to run
the jedec  sample application. So target boards can display
the content of the octo-NOR flash
of the stm32u585 and stm32l562 or stm32h735 disco boards.
The sfdp-bfp table is provided as example (overlay file),
to run this sample on the stm32l562e_dk platform.
It has to be defined in the deviceTree "in cases were runtime
retrieval of SFDP data is not desired."

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-22 14:26:57 +00:00
Francois Ramu
055c1c637e samples: drivers: stm32u5x octospi enables DMA
Adds the dma transfer for the octoSPI on NOR octo Flash
of the b_u585i_iot02a disco kit.
The channel for the GPDMA is 0-15 (0-7 for DMA1, 8-15 for DMA2)
The channel 12 to 15 are used for GPDMA transfers
to/from external memories.
The request is 41 for the OCTOSPI2.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-22 12:00:00 +00:00
Johann Fischer
1c4011ff6e usb: remove usb_pid.Kconfig file
Remove Kconfig file samples/subsys/usb/usb_pid.Kconfig added in
the commit e5cbe6a9e7 ("usb: cdc: Add unique PIDs for each sample")
with the motivation to have a separate ID for each sample supposedly
to be recognizable by the host.

The new USB support does not use the options, VID/PID is set
directly in the application. As a note, it is not necessary to have
unique PID for each sample, especially for the well known USB classes.

Replace the individual Kconfig options in the documentation
by a table with the references to the samples and PIDs.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-11-22 11:09:21 +01:00
Gerard Marull-Paretas
767dd47f98 samples: shields: npm6001_ek: initial version
Add a sample that demonstrates usage of the nPM6001 PMIC (all of its
functionalities).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-22 11:05:19 +01:00
Jeppe Odgaard
7d27309816 samples: Basic system heap Demo
A demo to showcase some of the sys_heap functions

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2022-11-22 13:17:59 +09:00
Mirai Shinjo
d595148c98 samples: sensor: doc: fix a code block formatting issue
This commit fixes a code block formatting issue in the stm32_vbat_sensor
sample documentation.

Signed-off-by: Mirai Shinjo <miraishinjo@icloud.com>
2022-11-22 12:54:44 +09:00
Chris Friedt
7a0fd7ad14 samples: drivers: flash_shell: disambiguate flash shell app
Both `drivers/flash/flash_shell.c` and
`samples/drivers/flash_shell/src/main.c` provide a flash shell
utility called `flash`.

Rename the latter to disambiguate.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-11-19 14:24:38 -05:00
Anas Nashif
b512c8e4fa samples: fix duplicate identifier
Test identifier was duplicated.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-18 09:19:47 -05:00
Dominik Ermel
31d4a2e7bd samples/nrf/onoff_level_light: Convert to new MCUmgr header paths
Header paths changed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Dominik Ermel
0556275faf samples/mcumgr/smp_svr: Apply rework in MCUMgr subsystem
Code changes required by rework in MCUMgr souce code structure.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Dominik Ermel
7c2924f4bc mgmt/mcumgr: Move transport headers to transport subdir
The MCUmgr transport headers have been moved to
zephyr/mgmt/mcumgr/transport/

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-17 15:31:17 +01:00
Benjamin Perseghetti
bc72ad318f boards: rddrone_fmuk66 fix pwm pinmux and servos
Fixes the channel 2 PWM pinmux adds servos and PWM LEDs.
Required to operate servo motors and status lighting.
Tested on RDDRONE board.

Signed-off-by: Benjamin Perseghetti <bperseghetti@rudislabs.com>
Co-authored-by: Sumit Batra <sumit.batra@nxp.com>
Co-authored-by: Landon Haugh <landon.haugh1@gmail.com>
2022-11-16 10:18:46 -06:00
Henrik Brix Andersen
f0199dc3e7 samples: drivers: eeprom: remove EEPROM shell overlay
Remove the EEPROM shell overlay from the EEPROM driver sample as this was
only introduced as a build test for the EEPROM shell. This is now done in
tests/drivers/eeprom/shell.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-11-15 09:43:42 -06:00
Kristofer Jonsson
e35e981564 samples: Add a TFLU Ethos-U sample program
Add a sample program that demonstates how to run inferences on
Arm Ethos-U.

Signed-off-by: Kristofer Jonsson <kristofer.jonsson@arm.com>
Signed-off-by: Fredrik Knutsson <fredrik.knutsson@arm.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-11-15 14:47:43 +01:00
Daniel DeGrasse
1aa01c18bb samples: drivers: ipm: update to use sysbuild
Update ipm_mcux sample to use sysbuild for multicore images

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Daniel DeGrasse
e033677787 samples: openamp: update openamp sample to use sysbuild
Update IPC openamp sample to use sysbuild for multi core images.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Daniel DeGrasse
71d8b0ab68 samples: openamp: add separate overlay files for remote cores
with sysbuild, DTS overlays for boards cannot automatically be passed to
the remote core. This means DTS overlays must be present for remote cores
as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Daniel DeGrasse
407fe95af3 samples: openamp: add lpc54114 configuration settings
Add lpc54114 configuration settings to enable booting second core with
sysbuild, and LMA address adjustment

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Daniel DeGrasse
a969b93ec7 samples: openamp: add additional required KConfigs for LPC55s69
LPC55s69 requires the second core to output a hex build to ensure the
image is flashed to the correct location, and uses the
CONFIG_SECOND_CORE_MCUX symbol in each core's build to indicate the build
targets a dual core config

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-11-15 14:46:02 +01:00
Jędrzej Ciupis
741972cf56 samples: net: wpan(usb|serial): exclude thingy53_nrf5340_cpuapp_ns
This commit excludes thingy53_nrf5340_cpuapp_ns platform from building
wpanusb and wpan_serial samples. The platform doesn't support TF-M yet
and therefore the build is bound to fail.

Due to limitations of the filter functionality, a more generic approach
where _ns platforms without TF-M support would be excluded from the
build, for example:

filter: dt_chosen_enabled("zephyr,ieee802154") and
	CONFIG_NRF_SOC_SECURE_SUPPORTED

doesn't properly filter out the needed platforms. As a result,
platform_exclude syntax is used to specifically exclude the platform.

Signed-off-by: Jędrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2022-11-15 12:13:46 +00:00
Chris Friedt
dae6d2f84b samples: drivers: fpga: fpga_controller: fix links in README.rst
Markdown links were incorrectly used in this ReST document.

Signed-off-by: Chris Friedt <cfriedt@meta.com>
2022-11-15 05:59:09 -05:00
Rodrigo Peixoto
27ec69eca1 samples: zbus: Add benchmark sample
The sample measures the time to transfer 256KB from the
producer to the consumers.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
078d561bf6 samples: zbus: Add runtime observer registration sample
The sample illustrates a way of using the runtime observer registration
feature. With this sample the developer can understand how to use static
and runtime observer registration.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
86513fb7af samples: zbus: Add the remote mock sample
The sample illustrates a way of exchange message with a host mock
running in a Python script. It can be used to improve the testability
and controllability of the tests.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
0528a43345 samples: zbus: Add the UART bridge sample
The sample illustrates a way of send all the channel event to the host
by using the UART, a user_data portion, and the claim/finish APIs.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
bc6963fd5b samples: zbus: Add dynamic channels sample
The sample illustrates a way of using dynamically allocated messages in
static channels.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
5ed4781c54 samples: zbus: Add work queue sample
The work_queue sample illustrates three reaction styles available for
using zbus. The first is a listener that reacts by callback; use it should
for urgent reaction. The second is a listener that responds by callback;
instead of executing the code, it pushes a job to a work queue that will
be executed shortly but not immediately. The last one is the subscriber
that reacts using a queue; use it for an asynchronous reaction where the
developer would like to control the flow.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Rodrigo Peixoto
68b5b05165 samples: zbus: Add the hello world sample to zbus
The hello world sample illustrates a simple way of using zbus. There is
a listener and a subscriber interacting each other by using a read-only
and a regular channel. The APIs are called by using the function
and macro variation.

Signed-off-by: Rodrigo Peixoto <rodrigopex@gmail.com>
2022-11-14 17:25:29 -05:00
Anas Nashif
67e8d03280 tests/samples: fix some missing tags
Many driver samples or tests only had 'drivers' as the tag, without a
tag indicating what driver that is exactly, so add some missing tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-14 07:08:04 -05:00
Yonatan Schachter
b49b11555c samples: flash_shell: Fix flash range printing
When running a flash read command on the flash shell, the hexdump
prints came out incorrect. There was a space missing between the
ninth element and its preceding "|", and a redundant newline.
This commit fixes this issue.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-11-14 12:38:03 +01:00
Yonatan Schachter
c5cb0d1a3b samples: blinky_pwm: Fix sample for rpi_pico
The RP2040 needs a DTS overlay for the PWM to work with the
blinky_pwm examples. This commit adds the required overlay.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-11-14 12:37:47 +01:00
Benjamin Lindqvist
85c6de4335 lorawan: enable run-time config of region/freq
This commit adds support for compiling in support for several different
regions/frequencies and dynamically choosing which to use in run-time.
This commit introduces no API breakages - if a prj.conf contains only a
single region Kconfig, the new function lorawan_set_region() does not
need to be called.

Signed-off-by: Benjamin Lindqvist <benjamin@eub.se>
2022-11-14 11:16:16 +00:00
Francois Ramu
838cd28195 samples: drivers: watchdog stm32 wwdg decrease apb clock
The most of the wwdg peripherals requires a reduced apb clock
to pass the sample.drivers.watchdog.stm32_wwdg testcase.
This apb1 prescaler is added to the overlay file
for that particular clock.
Specific overlay for the stm32h7 family because of the APB1
bus clock named d2ppre1.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-11 08:40:23 +00:00
Gerson Fernando Budke
92ca06577f samples: usb: mass: Add support to TFM NS boards
This add TFM cmake definitions to build mass storage sample for non
secure firmware boards versions. The stm32l562e_dk_ns board was used
to demonstrate. It uses SDMMC/SD with TFM profile large. Tests were
conducted using a 2GB transflash card with FAT-32 partition.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-10 11:26:11 +00:00
Gerson Fernando Budke
151e145b44 boards: arm: stm32l562e_dk: Enable usb tags for tests
This enables usb and usb_device tag for tests. It explicitly disable
samples/subsys/usb/dfu for non-secure version of this board due to
building errors, which can be explored in future.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-11-10 11:26:11 +00:00
Gaël PORTAY
a8ae2217e2 samples: modbus: print returned error code
This prints the returned error code, just like the other calls do.

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-11-09 10:46:02 -06:00
René Beckmann
a507186d12 samples: net: mqtt-sn: Add MQTT-SN publisher sample
This sample demonstrates the usage of the MQTT-SN library over UDP.
It connects to a gateway, publishes to the topic "/uptime" and also
subscribes to "/number".

Signed-off-by: René Beckmann <rene.beckmann@grandcentrix.net>
2022-11-09 10:43:00 +01:00
Hubert Miś
b2c5d7cb60 sample: add icmsg multi endpoint sample
Add a sample presenting ipc_service working with icmsg multi endpoint
backend. The sample creates multiple instances of icmsg, one of them
consisting of two endpoints.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2022-11-09 10:41:43 +01:00
Seppo Takalo
83d79b5996 net: lwm2m: We should not use read callbacks to generate new data
When read callbacks are used, it bypasses LwM2M engine data
handling and therefore LwM2M observation cannot work properly.

Read callbacks should be used only on special cases.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-11-09 09:16:22 +00:00
Peeyush Kumar
38907d1c65 samples: boards: stm32: Rename README.md to README.rst
Updated the README file extension from .md to the expected extension .rst

Signed-off-by: Peeyush Kumar <peeyush.ei@gmail.com>
2022-11-08 13:47:09 -06:00
Kevin Townsend
1cb49a389b samples: ipc: rpmsg: Fix AN521 buffer location
Updates the location of the shared memory buffer to account for
memory map chains with `mps2_an521_remote`.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-11-08 10:57:35 -05:00
Kevin Townsend
e3b21b88b0 samples: ipc: openamp: Fix AN521 buffer location
Updates the location of the shared memory buffer to account for
memory map chains with `mps2_an521_remote`.

Signed-off-by: Kevin Townsend <kevin.townsend@linaro.org>
2022-11-08 10:57:35 -05:00
Pavel Vasilyev
8a77f6e79e samples: bluetooh: mesh_demo: Fix compilation for bbc_microbit
Reduce number of relay buffers to compile mesh_demo for bbc_microbit
platform.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2022-11-08 10:47:46 +01:00
Maciej Perkowski
15afd31862 tests: usb: Make tests for usb mass sample more robust
It was found that the existing regex check was not enough to validate
correctness of execution of mass samples. Tests would pass even when
a filesystem failed to be mounted. An additional line to check is added
to validate the setup of a filesystem.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-11-08 10:45:08 +01:00
Jose Alberto Meza
2a8f7188c6 samples: drivers: peci: Add mec172xxebv overlay
Define DT alias for PECI

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-11-08 09:42:27 +00:00
Jamie McCrae
f33eab8fb6 samples: mgmt: mcumgr: Remove un-necessary modules from build
This removes some modules and functionality from the sample to
reduce the output application size to assist in fitting it to MCUs
with less flash storage space.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-11-08 09:41:24 +00:00
Francois Ramu
15cc076126 samples: subsys: littlefs on nucleo_h743zi
This commit fixes the overlay file for running the
samples/subsys/fs/littlefs on the nucleo_h743zi platform.
The storage_partition is moved to the qspi_nor flash
instead of the internal flash.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-05 19:57:40 +01:00
Sean Madigan
34718446e1 Samples: Bluetooth: Increase sync timeout for sync samples
Currently, the sync timeout means the device will timeout
straight after it syncs. This means we cannot send a sync
transfer as we are no longer synced.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-11-05 19:57:31 +01:00
Stephanos Ioannidis
d7f69fccc3 samples: chre: Correct main() function prototype
C++ standard requires C++ main() to have the return type of 'int'.

This commit updates the CHRE sample to define main() as
`int main(void)` and enable  `CONFIG_CPP_MAIN`, which instructs the
Zephyr kernel to call the C++ main().

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-05 16:41:45 +09:00
Stephanos Ioannidis
cb43c90058 samples: cpp_synchronization: Allow running on POSIX arch boards
This commit updates the cpp_synchronization to run on the "POSIX
architecture" boards such as `native_posix`, since the POSIX arch now
properly supports the main() defined in a C++ source file.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-05 16:41:45 +09:00
Stephanos Ioannidis
17ea196b02 samples: cpp_synchronization: Enable CONFIG_CPP_MAIN
This commit updates the cpp_synchronization sample to enable
`CONFIG_CPP_MAIN` since it defines its main() in a C++ source file.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-05 16:41:45 +09:00
Stancu Florin
b9f462e890 boards: cc13x2/cc26x2*: add ADC sample + update docs
Add ADC driver sample overlays + update features in doc + metadata for TI
CC13x2/CC26x2 based boards (cc1352r_sensortag, cc1352r1_launchxl,
cc26x2r1_launchxl).

Signed-off-by: Stancu Florin <niflostancu@gmail.com>
2022-11-04 17:31:59 -04:00
Kamil Serwus
278120acb6 board: samc21: add support for SAMC21N Xplained Pro Board
Add basic support board with SAMC21N soc including SPI, UART, I2C,
ADC, Flash, Leds.

Signed-off-by: Kamil Serwus <kserwus@gmail.com>
2022-11-04 16:03:01 +01:00
Anas Nashif
aead5b523b sample: tracing: add a configuration for percepio
Add a sample configuration for percepio.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-04 10:00:48 +01:00
Ederson de Souza
7ffc6c31b5 samples/boards: Add intel_adsp/code_relocation sample
A simple sample with some (explained) tricks to get code relocation for
Intel ADSP CAVS platforms.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-11-03 10:25:07 +01:00
Joakim Andersson
777ec7b48c samples: tfm_secure_partition: Add library configuration to sample.yaml
Add library model configuration to tfm_secure_partition model.
IPC model is now the default, so add back the library configuration
for the sample as an additional configuration to the default.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-11-02 16:10:18 -05:00
Francois Ramu
2749cfed8e samples: compression: lz4 requires more than 64kB of RAM
Set the min_ram limit to 64kB so that with new ztest lib
can run the sample on board with enough ram.
Smaller ram platforms are not used anymore.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-02 16:06:06 -05:00
Markus Swarowsky
c859f3069b samples: psa_crypto: Add twister regex for attestation token
So far running twister tests didn't fail even though the sample failed
to receive the initial attestation token data.
Therefore this adds the regex lines that the samples prints if the
IAT data were received.

Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
2022-11-02 15:41:41 +09:00
Maureen Helm
0ddc2a9b65 drivers: sensor: Remove brackets from sensor info shell command output
Brackets were originally used in the sensor info shell command output to
make it obvious when a field is a null string, however they incorrectly
suggest that a field is an array. Remove the brackets and conditionally
print "(null)" instead.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-11-02 15:40:24 +09:00
Maureen Helm
387a108b5f samples: sensor: Fix sensor shell application build command
Fixes the sensor shell sample application build command to use the
correct source directory.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-11-02 15:40:24 +09:00
Henrik Brix Andersen
836f582664 drivers: can: skip all CAN loopback mode tests for kvaser,pcican
Skip all CAN controller tests utilizing CAN loopback mode for the
kvaser,pcican CAN controller card as emulated in QEMU.

QEMU emulation of the SJA1000 CAN controller backend does not yet support
the SJA1000 Self Reception Request command which is required for proper
loopback operation.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-11-01 15:22:31 -04:00
Henrik Brix Andersen
4af4fc0314 samples: modules: canopennode: exclude qemu_x86 from storage build
Exclude the qemu_x86 and qemu_x86_64 boards from the build-only CANopenNode
storage test.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-11-01 15:22:31 -04:00
Henrik Brix Andersen
05d02e2dac samples: drivers: can: counter: use printf() instead of printk()
Use printf() instead of printk() for printing sample output. According to
the documentation Zephyr printk() and friends are for printing kernel debug
messages.

With printf() instead of printk() the CAN counter sample passes twister
test execution on native_posix and native_posix_64.

Fixes: #50570

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-11-01 09:02:41 +00:00
Ingar Kulbrandstad
7367980bea Bluetooth: Mesh: Extended advertiser as default
Setting the extended advertiser as default advertiser
to improve both preformence and reliability.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2022-11-01 08:52:56 +00:00
Kumar Gala
117039ca2b IPM: remove defconfig/proj setting of IPM drivers
Now that IPM drivers are enabled based on devicetree we can
remove any cases of them getting enabled by Kconfig, *defconfig*,
and *.conf files.

We need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-31 16:45:56 -05:00
Gaël PORTAY
1578a991bd samples: blinky_pwm: fix missing project renaming
The commit bfb1040612 has renamed the
sample blink_led to blinky_pwm, however, the project still have the
former name: blink_led.

This renames the project to its new name: blinky_pwm.

Signed-off-by: Gaël PORTAY <gael.portay@gmail.com>
2022-10-31 09:22:59 -05:00
Maureen Helm
32aa66d57e samples: sensor: Enable sensor info shell command
Enables the new sensor info shell command in the sensor shell sample
application and documents its usage.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-31 11:21:37 +01:00
Maureen Helm
eef0e1a180 samples: sensor: Update sensor shell documentation
Updates the sensor shell sample documentation to reflect the currently
supported sensor shell commands. The list and list_channels commands
were removed in commit 95b4d37230 but the
documentation wasn't updated at the time.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-31 11:21:37 +01:00
Keith Packard
d61d941ec8 samples/bluetooth: Fix mis-use of bt_data 'data' field
The data field is a *pointer* to the buffer, not the actual buffer itself.
Instead of smashing past the end of the struct, write through that pointer.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-10-29 11:32:06 +03:00
Johann Fischer
b26fca430c drivers: flashdisk: remove all DISK_FLASH* Kconfig options
Remove all obsolete DISK_FLASH* Kconfig options.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-28 12:45:58 +02:00
Tomasz Moń
51c46e98c7 samples: usb: mass: add disk description to overlays
Add flash disk description to overlays. Specify custom flashdisk
partition for fat fs api test to match the Kconfig values, because
native posix storage partition is too small for FatFS filesystem.

Co-authored-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2022-10-28 12:45:58 +02:00
Kumar Gala
7fff3de993 samples: synchronization: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus() and build checks
to use CONFIG_MP_MAX_NUM_CPUS.  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-27 13:59:57 -04:00
Kumar Gala
6aa67666c4 samples: smp: pktqueue: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus() and build checks
to use CONFIG_MP_MAX_NUM_CPUS.  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-27 13:59:57 -04:00
Kumar Gala
9092b83d03 samples: smp: pi: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus() and build checks
to use CONFIG_MP_MAX_NUM_CPUS.  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-27 13:59:57 -04:00
Nikolay Agishev
5b6f2f4fb6 twister: Add fiters to SYS-T related tests
New filter "TOOLCHAIN_HAS_NEWLIB == 1" was applied
because of following chain of dependencies:
LOG_MIPI_SYST_ENABLE=y --> CONFIG_MIPI_SYST_LIB --> \
--> REQUIRES_FULL_LIBC --> NEWLIB_LIBC.

Not all compillers announced in Zephyr support NewLib.

Signed-off-by: Nikolay Agishev <agishev@synopsys.com>
2022-10-27 11:03:30 +02:00
Thomas Stranger
338f1b9488 samples: subsys: canbus: isotp: fix sample path in Readme.rst
The path in the readme did not match the sample's real path.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-10-27 11:02:57 +02:00
Joakim Andersson
96698450c4 sample: tfm_regression_test: Only have audit partition in Library config
Only enable the TF-M Audit Partition in the TF-M regression tests when
Library model is used.
This is not supported in IPC model and produces a Kconfig warning.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-10-27 10:37:18 +02:00
Joakim Andersson
8bc9a3c042 sample: tfm_regression_test: Set library model explicitly
Set the TF-M library mode explicitly instead disabling IPC model and
relying on this selecting Libray model in the choice.
This is a follow-up on the TFM_IPC being put into a choice selection
when SFN model was added.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-10-27 10:37:18 +02:00
Dominik Ermel
a5f2b6bb43 samples/boards/nrf: Fix onoff_level_lighting_vnd_ap sample
Remove inclusion of moved and non needed header.
Other unneeded headers have been also removed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-10-27 02:21:39 +09:00
Mariusz Skamra
2627063ab2 Bluetooth: audio: pacs: Replace capabilities API with pacs
This changes the API to use proper naming convention, as the code has
been moved out of capabilities.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-26 08:49:00 +02:00
Henrik Brix Andersen
30c7d31fde samples: drivers: can: babbling: set CAN-FD mode if requested
Set the CAN controller to CAN-FD mode before attempting to send FD format
frames.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
Henrik Brix Andersen
f8a88cdb27 drivers: can: use flags fields for can_frame and can_filter structs
The can_frame and can_filter structs support a number of different flags
(standard/extended CAN ID type, Remote Transmission Request, CAN-FD format,
Bit Rate Switch, ...). Each of these flags is represented as a discrete bit
in the given structure.

This design pattern requires every user of these structs to initialize all
of these flags to either 0 or 1, which does not scale well for future flag
additions.

Some of these flags have associated enumerations to be used for assignment,
some do not. CAN drivers and protocols tend to rely on the logical value of
the flag instead of using the enumeration, leading to a very fragile
API. The enumerations are used inconsistently between the can_frame and
can_filter structures, which further complicates the API.

Instead, convert these flags to bitfields with separate flag definitions
for the can_frame and can_filter structures. This API allows for future
extensions without having to revisit existing users of the two
structures. Furthermore, this allows driver to easily check for unsupported
flags in the respective API calls.

As this change leads to the "id_mask" field of the can_filter to be the
only mask present in that structure, rename it to "mask" for simplicity.

Fixes: #50776

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
Henrik Brix Andersen
a9c7c58345 canbus: isotp: avoid reusing CAN controller driver API definitions
Avoid reusing the CAN_EXTENDED_IDENTIFIER and CAN_STANDARD_IDENTIFIER
definitions from the CAN controller driver API for ISO-TP structure members
as this is a fragile design.

The ISO-TP layer must be responsible for its own definitions where
needed. Replace the "id_type" ISO-TP struct member with a well-known
abbreviated "ide" bit (Identifier Extension Bit) struct member.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
Jamie McCrae
ff624a186c samples: mgmt: mcumgr: smp_svr: Fix stack overflow with bt
Fixes an issue with a possible stack overflow when using the
Bluetooth transport for large mcumgr transfer, the issue was caused
by moving to a dedicated workqueue but not moving the enlarged
system workqueue overlay to the new smp workqueue.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-10-25 16:25:13 +02:00
Emil Gydesen
31bf99cbd2 Bluetooth: ISO: Change ISO seq_num to 16-bit
The sequence number is by the core spec defined as 16-bit.
We had implemented a workaround for the wrapping of the
sequence number, which required the type to be larger
than 16-bit (32-bit).

However, since the definition of the sequence number,
and the use of, is poorly defined by the core spec, we
are reverting this workaround and reducing the sequence
number to 16-bit again. This way it is more in line
with the core spec, as well as more intuitive given the
other uses for the sequence number.

This change moves the responsibility of using the
right value to the upper layers, as the stack can
and will no longer provide any guarantees.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-24 10:38:49 +02:00
Sam Hurst
c2e9462637 samples: boards: Remove board specific USB-C Sink sample
This CL removes the board specific USB-C Sink sample in
favor of the generic USB-C Sink sample.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-10-22 18:38:35 -04:00
Sam Hurst
e2f5fcd91a samples: usb-c: sink: Add USB-C Subsystem Sink Sample
Implementing USB-C Sink functionality can be difficult.
This sample application serves as an example of how
to create an application with Power Delivery Sink
functionality.

Signed-off-by: Sam Hurst <sbh1187@gmail.com>
2022-10-22 18:38:35 -04:00
Krishna T
52ddc6e32d samples: net: zperf: Add loopback overlay
This is useful to profile networking stack using loopback interface, a
TX only option is also added but disabled by default.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2022-10-21 13:15:05 +02:00
Michal Sieron
702caf1c7e samples: boards: Add Qomu board sample
First pads are being configured for use by the FPGA.
Then CPU loads usbserial bitstream.
Finally it reenables clocks, sets up USB PID and waits for device to
enumerate.

Also disable software resets in used clocks.

Signed-off-by: Michal Sieron <msieron@antmicro.com>
2022-10-20 15:41:09 +02:00
Kumar Gala
ad5966a432 samples: move to using CONFIG_MP_MAX_NUM_CPUS=1
For samples that set CONFIG_MP_NUM_CPUS=1, switch to using
CONFIG_MP_MAX_NUM_CPUS=1 instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Felipe Neves
5760fcc8ab soc: xtensa: esp32_net:
Fixes boot sequence for esp32_net, also reflect the changes in the
esp32 ipm driver.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-10-19 16:03:00 +02:00
Stephanos Ioannidis
9dd570f8a2 tests: Remove explicit newlib nano override
This commit removes explicit `CONFIG_NEWLIB_LIBC_NANO=n` overrides
because the newlib nano variant is no longer enabled by default when
it is available.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-19 16:02:51 +02:00
Andrei Emeltchenko
87217eff6b samples: edac: Add sample documentation
Add EDAC sample documentation.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-10-18 16:59:34 +02:00
Torsten Rasmussen
36ea41fad3 samples: introduce 'with_mcuboot' sample to show sysbuild feature
This sample is intended to show users how they can create a sample which
has dedicated configuration files for extra images included in a build.

MCUboot is used as example on how its default can be adjusted and
MCUboot itself automatically be included in the build when using
sysbuild.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2022-10-18 14:13:27 +02:00
Veijo Pesonen
2fbb9e64be samples: lwm2m: allow longer endpoint names
Server might return the endpoint name in a registration reply. Default
max allowed endpoint name is only 12 characters.

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-10-17 20:06:32 +02:00
Gerard Marull-Paretas
178bdc4afc include: add missing zephyr/irq.h include
Change automated searching for files using "IRQ_CONNECT()" API not
including <zephyr/irq.h>.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-17 22:57:39 +09:00
Emil Obalski
2230857a44 samples: ipc: icmsg: Add usage of endpoint deregister
Expand the sample to show deregister functionality
for IPC service with icmsg backend.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
2022-10-17 14:49:42 +02:00
Emil Obalski
e25ca9f757 samples: ipc: icsmg: Clean up the sample
Make the sample exchange the data between cores
for predefined time. Clean up logging messages
and do not print transfer speed on each side.

This sample is now used to demonstrate functionalities
of ipc service with icmsg backend.

Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
2022-10-17 14:49:42 +02:00
Krzysztof Chruscinski
7e71bb7089 samples: subsys: logging: Add multidomain logging sample
Add sample which demonstrates multidomain logging.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Krzysztof Chruscinski
e322447109 logging: Initial multidomain support
Adding multidomain support by introducing log_link module which
acts as a receiver of log messages created by another domain.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-10-17 10:16:53 +02:00
Sean Madigan
5b1dd71f3e Bluetooth: kconfig: Add config options for PAST
Add config options specific for periodic advertising sync transfer.

Signed-off-by: Sean Madigan <sean.madigan@nordicsemi.no>
2022-10-17 10:14:10 +02:00
Kumar Gala
c778eb2a56 smp: Move arrays to use CONFIG_MP_MAX_NUM_CPUS
Move to use CONFIG_MP_MAX_NUM_CPUS for array size declarations instead
of CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-17 14:40:12 +09:00
Daniel DeGrasse
2169183ae1 samples: fat_fs: update overlays for nrf52840 and esp_wrover_kit
Update nrf52840 and esp_wrover overlays to use new sdmmc bindings.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-10-14 09:56:10 +02:00
Emil Gydesen
7ab1cafbc2 Bluetooth: Audio: Add Broadcast source application AD
This refactors how the BAP broadcast source handles the
extended and periodic advertising.

First it removes the start and stop of the extended
advertising, and instead expects the application
(or upper layers) to do this.

Second it exposes API functions to get the
necessary advertising data from BAP (service data and
the BASE), which the upper layers will then also
be responsible for setting and updating.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-10-14 09:51:39 +02:00
Florian Grandel
b309822e8e samples: net: wpanusb: document endianness
The WPAN-USB sample did not document endianness of some user space
variables. As the IEEE 802.15.4 stack uses attributes in several
different encodings, the endianness should be documented.

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-10-12 18:40:59 +02:00
Christopher Friedt
dbe2c0d59e include: net: http: rename http_x.h http/x.h
Some minor housekeeping prior to adding an http server
implementation. There are already a number of http headers
and that number will likely increase with subsequent work.
Moving them into a common directory cleans up the
`include/net` directory a bit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2022-10-12 09:02:21 -04:00
Gerard Marull-Paretas
3976ccd5f7 include: add missing sys/printk.h include
Some files were using the printk API without including sys/printk.h

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Gerard Marull-Paretas
6a0f554ffa include: add missing kernel.h include
Some files make use of Kernel APIs without including kernel.h, fix this
problem.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Seppo Takalo
f3ef443a97 samples: net: lwm2m_client: Split sensor modules out from main
Each module deserves their own file so we don't clutter the
main application.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2022-10-11 11:12:07 +02:00
Vinayak Kariappa Chettimada
2d6f6a7729 samples: Bluetooth: hci_rpmsg with 2 BIS configuration
Update the config file to support 2 Broadcast Streams in
hci_rpmsg samples for running iso_broadcast and iso_receive
samples on nRF5340 DK.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-10 13:55:06 +02:00
Vinayak Kariappa Chettimada
52a91fd02e samples: Bluetooth: Add configuration file for all controller features
Add project configuration overlay file to build the current
full feature set Bluetooth Low Energy Controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-07 14:34:14 +02:00
James Johnson
0eaff5a11d drivers: sensor: add ams AS621x Temperature Sensor driver support
Added support for the AMS AS621x series of temperature sensors as a
variant of the TI TMP108 temperature sensor.

Signed-off-by: Jared Baumann <jared.baumann8@t-mobile.com>
Signed-off-by: James Johnson <james.johnson672@t-mobile.com>
2022-10-07 10:01:47 +02:00
Mariusz Skamra
28ce0a96b1 Bluetooth: audio: capabilities: Remove redundant direction parameter
The direction is used to identify the list to append the registered
capabilities. There is no need to keep it in the bt_audio_capabilities,
it can be provided as a function parameter instead.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-06 22:41:27 +00:00
Franciszek Zdobylak
64feccf23d drivers: flash: shell: Add flash shell tools
This commit adds two new commands to flash shell tools: flash load and
flash page_info.

Signed-off-by: Franciszek Zdobylak <fzdobylak@internships.antmicro.com>
2022-10-06 22:35:57 +00:00
Chris Friedt
2114104223 samples: net: socketpair: use CONFIG_ARCH_POSIX shorthand
The `CONFIG_ARCH_POSIX` Kconfig option covers all POSIX
boards, so no need to specify them individually.

Signed-off-by: Chris Friedt <cfriedt@fb.com>
2022-10-06 15:32:49 -04:00
Benjamin Björnsson
2ba91ce850 samples: flash_shell: Add board to platform_exclude list
Exclude Arduino Portenta H7 because the flash driver isn't
supported yet on the M4 core.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-10-06 13:52:40 -05:00
Vinayak Kariappa Chettimada
aa50f7db74 samples: Bluetooth: Add boards to platform allowed to catch regressions
Add boards to CI platform_allowed list to catch regressions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-05 16:20:06 +00:00
Vinayak Kariappa Chettimada
b56c6eb697 samples: Bluetooth: Fix peripheral_ht compile error
Fix peripheral_ht compile error introduced in
commit a202341958 ("devices: constify device pointers
initialized at compile time").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-10-05 16:20:06 +00:00
Tom Burdick
f9d16072e8 rtio: Add macro to define iodev submission queue
The iodev submission queue existed but wasn't easily constructed as
there was no macro to define it.

Adds a simple macro wrapper around RTIO_SPSC_DEFINE for creating
the RTIO IO Device Submission Queue enabling each IO device to
have its own pending queue of requests.

The sample has been updated to use the iodev submission queue rather
than a k_msgq.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2022-10-05 12:42:16 +02:00
Erwan Gouriou
426c51af76 samples: shields: x_nucleo_53l0a1: Fix nodelabels
Following change of nodelabels names in shields, fix their usage in this
sample.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-10-05 16:15:44 +09:00
Joakim Andersson
41e040a3f8 samples: direction_finding_connectionless_tx: Use identity address
Use Identiy address in direction_finding_connectionless_tx sample.
Without this option the advertiser is advertising using an NRPA since
it is a non-connectable advertiser.
The function bt_le_ext_adv_oob_get_local cannot be used to get the NRPA
address of the non-connectable advertiser when privacy is disabled.

Check the return address of bt_le_ext_adv_oob_get_local.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-10-04 14:07:29 +00:00
TOKITA Hiroshi
c28fd3079e samples: driver: watchdog: Add GD32 SoCs support
Add support for boards that implement GD32 SoC.

Overlay file for longan_nano_lite enables FWDGT.

Add WDT_FEED_INTERVAL to make adjustable
the execution cycle of wdt_feed().

And also, make waiting for the WDT_FEED_INTERVAL period
for the watchdog window opens at the start of the test.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-10-03 18:07:16 +02:00
Erwan Gouriou
397a992d5f samples: shields: lmp90100_evb: Fix nodelabel
Shield's nodelabels should now be in the form <device>_<shield_name>.
This occurrence was left out in the initial change.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-10-03 14:15:08 +02:00
Juha Heiskanen
8279489aee net: lwm2m: RD Client update registration timeout
Renamed LWM2M_RD_CLIENT_EVENT_REG_UPDATE_FAILURE to
LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT.

Changed reported event type for registration timeout to
LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT from
LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE.
LWM2M_RD_CLIENT_EVENT_REGISTRATION_FAILURE should be only
reported case when server reject by response registration.

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-10-03 10:20:13 +02:00
Mariusz Skamra
9ecbee2587 Bluetooth: audio: capabilities: Remove callbacks
This removes the callbacks from capabilities. The callbacks are used for
unicast server role only, while the capabilities are used for the
broadcast sink role as well. Thus the callbacks can be removed as there
is another bt_audio_unicast_server_cb API that is specific for unicast
server role.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-03 10:17:21 +02:00
Martin Jäger
9cec058e8e boards: posix: native_posix: enable can_loopback0 by default
The .yaml file states that CAN is supported, but the basic sample
application samples/drivers/can/counter cannot be compiled without
additional configuration.

The loopback driver does not require any additional steps like the
linux SocketCAN driver, so it is safe to enable it by default and
get rid of the many overlay files in the tests.

ISO-TP tests and the counter sample are excluded via .yaml from
twister tests because of timing issues.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-10-03 10:17:12 +02:00
Mariusz Skamra
124d66e885 Bluetooth: audio: tbs_client: Make GTBS client only build option
Refactor Kconfig to add a way to enable GTBS only client.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-10-03 10:15:03 +02:00
Jim Mussared
e1c134a582 samples/bluetooth/hci_uart: Add support for USB CDC UART.
This PR adds support using the USB CDC UART in the hci_uart sample,
including sample configuration for the nRF 52840 dongle.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-03 10:14:35 +02:00
Michal morsisko
3b26d50012 samples: bluetooth: Add sample demonstrating direct advertising
This sample shows how to run BLE direct advertising towards central
with enabled privacy.

Signed-off-by: Michal morsisko <morsisko@gmail.com>
2022-10-03 10:13:40 +02:00
Pieter De Gendt
fd81163f58 samples: subsys: display: lvgl: Add native_posix overlay for SDL input
Enable SDL keyboard events using the zephyr,gpio-emul-sdl driver and
alias key to sw0.
Pressing 'r' on the keyboard resets the counter.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-10-03 10:12:03 +02:00
Pieter De Gendt
aa4082a093 samples: subsys: display: lvgl: Add button to reset counter
Connect the sw0 alias to reset the counter.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-10-03 10:12:03 +02:00
Ryan Erickson
eadb45612d samples: mcumgr: smp_svr: Add support for MG100 board
Add support to build the sample for the MG100 board.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-10-03 10:11:28 +02:00
Ryan Erickson
3996c0327b samples: net: mqtt_publisher: Add support for MG100 board
Add support to build the sample for the MG100 board.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-10-03 10:11:28 +02:00
Ryan Erickson
b612c49424 samples: net: lwm2m_client: Add support for MG100 board
Add support to build sample for MG100 board.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-10-03 10:11:28 +02:00
Valerio Setti
2bcc6f9194 samples: sensor: adding a sample application for the STM32 qdec driver
Sample application for the STM32 quadrature encoder driver

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2022-10-03 10:10:31 +02:00
Peter Marheine
5eb75b81f7 arm: rename default RAM region from 'SRAM' to 'RAM'
It's useful for RAMABLE_REGION to have a uniform name when
CODE_DATA_RELOCATION is supported, because otherwise the build system
needs to be aware of how the region name differs between architectures.
Since architectures tend to prefer one of 'SRAM' or 'RAM' for that
region, prefer to use 'RAM' as the more general term.

Signed-off-by: Peter Marheine <pmarheine@chromium.org>
2022-10-03 10:09:53 +02:00
Grant Ramsay
5a1845e9f8 samples: boards/esp32: Add ESP32 Ethernet sample
A sample project for ESP32 Ethernet testing.
Possibly this should be consolidated into existing networking samples

Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
2022-10-01 14:51:28 -04:00
Grant Ramsay
7bc8211aa4 boards: xtensa: Add esp32_ethernet_kit board
Adds support for the esp32_ethernet_kit board.
esp32_ethernet_kit board is useful for testing ESP32 Ethernet

Signed-off-by: Grant Ramsay <grant.ramsay@hotmail.com>
2022-10-01 14:51:28 -04:00
Anas Nashif
ebade6f48c samples: remove SOF sample
Sample is now maintained in the SOF repository, no need for duplication.
The SoF project maintains the board configurations and SOF related
configs better than we do.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-01 06:22:21 -04:00
Jose Alberto Meza
dafdef83b4 samples: drivers: espi: Re-enable eSPI SAF for MEC152x board
Add missing device tree entry for SAF HW block.
Re-enable driver for MEC152x board.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2022-09-29 14:59:32 +00:00
Stephanos Ioannidis
165cf8ddb5 samples: display: cfb_custom_font: Fix stale sample reference
The `cfb_custom_font` sample has been relocated from `samples/display`
to `samples/subsys/display`.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
4a35002adb samples: shields: x_nucleo_iks01a2: Fix outdated pinmux file reference
This commit removes the outdated reference to the board pinmux file and
updates the documentation point to point to the relevant Arduino
connector-related devicetree files.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
a0d335042a samples: ft800: Update outdated links
Apparently the URLs for these old products have been moved to under
"old2020" without any redirects ...

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
016fc8c22f samples: grove_display: Update outdated link
The "Grove Base Shield" seems to be no longer listed in the Seeed
website, so its link is replaced with that of the "Base Shield V2",
which is the successor of the "Grove Base Shield."

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
579de846b2 samples: led_lpd8806: Remove outdated link
The "RGB LED strips: an overview" link no longer works and there is no
direct replacement, so there is no point in listing this document in
the references anymore.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
50cced58d2 samples: counter: maxim_ds3231: Fix outdated link
This commit fixes the outdated link to the "Chronodot" product page.

It seems "macetech" no longer lists the older versions of this product
with DS3231, so the link has been replaced with the one from Adafruit.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
e04e9f3958 samples: sensor: th02: Fix outdated link to TH02 datasheet
This commit replaces the outdated link to the TH02 sensor datasheet
with the link to the Si7005 datasheet (the original part name of TH02
is Si7005).

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
ad39da73bb samples: bluetooth: unicast_audio_server: Fix incorrect link
The sample is named `unicast_audio_server`, not `audio_unicast_server`.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
3d80f937fb samples: sensor: ds18b20: Fix incorrect link
This commit fixes the incorrect link to the DS18B20 sensor product
page.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
25062a51c0 samples: sensor: bme280: Fix incorrect link
This commit fixes the incorrect link to the BME250 sensor product page.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
fab0f2afda samples: tfm_integration: Fix TF-M documentation link
Update the link for the TrustedFirmware-M documentation to point to the
official user guide.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
909abaf367 samples: openthread: coprocessor: Fix outdated link
This commit replaces the outdated link to the Tridonic net4more Border
Router product page, which now reports 404, with a link to its
datasheet (it seems like this product is no longer available).

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
6950aa94f7 samples: st_ble_demo: Fix incorrect app link
This commit fixes the incorrect app link and removes other unreferenced
links.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Stephanos Ioannidis
45a8ace1f3 doc: Use inline literals
Use inline literals where applicable -- especially for the words that
contain `@`; otherwise, Sphinx will think it is an email address.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-09-29 12:20:14 +02:00
Jordan Yates
58b65082c2 samples: lora: remove platform_allow
The twister docs specify that `platform_allow` should only be used
if applications can only possibly run on the specified platforms. This
is not the case for these applications, which should be able to run on
any board with LoRa support.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-09-29 08:59:03 +00:00
Jordan Yates
3cf42040ae samples: lorawan: verify region compilation
Issue #49960 showed that individual regions can fail to compile when
enabled. As requested in #50626, validate that each region compiles in
CI.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-09-29 08:59:03 +00:00
Emil Gydesen
3d7af0f272 samples: Bluetooth: unicast audio server stop sending on stopped
When the stopped callback is called, then the CIS is disconnected.
This should stop the sending of data from the server.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-09-27 09:16:21 +00:00
Dominik Ermel
882fe8f951 samples/smp_svr: Remove double inclusion of fs_mgmt.h
Cleanup.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-26 08:08:06 +00:00
Fabio Baltieri
b1715156dd samples: usb: dfu: exclude lpcxpresso55s69_cpu0
Exclude lpcxpresso55s69_cpu0 from the USB DFU tests, this triggers a
build assert due to unsupported flash write block size (512 bytes,
mcuboot supports 8 to 32).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-23 11:31:52 +00:00
Jay Vasanth
3bab0081dd samples: espi: add pinctrl in mec1501 board overlay
update mec1501modular board overlay to include pinctrl
properties for spi

Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
2022-09-21 18:05:32 +00:00
Vinayak Kariappa Chettimada
6843eef4cf samples: Bluetooth: Fix broadcast and receive to wait for all channels
Fix the iso_broadcast and iso_receive sample to wait on
semaphore for all channel establishment and all channel
terminate callbacks to be invoked.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-19 18:11:40 +02:00
Vinayak Kariappa Chettimada
3559abed4d samples: Bluetooth: iso_broadcast increase Tx buffers
Increase the ISO Tx Buffers to avoid throttling of ISO data
transmission when using 2 Broadcast ISO streams.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-19 18:11:40 +02:00
Pirun Lee
5b8b5b86db sample: ots: comply to coding guidelines MISRA C:2012 Rule 14.4
The controlling expression of an if statement
and the controlling expression of an iteration-statement shall have
essentially Boolean type.

Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>
2022-09-19 10:57:10 +02:00
Pirun Lee
f6df36b148 Bluetooth: ots: fix sample data operation error
Peripheral: Fix wrong objects index
Central: Fix client not working after re-connect.
         Check object properties before read/write.

Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>
2022-09-19 10:57:10 +02:00
Thomas Stranger
c1592fd4c7 samples: drivers: can: babbling: start can node
The device must be started before sending any frames.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-09-16 08:26:47 +00:00
Fabio Baltieri
067e82de4a samples: bt: hids: implement a sample report
The peripheral_hids sample currently implements the HID descriptor and
characteristics, but no notify report. Add some code for implementing a
simple one button click report for boards that have sw0 defined, so that
the sample actually does something beside connecting and enumerating the
device.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-15 16:27:35 +00:00
Fabio Baltieri
7eeed4ab73 samples: bt: hids: set report id in the report_map
The default report_map for peripheral_hids mouse sample descriptor is
missing a report id field. This seems to be confusing Android hosts into
somehow parsing reports incorrectly.

Adding a report id seems to fix the problem and still works correctly on
bluez hosts.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-15 16:27:35 +00:00
Francois Ramu
44b9cde054 samples: boards: stm32 serial wakeup form LPUART on nucleo_wl55jc
This overlay shows the LPUART at 9600 with wakeUp capability
to exit the nucleo_wl55jc target plaform from the low Power
stop mode, EXTI_Line 28 is the corresponding wakeUp source.
The LPUART is sourced by the LSE (32768Hz) and max baudrate
is 9600. Set the console to 9600.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-15 15:02:47 +00:00
Ryan Erickson
e7b6e0286a samples: net: wpanusb: exclude pinnacle_100_dvk
This sample does not support the pinnacle_100_dvk

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-09-15 11:58:23 +01:00
Ryan Erickson
37b35fb6e5 samples: net: wpan_serial: exclude pinnacle_100_dvk
This sample does not support the pinnacle_100_dvk

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-09-15 11:58:23 +01:00
Ryan Erickson
894b530f46 samples: mcumgr: smp_svr: Remove pinnacle_100_dvk overlay
The pinnacle_100_dvk enables appropriate drivers by
default if mcuboot is enabled.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-09-15 11:58:23 +01:00
Ryan Erickson
468cee3cd4 samples: net: mqtt_publisher: Remove pinnacle_100_dvk overlay
The pinnacle_100_dvk enables appropriate drivers by
default if networking is enabled.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-09-15 11:58:23 +01:00
Ryan Erickson
de1e50247a samples: net: lwm2m_client: Remove pinnacle_100_dvk overlay
The pinnacle_100_dvk enables appropriate drivers by
default if networking is enabled.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-09-15 11:58:23 +01:00
Aastha Grover
28bf1aaf25 docs: add definition and minimum criteria for samples
Adding guidelines for writing samples which includes definition
and minimum criteria to qualify as a sample.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-09-14 17:27:05 -04:00
Henrik Brix Andersen
180cdc105e drivers: can: add start and stop CAN controller API functions
Up until now, the Zephyr CAN controller drivers set a default bitrate (or
timing) specified via devicetree and start the CAN controller in their
respective driver initialization functions.

This is fine for CAN nodes using only one fixed bitrate, but if the bitrate
is set by the user (e.g. via a DIP-switch or other HMI which is very
common), the CAN driver will still initialise with the default
bitrate/timing at boot and use this until the application has determined
the requested bitrate/timing and set it using
can_set_bitrate()/can_set_timing().

During this period, the CAN node will potentially destroy valid CAN frames
on the CAN bus (which is using the soon-to-be-set-by-the-application
bitrate) by sending error frames. This causes interruptions to the ongoing
CAN bus traffic when a Zephyr-based CAN node connected to the bus is
(re-)booted.

Instead, require all configuration (setting bitrate, timing, or mode) to
take place when the CAN controller is stopped. This maps nicely to entering
"reset mode" (called "configuration mode" or "freeze mode" for some CAN
controller implementations) when stopping and exiting this mode when
starting the CAN controller.

Fixes: #45304

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Anders Storrø
97ed0061cb Bluetooth: Mesh: Remove experimental tag from CDB
The CDB module is a mandatory part of provisioning features in BTM, and
can not be regarded as experimental anymore.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2022-09-12 14:14:27 +00:00
Daniel Leung
47bf9ee51c samples: sensors: add a new one for lsm6dso as I2C on I3C bus
This adds some skeleton files to enable using LSM6DSO on I3C bus
while still acting like a I2C device. The new files here are
simply to provide a way to have overlay for each board that
would not conflict with the pure I2C one. Also this is set to
build only because it require external hardware that is not
necessary on the board being tested.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Daniel Leung
34e353c0a8 samples: sensors: adds a new one for lps22hh on I3C bus
This adds some skeleton files to enable using LPS22HH on I3C bus.
This still uses the C source file for I2C. The new files here
are simply to provide a way to have overlay for each board that
would not conflict with the I2C one. Also this is set to build
only because it may require external hardware that is not
necessary on the board being tested.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Rajkumar Kanagaraj
b32f81642c sample: psa_firmware: Fix the review comments
As suggested updated the docs `west build` command with
zephyr-app-commands.

Signed-off-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@linaro.org>
2022-09-09 16:31:20 -04:00
Rajkumar Kanagaraj
6b67c1a6ff samples: psa_firmware: fix documentation
Updated the document with the correct west build command,
and done some restructuring as well.

Signed-off-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@linaro.org>
2022-09-09 16:31:20 -04:00
Mulin Chao
839031271f driver: espi: npcx: add the controller attached flash sharing API
Add the flash channel support by implementing the controller attached
flash sharing APIs, including flash_read, flash_write, and flash_erase.
For flash_read, the max data payload the module can support is 64 bytes
in one transaction.
For flash_write, the max data payload the module can support is 16
bytes in one transaction.

Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
2022-09-09 16:30:51 -04:00
Gerson Fernando Budke
b5f65f201d boards: arm: stm32l562e_dk_ns: Add flash partitions
The current stm32l562_dk_ns has no flash partitions defined. This add
flash partitions following partition sizes that are compatible with
the TF-M platform defined at flash_layout.h and removes the redundant
overlays board files.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-09-09 16:40:20 +00:00
Thomas Stranger
2ef81686b6 samples/drivers/w1: scanner: add ds2485 overlay
Adds an overlay for the ds2485 and adds a test configuration
for it.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-09-09 14:11:30 +00:00
Francois Ramu
3402dfb3da samples: drivers: stm32h7 octospi enables DMA
Adds the dma transfer for the octoSPI on NOR octo Flash
of the stm32h7b3i and stm32h735g disco kits.
The channel for the MDMA is 0-15.
The MDMA request is 0x16 for the OCTOSPI1 fifo threshold

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-08 10:07:21 +00:00
Francois Ramu
446b09361a samples: drivers: stm32l562 octospi enables DMA
Adds the dma transfer for the octoSPI on NOR octo Flash
of the stm32l562e_dk disco kit.
The channel for the DMAMUX is 0-15 (0-7 for DMA1, 8-15 for DMA2)
The DMAMUX request is 41 for the OCTOSPI.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-08 10:07:21 +00:00
HaiLong Yang
ebc4a37a21 samples: flash_shell: add support for gd32 boards
After add zephyr,flash-controller property, most gd32 boards support
flash_shell sample.

gd32vf103c_starter and gd32vf103v_eval only have 32KB SRAM, so we
should reduce CONFIG_HEAP_MEM_POOL_SIZE to 8KB.

gd32f350r_eval only have 16KB driver, exclude from flash_shell sample.

Signed-off-by: HaiLong Yang <hailong.yang@brainco.cn>
2022-09-08 10:13:05 +02:00
Marek Materzok
33b851f71e boards: frdm_k64f: add SD/MMC support
The FRDM-K64F board has a SD/MMC slot. This patch modifies the DTS
files so that this feature works out of the box. This includes
configuring the SPI peripheral connected to the slot on the board.
This change follows the SD/MMC support for other boards, e.g.
Olimexino-STM32. It was tested on a FRDM-K64F board with the
fat_fs sample.

Signed-off-by: Marek Materzok <tilk@tilk.eu>
2022-09-07 16:37:36 -05:00
Pierre Marzin
10d6685f57 samples: blinky_pwm: add rcar_h3ulcb_cr7 board overlay's
Use dts overlay to declare the pwm-led only when needed.
This is only used for demo purpose of PWM0 on RCAR gen3
boards (H3ULCB only at the moment).

Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
2022-09-07 15:50:49 +02:00
Gerard Marull-Paretas
37c956ffb9 samples: pm: demonstrate usage of the policy latency APIs
Even though we have unit tests that cover the PM policy latency APIs, it
may not be obvious on how to use it in practice. This patch adds a new
sample where both the application and a device driver impose latency
requirements. The sample illustrates how latency requirements are
aggregated and are taken into account when choosing the CPU power state.
The test has been designed to run on native_posix, since it only serves
for demonstration purposes.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-09-07 10:28:55 +02:00
Vinayak Kariappa Chettimada
0c88407a28 samples: Bluetooth: Increase adv data Len for broadcast audio source
Increase the Controller supported Advertising Data Length
Maximum so that Advertising Data set by Broadcast Audio
Source sample is accepted by the controller.

Also, tune down the supported ISO Tx PDU size to suffice the
Broadcast Audio Source usecase.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-06 17:44:38 +02:00
TOKITA Hiroshi
519af86d38 samples: drivers: adc: Add rpi_pico support
Add support for rpi_pico board to adc driver sample.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-09-06 17:11:19 +02:00
Henrik Brix Andersen
424f696ce9 samples: drivers: can: add babbling node sample
In a Controller Area Network a babbling node is a node continuously (and
usually erroneously) transmitting CAN frames with identical - often high -
priority. This constant babbling blocks CAN bus access for any CAN frame
with lower priority as these frames will loose the bus arbitration.

Being able to simulate a babbling CAN node is useful when examining the
behavior of other nodes on the same CAN bus when they constantly loose bus
arbitration.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-09-06 09:56:57 +02:00
Henrik Brix Andersen
795280e2a2 samples: drivers: can: rename the CAN counter sample
Rename the CAN controller "counter" sample to make room for more CAN
related samples.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-09-06 09:56:57 +02:00
Dominik Ermel
60e0c698f6 tests/settings: Switch from FLASH_AREA_ to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
353a8f9682 samples/subsys/settings: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
00c16f6db2 samples: subsys: nvs: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
cf62fa28f8 fs: littlefs: sample: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
df5d7a4cb4 samples: reel_board: mesh_badge: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
35b82cb6da samples: esp32: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
80e34e2a24 samples: usb: mass: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
d69bc24702 samples/soc_flash_nrf: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Dominik Ermel
c696f93014 samples/mgmt/mcumgr/smp_svr: Switch to FIXED_PARTITION_ macros
The commit switches code from using FLASH_AREA_* macros to
FIXED_PARTITION_* macros.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Krishna T
25d0f87b3c net: dhcp: Add support for restarting DHCP
If a L2 link has been established, then the DHCP is taking too long as
it has to go through its capped exponential backoff timers to trigger
discover (The DHCP starts immediately during init, this is itself wrong,
it should start on a link UP notification) that delays the DHCP for
few seconds to a minute.

And if we do stop and start DHCP then also it goes through the initial
delays (though configurable), which is also not ideal.

Add support for restarting DHCP without any delay, i.e., release and
send discover immediately.

This is also useful in case L2 switches to a different subnet, in this
case Zephyr doesn't restart DHCP automatically, this API can be used by
L2 apps/drivers to restart DHCP to get new subnet IP.

Signed-off-by: Krishna T <krishna.t@nordicsemi.no>
2022-09-06 09:56:22 +02:00
Vinayak Kariappa Chettimada
92f289597e samples: Bluetooth: iso_receive: Updated to synchronize upto 2 streams
Updated the iso_receive sample to configure and synchronize
upto 2 BISes in the created BIG sync.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-05 17:37:47 +02:00
Vinayak Kariappa Chettimada
db84c7d679 samples: Bluetooth: iso_broadcast: Updated to broadcast 2 streams
Updated the iso_broadcast to configure and broadcast 2 BISes
in the created BIG.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-09-05 17:37:47 +02:00
Sylvio Alves
d524015f82 samples: boards: remove esp32 wifi sample code
`samples/net/wifi` replaces custom esp32 wifi sample
code. Then it can be removed from main repository.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-05 15:32:34 +00:00
Sylvio Alves
7d9edc8bf0 wifi: esp32: add support to wifi api mgmt
Moved all MBEDTLS dependencies from prj.conf
to Kconfig as WiFi depends on it.

Update esp32 wifi driver to enable `samples/net/wifi`
to work. Commands as such as `wifi connect` and `wifi scan` are now
available.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-05 15:32:34 +00:00
Gerard Marull-Paretas
79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Gerard Marull-Paretas
a6fb18541d samples: net: lldp: remove duplicate include
<zephyr/zephyr.h> was included twice.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Michal Narajowski
5c27067dcd Bluetooth: Mesh: Align Config Client API with Health Client API
This PR adds a `*_cli_*` infix to the Config Client API to match
the changes in Health Client. The old API is marked as deprecated.

Signed-off-by: Michal Narajowski <michal.narajowski@codecoup.pl>
2022-09-05 13:56:25 +03:00
Martin Jäger
e5b049249e samples: net: sockets: can: unconditionally include can.h
This header is also needed for struct can_filter, so it should not
only be included if one wants to set the device into loopback mode.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-09-05 08:57:16 +00:00
Fabio Baltieri
1ecd016e6a sample: smp_svr: fix test name mcumg -> mcumgr
The test names are missing an "r" from "mcumgr" for some reason. Add it
back.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 10:18:10 +02:00
Erwan Gouriou
14ae669a8d samples: sensors: lsm6dso: Fix regex filter following unit fix
https://github.com/zephyrproject-rtos/zephyr/pull/49068 fixed units
displayed by  the sample from dps to rad/s but did not update the
sample twister regex filter.
Fix the filter as well to allow testing in CI.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-02 11:24:08 +00:00
Erwan Gouriou
6654a06fad samples: stm32 serial wakeup: Don't run on stm32l562e_dk in CI
On STM32 PM serial wakeup sample, a power efficient configuration using
lpuart is provided for stm32l562e_dk target.
Though, since default configuration of the board is using ST-Link virtual
port com on uart1, which can't be changed in CI and hence can't be tested,
then remove this target from sample yaml configuration.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-02 11:23:09 +00:00
Parthiban Nallathambi
75479f5338 modbus: add user data for adu callback
add user data for adu callback, which helps in passing
socket and relevant application parameters.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2022-09-02 10:51:57 +02:00
Erwan Gouriou
5106b9cc2a samples: hts221: Fix testing support by twister
-In order to allow non regression of trigger mode in CI, add
a dedicated configuration for this mode
-Fix regex
-Use a filter on compat rather than using a fixture

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-09-01 13:15:14 -05:00
Mahesh Mahadevan
e1818f16fa samples: usb: Exclude frdm_kl25z from USB DFU test
Flash is disabled on frdm_kl25z

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-09-01 12:36:01 -05:00
Kumar Gala
00931ddf77 samples: i2s: echo: Remove DT_COMPAT_<compat> defines
We auto-generate DT_COMPAT_<compat> defines so we dont need to
explicitly define them anymore.

NOTE: we need to source Kconfig.zephyr first to pull in the autogen
Kconfig.dts files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-09-01 14:58:25 +00:00
Kumar Gala
e501c5c1bd wifi: remove defconfig/proj setting of Wifi drivers
Now that Wifi drivers are enabled based on devicetree we can
remove any cases of them getting enabled by *.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-31 21:57:06 +00:00
Florian Grandel
705a8b6ea1 net: ieee802154: introduce consistent MTU definition
Zephyr IEEE 802.15.4 drivers and L2 stack use the same constant names
for different MTU definitions. The intent of this change is to introduce
a consistent MTU definition which can be used everywhere in zephyr to
avoid confusion, bugs and name conflict.

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-08-31 21:52:37 +00:00
Yannick Thesen
8700bfd789 drivers: sensor: Added sample for the Würth Elektronik WSEN-HIDS sensor.
Added sample for the WSEN-HIDS humidity and temperature sensor.

Signed-off-by: Yannick Thesen <Yannick.Thesen@we-online.de>
2022-08-31 21:47:58 +00:00
Henrik Brix Andersen
720eeab30f samples: drivers: can: increase the maximum number of shell arguments
Remove the custom Kconfig value for CONFIG_SHELL_ARGC_MAX as it is too low
to account for the new arguments to the "can send" shell command.

The default for CONFIG_SHELL_ARGC_MAX was increased to 20 in
32ebeb0a5c which is sufficient for sending
non-CAN-FD format frames using the new "can send" shell command.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-31 10:45:35 +02:00
Pirun Lee
c3f2da178b samples: bluetooth: adding central_otc sample
Added a Bluetooth Central sample that demonstrates how to use
GATT Object Transfer Profile.

Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>
2022-08-31 10:39:33 +02:00
Gerard Marull-Paretas
50cfb3a567 samples: drivers: led_pwm: use DT_FOREACH_CHILD_SEP_VARGS
use DT_FOREACH_CHILD_SEP_VARGS to avoid an auxiliary macro.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-30 16:19:57 +02:00
Kumar Gala
492a741d9f crypto: remove proj setting of crypto drivers
Now that crypto drivers are enabled based on devicetree we can
remove any cases of them getting enabled by proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-30 10:43:12 +00:00
Katarzyna Giadla
52fe06495d samples: Rename 'samples' to 'sample'
Samples testcases should start with 'sample'. Some testcases
start with 'samples'.
This commit rename these testcases.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-08-29 07:30:42 -04:00
Katarzyna Giadla
a84531f4fd samples: Add name "sample" in the some samples modules
Some test cases in the module `samples` have not a name of this module.
This change adds the name `sample` to these test cases.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-08-29 07:30:10 -04:00
Flavio Ceolin
86b87ae42d samples: sof: Uses CONFIG_SCHED_CPU_MASK_PIN_ONLY
SoF pins threads to specific cores and don't need them to be executed in
multiple cores. This options allows Zephyr to do cache optimizations
during context switches.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2022-08-29 11:39:02 +02:00
Andy Ross
7f5e1904cc samples: Add fuzz sample
This is a simple example of fuzz test integration with Zephyr apps
that displays LLVM libfuzzer's most important feature: it's ability to
detect and explore deep and complicated call trees by exploiting
coverage information gleaned from instrumented binaries.

See README.rst and the inline comments for details

Signed-off-by: Andy Ross <andyross@google.com>
2022-08-26 11:57:46 +02:00
Aastha Grover
8a730b818b samples: kernel: Add README for simple condition variable sample.
Add README for simple conditional variable kernel sample.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-08-25 13:24:14 -05:00
Kumar Gala
3f8ba07b90 usb_device: remove Kconfig.defconfig* setting of usb device drivers
Now that usb device drivers are enabled based on devicetree
we need to remove any cases of them getting enabled by
Kconfig.defconfig* files as this can lead to errors.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-25 08:05:54 -05:00
TLIG Dhaou
366a32bccf Samples: sensor: stm32_temp_sensor: Edit the yaml file of the sample
-Edit the yaml file of the sample in order to execute tests.

Signed-off-by: TLIG Dhaou <dhaou.tlig-ext@st.com>
2022-08-24 11:35:45 +02:00
Francois Ramu
6bd5ef3137 samples: boards: stm32 serial_wakeup does not check device ready
Since the change in the PR  #49167
samples: boards: stm32: serial_wakeup: fix device usage issues
the sample should not check the "Device ready" anymore

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-23 14:44:44 +00:00
Francois Ramu
db39cd1169 samples: boards: pm on stm32 boards with serial wakeup
This commit retrains the power management testcase
tests/samples/boards/stm32/power_mgmt/serial_wakeup
to bun on stm32 boards only.
Limiting first to nucleo_wg55 and stm32l562dk targets,
more to be added.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-23 14:44:44 +00:00
Vinayak Kariappa Chettimada
e80ff5ff7a samples: Bluetooth: Refactor observer for bsim test reuse
Refactor the observer sample so that it can be reused as
bsim test to verify Extended advertisement chaining.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-23 16:21:00 +02:00
Vinayak Kariappa Chettimada
a5e62b09c4 samples: Bluetooth: Refactor broadcaster multiple for bsim test reuse
Refactor the broadcaster multiple sample so that it can be
reused as bsim test to verify Extended advertisement
chaining.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-23 16:21:00 +02:00
Vinayak Kariappa Chettimada
40115f5d62 samples: Bluetooth: Add Extended Scanning support to Observer sample
Added implementation to Observer sample so that when
Extended Advertising feature is enabled, it can receive
Extended Advertising Reports, and hence receive long AD
data from peer Extended Advertising Broadcaster Multiple
sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-23 16:21:00 +02:00
Vinayak Kariappa Chettimada
4fd7eb2193 samples: Bluetooth: Multiple Broadcaster
Added Extended Advertising multiple advertising set
broadcaster sample.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2022-08-23 16:21:00 +02:00
Carles Cufi
4c26b8518e modules: liblc3: Rename the module for consistency
The old project, liblc3codec, is not used anymore. Rename the Zephyr
module name, folders, and Kconfig options based on the new name, liblc3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-08-22 20:40:59 +02:00
Gerard Marull-Paretas
a202341958 devices: constify device pointers initialized at compile time
Many device pointers are initialized at compile and never changed. This
means that the device pointer can be constified (immutable).

Automated using:

```
perl -i -pe 's/const struct device \*(?!const)(.*)= DEVICE/const struct
device *const $1= DEVICE/g' **/*.c
```

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Gerard Marull-Paretas
aa0a7dfa92 samples: task_wdt: improve device usage
When no hardware device is available, set WDT_NODE to DT_INVALID_NODE.
Also switch to a single initializer using DEVICE_DT_GET_OR_NULL so that
we can constify the pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-22 17:08:26 +02:00
Francois Ramu
e195c3cad3 samples: drivers: adc running on the stm32U575 nucleo board
This change creates an overlay file so that the adc sample
is running on the nucleo_u575zi_q board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-22 10:23:53 +00:00
Piotr Pryga
34438da58e samples: Bluetooth: df: Add use of 16 bits wide IQ sampels
Change implementation of cte_recv_cb to print information about IQ
samples type. The changed code is ready for use of 8 bits and 16 bits
signed integer IQ samples. User has sample level option to enable
printing IQ samples.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-08-19 16:26:10 +02:00
Kumar Gala
de894f8aab dts: Replace DT_LABEL(node) with DT_PROP(node, label)
Toward deprecated DT_LABEL() macro, replace the handful of cases
that use DT_LABEL(node) with DT_PROP(node, label).

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-19 06:49:50 -05:00
Carlo Caione
e05c4b0a92 s2ram: Deal with system off failure
Some platforms have the possibility to cancel the powering off until the
very latest moment (for example if an IRQ is received). Deal with this
kind of failures.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-08-19 12:10:25 +02:00
Adam Zelik
65663516e1 samples: boards: nrf: ieee802154: Remove RTC user channel count setting
Setting CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT here is unnecessary
as the value needed is equal to the default.

Signed-off-by: Adam Zelik <adam.zelik@nordicsemi.no>
2022-08-19 12:08:59 +02:00
Mariusz Skamra
6219c12035 Bluetooth: csis: Expose bt_csis_generate_rsi function
The function will be used to update the RSI value. The returned value
can be later used in advertisement data for set identification. This
removes the need of specific bt_csis_advertise function so that the user
can call the API to generate new RSI once needed (e.g. on RPA change).
This allows the user to manage the advertisement data to fit it's needs.

< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
        Extended advertising: Disabled (0x00)
        Number of sets: 1 (0x01)
        Entry 0
          Handle: 0x00
          Duration: 0 ms (0x00)
          Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Data (0x08|0x0037) plen 33
        Handle: 0x00
        Operation: Complete extended advertising data (0x03)
        Fragment preference: Minimize fragmentation (0x01)
        Data length: 0x1d
        Flags: 0x06
          LE General Discoverable Mode
          BR/EDR Not Supported
        Unknown EIR field 0x2e: 16e61d64dc45
        Name (complete): audio test shell
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Data (0x08|0x0037) ncmd 1
	Status: Success (0x00)
< HCI Command: LE Set Advertising Set Random Address (0x08|0x0035) plen 7
        Advertising handle: 0x00
        Advertising random address: 4E:21:29:F8:94:93 (Resolvable)
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Advertising Set Random Address (0x08|0x0035) ncmd 1
        Status: Success (0x00)
< HCI Command: LE Set Extended Advertising Enable (0x08|0x0039) plen 6
        Extended advertising: Enabled (0x01)
        Number of sets: 1 (0x01)
        Entry 0
          Handle: 0x00
          Duration: 0 ms (0x00)
          Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4
      LE Set Extended Advertising Enable (0x08|0x0039) ncmd 1
        Status: Success (0x00)

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-19 12:07:31 +02:00
Gerard Marull-Paretas
e0125d04af devices: constify statically initialized device pointers
It is frequent to find variable definitions like this:

```c
static const struct device *dev = DEVICE_DT_GET(...)
```

That is, module level variables that are statically initialized with a
device reference. Such value is, in most cases, never changed meaning
the variable can also be declared as const (immutable). This patch
constifies all such cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
dee062bf0b samples: usb: audio: initialize devices at compile time
Initialize devices at compile time, allowing to constify device pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
b84da98b6e samples: net: wpan_serial: initialize devices at compile time
Initialize devices at compile time so that device pointers can be
constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
a74ee417bd samples: net: gsm_modem: initialize devices at compile time
Initialize devices at compile time so that device pointers can be
constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
87d3bb857a samples: ipc: initialize devices at compile time
Initialize devices at compile time so that device pointers can be
constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
af61ed61f5 samples: drivers: ps2: fix test issues
- Test effectively requires a microchip,xec-ps2, but it was "optional"
  even though the test continued setting up a callback that makes use of
  the device.
- Improve test filtering so that it requires a valid compatible to be
  enabled (allows to delete redundant ps2 tag)
- Initialize device at compile time (allowing to constify its pointer)

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
14968b4f0f samples: drivers: peci: improve test
- Require peci-0 alias (test without it is pointless)
- Initialize peci device at compile time
- Filter depending on alias
- Remove redundant peci tag

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
86b5517f99 samples: drivers: espi: initialize devices at compile time
Initialize devices at compile time so that device pointers can be
constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
e4e85d3fa2 samples: boards: stm32: usbc: initialize devices at compile time
Initialize ADC device at compile time, allowing to constify the device
pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
a11848fc32 samples: boards: stm32: serial_wakeup: fix device usage issues
Device ready check was wrong (< 0 ?!), so fix it. Also drop static
qualifier for the device variable (not needed) and initialize at
definition time.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
7fc33f9d47 samples: boards: reel_board: mesh_badge: initialize epd at compile time
Initialize epd device at compile time, so we can constify epd device
pointer.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Gerard Marull-Paretas
f1442c8bcc samples: boards: 96b_argonkey: sensor: init device at compile time
Initialize device at compile time so that device pointer can be
constified.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-19 11:51:26 +02:00
Henrik Brix Andersen
590cd5cb72 drivers: can: rename can_state enumerations
Rename the can_state enumerations to contain the word STATE to make their
meaning more clear:
- CAN_ERROR_ACTIVE  => CAN_STATE_ERROR_ACTIVE
- CAN_ERROR_WARNING => CAN_STATE_ERROR_WARNING
- CAN_ERROR_PASSIVE => CAN_STATE_ERROR_PASSIVE
- CAN_BUS_OFF       => CAN_STATE_BUS_OFF

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 21:41:11 +00:00
Hu Zhenyu
424668f5a7 tests: mec15xxevb_assy6853: Enlarge the IDLE_STACK_SIZE from 256 to 512
The test case "samples/boards/mec15xxevb_assy6853/power_management" could
always pass until commit 5f60164 was merged in. This patch changes the sem
take timeout value from 50ms to forever of the log thread, it will make the
idle thread run longer and takes more stack memory. Analyzed the coredump
of the failed test case, it can be found that the test case stucks at
z_idle_stacks. The test case used default CONFIG_IDLE_STACK_SIZE = 256 in
kernel/Kconfig, now we increase the value to 512 in prj.conf for this test
only. With this change, the test case can pass with the commit of 5f60164.
Fixes #47987

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-08-18 21:38:56 +00:00
Daniel Leung
ee40548788 samples: condvar: extra stack space for custom threads
When coverage is enabled, some boards require more stack space
for the custom threads created in main(). Since this "samples"
already has CONFIG_TEST enabled, we can pad the stack size
with CONFIG_TEST_EXTRA_STACK_SIZE.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-08-18 17:23:18 +02:00
Emil Gydesen
a301afca93 samples: Bluetooth: Restrict Audio TX length to SDU for unicast audio
Restrict the unicast audio samples to not send more data than
the configured SDU.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-18 12:33:44 +02:00
Måns Nilsson
1acd4bf422 samples: add support for optimized CMSIS-NN kernels
Updates tflite-micro sample hello_world to use CMSIS-NN optimized
kernels. This is also documented in the corresponding README file.

Signed-off-by: Måns Nilsson <mans.nilsson@arm.com>
2022-08-18 12:26:51 +02:00
Henrik Brix Andersen
27eb12ed48 net: socketcan: decouple SocketCAN and CAN controller headers
Decouple the zephyr/net/socketcan.h and zephyr/drivers/can.h header files
by moving the SocketCAN utilities to their own header.

This is preparation for including the SocketCAN types defined in
socketcan.h in a native posix (Linux) SocketCAN driver context without name
clashes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Henrik Brix Andersen
d1d48e8304 net: socketcan: rename SocketCAN header from socket_can.h to socketcan.h
Rename the SocketCAN header from socket_can.h to socketcan.h to better
match the naming of the functionality.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Henrik Brix Andersen
b40a8cb9fd net: socket: can: rename utility functions
Rename the SocketCAN utility functions to reflect the new naming of the CAN
controller API and SocketCAN API data types.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Henrik Brix Andersen
13c75417ba drivers: can: remove z prefix from public CAN API types
Remove the "z" prefix from the public CAN controller API types as this
makes them appear as internal APIs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Henrik Brix Andersen
d159947443 net: socket: can: prepend SocketCAN data types with socketcan
Rename the SocketCAN data types to "socketcan_*" in preparation of renaming
the low-level CAN controller API data types.

This breaks the naming compatibility with the similar SocketCAN data types
from the Linux kernel, but Zephyr and Linux SocketCAN are not 100%
compatible anyways (only the structure fields are compatible, extended
functionality such filtering, error reporting etc. are not).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-08-18 10:19:29 +02:00
Maureen Helm
4dfc43e296 samples: sensor: Fix displayed gyro units in lsm6dso sample
The sensor driver API specifies gyroscope units in radians/second, not
degrees/second. Fix the lsm6dso sample application printk string to
display the correct units.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-17 17:06:23 +02:00
Katarzyna Giadla
eae01f0fc5 samples: tests: Rename duplicated testcases
Names of some testcases are duplicated in another files.
This change rename duplicated testcases.

Signed-off-by: Katarzyna Giadla <katarzyna.giadla@nordicsemi.no>
2022-08-17 12:11:00 +02:00
Marcin Niestroj
af37c09440 modules: mbedtls: convert mbedTLS log levels to Zephyr log levels
So far LOG_DBG() was used inside debug hook for mbedTLS library. This meant
that it was hard to distinct log messages by simply looking at the log
level number, even though Zephyr logging subsystem supports colorful logs
depending on log level.

Choose an appropriate Zephyr LOG_*() macro based on log level coming from
mbedTLS library. Remove log level number from formatted log messages, as it
is now redundant.

One controversial thing about this change is that mbedTLS' "2 State change"
log level is mapped to Zephyr's "warning" log level. Those are not really
warnings in real life, but rather informational messages. However, using
"warning" log level for those allows to clearly distinguish between "2
State change" and "3 Informational" debug messages from mbedTLS.
Additionally, mbedTLS debug message implementation does not seem to be safe
to use in production, so keeping in mind MBEDTLS_DEBUG will be enabled just
during debugging phase, printing "2 State change" logs as warnings should
not be a big deal.

Set default MBEDTLS_DEBUG_LEVEL value depending on selected Zephyr logging
module level, so that only single option needs to be configured in
application project.

Remove prompt for MBEDTLS_DEBUG_LEVEL, so that interactively (e.g. via
menuconfig) adjusting MBEDTLS_LOG_LEVEL will always result in automatically
updating MBEDTLS_DEBUG_LEVEL option. This is to prevent so called "stuck
symbol syndrome".

Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
2022-08-17 12:03:52 +02:00
Tim Cooijmans
ea80d9e1d7 samples: drivers: lora: Add public_network and iq_inverted config
Explicitly set the newly add public_network and iq_inverted settings
in lora_modem_config in the lora send and receive samples.

Signed-off-by: Tim Cooijmans <timcooijmans@gmail.com>
2022-08-16 18:06:18 +02:00
Felipe Neves
d94dc98fd6 soc: xtensa: esp32_net: fixes include paths
that were changed with zephyr prefix  after rebasing.
Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-08-16 18:06:02 +02:00
Felipe Neves
d808fa2c6d samples: drivers: ipm_esp32: add return
when ipm driver initialization fails.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-08-16 18:06:02 +02:00
Felipe Neves
a5379b71f8 drivers: ipm: ipm_esp32: remove hardcoded nodelabels
by making shared memory property  of IPM binding.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-08-16 18:06:02 +02:00
Felipe Neves
0e17b8307a samples: drivers: ipm: added esp32 sample
code to demonstrate the utilization of assymetric
dual core infrastructure based on soft-IPM implementation.

Signed-off-by: Felipe Neves <felipe.neves@linaro.org>
2022-08-16 18:06:02 +02:00
Manuel Arguelles
7f26c1c25c tests: samples: revert timeout change for FVP BaseR
Partially revert commit 0028e9733295316d152eba07bf56677d83f4b1b5.
Timeout for tests/posix/common must be still increased for slow
platforms (previously was 120 sec).

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-08-16 15:51:38 +02:00
Kumar Gala
1ddcb3ab02 ethernet: remove defconfig/proj setting of ethernet drivers
Now that ethernet drivers are enabled based on devicetree we can
remove any cases of them getting enabled by proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-15 14:32:45 +02:00
Thomas Stranger
daa477f75b samples/tests: w1: remove overlays after moving to 'select bus'
Because 1-wire drivers no longer use depends on serial/i2c, but select
the Kconfig for the bus they depend on, several overlays can be removed.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-08-14 09:08:19 -05:00
Kumar Gala
632069b3de video: remove defconfig/proj setting of video drivers
Now that video drivers are enabled based on devicetree we can
remove any cases of them getting enabled by proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-14 09:05:36 -05:00
Kumar Gala
d8e6aed92f audio: remove defconfig/proj setting of audio drivers
Now that audio drivers are enabled based on devicetree we can
remove any cases of them getting enabled by proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-14 09:05:09 -05:00
Kumar Gala
8eead50071 manifest: Update lvgl
Update lvgl for devicetree updates to use zephyr,keyboard-scan.

Remove Kconfig symbol (LV_Z_POINTER_KSCAN_DEV_NAME) that don't exist
anymore since these values are coming from devicetree.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 17:54:03 -05:00
Kumar Gala
5ac8fca9cb kscan: Introduce zephyr,keyboard-scan chosen prop
Introduce zephyr,keyboard-scan chosen node property to point to the
node that implements the default KSCAN device.  This is similar to
the zephyr,display property.

We switch over the samples to utilize the new property instead of
kscan0 alias.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 17:54:03 -05:00
Kumar Gala
5281b58d29 samples: espi: disable SAF testing
espi saf node is not enabled in mec15xxevb_assy6853.dts so the sample
will fail to build.  For now disable CONFIG_ESPI_SAF to get the sample
to build.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 17:59:05 +02:00
Kumar Gala
9e8fb08c0f eeprom: remove defconfig/proj setting of eeprom drivers
Now that eeprom drivers are enabled based on devicetree we can
remove any cases of them getting enabled by proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-12 11:34:16 +02:00
Erwan Gouriou
f5378424f7 samples: boards: stm32: Add a serial wakeup sample
Add a sample to demonstrate use of (LP)U(S)ART with wakeup capability
This sample is provided with 2 configurations
- nucleo_wb55rg: Basic configuration that could be exercised in CI
- stm32l562e_dk: "Full feature" configuration that require some set up
configuration (be able to display console from lpuart) and allows to
achieve lowest power consumption.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-08-12 08:51:38 +01:00
Johann Fischer
9a1b990006 modbus: remove label property from devicetree overlays
Remove label property from devicetree overlays.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-08-11 09:39:24 -07:00
Johann Fischer
46a0e5347d modbus: remove the use of DT_INST_LABEL and DT_PROP(inst, label)
Although it is possible to simply use the interface number,
it has proven convenient to use the names for the interfaces
in the samples.

Migrate to DEVICE_DT_NAME().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-08-11 09:39:24 -07:00
Francois Ramu
8ec02948c5 samples: drivers: watchdog application running on stm32 boards
Adding configuration to run the watchdog sample application
on the stm32 boards through 2 common overlay files:
one for running on the IWDG one for WWDG, if compatible.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-08-11 17:47:05 +02:00
Kumar Gala
0e1a7e0241 drivers: led: Remove unnecessary Kconfig settings
Having the LED device enabled in devicetree will now get the driver
enabled by default when CONFIG_LED=y is set.  So we can remove
setting driver enabling Kconfig values in various .conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-11 17:46:43 +02:00
Kumar Gala
6de4cc5293 samples: i2s: echo: exclude litex_vexriscv
The litex platform has its own sample and echo sample does not
build on litex_vexriscv so exclude it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-11 12:20:33 +02:00
Hang Fan
7bc54c168f samples: bluetooth: set available contexts for unicast audio server
set available contexts for unicast audio server

Signed-off-by: Hang Fan <fanhang@xiaomi.com>
2022-08-10 16:10:48 +02:00
Krzysztof Frydryk
8dd57467cc drivers: dai: Enable Zephyr runtime power mgmt in Intel SSP driver
Enable Zephyr device runtime power management mechanisms in Intel SSP
driver. This allows Zephyr to track usage reference for power
domain gating.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-08-10 11:58:45 +02:00
Gerard Marull-Paretas
e2e9155dd5 boards: remove unused tag from supported list
All IEEE 802.15.4 tests/samples use DT-based filter now, so the
ieee802154 tag can be deleted.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
b74a22924e net: lib: config: remove NET_CONFIG_IEEE802154_DEV_NAME
Remove NET_CONFIG_IEEE802154_DEV_NAME in favor of DT based choice using
zephyr,ieee802154.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
b27f89342f samples: net: sockets: echo_(client|server): remove IEEE802154_DEV_NAME
Remove usage of CONFIG_NET_CONFIG_IEEE802154_DEV_NAME as it now works
with DT based choice.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
5b224055ba samples: net: openthread: coprocessor: remove Kconfig IEEE802154 choice
Remove Kconfig choice for IEEE802154. In this case, there's no in-tree
board, so there's no overlay or board to be updated.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
ec05fa81ff samples: net: wpan(usb|serial): filter based on zephyr,ieee802154
Rely on zephyr,ieee802154 choice being enabled for the samples.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
f0dab27dd8 samples: net: wpan_serial: use zephyr,ieee802154
Use the choisen zephyr,ieee802154 from DT as
CONFIG_NET_CONFIG_IEEE802154_DEV_NAME is being phased out.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Gerard Marull-Paretas
96c33ad2cb samples: net: wpanusb: use zephyr,ieee802154
Use the choisen zephyr,ieee802154 from DT as
CONFIG_NET_CONFIG_IEEE802154_DEV_NAME is being phased out.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-10 11:57:34 +02:00
Robert Lubos
2091b34820 net: zperf: Extract zperf into library
Make a library out of the zperf shell sample. This makes to enable the
module in any application, not only the dedicated sample.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-08-10 11:15:21 +02:00
Joakim Andersson
c51505f661 modules: tfm: Exclude non-secure TF-M application from build
Exclude the non-secure TF-M application from being built by TF-M.
This also stops the building of the tfm_ns_api library that we were
linking against.
This library is defined by the tf-m regression tests.
Add the installed interface source files exported by the TF-M build
system compile them in the zephyr build system.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-08-09 13:59:02 +02:00
Daniel DeGrasse
b896826cab samples: gptp: increase number of ethernet RX buffers for RT1050/1060
RT1050 and RT1060 were selecting an invalid number of RX/TX buffers
(below the allowed default). Raise this value for the gptp sample.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-09 12:29:18 +02:00
Daniel DeGrasse
21d9ffaf66 samples: zperf: enable hardware acceleration for RT1050/RT1060
enable hardware acceleration of ethernet checksum calculation for
RT1050 and RT1060

Performance change (as tested with iperf on RT1050)
TCP RX: 50.6Mbps->52.4Mbps
TCP TX: 49.5Mbps->50.2Mbps

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-09 12:29:18 +02:00
Daniel DeGrasse
929db1ba65 samples: zperf: use systick timer for RT1050
Use systick timer for RT1050 to provide better performance than low
frequency GPT timer

Performance change (as tested with iperf on RT1050)
TCP RX: 49.1Mbps->50.8Mbps
TCP TX: 40.8Mbps->46.2Mbps

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-08-09 12:29:18 +02:00
Kumar Gala
63769bd1c1 drivers: display: Remove unnecessary Kconfig settings
Have the display enabled in devicetree will now get the driver
enabled by default when CONFIG_DISPLAY=y is set.  So we can remove
setting driver enabling Kconfig values in various .conf and
defconfig files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-09 12:27:44 +02:00
Maureen Helm
17437f9dc5 samples: sensor: Remove adxl372 accelerometer sample
The accel_polling sample application supports the adxl372 driver, so we
can remove this redundant driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-09 12:27:07 +02:00
Maureen Helm
5306db05af samples: sensor: Remove adxl362 accelerometer sample
The accel_polling sample application supports the adxl362 driver, so we
can remove this redundant driver-specific sample.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-08-09 12:27:07 +02:00
Glauber Maroto Ferreira
7a58522b54 esp32: counter: samples: fix build config
Remove unnecessary build config and rename
Kconfig build variable.

Signed-off-by: Glauber Maroto Ferreira <glauber.ferreira@espressif.com>
2022-08-08 13:00:38 -05:00
Georgios Vasilakis
eeb970ebba samples: tfm_integration: tfm_regression_test Default to isol level 2
This defaults the TF-M regression tests to isolation level 2.
It is set in order to showcase a more secure configuration
by default. The default behavior of the sample is changed in
the prj.conf file. The yaml file which includes the test cases
enables testing for the three configurations: the library mode,
the IPC mode isolation level 1 and the IPC mode isolation level 2.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
2022-08-08 14:17:53 +02:00
Pirun Lee
5d1e59b984 bluetooth: ots: fix stack overflow
Default size of BT_RX_STACK_SIZE 1024 is not enough for this sample.
Increase it to prevent stack overflow.

Signed-off-by: Pirun Lee <pirun.lee@nordicsemi.no>
2022-08-08 14:16:26 +02:00
Kumar Gala
6986cb5b7d samples: nrf53_sync_rtc: drop IPM support
Nordic platform utilizes mailbox so remove the IPM support
from this sample.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-08 10:52:10 +02:00
Kumar Gala
daf7609cb7 boards: arm: nrf5340: Drop RPMSG service configuration
The preferred ipc service on NRF platforms is ipc_service.  Remove
configuration for rpmsg_service and just utilize ipc_service.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-08 10:41:55 +02:00
Reto Schneider
1c1801ee7f drivers: eeprom: Fix format strings
Building for native_posix_64 exposes faulty format strings.

Changes in this commit also ensure that the shell code gets built in CI,
thus this kind of problem can not be introduced again later on.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-08-07 14:29:36 +01:00
Kumar Gala
aaaed30071 samples: openamp_performance: remove sample
Remove sample as its only supported on one platform, should really
utilize the ipc subsystem, and so forth.

For now its better to drop it and when we have something better we
can add that.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-05 15:16:47 +02:00
Gerard Marull-Paretas
61361e870b kconfig: remove redundant IEEE 802.15.4 defaults or selections
All IEEE 802.15.4 drivers are now automatically enabled if they are
'okay' in DT and all of its dependencies are 'y', including
CONFIG_IEEE802154. This means individual driver enablement is not
necessary anymore in Kconfig.defconfig files or samples/tests. Boards
need to still make sure any dependencies are enabled, e.g. SPI bus in
some cases.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:56:47 +02:00
Gerard Marull-Paretas
cb448591ed samples: modules: tflite-micro: magic_wand: add missing CONFIG_I2C=y
The magic_want sample requires I2C bus to be enabled (used sensor is
connected to the bus).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
Gerard Marull-Paretas
c26d7259f8 samples: drivers: lcd_cyclonev_socdk: add missing CONFIG_I2C=y
The sample relies on using I2C API, so it must enable CONFIG_I2C.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-05 12:55:51 +02:00
TOKITA Hiroshi
4c326ea5da samples: sensor: accel_polling: Correct integration platform name
bl5340_dvk is a non-exists target.
I fix it to bl5340_dvk_cpuapp to fix the CI error.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-08-05 00:00:09 +09:00
TOKITA Hiroshi
9179350c40 samples: sensor: Add 3-Axis accelerometer polling sample
Add a polling sample for 3-Axis accelerometers.
This sample demonstrates how to data fetch and print to the console.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-08-04 09:06:57 -05:00
Kumar Gala
e6357ae160 samples: openamp: Convert to use DEVICE_DT_GET
Update sample to use DEVICE_DT_GET to remove usage of
device_get_binding.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-04 08:38:54 -05:00
Troels Nilsson
745cc6d099 samples: bluetooth: Update central_multilink to support ext. adv.
Small update to have the central_multilink sample work correctly
with extended advertising (when enabled)

Signed-off-by: Troels Nilsson <trnn@demant.com>
2022-08-04 13:45:17 +02:00
Juha Heiskanen
43c8bfb3e5 samples: net: lwm2m_client: Updated RD client event handler
Added missed LWM2M_RD_CLIENT_EVENT_ENGINE_SUSPENDED event handler

Signed-off-by: Juha Heiskanen <juha.heiskanen@nordicsemi.no>
2022-08-04 13:42:55 +02:00
Gerard Marull-Paretas
e6a345f967 drivers: ieee802154: uart_pipe: make driver DT-based
Use Devicetree to describe the UART UPIPE IEEE 802.15.4 driver. This
allows to remove usage of IEEE802154_UPIPE_DRV_NAME in preparation for
the removal of NET_CONFIG_IEEE802154_DEV_NAME.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-04 13:25:35 +02:00
Aastha Grover
5d23d4f4a6 samples: kernel: metairq: Update ReadMe
Update ReadMe for metairq sample application.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-08-03 14:00:22 -05:00
Gerard Marull-Paretas
44250fe3d3 soc: arch: synopsys: move timer0/1 IRQ information to DT
timer0/1 IRQ information was hardcoded in soc.h, however, Devicetree is
nowadays a better place to describe hardware. Note that I have followed
existing upstream Linux code to do these changes.

Ref.
- https://elixir.bootlin.com/linux/latest/source/arch/arc/boot/dts/
  hsdk.dts
- https://elixir.bootlin.com/linux/latest/source/Documentation/
  devicetree/bindings/timer/snps,arc-timer.txt

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-08-03 07:46:14 -04:00
Anas Nashif
31e0d86484 samples: do not use CONFIG_TEST_EXTRA_STACK_SIZE
samples should not use CONFIG_TEST_EXTRA_STACK_SIZE, instead, they
should set the recommended stack size directly.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-08-03 11:22:20 +02:00
Veijo Pesonen
ebaf501de9 samples: net: lwm2m: overlay for interop testing
For further details about interoperability testing please see

   * https://lwm2m.openmobilealliance.org/ - Test V1.1 12-Sep-2019

Signed-off-by: Veijo Pesonen <veijo.pesonen@nordicsemi.no>
2022-08-03 11:20:50 +02:00
Robert Lubos
7a626bfd2c samples: net: sockets: packet: Wait for the interface to come up
Make sure that the network interface is up before running the sample.
Otherwise, the sample could stop rightaway due to send failure.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-08-03 11:11:55 +02:00
Robert Lubos
189964ae1b samples: net: sockets: packet: Make sure all sockets are closed on exit
First off, fix the FD check when closing a socket - currently not all
sockets were closed on exit (0 is also a valid file descriptor).

Second issue is the use of k_thread_abort() on tx/rx threads. The
receving thread was blocked in recv(), and aborting its thread prevented
it from ending gracefully (i. e. the socket mutex allocated in recv()
was not released as the function did not exit properly). This resulted
on a consecutive `close()` call lock. Fix this by setting a timeout on a
receiving socket, and instead of aborting threads allowing them to exit
gracefully.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-08-03 11:11:55 +02:00
Fabio Baltieri
def230187b test: fix more legacy #include paths
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-08-02 16:41:41 +01:00
Dominik Ermel
63c2347207 samples/nvs: Switch flash_area_offset to use STORAGE_NODE_LABEL
The sample has been defining STORAGE_NODE_LABEL to be used
to point to storage partition, but flash_area_offset has still
been using "storage" directly.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-08-02 15:18:19 +02:00
Piotr Pryga
a0a8a12642 Bluetooth: hci: Use extended VS fatal error in hci and hci_rpmsg sample
Provide common helper functions to create extended extended Zephyr
Fatal Error functionality in HCI common code.

Use the implementation in hci_rpmsg sample.

The sample didn't provide an information about Controllers assert
or system fatal error to an application code while run with nRF5340
SoC. The goal for hci_rpmsg sample change is to enhance user experience
for conformance testing of the Bluetooth Controller while executed with
nRF5340.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2022-08-02 13:53:32 +02:00
Emil Gydesen
404d0c7a6e samples: Bluetooth: Unicast audio server set location
The unicast audio server sample did not set a location value,
and would report an invalid value of 0 when read.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-08-01 18:11:26 +01:00
Mariusz Skamra
acb9da2ba0 Bluetooth: samples: Add HAP Hearing Aid sample application
This adds sample application that can be used as reference
implementation and for HAP qualification purposes.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2022-08-01 18:10:34 +01:00
Hake Huang
cedc99b8ed samples: application_development: remove the code_relocation sample
covert this sample to a test cases

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-08-01 18:09:28 +01:00
Benjamin Björnsson
e172b1dbda debug: gdbstub: Move to DTS for uart device
Move from using Kconfig GDBSTUB_SERIAL_BACKEND_NAME to a devicetree
chosen property ("zephyr,gdbstub-uart"). This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-08-01 09:09:45 -07:00
Kumar Gala
346ac6b896 samples: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-08-01 17:59:32 +02:00
Caspar Friedrich
f2a7b88ef5 samples: Add 1-Wire scanner example
This adds a simple example to show basic 1-Wire bus operations

Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
2022-08-01 10:33:10 +02:00
Dominik Ermel
21f1c54089 samples/soc_flash_nrf: Fix flash device reference
Sample has been referencing flash area by its label, but flash device
by chosen `zephyr,flash-controller`, while flash area does not have
to be positioned on a device selected by the chosen directive.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-07-30 08:26:21 -05:00
Pieter De Gendt
7256a19056 samples: modules: nanopb: Limit the integration platforms
Reduce the number of build tests by explicitly setting the
integrations platforms.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-07-29 13:35:48 -04:00
Kumar Gala
2014c59d20 clock_control: remove defconfig/proj setting of clock control drivers
Now that clock control drivers are enabled based on devicetree we
can remove any cases of them getting enabled by *defconfig and
proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 14:12:12 +02:00
Kumar Gala
930f56baef samples: tracing: Add filter for uart tests
Add a filter to make sure devicetree chosen node has
property 'zephyr,tracing-uart' set in it.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 05:57:54 -04:00
Kumar Gala
3c9932ddf8 samples: tracing: make example in readme work
Add mps2_an521.overlay so that the example in the README.txt will
actually build.  Update README.txt to document needing to have
'zephyr,tracing-uart' property set under chosen node in devicetree.

Fixes #48416

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-29 05:57:54 -04:00
Aastha Grover
66786ed612 samples: Add missing sample.yaml
Adding the yaml files to sub-applications to avoid bitrot and
specifying the main applications with remote harness instead of
build_only.

Fixes #47613

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-28 20:51:14 +02:00
Kumar Gala
add2b28a3b samples: 96b_argonkey: Have README match actual code
Update README.rst code snippet to match what the actual code
was doing.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-28 08:50:27 -05:00
Emil Gydesen
d4b132a059 Bluetooth: Audio: Unicast client read available contexts
Read the available contexts during discovery and subscribe
for notifications.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-28 08:29:29 +02:00
Francois Ramu
8aa3960874 samples: drivers flash add a test case for stm32h7 octospi
This add a removes the SPI config
for the stm32H735 and stm32H7b3 disco boards
when testing the octoSPI.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-27 18:46:25 +02:00
Kumar Gala
fb9c241530 spi: remove defconfig/proj setting of SPI drivers
Now that SPI drivers are enabled based on devicetree we can remove
any cases of them getting enabled by *defconfig and proj.conf files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-27 09:49:00 +02:00
Håvard Reierstad
a68e52d848 samples: bluetooth: mesh_provisioner: push button to provision
In order to keep a flashed sample from provisioning forever, the sample
requires the user to press a button to provision a detected device.

The feature is only enabled if the board has a push button connected
via GPIO.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2022-07-27 09:46:39 +02:00
Dominik Ermel
3d64a0df6a samples: reel_board: mesh_badge: Select flash controller by area
Flash controller has been specified by `zephyr,flash-controller`
chosen DTS, which does not have to be the same controller as
a flash area exists on.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-07-26 14:10:16 -05:00
Alexandre Bourdiol
2495a06f1a samples: subsys: nvs: disco_l475_iot1: keep quadspi node
Due to introduction of alias spi-flash0
sha1: 64fbbd9a44
it is necessary to keep quadspi node
Instead of removing quadspi node, remove storage_partition node

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2022-07-26 14:34:17 +00:00
Kumar Gala
46850a12d3 samples: lwm2m_client: Fix building on native_posix
Sample code uses GPIO api's but wasn't enabling CONFIG_GPIO.  So
on native_posix this would cause the sample to not build.  Add
CONFIG_GPIO=y to prj.conf to fix this.

Fixes #48306

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-26 14:33:18 +00:00
Anas Nashif
ae8c4a934e samples: move sof under samples/modules
This is not a sample of an audio subsystem in zephyr, it is a sample
that completely depends on sof and its audio support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-07-25 14:41:37 -04:00
Kumar Gala
5d36157c7c sensors: Remove unnecessary Kconfig setting of sensors
Sensor Kconfig sybmols should be enabled if CONFIG_SENSOR=y
and the devicetree node for the sensor is enabled.  We can
remove explicitly enabling specific sensor drivers in .conf
files.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 15:18:56 +02:00
Carlo Caione
780ee52bde samples: Add missing READMEs
Add some missing README.rst

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-25 15:17:48 +02:00
Carlo Caione
ecdf224766 samples: Specify the remote harness
Instead of 'build_only'.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-25 15:17:48 +02:00
Carlo Caione
badafa59c5 samples: Add missing sample.yaml
Some samples are missing the sample.yaml file.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-25 15:17:48 +02:00
Kumar Gala
ef964ca4e1 samples: th02: simplify sample and use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE to remove usage of
device_get_binding.  Additionally simplfy the sample to
just access a single TH02 device.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-25 09:39:51 +02:00
Benjamin Björnsson
e81c0b07e2 samples: subsys: mgmt: updatehub: Update sample to use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE in order to remove DT_INST
usage.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-24 14:33:15 -05:00
Benjamin Björnsson
6ede1da434 samples: drivers: led_pwm: Update driver to remove DEVICE_DT_GET
Update driver to use DEVICE_DT_GET and remove usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-23 11:39:11 -05:00
Kumar Gala
6b5ae7799a samples: fpga: Convert to test to use use DEVICE_DT_GET
Update sample to use DEVICE_DT_GET to remove usage of
device_get_binding.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-23 09:28:40 -05:00
Kumar Gala
f2bcc794cd mgmt: osdp: Move to DTS for uart device
Move from using Kconfig OSDP_UART_DEV_NAME to a devicetree
chosen property ("zephyr,osdp-uart").  This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".

Changed the integration platform for the osdp samples to
stm32_min_dev_black as it already has zephyr,osdp-uart set.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-23 09:25:23 -05:00
Benjamin Björnsson
84649d2d83 samples: drivers: spi_flash: Update sample to use alias
Simplify driver by using DT_ALIAS instead of DT_LABEL.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-22 19:15:13 +00:00
Carlo Caione
d7f24b1743 sample: s2ram: Use harness remote
The sample requires a manual user interaction. Make CI skipping that by
requiring a remote harness (the user).

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-22 14:04:08 +00:00
Benjamin Björnsson
45cecadb35 samples: net: gsm_modem: Update sample to remove use of DT_INST
Simplify sample by removing usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-21 17:26:44 -05:00
Francois Ramu
31b9a6acc6 samples: usb: audio application uses static dev declaration
This change the applications to get device from the
compatible of the zephyr_udc0 node.
It is defined by the DTC_OVERLAY_FILE="app.overlay"

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-07-21 13:24:24 -05:00
Kumar Gala
894e8814af drivers: serial: rv32m1_lpuart: Remove unused Kconfig symbols
The driver has be DT_INST based for a while so the Kconfig
symbols CONFIG_UART_RV32M1_LPUART_<n> aren't used.  So lets
remove them.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-21 16:40:28 +00:00
Benjamin Björnsson
c8ba22f561 samples: sensor_batch_processing: Update sample to remove DT_INST
Update sample to use DT_COMPAT_GET_ANY_STATUS_OKAY in order to remove
DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-21 14:01:55 +00:00
Kumar Gala
6cfaa9c381 samples: crypto: Convert to use Update sample to use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE to remove usage of
device_get_binding if the device is devicetree based.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-21 14:00:38 +00:00
Benjamin Björnsson
5ad251b8d2 samples: sensor: tmp116: Update sample to remove use of DT_INST
Simplify sample by removing usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-21 08:28:29 -05:00
Benjamin Björnsson
706949cf71 samples: drivers: espi: Convert to use DT_NODELABEL
Convert to use DT_NODELABEL to remove usage of DT_INST in sample.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-21 06:06:02 -05:00
Benjamin Björnsson
2bed3950c3 samples: drivers: ht16k33: Update sample to remove use of DT_INST
Simplify sample by removing usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-21 05:31:57 -05:00
Fabio Baltieri
dd24c61a4a samples: fix shell_module Kconfig menu name
Shell sample has the wrong mainmenu name, rename it one that makes
sense.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-07-20 09:41:32 -05:00
Kumar Gala
60d3d49405 samples: boards: arc_secure_services: Remove empty prj.conf
We get the following error message from twister:

ERROR   - samples/boards/arc_secure_services/prj.conf:
          can't find: cannot mmap an empty file

Fix by removing the empty file.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-20 09:29:11 -05:00
Thomas Stranger
0cb7a1edcd samples/drivers/dac: add overlay file for nucleo_u575zi_q
Add overlayfile for the dac sample to use dac1_out1 on pa4.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-07-20 11:08:42 +02:00
Kumar Gala
dcfcd05ed3 tracing: Move to DTS for uart device
Move from using Kconfig TRACING_BACKEND_UART_NAME to a devicetree
chosen property ("zephyr,tracing-uart").  This is similar to a number
of other functions like "zephyr,shell-uart" or "zephyr,bt-uart".

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 16:00:47 -07:00
Benjamin Björnsson
93f71d6a8a samples: boards: nrf: battery: Remove uneccesary if-def
Remove if-def since io-channels is a required property of
the voltage-devider compatible so the else case won't happen.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 22:54:50 +00:00
Kumar Gala
c77035c61e samples: module: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:00:36 -07:00
Kumar Gala
6f5e75ba31 samples: usb: dfu: Fix building of sample on a few platforms
Fix building this sample on bl5340_dvk_cpuapp_ns and
pinnacle_100_dvk.  On these boards the NORDIC_QSPI_NOR
driver needs to be enabled for the sample to build.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 15:29:41 +00:00
Benjamin Björnsson
1f630f838a samples: drivers: watchdog: Update sample to use alias
Simplify sample by using DT_ALIAS to make the sample more generic.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson
f047816f0f samples: drivers: watchdog: Add alias to overlays
Add alias to overlays for boards that switch the watchdog to be
used while running this sample.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson
ab4a926c27 boards: Add alias to boards with watchdog enabled
Add alias to boards with watchdog enabled to facilitate the
move of samples/drivers/watchdog to use DT_ALIAS.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Benjamin Björnsson
55d47d341a samples: drivers: watchdog: Remove uneccesary overlays
These watchdogs are already enabled in device tree.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-19 09:28:43 -05:00
Kumar Gala
88021ecd47 samples: sensors: Remove label property from devicetree overlays
Label properties are not required

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 08:23:35 -05:00
Kumar Gala
a97765706a samples: boards: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 12:32:14 +00:00
Emil Gydesen
df75bfd8f6 Bluetooth: Audio: Add PACS location read for unicast client
The unicast client will now read the PACS location value
during the discovery procedure, as well as subscribing to
it.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2022-07-19 12:27:00 +00:00
Henrik Brix Andersen
7da63e1551 samples: net: sockets: can: add console harness configuration
Add a console harness for validating the output from the SocketCAN sample.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-19 10:31:10 +02:00
Henrik Brix Andersen
dd96b86835 net: samples: sockets: can: add support for native_posix
Add support for running the SocketCAN sample on
native_posix/native_posix_64 using the CAN loopback interface.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-07-19 10:31:10 +02:00
Kumar Gala
a8c400d1a5 samples: net: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:30:39 +02:00
Kumar Gala
28143b1cdc samples: subsys: Remove label property from devicetree overlays
"label" properties are not required.  Remove them from samples.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-19 10:30:20 +02:00
Carlo Caione
ec0b3148cc test: syscall_perf: Do not re-define csr_read
No need to re-define csr_read().

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2022-07-18 12:22:00 -04:00
Tomislav Milkovic
0fe2c1fe90 everywhere: Fix legacy include paths
Any project with Kconfig option CONFIG_LEGACY_INCLUDE_PATH set to n
couldn't be built because some files were missing zephyr/ prefix in
includes
Re-run the migrate_includes.py script to fix all legacy include paths

Signed-off-by: Tomislav Milkovic <milkovic@byte-lab.com>
2022-07-18 16:16:47 +00:00
Aastha Grover
35f42797b8 samples: drivers: fpga: merge both samples and add sample.yaml
Merge the fpga_controller and fpga_controller shell
sample applications and add sample.yaml to enable testing in
twister.

Fixes #47613

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2022-07-18 10:28:08 -05:00
Benjamin Björnsson
b92144ca3b samples: sensor: stm32_temp_vbat: Update sample to use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE to remove usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-18 14:32:09 +00:00
Benjamin Björnsson
8af2f0460d samples: sensor: stm32_temp_sensor: Update to use DEVICE_DT_GET_ONE
Update sample to use DEVICE_DT_GET_ONE to remove usage of DT_INST.

Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
2022-07-18 14:31:54 +00:00
Reto Schneider
6a6b3a1217 samples: net: zperf: Fix format specificer missmatch
NULL (void *) is not of type char *.

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-07-18 13:18:56 +00:00
Kumar Gala
cbc848f328 dts: bindings: device labels are now optional
All in tree device drivers use some form of DEVICE_DT_GET
so we no longer need to require label properties.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-18 10:39:14 +00:00
Attie Grande
adeb181a72 boards: arm: atsamr34: Add SAMR34 Xplained board
Implement support for SAMR34 Xplained Pro dev board.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-18 10:35:46 +00:00
Attie Grande
876dc19d27 boards: arm: atsaml21: Add SAML21 Xplained board
Implement support for SAML21 Xplained Pro dev board.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2022-07-18 10:35:46 +00:00
Kumar Gala
eecaf6dce4 samples: boards: nrfx_prs: use DT_LABEL macro
Change code to use DT_LABEL macro so its more obvious what is going on.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-17 16:43:31 -05:00
Jimmy Ou
d98cad84c6 samples: drivers: display: add support for max7219
Add max7219_8x8 into sample.yaml for testing.

Signed-off-by: Jimmy Ou <yanagiis@gmail.com>
2022-07-15 10:10:48 +02:00
Ola Tangen Kulseng
1563d4a0c3 net: lwm2m: Default ssid
Created the variable CONFIG_LWM2M_SERVER_DEFAULT_SSID to be
the default ssid when not using bootstrap. Needed for access control.

Signed-off-by: Ola Tangen Kulseng <ola.kulseng@nordicsemi.no>
2022-07-15 10:10:16 +02:00
Johann Fischer
d402911801 shields: add shield support for AMG88xx sensor
Add shield support for Panasonic AMG88xx sensor and
remove app.overlay from amg88xx sample.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2022-07-15 10:07:30 +02:00
Kumar Gala
774f8b5b73 samples: sensor: qdec: Remove sample
The sensor shell can handle / does everything this sample does so just
remove the sample in favor of sensor shell.

Signed-off-by: Kumar Gala <galak@kernel.org>
2022-07-15 10:00:30 +02:00
Kumar Gala
6b33c03892 samples: lps22hh: 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
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