Commit graph

19400 commits

Author SHA1 Message Date
Anas Nashif bd2838bb78 sanitycheck: asserts are now enabled by default
sanitycheck now runs with asserts enabled, so no need for this option
anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-12 08:24:23 -05:00
Sebastian Bøe 0e6689d559 sanitycheck: Default to using Ninja
It is important that it is easy to reproduce CI issues locally. Using
the same sanitycheck options locally and in CI helps in this
regard. Specifically, Ninja and Make can produce different results and
therefore the default generator should be the same for sanitycheck and
shippable.

This patch makes four changes:

The sanitycheck option '--make' is introduced to allow specifying Make
as a generator.

CI no longer passes the option '--ninja' to sanitycheck.

Sanitycheck defaults to using Ninja.

Sanitycheck documents the --ninja option as deprecated.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-02-12 08:24:23 -05:00
Vinayak Kariappa Chettimada 4eedb5067f Bluetooth: mesh: Account for scan window delaying adv events
New advertising started while scanning is already enabled
would delay the first advertisement event until the end of
the current overlapping scan window in the Zephyr native BLE
controller implementation. Hence, consider this scan window
duration when calculating the advertising stop.

Relates to: #6083

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-12 12:13:38 +02:00
Vinayak Kariappa Chettimada af13d6d581 Bluetooth: controller: Fix soft latencies in periodic ticker
Fix, add the missing code for the removal of any accumulated
soft latencies or negative drift ticks when scheduling next
interval expiry with added laziness.

Typically a first interval would accumulate soft latencies
and this has to be removed if the interval is rescheduled
with any added laziness (scheduled to the next soft real
time interval).

Example, scan windows block any new scheduling until the end
of the window, adding latencies to any soft real time ticker
expiry which should try to execute as early as possible after
the scan window.

Fixes: #6083

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-12 12:13:38 +02:00
Vinayak Kariappa Chettimada 57e49b1f03 Bluetooth: controller: Refactor BT_CTLR_ADV_INDICATION feature
Refactor BT_CTLR_ADV_INDICATION feature by moving the
implementation closer to the implementation that is closing
the advertisement event so that in the future new members
can be added as necessary (example, advertised channels).

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-12 12:13:38 +02:00
Vinayak Kariappa Chettimada baf05409f8 Bluetooth: controller: Fix BT_CTLR_XTAL_ADVANCED cond. compilation
Fix compile warnings when BT_CTLR_XTAL_ADVANCED Kconfig
option is disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-12 12:13:38 +02:00
Johan Hedberg 5ded8d8d49 Bluetooth: Remove useless BT_L2CAP_TX_USER_DATA_SIZE Kconfig variable
No one was setting this to any other value than its default, which
happens to be the same as BT_BUF_USER_DATA_MIN.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-12 09:48:32 +02:00
Johan Hedberg c14c2692e2 net: buf: Set default user data size to 4
Since all in-tree users are good with 4 bytes of user data, reduce the
default to 4. Also fix the default and rage values where apparently
'0' and '8' had been swapped.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-12 09:48:32 +02:00
Johan Hedberg 0ad6dbd80d Bluetooth: Move HCI command buffer user data into separate array
The HCI command buffers are the only ones with more than 4 bytes of
required user data. Move the user data into a separate array and do
the mapping with the help of net_buf_id(). After this, it will be
possible to reduce the default net_buf user data size from 8 to 4.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-12 09:48:32 +02:00
Johan Hedberg a7518ba30f Bluetooth: Mesh: Fix coverity warning with unchecked error return
This fixes Coverity CID 182769.

Fixes #6102

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-11 21:38:02 +02:00
Vinayak Kariappa Chettimada a152109eb1 Bluetooth: controller: Fix nRF52840 radio timings for Coded PHY
Fix incorrect radio timing for Tx chain delay for S2 and S8
coding. Regression introduced  in commit 55d3ce111c
("Bluetooth: controller: Refactoring nRF5 radio driver").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-11 20:33:02 +01:00
Johan Hedberg d5f27b70cc Bluetooth: Remove bogus return statements for BR/EDR connections
Having these in the beginning of a switch statement without any case
statement makes no sense.

