Commit graph

500 commits

Author SHA1 Message Date
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Emil Obalski c1f5e11bb6 usb: Cleanup for multiplied defines
Some of defines are present in several header files.
Those defines are the same with value but with different naming.

Common defines are brought to usb_common.h

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-09 12:48:13 -05:00
Carlo Caione 6eb48088ed samples: logger: Fix test on stack hungry platforms
This test is failing on platforms requiring a bigger stack size. This
issue is fixed by adding the missing CONFIG_TEST_EXTRA_STACKSIZE to
tweak the thread stack size.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-11-20 15:59:12 +01:00
Emil Obalski 6c82c80a3c drivers: Add support for nRF52833 in several drivers
By adding new SoC to Zephyr drivers has to be updated.
Commit affects:
 - USB driver
	- support for nRF52833 added.
	- support for USB_DEVICE_REMOTE_WAKEUP in hid-mouse added.
 - SPI
 - IEEE 802.15.4
 - CLOCK CONTROL

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-11-13 10:33:38 -06:00
Torsten Rasmussen 46b9b15c6d openamp: ensure external openamp is build when target is out-of-date
Fixes: #19918
https://cmake.org/cmake/help/latest/module/ExternalProject.html

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2019-11-13 04:54:49 -06:00
Peter A. Bigot a58d8ebaa6 driver: uart: make deprecation effective
Several macros were documented as deprecated but lacked the
infrastructure to produce deprecation warnings.  Add the deprecation
marker, and fix the in-tree references to the deprecated spellings.

Note that one non-deprecated macro should have been deprecated, and
is, referring to a newly added line control bit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-11-07 12:44:15 -06:00
Ulf Magnusson bd6e04411e kconfig: Clean up header comments and make them consistent
Use this short header style in all Kconfig files:

    # <description>

    # <copyright>
    # <license>

    ...

Also change all <description>s from

    # Kconfig[.extension] - Foo-related options

to just

    # Foo-related options

It's clear enough that it's about Kconfig.

The <description> cleanup was done with this command, along with some
manual cleanup (big letter at the start, etc.)

    git ls-files '*Kconfig*' | \
        xargs sed -i -E '1 s/#\s*Kconfig[\w.-]*\s*-\s*/# /'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-04 17:31:27 -05:00
Kumar Gala 4cc91fdd00 sample/tests: replace DT_ define filters with dt_ functions
convert sample and test yaml filters that utilize a DT_ define to
instead use a dt_ function.  The intent is to remove the Kconfig
generated DT defines and just make directy queries into the device tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-04 09:02:14 -05:00
Wentong Wu 78cc4cb6a3 samples: add sample for logging syst format output
add sample for syst format output to prove the output can be
decoded by the existing decoder.

Fixes: #19841.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-10-29 10:18:51 +01:00
Daniel Leung b7eb04b300 x86: consolidate x86_64 architecture, SoC and boards
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.

() Removes the x86_64:x32 architecture and SoC, and replaces
   them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
   qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-10-25 17:57:55 -04:00
Maureen Helm 65d9f541a7 boards: mimxrt1050_evk: Configure default sdhc instance at board level
Configures the default instance of the sdhc driver for the
mimxrt1050_evk board so applications don't have to configure it
explicitly. Similarly, enables the gpio instance required by the sdhc
driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-10-23 09:49:05 -05:00
Maureen Helm f8cfe453fd soc: nxp_imx: Configure default sdhc driver at the soc series level
Configures the default sdhc driver for the imx rt soc series so
applications don't have to configure it explicitly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-10-23 09:49:05 -05:00
Maureen Helm efa099e1f5 disk: Configure default sdhc volume name for fatfs
Configures the default sdhc disk volume name to "SD" when fatfs is
enabled. This prevents applications from having to configure it
explicitly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-10-23 09:49:05 -05:00
Jukka Rissanen dc7b307a47 logging: Print hexdumps with 16 bytes in one line
The hexdump was earlier printed using 8 bytes in one line like this

[00:00:00.131,143] <wrn> sample_instance.inst2: Example of hexdump:
01 02 03 04 05 06 07 08 |........
09 0a 0b 0c 0d 0e 0f 10 |........
11 12 13 14 15 16 17 18 |........
19 1a 1b 1c 1d 1e 1f 20 |.......
21 22                   |!"

This is not utilizing the width of the output best way possible.

Better utilization of the output is to print 16 bytes in one line
like this:

[00:00:00.131,136] <wrn> sample_instance.inst2: Example of hexdump:
01 02 03 04 05 06 07 08  09 0a 0b 0c 0d 0e 0f 10 |........ ........
11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20 |........ .......
21 22                                            |!"

In order to make it easier to find / calculate the bytes in the
output, print the output bytes in 8 byte groups.

