Commit graph

500 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
Peter A. Bigot 88c0545ea4 samples: usb: mass: add support for littlefs file systems
This allows mass storage exposure of a littlefs file system,
specifically one on the SPI NOR flash of the nrf52840dk_nrf52840.  In
combination with littlefs-fuse this allows a host system to examine
and change the local storage of a Zephyr application.

Note that it is critical that all parameters of the file system match
between what Zephyr is using and what littlefs-fuse is using.
Inconsistencies can produce confusing results where each system sees
different content.  The README has been updated with a detailed
example.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Peter A. Bigot f128cbe80f samples: usb: mass: update nrf52840dk board configuration
Drop the old redefine-everything-in-a-special-conf approach and put
the customization appropriate for this board into the board directory
where it's handled automatically.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Peter A. Bigot f5e31c4d5d samples: fs: littlefs: fix lost flash area reference
The API call to close the flash area was only invoked when the flash
area was erased.  It should be closed in all paths.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-05-06 11:31:44 +02:00
Alexander Wachter 464f135ce6 canbus: Convert canbus driver and subsys to new timeout API
Convert all canbus related API/samples/tests/subsys
to the new timeout API with k_timeout_t.

Signed-off-by: Alexander Wachter <alexander@wachter.cloud>
2020-05-06 10:19:13 +02:00
Marcin Niestroj 6f643cd2b7 samples: shell: shell_module: add demo hexdump command
Demonstrate hexdump command by dumping all command parameters.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-05-06 09:42:02 +02:00
Ioannis Glaropoulos 4cf4be4373 samples: subsys: openamp: use new-style DT macros for shared memory
Adapt to using new-style device tree macros
for shared memory base address and size.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-05-05 10:08:28 -05:00
Kumar Gala 4e93b77552 samples: Convert DT_ALIAS_* to new DT_ALIAS() macro
Convert DT_ALIAS_* defines to use DT_ALIAS() plus other macros from
include/devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-05-04 15:28:20 -05:00
Paolo Teti a17770e702 samples: canbus: isotp: fix a typo
Fixed 'erreor' in 'error'

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
2020-05-01 12:32:22 -05:00
Anas Nashif 50a9184787 samples: fix configuration for systemview/cpu stats
need to enable tracing.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Anas Nashif eaba71738e samples: move tracing sample from tests/
This is more a sample than a test, so put it under samples with the goal
of having dedicated tracing tests in the future under tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-04-29 22:30:19 -04:00
Kumar Gala 3f236f2183 can: dts: Convert can-primary alias to zephyr,can-primary chosen prop
Convert CAN to use a chosen node property that is similar to how we
handle zephyr,entroy or zephyr,flash-controller as the means to select a
specific peripheral instance utilized by a subsystem.

Replace references of the form:

alias {
	can-primary = &can1;
};

with:

chosen {
	zephyr,can-primary = &can1;
};

Replace various macro/define references with either
DT_CHOSEN(zephyr_can_primary) or replace DT_ALIAS_CAN_PRIMARY_LABEL
with DT_CHOSEN_ZEPHYR_CAN_PRIMARY_LABEL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-29 14:27:31 -05:00
Kumar Gala 7a15afc1d4 drivers: flash: replace DT_FLASH_DEV_NAME with DT macro
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.

NOTE: For a SoCs with on die flash, this points to the controller and
      not the 'soc-nv-flash' node.  Typically the controller is the
      parent of the 'soc-nv-flash' node).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-27 18:43:20 -05:00
Antony Pavlov 3d35a8dde5 samples: conf: don't enable option twice
Remove enabling of the same option twice.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2020-04-25 13:39:17 -05:00
Luiz Augusto von Dentz 2534ab11c0 USB: Add driver and PID for Bluetooth H4
This adds USB_PID_BLE_HCI_H4_SAMPLE along with it driver which uses H4
over bulk endpoints.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-04-20 21:59:47 +03:00
Andrzej Puzdrowski 8579d9f371 samples/susbys/mgmt/mcumgr/smp_svr: add nrf5 configs
Added default configuration files for nrf5 boards so the sample
is building with expected features for these boards.

Would be greater to use OVERLAY_CONFIG instead of files addition,
but that doesn't work from CMakeLists.txt scope.

fixes #24442

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-04-20 15:57:52 +02:00
Mikkel Jakobsen 90f005bc2f samples: subsys: mgmt: smp_svr: enable FS commands
During the last refactoring of the sample, CONFIG_MCUMGR_CMD_FS_MGMT
was mistakenly set to n instead of y for the bluetooth transport.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 17:45:52 +02:00
Mikkel Jakobsen a518516d5d samples: subsys: mgmt: smp_svr: add udp sample
This sample now supports SMP UDP transport.
Two config overlays have been added for ipv4 and ipv6, respectively.

The sample documentation has been completely revamped to be less
bluetooth focused and more general.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 10:16:25 +03:00
Mikkel Jakobsen 6113bc6282 samples: subsys: mgmt: smp_svr: refactor sample
To prepare this sample supporting future SMP transports, the sample
code is now split into a main and bluetooth file. A common config
has been identified and application specific config is put into
overlay config files.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2020-04-17 10:16:25 +03:00
Torsten Rasmussen 0e31656e67 cmake: fixed issue with invalid usage of APPLICATION_SOURCE_DIR
Fixes: #24158

The shell/fs sample was using APPLICATION_SOURCE_DIR before it has been
defined.

This has now been fixed to use the proper way of overlaying board
specific settings using boards folder.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-04-09 16:57:30 +02:00
Carles Cufi 233d6c87e6 boards: nrf52840_pca10059: Rename to nrf52840dongle_nrf52840
The board name for the nRF52840 Dongle, so far known as
nrf52840_pca10059, is renamed to nrf52840dongle_nrf52840. Its
documentation and all references to its name in the tree are updated
accordingly. Overlay and configuration files specific to this board are
also renamed, to match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Carles Cufi 6656214af2 boards: nrf52_pca10040: Rename to nrf52dk_nrf52832
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832.  Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-04-06 13:09:07 +02:00
Kumar Gala 2d7cc8f774 samples: subsys: canbus: canopen: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00
Kumar Gala ce41833a10 samples: subsys: fs: fat_fs: Move dts overlays under boards
Move the dts overlay under a boards/ dir to make it match conf files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-01 10:44:31 -04:00