Fixes #6135

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-11 18:29:57 +02:00
Alberto Escolar Piedras bc101c5b25 sanitycheck: better coverage report generation
When generating coverage report:
* Also generate branch coverage
* If the report is properly generated tell user where to find it
* Handle case in which no ztests are run (it would crash before)

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-11 11:09:42 -05:00
Paul Sokolovsky bc1a82acc7 samples: net: sockets: Clean up/improve socket samples
With 323e8cf069 applied and printf() working out of the box,
CONFIG_NET_BUF_LOG=y workarounds can be removed from configs of
all samples.

Also, print an intro message at the start of each server sample,
to give a user hint that the app didn't just hang and what to do
next. (The port waiting for connection is printed. We can't (easily)
print host address, because the samples should run on both Zephyr
and POSIX systems, and finding out local host address would require
hairy #ifdef's undermining the purpose of these samples (that is,
showing that the *same* code can be used on both types of systems)).

Fixes: #5379

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-02-11 09:49:31 -05:00
Johan Hedberg 7aeb1fa136 net: buf: Remove incorrect dependency for NET_BUF_POOL_USAGE
NET_BUF_POOL_USAGE was never supposed to depend on NET_BUF_LOG.

Fixes #6127

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-11 13:37:09 +02:00
Johan Hedberg 9da02caff2 net: buf: Make net_buf_simple_init() forward compatible
Make it safe to call net_buf_simple_init() even if the buffer was
created using the new macros. This is possible to detect since with
the new macros buf->__buf will be non-NULL and with the old
NET_BUF_SIMPLE() macro it will be NULL.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-11 10:40:57 +02:00
Daniel Wagenknecht 5361963224 boards: stm32f072b_disco: add supported features
Add gpio, i2c and spi as supported feaures.

Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
2018-02-10 22:42:38 -05:00
Henrik Brix Andersen bc5b39551c doc: remove spurious console code block from arduino_zero doc.
Remove spurious console code block to fix formatting of the following
zephyr-app-commands directive. While I am here, fix the indentation of
the two zephyr-app-commands directives.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-02-10 18:21:34 -05:00
Anas Nashif b3b31ade11 doc: add initial microbit documentation
Add a basic description of the platform and some placeholders, this will
need to be refined.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-10 15:27:36 -05:00
Alberto Escolar Piedras 25e0636c84 doc: Sanitycheck command line options fixup
Aligned sanitycheck command line options in doc
with the actual ones.
+
Minor fix in --coverage description.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-10 13:22:06 -05:00
Anas Nashif ce74393267 toolchain: gcc/common: add header guard
Added guards to the toolchain/gcc.h and toolchain/common.h

Those files should never be included directly, but a guard is useful
regardless.

Fixes #5130

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-10 11:14:32 -05:00
Johan Hedberg 4637620a66 tests: net/buf: Update to new API
Update the net_buf unit test to test the features from the new API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 5008ec7a06 net: buf: Introduce variable data length allocators
Introduce two new "standard" data allocators to net_buf. There are now
three in total:

NET_BUF_POOL_FIXED_DEFINE: This is the closes to the old
implementation, i.e. fixed size chunks.  It's also what the old
NET_BUF_POOL_DEFINE macro maps to.

NET_BUF_POOL_HEAP_DEFINE: uses the OS heap

NET_BUF_POOL_VAR_DEFINE: defines a variable sized allocator using
k_mem_pool (this is all that there was in my first draft of this
feature)

Currently the variable length allocators (HEAP & VAR) support
reference counted data payloads, i.e. cheap cloning. The FIXED
allocator does not currentlty support this to allow for the simplest
possible implementation, but the support can be added later if
desired.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg dd09cbc1c4 net: buf: Redesigned API with split data and meta-data
Redesign of the net_buf_simple and net_buf structs, where the data
payload portion is split to a separately allocated chunk of memory. In
practice this means that buf->__buf becomes a pointer from having just
been a marker (empty array) for where the payload begins right after
the meta-data.