This has the benefit that it is easier to map the Zephyr hex output
to Wireshark output which prints the bytes like this.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-10-11 17:53:50 +02:00
Andrei Emeltchenko 3aac8e3e19 samples: usb: webusb: Update sample README
Add Requirements and Building instructions

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-09 17:16:41 -05:00
Peter Bigot e28f330a8e coccinelle: standardize k_thread create/define calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments
to k_thread_create and K_THREAD_DEFINE to use the standard timeout
macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
Peter Bigot 49d6837bec samples: move board overlay files into boards directory
Application board.overlay files tend to be paired with
boards/board.conf files that extend the functionality of a board.
Move the overlay files to the same location as the config files that
they work with.

A few overlay files that are paired with a prj_board.conf file in the
application root directory are left in place.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-01 20:38:24 -07:00
Andrei Emeltchenko e0fbac01a3 samples: usb: webusb: Update README and sample link
Update instructions and webusb sample link.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-10-01 18:11:13 -04:00
Anas Nashif 2d4837061a tests: fix identifiers
Fix identifier and rename plain 'test' to something more appropriate.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-09-30 17:20:22 -04:00
Kamil Piszczek a320010e4a boards: x86: qemu_x86: adding nvs capability
Added the NVS capability to the QEMU x86 board description.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-09-27 10:06:40 -07:00
Kumar Gala 7847348b8e samples: ipc: openamp: Add testing harness
Add console testing harness for expected output.  This allows us
to validate that the test is running properly on hardware.

We expect output of the form:

Master core received a message: 1
Master core received a message: 3
Master core received a message: 5
    ...
Master core received a message: 95
Master core received a message: 97
Master core received a message: 99
OpenAMP demo ended.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-18 20:20:07 -04:00
Kumar Gala ae197ed395 samples: ipc: ipm_mcux: Add testing harness
Add console testing harness for expected output.  This allows us
to validate that the test is running properly on hardware.

We expect output of the form:

Hello World from MASTER! ARM
Received: 1
Received: 2
Received: 3
...
Received: 20
Received: 21
Received: 22
...

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-09-18 20:20:07 -04:00
David B. Kinder 60136f00cb doc: add how to exit from QEMU in samples
While trying out the hello_world sample built for QEMU, I was expecting
the sample app to exit and I'd return to a command prompt.  Nope.  You
need to exit QEMU manually, so add that step to the sample instructions.
Looking around, there are more uses of QEMU like this that could use
this added step after running the sample app.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-09-02 12:06:08 -04:00
Piotr Zięcik b52a902fdf samples: logging: Add usermode showcase
This commit extends existing logging sample in order to present
logger usage from user mode thread.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-08-27 14:29:21 -04:00
Kumar Gala 9958757c0f samples: cdc_acm_composite: rework sample logging
Match the logging changes made in samples/.../usb/cdc_acm to the
cdc_acm_composite sample.  This allows any device testing checks to work
properly.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-27 10:28:24 -04:00
Kumar Gala 002c48ecf8 samples: nvs: Add testing harness
Add console testing harness for expected output.  This allows us
to validate that the test is running properly on hardware.

We expect output of the form (the Reboot_counter will increment
overtime).

Id: 1, Address: 192.168.1.1
Id: 2, Key: ff fe fd fc fb fa f9 f8
Id: 3, Reboot_counter: 5
Id: 4, Data: DATA
Id: 5, Longarray: 0 1 2 3 4 5 6 7 8 9 ... 7f

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-26 22:33:14 -04:00
Johann Fischer 6de84125d3 samples: cdc_acm: rework sample logging
Use  LOG_LEVEL_INF as defautl log level and use LOG_INF
for important messages. Relax while loop and
give CPU resources to low priority threads like logging.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-23 15:47:06 +02:00
Kumar Gala 6f473e9240 samples: usb: webusb: Mark harness as TBD
Mark harness as TBD as we haven't defined how to test/validate this
sample on real hardware.  As such marking it 'harness: TBD' will get it
skipped from being attempted to run on hardware via --device-testing

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-22 07:08:20 -04:00
Paul Sokolovsky e27b0876c3 samples: shell: fs: README: Typo in "pkgconfig" name.
Was "pkconfig", which may confuse users whether some different tool
than the standard pkgconfig is meant.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-20 18:04:21 -04:00
Peter Bigot 4914d0db3b samples/subsys/logging/logger: rearrange for standard use of extern "C"
Consistently place C++ use of extern "C" after all include directives,
within the negative branch of _ASMLANGUAGE if used.

Background from issue #17997:

Declarations that use C linkage should be placed within extern "C"
so the language linkage is correct when the header is included by
a C++ compiler.

