Commit graph

19237 commits

Author SHA1 Message Date
Sebastian Bøe
2224e22a6f drivers: sensor: Fixed include paths s/</"/
CMake no longer adds the source directory to the system include path.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 11:21:41 -05:00
Sebastian Bøe
29bb2a8fbf cmake: Fixed drivers/sensor/CMakeLists.txt
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 11:21:41 -05:00
Paul Sokolovsky
91e810f87a net: sockets: sendto: Remove adhoc handling of max pkt payload size
Now the check happens on the level of the core IP stack, in
net_pkt_append().

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-10 16:30:42 +02:00
Paul Sokolovsky
4718dac560 net: net_pkt_append: Take into account MTU when adding data to a packet
If we were asked to add 10KB to a packet, adding it won't help -
such packet won't be even sent by hardware on our side, and if
it is, it will be dropped by receiving side. So, make sure we
never add more data than MTU as set for the owning interface.
This actually gets a bit tricky, because we need also to account
for protocol header space. Typically, when net_pkt_append() is
called, protocol headers aren't even added to packet yet (they
are added in net_context_send() currently), so we have little
choice than to assume the standard header length, without any
extensions.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-10 16:30:42 +02:00
Anas Nashif
706ac7fe07 doc: redirect doc generation output using tee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-10 09:30:10 -05:00
Carles Cufi
92d3d367e3 doc: ext: Add a run goal to the zephyr-app-commands
Since run is also used commonly, add it as a goal as well for those
users of the extension that want to create a sequence similar to:

$ make
$ make run

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-10 09:27:23 -05:00
Carles Cufi
041f018300 doc: ext: Add compact option to zephyr-app-commands
The new :compact: option allows for a single block of code output
without additional newlines or comments.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-10 09:27:23 -05:00
Carles Cufi
30f2acb057 doc: ext: Extend zephyr-app-commands with new args
New arguments added:

- conf: -DCONF_FILE=<>
- gen-args: Additional arguments to pass to CMake
- build-args: Additional arguments to pass to Make or Ninja

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-10 09:27:23 -05:00
Johan Hedberg
1f76023ad4 Bluetooth: Mesh: Fix ignoring prohibited ReceiveWindow value
According to the Mesh Spec value 0x00 of ReceiveWindow parameter is
prohibited. This is needed to pass MESH/NODE/FRND/LPN/BI-03-C.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 15:35:15 +02:00
Johan Hedberg
85e7a3d47e Bluetooth: Mesh: Fix typo when iterating GATT clients
The intention of the code was to access client->conn and not
clients->conn (which would always access the first client struct).

Fixes #4738

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 15:13:01 +02:00
Johan Hedberg
9c8ce3d7c4 Bluetooth: Mesh: Fix Mesh feature description in Kconfig
Use the correct term for the feature, and reformulate the help text
for BT_MESH.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 08:11:52 -05:00
Sebastian Bøe
f0346bfac0 flash: Change type of FLASH_SCRIPT_ENV_VARS
The old way of constructing FLASH_SCRIPT_ENV_VARS was corrupting the
values that were passed to the flasher. This new method is the
standard way of creating a dictionary/hashmap in CMake and does not
suffer from the same problem.

