Commit graph

41264 commits

Author SHA1 Message Date
Vikrant More
36a6adafd9 samples: mesh: removed redundant code
Remove redundant code from implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
4835c0f201 samples: mesh: removed bugs in on-off transition
If Node Lightness is in downward transition & received Generic
onoff message to set state equal to 1 then Node transaction get
stopped in between. Ideally it should reach to default lightness
value if it is non-zero. This commit has solved this bug.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Vikrant More
243044361b samples: mesh: single timer to handle all transitions
This commit upgrade the implementation to reduce complexity in
algorithm. Previously there was different timers for lightness
as well as temperature transitions. But at time only single
transition is remain activated & hence there is no need
of multiple timer for each entiity.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-05-10 14:09:36 +03:00
Carles Cufi
9cea26ae77 doc: west: Document west installation in-depth
Create a new dedicated section for west installation that details
some of the finer aspects of the process and steps involved.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-10 13:08:27 +02:00
Carles Cufi
66fdd48fdd west: Add completion command
Add a completion command that dumps the contents of a shell
completion file present in the zephyr repository.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-10 13:08:27 +02:00
Carles Cufi
f43d306527 west: Add bash completion file
This file was previously located in the west repository, under scripts/.
Since it now includes knowledge about specific behavior ef zephyr
extension commands, we move it here after overhauling it completely.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-10 13:08:27 +02:00
Paul Sokolovsky
22f1a29185 net: sntp: Add convenience API for one-shot SNTP query
sntp_simple() function queries the server (passed as "addr[:port]"
string). It wraps calls to a number of other functions, and may be
useful to write simple, concise apps needing the absolute time.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-10 13:44:32 +03:00
Paul Sokolovsky
426f3fa1ac net: socketutils: Add utils to manipulate network address strings
Two utils to manipulate addresses in format "addr[:port]". I.e.,
network address (domain name or numeric), optionally followed by
port number:

* net_addr_str_find_port(), to return pointer to port number
substring (or NULL if not present).
* net_getaddrinfo_addr_str(), which is effectively getaddrinfo()
wrapper taking a "addr[:port]" string as a parameter.

The header file is named socketutils.h to emphasize that these
utility functions are implemented on top of BSD Sockets API
(and other POSIX/ANSI C functions), and thus portable to other
POSIX systems (e.g., Linux), so can be used in apps testing
POSIX compatibility. More utility functions (beyond address
manipulation) can be added later.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-10 13:44:32 +03:00
Paul Sokolovsky
9ca9e077aa net: socket: Define NI_MAXHOST for compatibility
Not in POSIX. Linux man getnameinfo says about it:

"In order to assist the programmer in choosing reasonable sizes for
the supplied buffers, <netdb.h> defines the constants

           #define NI_MAXHOST      1025
           #define NI_MAXSERV      32

Since glibc 2.8, these definitions are exposed only if suitable
feature test macros are defined, namely: _GNU_SOURCE, _DEFAULT_SOURCE
(since glibc 2.19), or (in glibc versions up to and including 2.19)
_BSD_SOURCE or _SVID_SOURCE."

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-10 13:44:32 +03:00
Alexander Wachter
bc6186571e drivers: can: stm32: fix filter mode set
Bits are actually shifted by filter number instead of bank number.
This results in wrong mode and filter_index calculation.
Fix shifting of mode bits by using bank_number instead of filter_number.

Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
2019-05-10 11:55:46 +02:00
Robert Lubos
2de06b4b3c net: Avoid calling L2 functions on offloaded interface
Calling functions like `net_if_start_dad`, `join_mcast_nodes` or
`net_if_start_rs` lead to L2 API function calls, which is not correct
for offloaded interfaces and leads to a crash. This is especially
problematic, as they are called in the default configuration.