Similarly #include directives should be outside the extern "C" to
ensure the language-specific default linkage is applied to any
declarations provided by the included header.

See: https://en.cppreference.com/w/cpp/language/language_linkage
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-19 23:36:59 +02:00
Jukka Rissanen 303ef27535 samples: usb: hid-cdc: Use proper value in k_busy_wait()
The wait time value should be in microseconds.

Fixes #18059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-07 12:24:23 +02:00
Peter A. Bigot 167eb53e74 subsys/fs/littlefs: allow customization of file system configuration
There's desire to be able to customize parameters on a per-filesystem
basis, which means we need a way to override the Kconfig defaults which
are global.  This also means the littlefs data structure cannot own the
cache and lookahead buffers.

Switch to using a macro to define the littlefs data structure.  The
default version uses the Kconfig constants.  A custom one takes
arguments providing the most likely partition-specific parameters.
Finally the user is free to bypass the helper macros and set any
parameters desired, though validation is limited and only present when
CONFIG_DEBUG is enabled.

Extend the test suite with a performance module, which confirms that
these settings have an impact proportional to the log of changes to the
cache or IO sizes.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot 5fe2591074 subsys/fs/shell: add littlefs support
Add support for the littlefs file system in the fs shell.  Update
the sample to use the same partition configuration as the littlefs
example for the SPI NOR test platform.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot cfa64bde1c samples/subsys/fs/littlefs: add a basic sample
Uses a littlefs file system to maintain a boot counter.  Also tests some
other functions.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Joakim Andersson c1a754f665 Bluetooth: Host: Print error codes in hex
Error codes are listed in header files and in the core spec as hex
values. Always print them in hex in debug for easier error code
checking.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:18:17 +02:00
Karl Zhang dea40b6342 Musca B1: MHU: IPM MHU dual core on V2M Musca B1
Add support for ipm_mhu_dual_core sample on Musca B1.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-07-31 10:31:29 -04:00
Anas Nashif 578ae40761 boards: remove quarl_se_c1000
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Peter A. Bigot bea5e11784 samples/subsys/fs: move existing test into fat_fs
The sample is specific to the SDHC/fat_fs API.  Move it down to make
room for other file systems.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-25 06:39:55 +03:00
Piotr Zięcik ec857d0e4a logging: Do not use CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC
On some SoCs the frequency of the system clock is obtained at run time
as the exact configuration of the hardware is not known at compile time.
On such platforms using CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC define
directly introduces timing errors.

This commit replaces CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC by the call
to inline function sys_clock_hw_cycles_per_sec() which always returns
correct frequency of the system clock.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-07-24 15:10:02 +02:00
Jan Van Winkel ded4ba091f samples: fs: Corrected flash ctrl name in fs shell
Corrected the flash controller name in the FS shell sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-07-22 18:44:11 +02:00
Carles Cufi ff0b76ea4a samples: usb: console: Remove overlay file
After the removal of the virtualcom DT node in 5071eee, using the chosen
node is no longer functional. Instead the Kconfig
CONFIG_UART_CONSOLE_ON_DEV_NAME is used to locate the correct UART.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-07-22 16:20:11 +02:00
Jan Van Winkel 6b8433bd33 samples: fs: Added libfuse req. to fs shell README
Updated fs shell sample readme to state the requirement of a 32-bit
version of libfuse while building for native_posix board

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-07-22 15:08:36 +02:00
Peter A. Bigot 0626c8f1d3 samples: add board customization for native_posix_64
Sample applications for display functions do not work on native_posix_64
due to missing overrides.  Clone the native_posix_64 Kconfig override
for all samples that have a native_posix Kconfig override.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-17 15:29:42 -07:00
Nicolas Pitre 6609c12516 tests: enable native_posix_64 testing
Whenever conditions are applied to native_posix, they should apply to
native_posix_64 too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-07-16 10:41:11 -07:00
Anas Nashif 587d0ec252 samples: webusb: remove whitelisting
Remove whitelisting and enable broader testing on all boards with needed
features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Anas Nashif 343d9ccd06 samples: hid-mouse: use DT filtering instead of platform_exclude
Do not platform_exclude, instead use DT filter.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Anas Nashif 0277f1afb7 samples: console: remove whitelisting
Remove whitelisting and enable broader testing on all boards with needed
features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Anas Nashif d092952c54 samples: mass_storage: remove whitelisting
Remove whitelisting and enable broader testing on all boards with needed
features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-12 05:54:16 -07:00
Jun Yang 933d59ee3c samples/fs: support fs demo on mimxrt_1050 evk board
Add mimxrt_1050 evk board into white list.

FS demo Kconfig for mimxrt_1050 evk board.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Jun Yang c7e625f2b3 sdhc: rename disk_access_sdhc.c
The name disk_access_sdhc.c is ambiguous,