This fixes
https://github.com/zephyrproject-rtos/zephyr/issues/4844#event-1334599401

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 07:54:54 -05:00
Sebastian Bøe
8dd3bb8666 flash: Pass env var OPENOCD_DEFAULT_PATH to flasher
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-10 07:54:54 -05:00
Jukka Rissanen
3c0a0053fa samples: net: Remove QEMU_NET_STACK setting from CMakeLists.txt
The QEMU_NET_STACK is enabled automatically if building
a networking application to QEMU so no need to do it for
each networking sample.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 14:52:53 +02:00
Jukka Rissanen
ede10b96e4 cmake: Set proper QEMU options for networking applications
If compiling networking application for QEMU, then serial ports
must be set properly for QEMU<->host connectivity using SLIP.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-10 14:52:53 +02:00
Johan Hedberg
e980d45c13 Bluetooth: Mesh: Fix net_find_and_decrypt() function
The function return type was declared incorrectly. Also, the magic
checking for i after exiting the loop could cause some false positive
compiler warnings. Instead, return directly from the loop (with the
downside of duplicating a few lines of code).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 14:52:23 +02:00
Szymon Janc
1a50ee1fe0 Bluetooth: btp: Add initial commands for Mesh service
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2017-11-10 14:44:23 +02:00
Johan Hedberg
25c5d36b91 Bluetooth: Mesh: Avoid using 64-bit storage & math for beacons
It's in practice impossible for the time between two beacons to be
more than 50 hours (the approximate wrap-around time for a 32-bit
millisecond timer), so we can use a 32-bit timestamp instead of a
64-bit one for the beacon tracking.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 14:33:03 +02:00
Johan Hedberg
68f6b59e2d Bluetooth: Fix deadlock-risky HCI command buffer allocation
The LE scanning and advertising implementations were allocating and
holding buffers (the scan & advertising parameters respectively) while
at the same time potentially sending other commands (such as setting
the local private address). If these APIs would end up being called
simultaneously from different contexts, this could lead to a deadlock
in trying to allocate HCI command buffers, especially considering that
the default HCI command buffer count is 2.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-10 10:42:38 +02:00
Anas Nashif
446503dc50 cmake: Support disjoint toolchain and SDK locations
Make more toolchains use the tools provided by the Zephyr SDK.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-09 23:22:11 -05:00
Gil Pitney
dec93834d9 cmake: Fix drivers/serial/CMakeLists.txt to build uart_cc32xx.c
Previously, a typo prevented UART from working for any program
built for BOARD=cc3220sf_launchxl.

Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
2017-11-09 22:01:34 -05:00
Leandro Pereira
114f6032fe cmake: Support disjoint toolchain and SDK locations
Some toolchains, such as the one provided by Espressif for the ESP32,
or ISSM provided by Intel, will contain only the compiler, linker, and
supporting tools.  Other binaries needed by the build system that are
provided by the Zephyr SDK need to be found somewhere else.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-09 19:52:25 -05:00
Sebastian Bøe
c218261a33 sanitycheck: Fixed documentation for --extra-args and extra_args
sanitycheck was incorrectly documenting that --extra-args would pass
on it's input unchanged to Make.

In reality --extra-args acts as a way to define extra CMake cache
entries. The key-value entries will be prefixed with -D before being
passed to CMake.

E.g
"sanitycheck -x=USE_CCACHE=0"
will translate to
"cmake -DUSE_CCACHE=0"

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
71d7de01ef sanitycheck: Minor internal documentation fixes
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
7cc2071f71 doc: Remove all mentions of --ccache
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
781e39887c sanitycheck: Remove the --ccache option from sanitycheck
The --ccache option will be replaced by another mechanism.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Sebastian Bøe
728cda15de ci: Don't define the deprecated ENV var USE_CCACHE
USE_CCACHE has been deprecated. ccache now defaults to being enabled
and users can define the CMake variable -DUSE_CCACHE=0 to turn it off.

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-09 17:55:30 -05:00
Kumar Gala
3a5ca91f28 crypto: Update TinyCrypt to 0.2.8
Version 0.2.8 of this library has been released on Aug 29, and this
patch updates the library from version 0.2.7.  A summary of changes
is available at the official repository at:

    https://github.com/01org/tinycrypt/releases/tag/v0.2.8

A number of the changes we already had in tree, so the import to sync
with v0.2.8 is pretty minor.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 16:39:03 -06:00
Kumar Gala
ef912810d3 dts: Move dts files into board dirs
Move the dts files into the board dir so that board ports can be more
standalone.  This will allow us at some point to have board ports
outside of the tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 14:23:41 -06:00
Kumar Gala
09c63b373a dts: Move fixup files into board dirs
Move the dts fixup files into the board dir so that board ports can be
more standalone.  This will allow us at some point to have board ports
outside of the tree.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 14:23:41 -06:00
Kumar Gala
def016dd5d cmake: dts: Allow DTS_SOURCE to be defined anywhere
Allow for DTS_SOURCE to be defined in other locations (ie by board
directory code).  Thus allow the board to set any location to find the
dts source file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 14:23:41 -06:00
Kumar Gala
b37cfd6478 cmake: dts: Allow DTS_BOARD_FIXUP_FILE to be defined anywhere
Allow for DTS_BOARD_FIXUP_FILE to be defined in other locations (ie by
board directory code).  Thus allow the board to set any location to find
the fixup file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 14:23:41 -06:00
Kumar Gala
4c424616bd cmake: dts: rename dts fixup file related variables
Rename the variables related to DTS fixup to be clear what they are used
for.  This also lets us introduce a SOC level DTS fixup in the future
that is distinct from the board one.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-11-09 14:23:41 -06:00
Johan Hedberg
c7001a4620 Bluetooth: samples: Remove references to Kbuild-style building
Update the documentation for the Bluetooth samples not to refer to the
old style of building using make. Instead, simply refer to the general
instructions.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-09 10:57:49 -05:00
Carles Cufi
fa0030a31c doc: getting_started: Convert to using app extension
Use the new zephyr-app-commands extension to document the building of
applications

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-09 10:35:22 -05:00
Carles Cufi
e23742d5c7 doc: ext: Fix application extension CMake params
CMake requires "-D" for every macro that is passed into it. Add the
relevant "-D" for the Make variant of the extension.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-09 10:35:22 -05:00
Loic Poulain
eb83cda770 usb: dc_dw: Improve TX perf and reliability
During large USB transfer it's pretty common to call ep_write whereas
the previous TX transfer is not achieved and so the TX FIFO space is
not available. Sleeping 20ms in this case introduce a relatively high
latency and reduce the throughput.