Avoid calling these functions while an offloaded interface is brought up
by adding extra jump label.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-05-10 10:07:26 +03:00
Robert Lubos
cd07a30c51 net: Allow to disable native IP stack with socket offloading
In case socket offloading is used, one might want to disable native IP
stack, both IPv4 and IPv6, to save memory. Currently it is not possible
due to preprocessor check. Prevent that by adding additional exception
for socket offloading.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-05-10 10:07:05 +03:00
Mark Wang
a93fcb10fd boards: mimxrt1050_evk: configure USB device EHCI driver for rt1050
set usbd1 status as OK in mimxrt1050_evk.dts
add usb_device supported information in rt1050 yaml file.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-09 13:37:02 -05:00
Mark Wang
32f8521cce soc: nxp_imx: configure USB device EHCI controller driver for rt1050
add usbd1 definition to rt dts file,
set EHCI controller config default value in rt1050 default config file,
add EHCI controller driver MACROs to dts_fixup.h,
initialize EHCI clock in rt soc.c
add HAS_MCUX_USB_EHCI for supported soc in Kconfig.soc

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-09 13:37:02 -05:00
Mark Wang
5f0d065514 drivers: usb: nxp: add NXP EHCI USB device controller driver shim
usb_dc_mcux_ehci driver is one shim of the NXP SDK ehci driver.
select NOCACHE_MEMORY if HAS_MCUX_CACHE

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-09 13:37:02 -05:00
Mark Wang
8487a1eb2c ext: mcux: Import NXP SDK USB EHCI controller driver to ext/ directory.
Put the driver files to ext/hal/nxp/mcux/middleware/usb/device.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
2019-05-09 13:37:02 -05:00
Marcin Szymczyk
b1f3825ea3 usb: cdc: add option to force IAD
Interface Association descriptor has to be used with Windows 7.
Add CONFIG_CDC_ACM_IAD option to force its usage, disabled by default.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2019-05-09 08:20:34 -04: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
Piotr Mienkowski
c53c32e17d board: efr32_slwstk6061a enable SoC DC-DC converter
This commit enables internal SoC DC-DC converter on efr32_slwstk6061a
board.

RF components on efr32_slwstk6061a board are connected to the internal
SoC DC-DC converter. Upon startup the DC-DC converter is configured in
the bypass mode. Such configuration provides enough power for the SoC to
boot and perform basic operation. It is not enough however to operate
the radio subsystem. Without this patch enabling radio in Rx or Tx mode
causes voltage drop and triggers brown out detector reset.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-05-09 06:46:14 -05:00
Marc Herbert
a880fb1343 cmake: explain BUILD_VERSION and KERNEL_VERSION_*
- Add examples for the latter.
- Point at each other and highlight how independent they are from each
  other.
- State their inputs and outputs in plain English.
- Fix "git describe" error message giving the wrong impression that
  everyone cares about BUILD_VERSION. Only the boot banner cares now.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-05-09 11:52:05 +02:00
Jun Li
d1b21f3462 soc: stm32: enable outputing hex file
Hex firmware file is convenient in some scenarios, like
generating signed firmware with `west sign`. So, enable
generating hex file.

Signed-off-by: Jun Li <jun.r.li@intel.com>
2019-05-08 21:11:10 -04:00
Andrzej Puzdrowski
c2f08dadf0 dfu/img_util: : non-secure app support
In non-secure Trustzone application dedicated flash non-secure
partition are used instead of regular one, which become secure
partition in Trustzone collaboration model.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-08 20:02:50 -04:00
Charles E. Youse
03199f9994 include/sys_clock.h: consolidate identical branches in __ticks_to_ms
The two branches of the compile-time conditional are identical, so
they are consolidated and the conditional removed.

Just hygiene again.  No functional change.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-08 19:57:26 -04:00
Charles E. Youse
e1cb4ca0f4 include/sys_clock.h: simplify _NEED_PRECISE_TICK_MS_CONVERSION
This is just hygiene. Some preprocessor logic is optimized, eliminating
a temporary (_NON_OPTIMIZED_TICKS_PER_SEC) in the process.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-08 19:57:26 -04:00
Francisco Munoz
3667d0b761 boards: microchip_mec: Introduce gpio to the eval board
Enables GPIO driver in the board defconfig

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-05-08 16:39:54 -07:00
Francisco Munoz
35cfe113d2 soc : microchip_mec : Add gpio driver common definitions
Macros and enums are included for supporting pin configuration
settings.

Entries to the dts_fixup were also included in order
to configure port level settings.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-05-08 16:39:54 -07:00
Francisco Munoz
0cb238127d drivers: gpio: Introduce microchip gpio driver
Adds a new xec gpio driver that can be used with the
XEC MCUs. This driver modifies the PCR1 register in order
to configure gpio settings. Interrupts are triggered by the EC
interrupt aggregator block.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-05-08 16:39:54 -07:00
Francisco Munoz
2452b84c89 dts : Introduce gpio node entries for Microchip MEC
Dts Nodes for all the GPIO portswere defined. In addition,
a new binding file was created for the gpio driver.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
2019-05-08 16:39:54 -07:00
Jose Alberto Meza
b47669ac9d CODEOWNERS: Add code ownership for Microchip XEC drivers
Set ownership for Microchip XEC drivers

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Jose Alberto Meza
35d529b6ec boards : arm : Add I2C support for MEC15xx EVB
Expose 3 I2C instances with default SoC-Phy mappings for use with EVB

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Jose Alberto Meza
a94f1718ce drivers: i2c: mchp: Add I2C driver for MEC family
Add i2c_mchp_xec byte-to-byte driver to support I2C instances
for MEC family

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Jose Alberto Meza
291e1289a0 dts: mchp: Add Microchip I2C SoC device tree
Expose MEC1501 5 I2C/SMB  controllers
Add Microchip specific I2C device tree properties

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Jose Alberto Meza
467d1c3205 soc: arm: mchp: Add I2C to device tree for MEC1501
Add additional support to device tree for I2C

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Jose Alberto Meza
99ba2e7fba ext: hal: mchp: Fix compilation for MEC1501 SMB macros
Adjust space definition for I2C register base addresses

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-05-08 15:02:26 -07:00
Benjamin Valentin
13453b9105 boards: enable i2c on the SAM R21 Xplained Pro board
Hook up SERCOM1 to I2C, it is connected to the EXT3 header and
the EDBG embedded debugging interface.