actually this driver depends on SPI,

rename this file.

In addition, move the generic sdhc stuff from C file

to head file for other sdhc drivers to use.

1) disk_access_sdhc.c->disk_access_spi_sdhc.c.

2) create .h and move sdhc specifications from .c to .h.

Signed-off-by: Jun Yang <jun.yang@nxp.com>
2019-07-10 11:58:15 -05:00
Andrei Emeltchenko 7cc57a1586 samples: usb: webusb: Remove dependence on GPIO
Remove old dependence.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-07-08 11:20:53 -07:00
Kumar Gala db167c606d dts: Rename LED._GPIO_* -> DT_ALIAS_LED._GPIOS_*
We use the following commands to rename any
LED._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_LED._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l LED._GPIO_CONTROLLER | xargs sed -i 's/LED\(.\)_GPIO_CONTROLLER/DT_ALIAS_LED\1_GPIOS_CONTROLLER/g'
git grep -l LED._GPIO_PIN | xargs sed -i 's/LED\(.\)_GPIO_PIN/DT_ALIAS_LED\1_GPIOS_PIN/g'
git grep -l LED._GPIO_FLAGS | xargs sed -i 's/LED\(.\)_GPIO_FLAGS/DT_ALIAS_LED\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-02 08:26:37 -04:00
Kumar Gala 284bc9d964 dts: Rename SW._GPIO_* -> DT_ALIAS_SW._GPIOS_*
We use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l SW._GPIO_CONTROLLER | xargs sed -i 's/SW\(.\)_GPIO_CONTROLLER/DT_ALIAS_SW\1_GPIOS_CONTROLLER/g'
git grep -l SW._GPIO_PIN | xargs sed -i 's/SW\(.\)_GPIO_PIN/DT_ALIAS_SW\1_GPIOS_PIN/g'
git grep -l SW._GPIO_FLAGS | xargs sed -i 's/SW\(.\)_GPIO_FLAGS/DT_ALIAS_SW\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-01 07:14:36 -05:00
Anas Nashif 5b0aa794b2 cleanup: include/: move misc/reboot.h to power/reboot.h
move misc/reboot.h to power/reboot.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif a2fd7d70ec cleanup: include/: move misc/util.h to sys/util.h
move misc/util.h to sys/util.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 9ab2a56751 cleanup: include/: move misc/printk.h to sys/printk.h
move misc/printk.h to sys/printk.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 5d001f3e41 cleanup: include/: move misc/byteorder.h to sys/byteorder.h
move misc/byteorder.h to sys/byteorder.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 7435e5e089 cleanup: include/: move ring_buffer.h to sys/ring_buffer.h
move ring_buffer.h to sys/ring_buffer.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif d1b2718687 cleanup: include/: move uart.h to drivers/uart.h
move uart.h to drivers/uart.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 6524925753 cleanup: include/: move ipm.h to drivers/ipm.h
move ipm.h to drivers/ipm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 6aa9c3a68f cleanup: include/: move gpio.h to drivers/gpio.h
move gpio.h to drivers/gpio.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif fe051a9055 cleanup: include/: move flash.h to drivers/flash.h
move flash.h to drivers/flash.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif f641d099cc cleanup: include/: move disk_access.h to disk/disk_access.h
move disk_access.h to disk/disk_access.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 52e0efac97 cleanup: include/: move stats.h to stats/stats.h
move stats.h to stats/stats.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif f048792888 cleanup: include/: move nvs/nvs.h to fs/nvs.h
move nvs/nvs.h to fs/nvs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 656f4dfdac cleanup: include/: move fs.h to fs/fs.h
move fs.h to fs/fs.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Anas Nashif 169589221d cleanup: include/: move console.h to console/console.h
move console.h to console/console.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00
Johann Fischer abaeaed2af usb: sort usb config data by section
USBD_CFG_DATA_DEFINE macro has not consider that a class
could have more than one set of usb_cfg_data struct.
If a class has more than one set of usb_cfg_data
then they should be sorted the same way like by
USBD_DEVICE_DESCR_DEFINE macro.

Fixes: #16240

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-06-27 12:18:05 +02:00
Andrzej Głąbek 036791364c usb: kconfig: nrf52840: Enable REMOTE_WAKEUP option only when needed
This patch removes the "hard" selection of the USB_DEVICE_REMOTE_WAKEUP
Kconfig option for USB devices made on the nRF52840 SoC. Now it's up to
the application to decide if it wants to enable the option. This change
makes it possible to pass the USB3CV Chapter 9 Tests for applications
that don't use the remote wakeup feature, since when a USB device only
reports that it supports this feature, and the mentioned option makes
it to do so, one of the test cases expects the USB device to actually
perform the remote wakeup. And when the feature is not reported as
supported, the test case is skipped.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-06-27 12:17:45 +02:00
Andy Ross 42d8936f4d samples/subsys/usb/dfu: Set sanitycheck test to build_only
This sample has to be operated manually (it's a USB DFU implementation
that needs to be plugged into a host to validate).  Sanitycheck is
failing right now becuase it tries to flash and run it, and doesn't
see a harness declaration.

