Commit graph

99049 commits

Author SHA1 Message Date
Ioannis Glaropoulos
4fdcb193de arch: arm: mpu: move the early return higher in the execution process
This commit moves the block of the early return before
the derivation of the stack size, to avoid unnecessary
operations if this is not a user thread.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-06 22:55:16 +01:00
Ioannis Glaropoulos
929da0feac arch: arm: mpu: fix thread user stack region size
In user mode a thread stack will include the optional
stack guard area (present if MPU_STACK_GUARD is defined.
The guard area has been originally take out of the thread
stack size calculation. For MPUs with no power-of-two size
requirement, we need to increase the size of the MPU region
for user-mode, to account for the additional guard region.
MPUs with power-of-two size requirement will, anyway, round
up the region size to the next power of two.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-06 22:55:16 +01:00
Henrik Brix Andersen
0d412ab20e cmake: fix code section ordering
Order the code sections according to their numbering in the table of
contents.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-06 16:54:54 -05:00
Aurelien Jarno
db94cef75d boards: enable USB device on Atmel SMART SAM E70 Xplained Board
This enables the USBHS interface on the Atmel SMART SAM E70 Xplained
Board, by adding an entry to the DTS. It also updates the documentation
and mark usb_device as supported for the tests.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-06 16:32:35 -05:00
Aurelien Jarno
6b6e54321a drivers: usb: add usb device driver for Atmel SAM E70 family
This patch adds a USB device driver for the USBHS device that can be
found on Atmel SAM E70 SoC family. Only the FIFO mode is supported
(as opposed to DMA). It supports LS, FS and HS modes, but defaults to
FS mode as Zephyr does not fully support HS mode yet.

Tested examples on an Atmel SMART SAM E70 Xplained Board:
* usb/cdc_acm
* usb/hid-mouse
* usb/mass

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-11-06 16:32:35 -05:00
Sebastian Bøe
9296fdc45e cmake: Abort early if Python3 is not found
When Python3 is not found the build system will warn the user and then
continue. Python3 is required and continuing can only confuse the user
with new off-topic error messages.

This patch denotes Python3 as required to resolve this.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-06 16:31:51 -05:00
Szymon Janc
b6979010c6 Bluetooth: host: Fallback to L2CAP for CPUP if rejected by master on LL
Fallback to L2CAP Connection Parameters Update Request if LL Connection
Update Request was rejected by remote device that has this marked as
supported in features. This can happen if procedure is supported only
by remote controller, but not enabled by host. This is connection
parameters update with iOS devices.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2018-11-06 16:30:15 -05:00
Flavio Ceolin
22236c9d6d kernel: Make tag identifiers unique
Some places are using the same tag identifier with different types.
This is a MISRA-C violation and makes the code less readable.

MISRA-C rule 5.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-06 16:20:15 -05:00
Flavio Ceolin
fcfcb7e902 include: misc: Do not mix comment characters
MISRA-C recommends to no use // within /* comment.

MISRA-C rule 3.1

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-06 16:20:15 -05:00
Flavio Ceolin
3ced176088 subsys: logging: Fix switch statement
According with MISRA-C and unconditional break statement must
terminate every switch-clause.

MISRA-C rule 16.1 and 16.3

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-06 16:20:15 -05:00
Flavio Ceolin
19301849e8 lib: Normalize if/else statements
Enforce braces in all if/else statements. This is part of MISRA-C rule
15.6.

MISRA-C rule 15.6

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-11-06 16:20:15 -05:00
Kiril Zyapkov
f45996ef74 boards: arm: fix openocd.cfg for nucleo_l476rg
Other ST boards have their openocd.cfg support file updated,
but Nucleo L476RG was still looking for board/st_nucleo_l476rg.cfg
and fails with Zephyr SDK 0.9.5.

Signed-off-by: Kiril Zyapkov <k.zyapkov@allterco.com>
2018-11-06 16:17:21 -05:00
Sebastian Bøe
075525cfe7 cmake: Add support for out-of-tree shields
Add support for out-of-tree shields. Out-of-tree shields can now be
stored in out-of-tree board directories.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-06 16:16:01 -05:00
Marek Pieta
c99fd5c807 subsys: debug: tracing: Fix interrupt hooks
Change fixes interrupt hooks.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2018-11-06 16:15:29 -05:00
Ioannis Glaropoulos
e9432c6e94 doc: kernel: usermode: correct prefixes in app memory section
Application shared memory API uses 'appmem_' prefix for
its functions and macros. This commit updates the respective
documentation to align with the API convention.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-06 16:14:41 -05:00
Ioannis Glaropoulos
ff5d942db8 tests: kernel: userspace: minor typo fixes
Some minor style and typo fixes in
tests/kernel/mem_protect/userspace/src/main.c.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-11-06 16:14:41 -05:00
Erwan Gouriou
be74a13b5b dts/arm/st: Fix I2C issues in stm32l4 series
Add clocks property in stm32l4r5 devices.
Replace i2c2 node by i2c3 node in l4.dtsi as i2c3 available
in all stm32l4 SoCs while i2c2 is not available in some parts.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-06 16:14:13 -05:00
Erwan Gouriou
9df3a1f67f drivers/i2c: stm32: get clock bits/bus from dts files
Get STM32 I2C clocks bus and bits information from
device tree files.

Fixes #10435

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-11-06 16:14:13 -05:00
Christopher Métrailler
9b39be1147 ext: hal: nordic: Add missing peripherals in Kconfig
Peripheral drivers are already available but cannot be enabled trough
Kconfig. This allow project to use nrfx drivers.

Signed-off-by: Christopher Métrailler <christopher.metrailler@nordicsemi.no>
2018-11-06 16:12:55 -05:00
Andrei Emeltchenko
5addb3a925 samples: net: Correct FRDM + CR20A configuration
Correct configuration for frdm_k64f + mcr20a shield.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Andrei Emeltchenko
94fc0e9cb0 samples: net: Add 802154 overlay configuration for reel_board
Add reel_board configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-11-06 16:09:09 -05:00
Johan Hedberg
39155d55b6 samples: boards/mesh_badge: Fix checking for null in hello message
Use strncpy instead of memcpy to make sure copying stops at the first
null-character.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Johan Hedberg
a19ca5cce6 samples: reel_board/mesh_badge: Fix null-termination of string buffer
The way the code is structured the buffer is always guaranteed to be
large enough, however perform explicit termination anyway to avoid
Coverity warnings.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:31:24 +02:00
Johan Hedberg
97141734f1 Bluetooth: shell/gatt: Fix unreachable code
The code had somehow gotten corrupt (yet in a way that it compiles) so
that an intended if-branch was missing.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-11-06 22:29:51 +02:00
Himanshu Jha
4a5042dd77 sensor: lis2mdl: Handle return value of i2c_burst_read
i2c_burst_read can fail during read/write procedure. Therefore,
add a sanity check for its return value.

Fixes #11101
Coverity-CID: 189505

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-06 14:10:51 -06:00
Anas Nashif
e25d67b7b0 boards: qemu_x86: remove deprecated qemu options
Options "-clock dynticks" and  "-balloon none" are deprecated and
produce warning in recent Qemu versions, so remove them.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-06 12:42:08 -05:00
Himanshu Jha
d88421db37 CODEOWNERS: Assign maintainer of Coccinelle Infrastructure
Add myself and Julia Lawall as the maintainer of Coccinelle
Infrastructure.

Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-06 12:41:49 -05:00
Krzysztof Chruscinski
c036d2f4dd logging: Add compile time error on 64 bit platforms
Logger is designed with assumption that address fit in 32 bits.
Added explicit compilation error on 64 bit platforms.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-06 18:24:22 +01:00
Wayne Ren
a82ca0bb47 arc: fix the coverity issuse in thread.c
fix coverity CID: 187905

issue fixes #9765

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2018-11-06 08:37:36 -08:00
Jonas Norling
ac960bf91b ext: hal: nordic: Make it possible to build NRFX GPIOTE and PPI
This makes it possible for the application to enable building of the
GPIOTE and PPI subsystems in NRFX.

Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
2018-11-06 17:18:20 +01:00
Kumar Gala
bfc4281cc0 arm: kinetis: Add basic DTS support for TRNG
Add dts binding and info for TRNG device and enable basic support to
get the device name from DTS.  We leave for now the base addresses
coming from the MCUX HAL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 08:49:50 -06:00
Kumar Gala
727a9a7f99 arm: kinetis: Add basic DTS support for RNGA
Add dts binding and info for RNGA device and enable basic support to
get the device name from DTS.  We leave for now the base addresses
coming from the MCUX HAL.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 08:49:50 -06:00
Kumar Gala
6ce4a08c97 drivers: entropy: Get device name from dts if supported
If we have DTS support for an entropy driver we should get the name
generated from DTS ('label' property on the entropy device node).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 08:49:50 -06:00
Kumar Gala
7c2a8a4678 dts/extract_dts_includes.py: Expose flash partition extract function
Allow directly calling the flash partition extraction function and
remove passing any arguments that the function doesn't actually use.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Kumar Gala
6fd3fbbd22 dts/extract_dts_includes.py: Rework flash partition extraction
Reworked flash partition extraction so we call it when we see a
node that is 'partiton@' instead of per property.  We also handle the
'read-only' property in the flash partition extraction function which
lets us remove 'use-property-label' handling.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Kumar Gala
577df2dbe3 dts/extract_dts_includes.py: remove use of 'use-property-label' in regs
We don't have any cases that need 'use-property-label' related to
handling of reg extraction so lets remove it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-06 07:42:39 -06:00
Niranjhana N
d158c07ddb samples: net: echo: fix unchecked returns
Before connecting, check for errors in
bind and listen calls in the echo test.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-11-06 13:18:20 +02:00
Pavel Kral
564f02ec0e drivers: rtt: fix no return statement in rtt_init
Add missing return statement to rtt_init function.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-11-06 11:47:15 +01:00
Tomasz Bursztyka
3200914ed9 net/ethernet: Remove as many ifdef for CONFIG_NET_VLAN as possible
Most of vlan functions have dummy aliases when it's not enabled, so
let's use this.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-06 12:42:06 +02:00
Tomasz Bursztyka
7280757d7d net/ipv4: Use iface's ll reserve relevantly
No need to evaluate what's the ll reserve size here as net if has a
function to do so.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-06 12:42:06 +02:00
Jukka Rissanen
4f0d8b7680 samples: net: echo-server: ROM usage of quark_se_c1000_devboard
Tweak ROM usage of quark_se_c1000_devboard so that test_usbnet
test will pass. The board just disables network statistics as
that is not really needed here.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:11:08 +02:00
Jukka Rissanen
a561913516 tests: net: ipv6: Test interface local scope dst pkt sending
Make sure that if network packet destination IPv6 address is
interface local scope multicast address FF01::, then those
packets must routed back to us when sending them.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:11:08 +02:00
Jukka Rissanen
9fc9d1496e net: ipv6: Loopback interface local scope packets back to us
If the destination IPv6 address is interface local scope multicast
address FF01::, then loopback those packets back to us as that is
the purpose of those addresses. They are to work same way as
localhost unicast address. See RFC 3513 ch 2.7 for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:11:08 +02:00
Jukka Rissanen
a13cee27c3 net: shell: Add IPv6 and IPv4 checks for ping command
If IPv6 is disabled, then we can skip IPv6 checks and avoid
Coverity warnings. Same thing for IPv4.

Coverity-CID: 189506
Fixes #11100

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:09:12 +02:00
Jukka Rissanen
ad27d0e39e net: ipv6: Check the size of the ICMPv6 echo-req packet
The minimum size is 8 bytes, drop packet if shorter.

Fixes #10970

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-11-06 11:08:15 +02:00
Paul Sokolovsky
de659240e6 net: if: net_if_set_link_addr: Mention lifetime for address buffer
This function just stores the buffer pointer passed, so explicitly
mention that the buffer must remain valid while netif itself is
valid. For example, it can't be stored on stack.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-11-06 10:25:25 +02:00
Mariusz Skamra
50768a6bba Bluetooth: Do not compile GATT response handlers if Client is disabled
This will exclude GATT Client response handlers from compilation
if GATT Client support is disabled.

Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2018-11-06 09:33:19 +02:00
David B. Kinder
ae4d7612f0 doc: filter expected dup decl warnings
The API documentation for networking.rst can throw a doxygen warning
depending on the versions of sphinx/breathe being used.

Fixes: #11111

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-11-05 23:40:26 -05:00
Anas Nashif
62cce740ea sanitycheck: clarify -s vs -T options in ztest doc
Clarify the difference and fix the ztest documentation adding more
examples.

This fixes #10662.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-05 17:31:36 -05:00
Sebastian Bøe
637c41a382 Bluetooth: controller: Refactor the k32src_wait() function
This is a pure refactoring of the k32src_wait function. It used the
following rules when refactoring:

Don't use the preprocessor when unprocessed C language suffices.

Don't undefine macro's.

Avoid global variables when possible.

Use consistent names for similiar things (hf_clock, lf_clock).

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-11-05 21:46:00 +01:00