Commit graph

5068 commits

Author SHA1 Message Date
Ilya Tagunov 30e15de442 samples: drivers: dac: Add Nucleo-L152RE board
Enable DAC samples for Nucleo-L152RE board.

Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
2020-06-12 11:06:44 +02:00
Paul Sokolovsky c22f403a97 samples: posix: eventfd: Add sample.yaml for CI builds
Also, add prj.conf options to make the sample builds on more
platforms. Finally, update the sample source to print explicit
"Finished" message, to let user know that the processing is done.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-06-11 09:47:08 -04:00
Krzysztof Chruscinski 1b4b9386e5 sys: util: Added separator to FOR_EACH_ macros
Added separator (e.g. comma or semicolon) parameter to FOR_EACH_ family.
Separator is added between macro execution for each argument and not at
the end.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-10 11:58:13 +02:00
Gerson Fernando Budke ce26bb5365 samples: coap_server: Refactor to use coap_get_option_int
Small clean-up to use coap_get_option_int.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-06-09 21:25:11 +03:00
Krzysztof Chruscinski fe7ffc034e samples: bluetooth: hci_uart: Fix conf file name
Conf file was not renamed after board renaming.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-09 19:06:16 +02:00
Krzysztof Chruscinski 43cad10f73 drivers: serial: nrf: Remove flow control configuration from kconfig
Removed flow control configuration from Kconfig and updated samples
to use device tree for that.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-06-09 19:06:16 +02:00
Simon Glass f895cf4d9c samples: fade_led: Correct the sample name in the docs
The docs do not match the directory this sample is in. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-06-09 10:24:43 -05:00
Peter A. Bigot 0a018db0ff samples: subsys: mgmt: smp_svr: increase fs support stack size
The upload command invokes lfs_stat() on the destination file which
overflows the stack.  Adding 256 bytes seems to make it work.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-06-09 14:57:28 +02:00
Reto Schneider 0b4b3ae4dd cmake, samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.

See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2020-06-09 08:18:29 -04:00
Alexey Markevich b9f6e33afb samples: net: google_iot_mqtt: fix log typo
Wrong port number logged.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Alexey Markevich d6d5ae170a samples: net: google_iot_mqtt: log actual error
Error logging was using the wrong variable.

Signed-off-by: Alexey Markevich <buhhunyx@gmail.com>
2020-06-08 19:53:03 +03:00
Kumar Gala d00d0f1266 samples/tests: Convert use of %ll{u,d} to PRI{u,d}64
Move to using PRIu64/PRId64 instead of %llu/%lld since on
native_posix_64 the uint64_t/int64_t type is defined in terms of 'long
int' and not 'long long int'.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Kumar Gala a1b77fd589 zephyr: replace zephyr integer types with C99 types
git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-06-08 08:23:57 -05:00
Carles Cufi 8beda01c0f doc: reference: Update overview for 2.3
Update the API overview page by looking at the changes in include/ since
the last release.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-06-05 20:36:16 +02:00
Peter Bigot 1af0428c3d samples: usb: mass: set storage device for FatFS
Left unset it becomes the first partition, which is not what's used
for littlefs, and specifically isn't on the external flash for
nrf52840dk_nrf52840.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-05 17:44:39 +02:00
Peter Bigot d32b4bd210 samples: usb: mass: fix to support FatFS on external file system
The flash interface header needs to be available regardless of
selected filesystem implementation.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-06-05 17:44:39 +02:00
Christopher Friedt fb9f6a482f samples: sockets: socketpair: mitigate negative index
Fixes #25780
Coverity-CID: 210612

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt 9cc82a036a samples: sockets: socketpair: check return of pthread_create
Fixes #25737
Coverity-CID: 210585

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Christopher Friedt fb21b2f0b7 samples: sockets: socketpair: check return value of send
Fixes #25736
Coverity-CID: 210583

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-06-03 18:33:19 +02:00
Vincent Wan 99a9aa4f7d samples: cc13x2_cc26x2: system_off: fix documentation formatting
Fix minor formatting issue in README to fully display console output.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-29 15:05:18 +02:00
Marc Herbert 2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Johann Fischer 8f4df1784a samples: usb: update PID in the samples documentation
Update PID and SerialNumber in the samples documentation.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-05-27 14:15:52 +02:00
Johann Fischer 3ce80c4d7a samples: wpanusb: assign next free sample PID
Assign next free sample PID to wpanusb sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-05-27 14:15:52 +02:00
Christopher Friedt 2710c188ad samples: sockets: socketpair: sample application and docs
Support for the socketpair(2) system call was recently
added for 2.3.0 .