Set it to build_only when run under sanitycheck.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-19 14:37:20 -04:00
Andy Ross 3cea065954 samples/subsys/power/device_pm: Add test harness integration
Right now this fails needlessly under sanitycheck for lack of a
harness declaration.  It's short, just stuff in a simple regex check.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-19 14:37:20 -04:00
Ulf Magnusson eba81c6e54 yaml: Remove redundant document separators
YAML document separators are needed e.g. when doing

  $ cat doc1.yaml doc2.yaml | <parser>

For the bindings, we never parse concatenated documents. Assume we don't
for any other .yaml files either.

Having document separators in e.g. base.yaml makes !include a bit
confusing, since the !included files are merged and not separate
documents (the merging is done in Python code though, so it makes no
difference for behavior).

The replacement was done with

    $ git ls-files '*.yaml' | \
        xargs sed -i -e '${/\s*\.\.\.\s*/d;}' -e 's/^\s*---\s*$//'

First pattern removes ... at the end of files, second pattern clears a
line with a lone --- on it.

Some redundant blank lines at the end of files were cleared with

    $ git ls-files '*.yaml' | xargs sed -i '${/^\s*$/d}'

This is more about making sure people can understand why every part of a
binding is there than about removing some text.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-19 10:40:10 +02:00
David B. Kinder 6b2cd29223 doc: fix misspellings in documentation
Fix misspellings and doc issues missed during regular reviews (including
some files without a trailing newline)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-06-18 15:08:19 -04:00
Ulf Magnusson a84ded74ea dts: Replace status = "ok" with status = "okay"
The DT spec. only has "okay" and not "ok". The Linux kernel has around
12k "okay"s and 300 "ok"s.

The scripts/dts scripts only check for "disabled", so should be safe re.
those at least.

The replacement was done with

    git ls-files | xargs sed -i 's/status\s*=\s*"ok"/status = "okay"/'

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-14 19:51:13 -05:00
Kumar Gala a2693975d7 dts: Convert from DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...
Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-14 08:02:15 -05:00
Anas Nashif efb47ace39 doc: samples: cleanup board reference and layout
Cleanup references to boards in some of the example and use the same
boards through the examples. Other minot cleanups and make the text more
generic and not specific to certain boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-13 16:09:02 -04:00
Jan Van Winkel 265b195369 samples: fs: Added FS shell sample
Added file system shell sample

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-06-11 08:31:54 -04:00
Anas Nashif 2fb19fcbdd style: samples/tests: add braces around if/while statements
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-06 15:20:21 +02:00
Andrei Emeltchenko df2bb46497 usb: console: Initialize USB console after USB Device stack
It does make sense to initialize USB console after USB Device stack.
Note that the value is selected only if we specify USB_UART_CONSOLE
in prj.conf, not in menuconfig afterwards.

Fixes #16518

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-06-05 11:44:17 +02:00
Luiz Augusto von Dentz b65fe62719 Bluetooth: Add possibility to pass a user_data to conn_tx_cb_t
This allows setting a custom pointer to be passed back to the complete
callback at expense of increasing the buffers in 4 bytes.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-29 16:31:03 +03:00
Andrei Emeltchenko 3f13079a7c samples: usb: hid: Fix harness configuration
Fix configuration indicating changes in USB device.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko 1b64e53aeb samples: usb: webusb: Use Automatic endpoint assignments
Use endpoint index since addresses are automatically assigned.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko 3d58abf68b samples: usb: webusb: Use new descriptor placement API
Simplify code using new descriptor API and remove old composite
initialization.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko 3880a42375 usb: Align legacy and composite interface
Remove duplicated execution path for composite configuration, USB
device stack initialization is done inside stack for both cases.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Aurelien Jarno 819e749ccd usb: move the request handler buffer to the USB device code
In order to unify the legacy and composite code, move the class and
vendor request handler buffer into the USB device code, just like in
composite mode. The option is renamed from USB_COMPOSITE_BUFFER_SIZE
into USB_REQUEST_BUFFER_SIZE and also replaces the USB_DFU_MAX_XFER_SIZE
and USB_HID_MAX_PAYLOAD_SIZE options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-27 09:25:06 -04:00
Andrei Emeltchenko 9f2ddc9f8e usb: webusb: Trivial syntax fix
Fix supended -> suspended.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko b364b841cc usb: webusb: Fix callback not called
Until PR #15818 is applied we need to use this solution to get
callback called.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-16 07:17:50 -05:00
Karl Zhang d75f3cede8 sample: mhu: IPM MHU dual core on V2M Musca
Sample walk through:
    1. CPU 0 will wake up CPU 1 after initialization
    2. CPU 1 will send to CPU 0 an interrupt over MHU0
    3. CPU 0 return the same to CPU 1 when received MHU0 interrupt
    4. Test done when CPU 1 received MHU0 interrupt