This can be observed when pinging the board with CDC-ECM net class.
ping reply is split into 2 USB TX transfer, the second one is only
triggered after 20ms, making ping latency > 20ms.

To fix this, just continuously read the FIFO availabilty and fire TX
as soon as possible.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:15:55 -06:00
Paul Sokolovsky
b86b079f32 net: tcp: net_tcp_parse_opts: Convert MSS value to host byte order
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2017-11-09 17:00:26 +02:00
Andrei Emeltchenko
994ec924e3 usb: samples: Support build for 96b_carbon board
Rename netusb project file to be more general and support sanity build
for 96b_carbon board.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2017-11-09 09:31:58 -05:00
Loic Poulain
fa2da6713b usb: stm32: Fix null dereference in ep_write
ret_bytes param is optional and then can be NULL.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:13:14 -05:00
Loic Poulain
4a2e967a87 usb: stm32: Fix TX FIFO overwrite
In the same way as dw driver, check that FIFO is empty before
writing any new data. This patch introduces a boolean semaphore
which is requested before any new TX transfer and released on
transfer completion.

This fixes usb-ecm support on 96b_carbon board.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2017-11-09 09:13:14 -05:00
Jukka Rissanen
d63efc3aa1 samples: net: rpl: RPL node application was missing sample.yaml
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Jukka Rissanen
025e07e413 samples: net: rpl: Fix compile error in rpl-node application
Some required files were removed from samples/net/common which
caused compile error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-09 10:59:30 +02:00
Tomasz Bursztyka
58bc383cfd net/ieee802154: Properly check the sequence when handling ACK frames
When sending a packet with AR flag set, the ACK frame that should be
replied to it must holp the same sequence number, so let's verify this
properly.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-09 10:00:38 +02:00
Tomasz Bursztyka
cf78219318 net/ieee802154: Make FC/Seq validation function public
There will be place where validating only this part of the frame will be
necessary. This will avoid to run the little bit heavier
ieee802154_validate_frame().

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-09 10:00:38 +02:00
Anas Nashif
036dde2201 ci: reduce number of minions to 4
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 21:38:25 -05:00
Marti Bolivar
93c23d810b boards: x86: convert make to cmake
Unify documentation formatting and use zephyr-app-commands where
applicable.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-08 20:00:22 -05:00
Marti Bolivar
6092fb0f86 doc: add zephyr-app-commands directive
Add extensions/zephyr to the documentation. This is where Sphinx
extensions customized for Zephyr will live.

Within, add application.py. This provides a directive,
zephyr-app-commands, which generates commands in the docs to build,
flash, debug, etc. an application. For now, these are Unix shell
specific. Later on, they can be customized to generate additional
formats, perhaps with extra options.

After this is used throughout the tree, doing this with an extension
enables global changes with changes to the directive implementation
only.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2017-11-08 20:00:22 -05:00
Anas Nashif
162e64a3bd cmake: use zephyr_library_* for all boards
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-08 20:00:22 -05:00
Carles Cufi
00a07c385c doc: cmake: Unify getting started guides
Unify the format and mechanisms used in the different Getting Started
guides so that they are consistent in:

- The way Kconfig is built
- Avoiding using -B and -H CMake options
- -DBOARD instead of export

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-08 20:00:22 -05:00