Fixes #3283

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 09dcbcc579 tests: net: mgmt: Increase mgmt event stack
This stack seems to be overflowing on xtensa.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg bd989a79ba tests: Remove broken net_buf unit tests
The net_buf unit tests were doing some pretty hacky stuff with
defining a dummy _net_buf_pool_list variable to fulfil the linker
magic that happens with a real build. Until now the code got lucky in
that the simple net_buf_alloc() tests didn't depend on
_net_buf_pool_list being valid, however with the coming redesign even
net_buf_alloc will require proper setup of this.

Since the unit tests were extremely minimal, and not testing anything
beyond what tests/net/buf already tests, just remove them for now.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 1d131338bc net: samples: zperf: Reduce quark_se_c1000_devboard buffer counts
This gives a bit more margin to the available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
Johan Hedberg 5856540c90 net: samples: throughput_server: Decrease buffer count
Decrease the buffer count in order to give a reasonable margin to the
available RAM.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-02-10 09:20:42 +02:00
David B. Kinder 23c6095ebf doc: update CONTRIBUTING guidelines
Commit messages now require a body summary (before it could be blank for
"trivial" changes).

Add mention of uncrustify to help format code to project standards.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-09 22:48:56 -05:00
Anas Nashif f03d789cca doc: add qemu_riscv32 brief documentation
Very brief documentation of the board as a placeholder, more info on
supported features will follow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-09 18:03:12 -05:00
Anas Nashif abd613d063 board: zedboard_pulpino: move docs
Move README to doc/ and convert it to RST.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-02-09 18:03:12 -05:00
Carles Cufi 6bb98cc4fb kconfig: Sort the glob results
Sort the glob results when Kconfig sources do 'source
"/path/*/Kconfig"' to ensure that the resulting dotconfig file is the
same for all platforms.

This fixes #5743

Credit goes to @ulfalizer.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-09 10:31:26 -05:00
Ramakrishna Pallala cf2fb622e3 include: logging: clean up of sys_log.h
Remove unused macro IS_SYS_LOG_ACTIVE.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-09 10:11:52 -05:00
Ramakrishna Pallala 5f1b366713 drivers: i2c: i2c_nios2: Fix format specifiers in log messages
Fix format specifiers in SYS_LOG_ERR messages.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-09 10:11:52 -05:00
Sean Nyekjaer a09b6f538a arch: atmel_sam0: rename samd SoC series to samd21
Atmel SAMD21 series was classified too broadly as SAMD.
This patch names it correctly to make room,
for other members of SAMD series

Signed-off-by: Sean Nyekjaer <sean@nyekjaer.dk>
2018-02-09 08:34:55 -06:00
Carles Cufi 48ddce7a66 tests: build: Test build with MCUboot support
Add a new build variant that builds for Nordic nRF52832 with the new
MCUboot CONFIG_BOOTLOADER_MCUBOOT Kconfig variable set.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-09 09:11:13 -05:00
Carles Cufi 72684ef815 dts: mcuboot: Support for common overlays and mcuboot
When the Kconfig BOOTLOADER_MCUBOOT is selected, an overlay to place the
image at the slot0 location is required. In order to avoid having to do
this manually for all samples when targetting MCUboot, include the logic
inside the dts.cmake script to prepend a new common.dts file that then
conditionally includes mcuboot.overlay.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-09 09:11:13 -05:00
Carles Cufi 06b9841675 dts: Move dts.cmake to cmake/
Move the DTS CMake file to the cmake/ folder, where all other .cmake
files live.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-02-09 09:11:13 -05:00
Sebastian Bøe 217ece1382 codeowners: Fix CODEOWNERS for $ZEPHYR_BASE/CMakeLists.txt
CMakeLists.txt @nashif @SebastianBoe

was supposed to reference only the root file, but was referencing all
files. This commit patches CODEOWNERS to behave as intended.

See https://help.github.com/articles/about-codeowners/

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-02-09 08:54:16 -05:00
Vinayak Kariappa Chettimada 18f366ca07 Bluetooth: controller: Fix disabling of Coded PHY feature
Fix conditional compilation in nRF5 radio interface so that
when Coded PHY feature is not selected then it does not use
the PPIs required for supporting the feature.