The wake up second core and private core ID are soc specific.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-05-15 15:37:50 -05:00
Marcin Szymczyk a30950c64b usb: cdc: add .inf file
Added .inf driver file for Windows.
CDC examples will now work on Windows.

Note:
This .inf is not signed and may cause problems during installation.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04:00
Marcin Szymczyk e5cbe6a9e7 usb: cdc: Add unique PIDs for each sample
Unique PID is required for each sample in order
to be recognized by host.

When creating a new sample:
- Add USB_PID_<SAMPLE_NAME>_SAMPLE
  in samples/subsys/usb/usb_pid.Kconfig
- Create Kconfig file in your sample's subdirectory, containing:
  config USB_DEVICE_PID
	default USB_PID_<SAMPLE_NAME>_SAMPLE

  source "Kconfig.zephyr"

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04:00
Andrei Emeltchenko 88145db607 samples: usb: cdc_acm_composite: Refactor sample
Use ring buffer and logger.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-07 23:11:44 -04:00
Andrei Emeltchenko 0e57e4fb78 samples: usb: cdc_acm: Update CDC ACM echo sample
Update CDC ACM sample using ring buffer and fifo_fill / fifo_read
functions.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-07 23:11:44 -04:00
Andrei Emeltchenko f4ff72bbd3 usb: webusb: Add more log output
Add log prints for special requests.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko b0373fbd07 usb: webusb: Fix payload for vendor requests
Fixes payload and simplifies code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko 87b3c63114 usb: webusb: Remove unneeded headers
Remove unneeded headers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko bc05efacbf usb: webusb: Fix logging for webusb
Replace LOG_MODULE_DECLARE with LOG_MODULE_REGISTER and update default
log level.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko 34a2b4011d usb: webusb: Update license header
Update license header to standard Zephyr.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Andrei Emeltchenko dac83213f4 usb: webusb: Strip 'serial' from names
Since we have remove CDC ACM logic from webusb strip also serial from
function names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-06 11:18:34 +02:00
Marcin Szymczyk be1ec7822c usb: samples: mass: add configuration and fs for FLASH
Adds required Kconfig options for flash driver.
Adds FatFS filesystem for flash disk.
Fixes #14459.