Signed-off-by: Benjamin Valentin <benpicco@googlemail.com>
2019-05-08 14:49:53 -04:00
Charles E. Youse
50c71e6043 arch/x86: CONFIG_BOOTLOADER_UNKNOWN renamed to CONFIG_X86_MULTIBOOT
The only use of the BOOTLOADER_UNKNOWN config option is on x86, where
it controls whether a multiboot header is embedded in the output.
This patch renames the option to be more descriptive, and makes it
an x86-specific option, rather than a Zephyr top-level option.

This also enables X86_MULTIBOOT by default, since the header only
occupies 12-16 bytes of memory and is (almost always) harmless.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-08 14:49:19 -04:00
Peter Herager
95e1eb960b Bluetooth: Add additional attributes to DIS
Add SW, HW, FW & serial attributes to DIS
Add support for reading attributes from settings during boot

Signed-off-by: Peter Herager <pehe@oticon.com>
2019-05-08 20:17:07 +03:00
Peter Herager
4678447d45 Bluetooth: Add debug kconfig for bluetooth services
Add kconfig to enable debug output for bluetoth services

Signed-off-by: Peter Herager <pehe@oticon.com>
2019-05-08 20:17:07 +03:00
Brett Witherspoon
cddb3a1e34 drivers: adxl362: use Kconfig for interrupt mode
Commit 11295c1 added Kconfig options for interrupt mode, but then hard
coded the interrupt mode. This commit uses the Kconfig option to set
the interrupt mode.

Applications expecting the interrupt mode to be something other than
the default will need to be updated.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-08 12:00:17 -05:00
Brett Witherspoon
ae9905232c drivers: adxl362: don't skip mutex unlocking in error path
The default case of the switch statement jumps over the unlocking of the
trigger mutex. This has been fixed with more granular locking which has
the added benefit of being more explicit about what is being protected.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-08 11:58:07 -05:00
Benjamin Valentin
29deef2def drivers: watchdog: sam0: Check if timeout is valid
The upper limit of the timeout should not be 0.
tests/drivers/watchdog/wdt_basic_api checks for this and fails as the
driver currently only checks that the timout does not exceed the upper
bound.
This also makes it check the lower bound, so that the test passes.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-05-08 11:52:22 -05:00
Mark Ruvald Pedersen
37d494778e cmake: Rename kernel_elf to zephyr_final
* KERNEL_ELF was easily confused with KERNEL_ELF_NAME and KERNEL_NAME.
 * kernel_elf as the name of the binary indicates it somehow only
   contains the kernel, which is not correct.

Rename to zephyr_final as this is the reality: Zephyr elf has been
linked again (a number of times) due to generated kernel files.

Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
2019-05-08 10:40:39 -04:00
Alexander Svensen
774d5e871c Bluetooth: controller: split: Fix Conn Param Req procedure stall issue
Fix an issue wherein local or remote initiated Connection
Parameter Request procedure would stall without generation
of LE Connection Update Complete HCI event because a local
or remote initiated PHY Update procedure has overwritten the
currently active Link Layer Control Procedure type.

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
2019-05-08 11:21:52 +02:00
Alberto Escolar Piedras
89b0116ab8 CODEOWNERS: remove use of commas
Commas are not allowed in this file and prevent parsing by github

Error introduced in
7c7db00a77

Fixes #15998

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-05-08 10:41:30 +02:00
Marc Herbert
1c8632cfaa sanitycheck: support symbolic links in ZEPHYR_BASE
Fix issue where sanitycheck wrongly assumed tests inside ZEPHYR_BASE
to be outside ZEPHYR_BASE and dropped the prefix in their name. This
happened when:
- ZEPHYR_BASE contains symbolic link(s), and
- relative --testcase-root argument(s) are passed