This will allow pwm_nrf5_sw driver to use PPI channels 14 to
19 and support 3 PWM channels. Without the Coded PHY feature
disabled, only PPI 14, 15, 18 and 19 are available for PWM.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-02-09 14:41:44 +01:00
Ravi kumar Veeramally b22ab26b10 net: app: Add a new API to get net pkt based on dst
Added a new API to get net pkt based on dst address. Destination
address will be used to find correct net_context.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-02-09 14:45:53 +02:00
Ravi kumar Veeramally 09b361deed net: app: Fix get_server_ctx helper function
When net_app_ctx has multiple net_contexts, selecting net_context
based on dst address has some glitches.

E.g. One net_app_ctx and two net_contexts (net_ctx1, net_ctx2).
     Both net_contexts are mapped to net_app_ctx.
     When a caller looking for net_ctx (e.g. net_ctx2) with
     matching dst address. Loop goes through net_ctx1 and dst
     doesn't match. But another if condition checks does this
     net_context mapped to net_app_ctx, yes it matches.
     So return net_ctx1, which is wrong.

So first go through all elements in array of net_contexts for
matching dst address, if it fails to find then go for matching
net_app_ctx.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-02-09 14:45:53 +02:00
Ravi kumar Veeramally 0055e007d0 net: if: Provide a Kconfig to select default network interface
Default network interface is the first interface if there are multiple
interfaces exist. But this creates an issue when different parts of
the network subsystem wants to choose particular default interface.
At-least with this Kconfig option user can select default network
interface.

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-02-09 14:44:15 +02:00
Alberto Escolar Piedras c6524abc39 CI: also generate coverage for unit tests
sanitycheck: Compile unit tests with coverage enabled always
      + run also first unit tests together with native_posix
shippable: also include unit_testing coverage into report to
      codecov

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-09 07:39:55 -05:00
Christopher Collins aa8850b42a subsys: storage: flash_map - Use correct macro
Prior to this commit, the old `FLASH_DRIVER_NAME` macro was being used
in the definition of the flash drivers array.  This caused the array to
have a size of 0.

This commit changes the code to use the newer `FLASH_DEV_NAME` macro,
causing the configured flash device to be present in the table.

Signed-off-by: Christopher Collins <ccollins@apache.org>
2018-02-08 23:29:23 -05:00
Ramakrishna Pallala c9a4fd94ba drivers: i2c: i2c_nios2: Fix SYS_LOG warnings
Fix sys log compilation warnings by defining the
SYS_LOG_LEVEL to SYS_LOG_I2C_LEVEL in Nios-II i2c driver.

This commit fixes Issue #6062

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-02-08 23:28:28 -05:00
Kristian Klomsten Skordal 0225e952ff cmake: ld: add application source dir to linker script cpp command
To enable using application-defined sections in linker scripts, the
application source directory must be included in the search path when
running the preprocessor to generate linker scripts.

This prevents build failures when using any of the configuration options
CONFIG_CUSTOM_RODATA_LD, CONFIG_CUSTOM_RWDATA_LD and
CONFIG_CUSTOM_SECTIONS_LD.

Signed-off-by: Kristian Klomsten Skordal <kristian.skordal@nordicsemi.no>
2018-02-08 15:57:32 -08:00
Alberto Escolar Piedras 6c483ead26 native: timer bugfix in tickless mode part
Bugfix in the tickless mode part:
During _time_idle_exit it was not announcing to the kernel the
already passed silent ticks, but it was left for the tick interrupt
itself.
This did not cause any trouble so far as there was only the timer
interrupt in this board.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-08 15:56:48 -08:00
Vipul Rahane 19b1ce6b64 ext: lib: tinycbor: Add req Zephyr specific files
Include both build an configuration files required to build
TinyCBOR with Zephyr.

Signed-off-by: Vipul Rahane <vipulrahane@apache.org>
2018-02-08 21:17:22 +01:00
Vipul Rahane 2988deb735 ext: lib: tinycbor: half/full-FP support changes
- Make half float encode/decode conditional
- src/cborpretty.c, src/cbortojson.c and src/cborvalidation.c
  conditionally include math.h and half float type support
- Conditionally include math.h in src/compilersupport_p.h to avoid
  newlib libc from getting compiled in
- Conditionally compile src/cborparser_dup_string.c if newlib libc is
  compiled in

Signed-off-by: Vipul Rahane <vipulrahane@apache.org>
2018-02-08 21:17:22 +01:00