Note: As USB MSC does not support multiple disks (see #14937),
only one (flash by default, modify CONFIG_MASS_STORAGE_DISK_NAME
to "RAM" for RAM disk) will appear to host.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-06 11:05:04 +02:00
Andrei Emeltchenko da701f9d55 samples: hid-cdc: Update USB device names and project conf
Update project configuration and USB HID and CDC ACM device names for
sample hid-cdc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko 995b568b14 samples: cdc_acm: Update CDC ACM Device name
Update device name for USB CDC ACM.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko 1b3227fd99 samples: usb: Correct USB HID device name
Use "HID_0" as a device name since we have only device count now.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-28 12:22:23 -04:00
Andrei Emeltchenko e952033559 samples: usb: mass: Add whitelist mass storage on ram
To support mass storage over USB in RAM we need a board with
sufficient RAM. Fix failing tests for boards with low memory.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 4f2674f164 samples: usb: Add depends_on gpio
Add gpio dependence, fixing build for native_posix.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 69726bbccb usb: tests: Enable other boards for test
Enable other boards with USB device supported

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Andrei Emeltchenko 35a81562e8 samples: usb: hid: Enable harness for the sample
Enable harness so we can execute smoke tests on the hardware with
command line:
sanitycheck --device-testing --device-serial /dev/ttyACM0 -p <BOARD>
  -T samples/subsys/usb/hid

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-18 12:16:05 -04:00
Johann Fischer bf71aee8e4 samples: cdc_acm: add config overlay for cdc_acm+dfu
Add config overlay for cdc_acm+dfu composite configuration.
Manual configuration over menuconfig may be error-prone for
the user because then FLASH_LOAD_OFFSET and FLASH_LOAD_SIZE
should also to be set to appropriate values.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-16 08:55:51 -04:00
Johann Fischer c13e201b18 usb: replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS
Replace MAX_PACKET_SIZE0 with meaningful USB_MAX_CTRL_MPS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-04-11 13:35:24 -04:00
Aaron Tsui 5922be2ed6 samples: subsys: logging Remove repetitive code.
Remove repetitive code

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Aaron Tsui 1c742a9756 doc: subsys: logging Update documentation
Update documentation.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Andrei Emeltchenko 721f3d1cd0 usb: Refactor USB status callback
Merge cb_usb_status_composite and cb_usb_status and use common
forward_status_cb for both composite and normal devices.

Fixes #14882

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-05 12:23:57 +02:00
Anas Nashif 6e6f13c18a samples: fix identifiers for samples
Fix identifiers for tests in samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-01 12:23:09 -04:00
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Krzysztof Chruscinski fdc1ee59d8 sample: subsys: logging: Ensure that logger RTT backend is tested
Logger RTT backend should be compiled on the boards that have RTT.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-28 08:41:28 -05:00
Krzysztof Chruscinski 8dd015f49e sample: subsys: shell: Ensure that shell RTT backend is tested
Shell RTT backend should be compiled on the boards that have RTT.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-03-28 08:41:28 -05:00
Andrei Emeltchenko 972221423c samples: usb: console: Select console device name
Instead of relying on overlays which requires to write overlay for
every board (100+) define console device name.

Fixes #14698

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-25 12:03:15 +01:00
Andrei Emeltchenko 7ecd8d2ff3 samples: usb: cdc_acm_composite: Fix missing irq handling
If there are several queued interrupts we can miss some of them. Use
while() loop to catch them all.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-03-25 12:03:15 +01:00
Flavio Ceolin ef0417fa6d samples: ipc: openamp: Avoid dead code
Checking the return of metal_init to avoid having dead code.

Coverity CID: 190932

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-23 09:52:51 -05:00
Johann Fischer 5ed4b6a334 samples: usb_dfu: update application signing in README.rst
Update application signing example in README.rst.

resolves: #14510

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-03-15 05:58:07 +01:00
David B. Kinder 6000a6205a doc: prepare for improving doc API linking
Linking to API material requires knowing the pecularities of how
doxygen, sphinx, and breathe work. In an attempt to hide some of this
we're preparing the current docs to allow use of configuration defaults
that will let us more simply use a default role that will hunt for a
reference target in the various domains that are available by using a
default "role" of "all".  This will let us use the simple notation
`functionname` or `typename` without fully specifying the reference as
:c:func:`functionname`.

This patch cleans up exising docs that were (incorrectly) using single
backtics where double backtics should have been used, and also found
some typos (such as a space between the role name and the reference,
such as :file: `filename`, and a missing colon such as
c:func:`functionname`)

This is a start to address issue #14313

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-15 05:47:19 +01:00
Ramakrishna Pallala d910aa6029 samples: power: Add test for device Idle PM
Added test for Device Idle Power Management to invoke
device_pm_get/put API's.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-14 14:26:15 +01:00
Marcin Szymczyk c8dfdb63f9 usb: samples: mass: add warning for no conf and nrf52840 conf
Added a warning that will abort build without disks.
Added a default configuration for nrf52840_pca10056.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-13 05:48:35 -05:00
David B. Kinder 505cc2bb0e doc: use :zephyr_file: where appropriate
A new role :zephyr_file: is available that renders to a link to the file
or folder in GitHub.  Find appropriate references using :file: and
convert to :zephyr_file: to take advantage of its linking capability.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-03-09 09:50:27 -05:00
Marcin Szymczyk 6983645552 usb: add hid-cdc example
This example combines 2 HID classes and 2 CDC ACM classes to create
a composite, multi-instance device.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-03-05 09:35:26 +01:00
Anas Nashif 5cf49956e7 logging: add backend for xtensa simulator
Add backend for the xtensa simulator.

Fixes #10164

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-04 10:35:07 -05:00
Kumar Gala 9fa8674239 samples: fs: Fix possible integer overflow
We are doing math of two 32-bit numbers and assigning into a 64-bit
result.  Add explicit cast of one of the values being multipled to get
explicit promotion.

Fixes: #13883
Coverity CID: 190930

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-02 17:38:23 +01:00
Kumar Gala 11b3dce674 samples: ipc: openamp: Fix missed return error check
The return from ipm_set_enabled wasn't assigned to 'status' so the check
right after the call to ipm_set_enabled() wasn't doing the right thing.

Fixes: #13881
Coverity CID: 190932

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-02 17:38:23 +01:00
Paweł Zadrożniak aa4c30c3e9 samples: usb: hid: remote wakeup in HID mouse example
Added support for remote wakeup in hid_mouse example.
If rempote wakeup support is enabled, wakeup request
is performed on every button click when the bus in suspended state.

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2019-02-27 10:37:16 +01:00
Laczen JMS 68ea30c123 fs/nvs: Improve init speed and remove fs->locked
This patch removes the free space calculation from nvs initialization.
The available space can be calculated if required using the routine
nvs_calc_free_space.

This patch also removes the locked state of nvs, it is not possible to
get in a locked state.

This patch adds an extra check on the sector_size configuration and only
allows operation on nvs when nvs has been initialized.

This patch also solves issue #13369, the usage of FLASH_ERASE_BLOCK_SIZE
has been replaced with the flash page api.

Changes:

Removed locked state and free_space from the nvs structure.

nvs_reinit(): has been replaced with by an internal only function
_nvs_startup().

nvs_write(): removed the possibility to place the file system in a
locked state, if to many gc operations are required it will return
-ENOSPC.

ssize_t nvs_calc_free_space(): introduced, calculates the free space
that is available in the nvs file system.

Removed define LOG_LEVEL.

Rebased to current master.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-02-21 09:32:52 -05:00
Andrzej Puzdrowski 662b44e357 sample/subsys/usb/dfu: correction to documentation
Reverted unwanted documentation change on usb dfu sample.
Changes was introduce accidentally within PR #13475

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-02-20 19:43:43 -05:00
Krzysztof Chruscinski a64b0fe1e3 shell: Deprecate macros for subcommands creation
Macros are replaced by C++ friendly versions:
- SHELL_CREATE_STATIC_SUBCMD_SET by SHELL_STATIC_SUBCMD_SET_CREATE
- SHELL_CREATE_DYNAMIC_CMD by SHELL_DYNAMIC_CMD_CREATE

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Krzysztof Chruscinski 3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Erwan Gouriou 1b7b384639 samples/subsys/nvs: Fix typo in samples description.
Typo fix.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-19 07:45:50 -06:00
Anas Nashif 996c252e51 dfu: mcuboot: rename boot_swap_type> mcuboot_swap_type
This function conflicts with a function of the same name in mcuboot.
This happens when building USB DFU support into mcuboot.

DFU over USB uses image manager and mcuboot internals to manage images
downloaded to the device.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-19 09:32:02 +01:00
Erwan Gouriou 70e223a5b9 samples/subsys/nvs: Add a clean test termination
If nvs sample is run once until max reboot value, the next time it is is
ran on the same board, it will not behave as expected as code will
read reboot counter set to max value and will stop there.
In order to avoid the operation to wipe the flash manually between
2 runs of the test, add a clean termination to the test by resetting
the reboot counter before exiting.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-12 20:16:22 -05:00
Kumar Gala b813ae2b54 samples: subsys: nvs: Convert FLASH_ERASE_BLOCK_SIZE to DT_
Use DT_FLASH_ERASE_BLOCK_SIZE prefixed defined instead of
FLASH_ERASE_BLOCK_SIZE as the non-DT version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala dc0ad52320 samples: nvs: Convert FLASH_AREA to DT_FLASH_AREA
Use DT_FLASH_AREA prefixed defined instead of FLASH_AREA as the non-DT
version is deprecated.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 22:39:07 -06:00
Kumar Gala 4433041da4 samples: subsys: ipm_mcux: Convert to use DT_ prefixed defines
The code has been using non DT_ prefixed defines for DT generated
defines.  Switch to use DT_ prefixed ones as we want to deprecated
the non DT_ prefixed defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-08 16:03:17 -06:00
Jakub Rzeszutko 090ef041e8 shell: improved shell_prompt_change function
Shell will store only pointer to the prompt string instead of
copying it to the RAM buffer. It will save RAM memory and
it will simplify implementation of a  new feature: "select"
command. When a command will be selected than shell will
display command syntax as a prompt.

Removed obsolete ASSERT check in a static function.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-02-08 14:51:52 -05:00
Andrei Emeltchenko 1e9235259a samples: cdc_acm_composite: Add README documentation
Add README describing the sample.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko d1f84ea781 samples: cdc_acm: Add composite CDC ACM sample
Add sample creating 2 serial USB ports and establishing communication
between those 2 ports.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko bf0a4a8cfb samples: usb: Update samples for new port name
Use new multi instance interface and new port names.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko 0ccc28c4a8 samples: hid-mouse: Refactor and use new HID Device interface
Refactor of hid-mouse and using new HID Device interface.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko 6cf619f549 samples: hid: Use HID Device interface for samples
Use new HID Device interface for HID sample

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
Andrei Emeltchenko 6aefb16964 usb: cdc_acm: Add menuconfig option for multiple instances
Add menuconfig option to select another instance of CDC ACM device.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-02-08 11:23:04 -05:00
David B. Kinder c1dce2f799 doc: fix misspellings in docs
Fix misspellings missed in regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-02-07 22:06:14 -05:00