To generate unique names, TestCase.get_unique(testcase_root) first
checks whether "testcase_root" starts with ZEPHYR_BASE. Either may or
may not include symbolic links so both must be canonicalized before
comparison. While fixing this method, replace explicit forward slash
"/" and string replace with os.path.relpath() and make a couple other
simplifications and minor pydoc fixes.

Add new canonical_zephyr_base = os.path.realpath(ZEPHYR_BASE) constant
and corresponding comments and guidelines.

The most visible effect of this mismatch was sanitycheck dropping the
--testcase-root prefix from the unique name of tests inside
ZEPHYR_BASE. This means some test names could be not unique anymore
and silently overwrite each other's results, example:

 bash# cd zephyr_dir_with_symlink; export ZEPHYR_BASE=$(pwd)
 ./scripts/sanitycheck -T samples/portability/cmsis_rtos_v1 \
                       -T samples/portability/cmsis_rtos_v2

The more systematic and practical consequence (and how I actually
found this) was test outputs landing in unexpected locations.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-05-07 23:19:35 -04:00
Krzysztof Chruscinski
9012960e93 drivers: counter: Add optional (D)PPI wrapping to nRF RTC driver
If top value is different than maximal top value (24 bits) then
wrapping must be handled. There are 2 ways to handle that:
- in software, by clearing the counter in the interrupt
- by HW, using (D)PPI which connects compare event with clear task

First option was already implemented but it has accumulative error.
Added PPI option which requires 1 PPI channels but has no accumulative
error.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-07 23:19:00 -04:00
Krzysztof Chruscinski
7a2d025bce testsuite: ztest: Add zassert_within macro
Added macro to test value against another value with
accepted delta.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-07 23:18:22 -04:00
Mariusz Skamra
44739f4427 Bluetooth: controller: Workaround CPR procedure collision at CPU instant
This is a workaround for IOP issue, where peer rejects LLCP Slave
Connection Parameter Request with LMP Error Transaction Collision
error code even if previous request is complete at the instant.

Relates to #15366.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-05-07 23:17:34 -04:00
Luiz Augusto von Dentz
f9e89e5532 Bluetooth: shell: GATT: Make get command take a handle range
This enables get command to operate on a handle range so multiple
attributes values can be printed out:

uart:~$ gatt get 0x0001 0xffff
attr 0x00506600 uuid 2800 perm 0x01
00000000: 01 18
attr 0x00506600 uuid 2803 perm 0x01
00000000: 20 03 00 05 2A
attr 0x00506600 uuid 2a05 perm 0x00
attr 0x00506600 uuid 2902 perm 0x03
00000000: 00 00
attr 0x00506600 uuid 2803 perm 0x01
00000000: 0A 06 00 29 2B
attr 0x00506600 uuid 2b29 perm 0x03
00000000: 00
attr 0x00506600 uuid 2803 perm 0x01
00000000: 02 08 00 2A 2B
attr 0x00506600 uuid 2b2a perm 0x01
00000000: AA 2D 05 EB E8 1D D0 E5 F7 B9 C1 B6 3F 66 93 15
attr 0x00506600 uuid 2800 perm 0x01
00000000: 00 18
attr 0x00506600 uuid 2803 perm 0x01
00000000: 0A 0B 00 00 2A
attr 0x00506600 uuid 2a00 perm 0x09
00000000: 74 65 73 74 20 73 68 65 6C 6C
attr 0x00506600 uuid 2803 perm 0x01
00000000: 02 0D 00 01 2A
attr 0x00506600 uuid 2a01 perm 0x01
00000000: 00 00
attr 0x00506600 uuid 2803 perm 0x01
00000000: 02 0F 00 A6 2A
attr 0x00506600 uuid 2aa6 perm 0x01
00000000: 01
attr 0x00506600 uuid 2803 perm 0x01
00000000: 02 11 00 04 2A
attr 0x00506600 uuid 2a04 perm 0x01
00000000: 18 00 28 00 00 00 2A 00
attr 0x00506600 uuid 2800 perm 0x01
00000000: 0D 18
attr 0x00506600 uuid 2803 perm 0x01
00000000: 10 14 00 37 2A
attr 0x00506600 uuid 2a37 perm 0x00
attr 0x00506600 uuid 2902 perm 0x03
00000000: 00 00
attr 0x00506600 uuid 2803 perm 0x01
00000000: 02 17 00 38 2A
attr 0x00506600 uuid 2a38 perm 0x01
00000000: 00
attr 0x00506600 uuid 2803 perm 0x01
00000000: 08 19 00 39 2A
attr 0x00506600 uuid 2a39 perm 0x00

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-07 23:17:13 -04:00