This change adds a sample application that demonstrates
how it can be used.

Fixes #25527

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2020-05-27 14:14:04 +02:00
Emil Obalski 44c153380b usb: doc: Add note about cdc+dfu Windows OS exception.
Add a note for composite (CDC+DFU) device overlay.
Composite device CDC+DFU may not work with Windows OS host.
Windows OS does not send reset after DFU_DETACH request
(does not re-enumerates) and thus make it unable for
the device to restart in DFU mode.

For more details refer to #23337.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-27 13:48:40 +02:00
Peter Bigot 24c1be3896 samples: nrf: system_off: demonstrate use of device pm to reduce power
Currently system power management does not automatically control
device power, and this example demonstrates high current draw due to
the UART being enabled.  Enable device power management and
demonstrate how to manually turn off greedy devices.

Also remove the 60 s delay that confirms we successfully turned off
the residency policy; that's not directly relevant to the purpose of
the sample.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-25 16:25:33 +02:00
Kumar Gala 2ef135dc23 samples: usb: audio: Fix building off sample with sanitycheck
The USB audio samples when added didn't have any tests: sections in the
sample.yaml so they would never get build on any platform as part of
sanitycheck.  Add the tests: section and limit the samples to build on
nrf52840dk_nrf52840 as that was the intended platform these samples
where initially developed for.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-21 16:55:27 +02:00
Paul Sokolovsky 8af7187255 samples: net: echo_async_select: Use read()/write() if possible
If build with full POSIX API, use read()/write() instead of
recv()/send() calls for sockets.

We have read()/write() support for a while, but no samples/tests
actually performed at least a build test for it (so it will be
done now).

