Commit graph

10761 commits

Author SHA1 Message Date
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