Fixes: #25407
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-05-20 15:37:23 +02:00
Daniel Leung ec9a413983 boards: x86: make up_squared default to x86_64
This makes the up_squared board default to x86_64.
This also adds a new board, up_squared_32, for when 32-bit
is desired.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-19 19:19:51 +02:00
Martí Bolívar 6bc17e3211 samples: various servo_motor fixes
Though there were issues with this sample before e959386bd2 ("samples:
servo_motor: cleanups and changes"), that commit introduced further
bugs. This happened because the new pwm-servo alias that commit
switched to wasn't provided by any boards, so it wasn't built in CI.

Before that, however, the recommendation to use bbc_microbit in the
sample documentation was also buggy in a couple of ways:

    1. bbc_microbit doesn't have the pwm-0 alias the sample
       previously required, so it didn't build on that board

    2. the documentation's comment to use pin 0 on the edge connector
       is wrong; PWM channel 0 is wired to GPIO P0.0 on the SoC,
       which is actually pin 21 on the connector

Fix it all up.

Tested on bbc_microbit. I verified the pinout and also made sure that
the sample correctly generates pulses from 700 to 2300 usec.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-19 17:27:07 +02:00
Alexandre Bourdiol 507ebecffc sample: drivers: counter: alarm: adapt test to driver change
Due to counter driver implementation change
"driver/counter/counter_ll_stm32_rtc.c: Add 1 tick to alarm"
It is necessary to adapt sample test (sanitycheck)
to take into consideration 1 tick precision/tolerance.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-05-19 14:48:49 +02:00
Gerson Fernando Budke ac117c8d63 samples: net: updatehub: Add sample.yaml file
Add missing sample.yaml file to enable CI build tests. Local tests can
be executed executing sanitycheck:

./scripts/sanitycheck -l --testcase-root samples/net/updatehub

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-05-18 11:12:31 +02:00
Gerson Fernando Budke dc84dd5db5 samples: net: wifi: Enable esp32 offload tests
The esp32 offload driver is used by shield esp_8266. This shield
doesn't have tests enabled to ensures that dependencies are ok.
This enables wifi sample to validate shield esp_8266 on CI and
consequently esp32 offload driver.

Fixes: #25386

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-05-16 19:56:06 +02:00
Joakim Andersson a8583ae1d9 samples: drivers: lcd_hd44780: Add readme
Add readme for lcd_hd44780 sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 6c6c03d60c samples: driver: flash_shell: Add readme
Add readme to flash_shell driver sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 2d21eb97d0 samples: drivers: i2c_fujitsu: Change readme to rst format
Rename README.txt to README.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson e01958e447 samples: drivers: entropy: Change readme to rst format
Rename README.txt to READMED.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 798f9c4c67 samples: drivers: current_sensing: Change README to rst format
Rename README to README.rst and change to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson a7b8295428 samples: drivers: crypto: Change README to rst format
Rename README.txt to README.rst and convert to rst format.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson ef467c831c samples: drivers: Change drivers.rst to find all samples readme file
Change toc depth to find all samples readme file for driver folder.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 54ce249548 samples: cpp_synchronization: Change sample description to rst format
Rename README.txt to README.rst and change format to rst.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 44bcf98962 samples: boards: intel_s1000_crb: Rename to README.rst
Rename the sample .rst files to README.rst to be consistent with other
samples.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 7e04752f99 samples: out_of_tree_driver: Add readme to out of tree sample
Add reade to out of tree sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson f5ec251c8f samples: external_lib: Add readme to external library sample
Add readme to external library sample

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Joakim Andersson 54e28678a3 samples: code_relocation: Add readme for code relocation sample
Add readme for code relocation sample.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-05-15 17:18:56 +02:00
Christoph Reiter 05f1b97d13 doc: fix board name in DPS310 sample
The rename of the nrf52 boards was missed in the sample documentation.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-15 17:17:46 +02:00
Wentong Wu 72227574d8 timer: remove QEMU_TICKLESS_WORKAROUND
Qemu icount mode enabled, remove QEMU_TICKLESS_WORKAROUND.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-05-14 13:52:07 +02:00
Christoph Reiter c8a30ecacc sensor: add sample for Infineon DPS310
Add an example on how to use the DPS310 sensor.

Signed-off-by: Christoph Reiter <christoph.reiter@infineon.com>
2020-05-14 11:02:29 +02:00
Peter Bigot 0a07a29c74 boards: fix misleading size for partition
The length field for the MCUBOOT slot partitions in Nordic platforms
has always had an extra leading zero suggesting it's a 40-bit value,
being stored in a 32-bit field.  Remove the incorrect leading zero to
reduce misunderstanding of the field.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-05-13 21:25:29 +02:00
Kumar Gala ff579a3af3 flash: Convert DT_FLASH_AREA to FLASH_AREA macros
Convert with a combo of scripts and by hand fixups:

git grep -l DT_FLASH_AREA_.*_ID | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'

git grep -l DT_FLASH_AREA_.*_OFFSET | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'

git grep -l DT_FLASH_AREA_.*_SIZE | \
 xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-13 21:22:53 +02:00
Martí Bolívar f83ecb7bc6 samples: hid-mouse: cleanups
Similar cleanups as done to other samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar 59e63845d1 samples: hid-cdc: cleanups
Similar cleanups to other samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar 8970e13f63 samples: lwm2m_client: cleanups
Make this code access the common led0 sample alias in the usual way.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar 6c3fb76698 samples: mesh_badge: remove dead code
PULL_UP is not used. The sw0 flags are read directly in
configure_button().

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar d42ef5e5da samples: bbc_microbit: cleanups
Clean up the board specific samples:

- Do not hard-code the i2c0 device label in the line follower sample.
- Miscellaneous docs cleanups.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar c58db0c995 samples: threads: cleanups
Align the docs and source code with other changes done to the basic
samples.

Use numbers 0 and 1 to refer to the LEDs consistently. This matches
the generic devicetree aliases used by Zephyr, instead of using USR1
and USR2, which are specific to 96b_carbon.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar e959386bd2 samples: servo_motor: cleanups and changes
Align the sample with changes made to other basic samples.

Move away from 'pwm-0' as a devicetree alias, requiring applications
to define a 'pwm-servo' alias. We are getting rid of the aliases that
just bounce through to node labels as soon as we can, might as well
get the applications ready now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar a0f940ae04 samples: rgb_led: cleanups
Align this sample with the changes made to the other basic samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar b6e4e9f991 samples: minimal: cleanups
Touch up the README while we're looking at the basic samples.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar 0156b6c185 samples: fade_led: cleanups and fixups
Align the sample and its documentation with the other basic samples.

Adjust the fade algorithm so that it looks better and takes less time
to verify by taking 2.5 seconds instead of 10.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar bfb1040612 samples: rename blink_led to blinky_pwm
The difference between "blinky" and "blink_led" is not clear.
This rename makes it more obvious that "blinky_pwm", well,
blinks an LED using PWM.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-13 19:51:01 +02:00
Martí Bolívar aab2252817 samples: blink_led: cleanups and fixups
Align this sample's source code and documentation with other basic
samples.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Input data sstream is passed to output data stream.

For more details refer to README.rst.

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

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

Input data stream is passed to output data stream.

For more details refer to README.rst.

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

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

Closes #24187.

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

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

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

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

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

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

Fixes #22421

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-05-07 11:20:27 +02:00