Commit graph

41120 commits

Author SHA1 Message Date
Armando Visconti
180b139786 drivers: sensor: lsm6dsl: Adding sensorhub support
Adding sensorhub support. Only one slave device can be selected
among LIS2MDL (magnetometer) and LPS22HB (pressure and temperature).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-04-30 16:16:08 -05:00
Anas Nashif
a6eee02c00 samples: enhance integration sample and document it
Document the integration test sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Anas Nashif
2b62f1ab02 tests: fixed doxygen comments
Various fixes to bad doxygen syntax.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Anas Nashif
67194a40ef tests: errno: document test functions
Use doxygen to document test and cleanup test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Anas Nashif
25e7b27be5 tests: critical: document test functions
Use doxygen to document test and cleanup test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Anas Nashif
2182a53fec tests: irq_offload: document test functions
Use doxygen to document test and cleanup test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 17:15:29 -04:00
Henrik Brix Andersen
2d1c5241bf samples: flash_shell: Use correct flash write block size
Change the flash_shell sample from using FLASH_WRITE_BLOCK_SIZE
definition to using the flash_get_write_block_size() api for the
selected flash_device.

This fixes the flash_shell sample when using multiple flash devices
with different write block sizes.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-30 17:05:06 -04:00
Rajavardhan Gundi
68040c8d78 kernel: sem: Modify the way BUILD_ASSERT is used
BUILD_ASSERT() macro makes use of __COUNTER__ which may not be
supported in some compilers (like xcc). So, multiple uses of
BUILD_ASSERT() in same scope is not possible for such compilers.
Instead, the expression to BUILD_ASSERT can be "&&"ed to achieve
the same purpose.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-04-30 16:46:14 -04:00
Rajavardhan Gundi
7db4d5699e Revert "warnings: Disable "unused-local-typedefs" compiler warning"
This reverts commit d9ac1d4b4a.

This option can be compiler specific and is not required anymore.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 16:46:14 -04:00
Andrew Boie
9faa42f522 slist: abstract node and list implementation
Singly-linked lists work in a specific way, but this will allow
slist semantics to be defined for any data structure that can store
a "next" pointer in any way at all, possibly something not even
a pointer value, but a table index.

The immediate need for this patch is to allow the easy definition
of an slist variant which stores flags in the low-order bits of the
node pointer.

The compiler does not need them, but the function prototypes have
been left in slist.h to make the header easier to understand by
the end user and not confuse Doxygen.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-04-30 13:15:51 -04:00
Sebastian Bøe
f9b2da37b0 kconfig: Move CPLUSPLUS from root to "Compiler Options"
Enabling C++ support for the application has been inappropriately
located at the root of the Kconfig menu. The root should be kept as
clean possible to allow easy navigation.

This commit moves CONFIG_CPLUSPLUS into

~/"Build and Linker Features"/"Compiler Options".

This is a purely cosmetic change and does not change the
'visibility' (depends) of the Kconfig option.

Arguably, it would fit better into

~/"Build and Linker Features"/"Language Options"

but this entry does not exist.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-30 13:12:01 -04:00
Anas Nashif
f8c1cc175a toolchain: update xtools config
Add placeholders for all possible xtools toolchains.

Fixes #6911

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 12:54:35 -04:00
Andrew Boie
de7f40acfb kconfig: fix menuconfig
"depends on" cannot use expressions as arguments, this statement
didn't actually do anything for kconfiglib.py and caused an
error with menuconfig.

There's currently no way to depend on a system heap being
present, however forthcoming patches move this feature away
from using the system heap anyway.

For now, if the user enables dynamic objects without defining
a system heap, they will get a build error.

Fixes #7266.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-04-30 09:22:48 -07:00
Anas Nashif
33d87efda5 build: simplify git describe call
Instead of using a module that tries to do too many things that break
in different places, keep it simple and just call git describe.

This fixes #7044 and fixes #7207.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-30 10:16:40 -04:00
Tomasz Bursztyka
f4ad698847 drivers/spi: Remove DW spi slave test left over
This reset to 0 was used for testing threshold on slave mode.

Coverity-CID: 185402

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-30 08:07:06 -04:00
Spoorthi K
ff0857df25 tests: threads: Add test to verify delayed thread abort
As k_thread_cancel() is deprecated, we need to test if delayed thread
which is in wait queue can be cancelled from k_thread_abort().

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-04-30 06:55:46 -04:00
Ramakrishna Pallala
e7648ba320 lib: posix: pthread_common: Fix potential integer overflow issue
Fix potential overflow of interger expression for by fixing
variable type to s64_t.

CID: 185275

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-04-30 06:49:42 -04:00
Jukka Rissanen
2002a4e245 net: arp: Do not access NULL network packet
The code was accessing network pkt before the value of the pkt
was checked.

Coverity-CID: 185394

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-30 10:45:12 +03:00
Yannis Damigos
d9cdf7bf30 arch/arm/soc/st_stm32: Fix typos in soc.h
Fix typos in soc.h for stm32f1 and stm32l4 families.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-04-28 20:46:08 +05:30
Manivannan Sadhasivam
517a08ee13 CODEOWNERS: Add myself as the Codeowner for LED API and drivers
Add myself as the Codeowner for LED API and its drivers.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-28 20:39:55 +05:30
Manivannan Sadhasivam
42a7c5732f arm: soc: Elaborate Kconfig strings for MPU selection
Some of the SoCs specify "Enable MPU" in Kconfig for enabling MPU
support. This will create ambiguity while selecting options via
menuconfig. Hence, append SoC family name to the selection strings
to looks more elaborative.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-28 20:38:12 +05:30
Manivannan Sadhasivam
c36e5ac129 arm: Fix title for SoC configuration in Kconfig
The title for selecting the configuration options for SoC's should be
"SoC Configuration" not "Board Configuration".

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-28 20:38:12 +05:30
Henrik Brix Andersen
b27d96850f samples: bluetooth: Add Apple iBeacon demo application
Add a simple demo implementation of an Apple iBeacon BLE broadcaster.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-28 10:55:19 +03:00
Manivannan Sadhasivam
034a11b7cd boards: arm: 96b_neonkey: Fix I2C_3 for LP3943 LED driver
Following changes are necessary to use LP3943 LED driver present
in 96Boards Neonkey board

1. Enable I2C_3 interface
2. Reduce the speed of I2C_3 bus on 96Boards Neonkey. Due to some
design quirks, on board LP3943 LED driver connected to I2C_3
operates only at Standard speed of 100KHz.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Manivannan Sadhasivam
1572594b53 samples: drivers: Add sample application for LP3943
Add sample application for TI LP3943 LED driver. This application
displays a continuous pattern that turns on 16 LEDs at 1s one by
one until it reaches the end and turns off LEDs in reverse order.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Manivannan Sadhasivam
bb394bbafb drivers: led: Add LED driver support for TI LP3943
Add support for Texas Instruments LP3943 - 16 channel LED driver.
Supported blinking period: 0 to 1600ms
Supported brightness value: 0 to 100%

This driver supports the following APIs:

1. led_blink
2. led_set_brightness
3. led_on
4. led_off

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Manivannan Sadhasivam
94bba071d6 drivers: led: Add public API for LED drivers
Add support for LED APIs for controlling the LED devices. This
API can be used by the LED devices present on the chip and connected
externally via buses like I2C, SPI etc...

Following APIs are currently supported:

1. led_blink
2. led_set_brightness
3. led_on
4. led_off

Driver support using these APIs will be added in subsequent patches.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Ioannis Glaropoulos
c7d808f965 arch: arm: improve help text for PROGRAMMABLE_FAULT_PRIOS option
Improve the help text of ARM k-config option
CPU_CORTEX_M_HAS_PROGRAMMABLE_FAULT_PRIOS.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2018-04-27 17:41:24 +05:30
Johan Hedberg
992070f12d boards: microbit: Add flash partition definitions to dts
These are a direct copy from the nrf51_pca10028 board, since it's also
an nRF51 and has the same size flash.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-27 17:37:30 +05:30
Ulf Magnusson
63cb2334f0 doc: Document Zephyr's Kconfig configuration scheme
In particular, try to demystify Kconfig.defconfig files, and provide
guidelines on whether configuration settings should go in
BOARD_defconfig or Kconfig.defconfig.

The board porting section seems to be the most relevant one here, so put
the documentation there, with some "see also" links from elsewhere.
Things could be reorganized later if needed.

Give a general overview of visible and invisible Kconfig symbols as
well, as that ties in with the configuration scheme.

This is reverse-engineering on my part. The configuration scheme doesn't
seem to be documented anywhere prior.

Fixes: #7159

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
2018-04-27 13:31:20 +02:00
Andrzej Puzdrowski
3298d60ff9 tests: subsys: settings: Add FCB-beckend initialization test
Added test for initialization with FCB backend.
This test should goes over reset so it test blank and
subsequent initialization and data restoring capability
after the reset.



Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-04-27 13:20:14 +02:00
Ravi kumar Veeramally
6c70aa28d2 samples: net: Fix CoAP server payload dump function
Payload dump function not adopted to multi fragments CoAP packet. Still
assumes whole payload exists in single packet. Also does not handle all
return cases of coap_packet_get_payload() function, which is causing
coverity failures.

Coverity-CID: 185277
Coverity-CID: 185278

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2018-04-27 13:28:25 +03:00
Sebastian Bøe
8bcf30e21a cmake: posix: Use absolute paths for toolchain paths
Make posix align with non-posix platforms by having CMAKE_C_COMPILER
and friends use absolute paths.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
71b849f18c cmake: Port Zephyr to use zephyr_check_compiler_flag
This commit ports nearly all usage of check_c_compiler_flag,
check_cxx_compiler_flag, and check_compiler_flag to use
zephyr_check_compiler_flag instead.

This has a significant CMake configure-time performance impact.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
84475810ec cmake: Introduce zephyr_check_compiler_flag()
zephyr_check_compiler_flag is introduced to resolve
https://github.com/zephyrproject-rtos/zephyr/issues/5633

The time spent when invoking CMake is halved with a warm cache.

See the API documentation for details.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
a7c3f4ed25 cmake: toolchain: Checksum the toolchain to uniquely identify it
This commit introduces TOOLCHAIN_SIGNATURE. A CMake variable that is
defined like this:

Toolchains with the same signature will always support the same set of
flags.

Currently it is implemented by MD5summing the CC binary.

This is useful for instance if the build system needs to determine if
it has seen the toolchain before, e.g. in a caching use-case.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
c95c6bef04 cmake: check_compiler_flag: Support empty-string options
This commits allows check_compiler_flag to accept the empty string as
an option. There are several use-cases for accepting no flag, one of
which is testing the toolchain itself.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
709daa20e9 cmake: Find a directory that could be used to cache files
To improve the build system's "clean build" runtime we need to cache
files in a directory outside of the build directory.

Caching files outside of the build directory is is already being done
to a certain degree today. For instance, if a user has installed
ccache it will cache files in $HOME/.ccache/.

This commit locates a directory that is suitable for caching files in
a cross-platform way. For instance on Linux this is believed to be
$HOME, on Windows this is believed to be %LOCALAPPDATA%.

If for whatever reason no environment variables are are found to be
suitable we fall back to using $ZEPHYR_BASE/.cache/. For users that
often use 'git -clean' the caching mechanism will not work as well,
but it will at least be better than no caching at all.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Sebastian Bøe
6c3a94c01f cmake: Add function for checking if a directory is write-able
Added a CMake extention for determining if a directory is write-able
by the build system. To determine this, we attempt to 'touch' a file
in the directory and check the return code of this command.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-04-27 12:06:02 +02:00
Anas Nashif
6f1cff733e ztest: fix result checking
Fixes #7208: failed tests return -1, not 1. Fix this and adjust logic.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-04-27 08:37:29 +05:30
Kumar Gala
ae5e11bebc arm: soc: NXP: Enable SEGGER RTT on all NXP SoCs
It seems like SEGGER is supported across all the NXP SoC families so
lets enable it across all of them.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-04-26 14:49:57 -05:00
Yannis Damigos
f496fd2a04 boards/arm/stm32_min_dev: Fix APB2 prescaler value
The allowed values for APB2 prescaler are: 1, 2, 4, 8, 16.
Set APB2 prescaler value to 1 in boards defconfig.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-04-26 12:51:46 -05:00
Inaky Perez-Gonzalez
75e2d901e7 sanitycheck: refinements to --list-tests
This packs a few improvements:

- Add a smarter regex that will catch multiple combinations of

    ztest_[user_]unit_test[_setup_teardown](NAME[, setup, teardown])

  as well as single liners like:

    ztest_test_suite(mutex_complex, ztest_user_unit_test(TESTNAME));

- Limit how much we look forward in suite_regex -- we don't have to
  look past the first argument, otherwise we consume too much and the
  loopup at suite_regex_match.start() will start too late.

- Remove include_regex, unused

- Fix the path where we warn about matches in achtung_regexes--it
  needed a few decodes and to use error() vs the unexistant warning()

- Cleanup the path to produce the subcase names, doing the decode and
  the purging of any test_ prefix in scan_path().

Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2018-04-26 21:27:57 +05:30
Johan Hedberg
d67009da08 subsys: settings: Fix Kconfig dependencies
If CONFIG_FLASH_PAGE_LAYOUT is not enabled, building the settings code
fails at the linking stage with the following error when FCB is the
backend.

libzephyr.a(settings_init.c.obj): In function `settings_init_fcb':
subsys/settings/src/settings_init.c:62: undefined reference to `flash_area_get_sectors'
collect2: error: ld returned 1 exit status

Also, the File System backend will currently only work with NFFS due
to fs_rename() missing from other File Systems (FAT in particular).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-26 16:24:31 +02:00
Jukka Rissanen
a12138d45c net: hostname: Fix hostname buffer length
The buffer allocated for hostname was one byte too short.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-26 16:31:16 +03:00
Andrei Emeltchenko
222aa6009c netusb: rndis: Fix RNDIS always disabled state
Fix regression with RNDIS due to different USB configuration method.
RNDIS drivers in Windows never call Set Interface and netusb is always
disabled. Change to enable netusb upon USB Set Configuration.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-26 16:30:29 +03:00
Andrei Emeltchenko
185f2be681 netusb: rndis: Add more debugs
Add debug for enable / disable callbacks

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-04-26 16:30:29 +03:00
Johan Hedberg
9968cda453 fs: Convert NFFS partition to a generic one
The NFFS partition at the end of flash is also useful for any other
file system or even the Flash Circular Buffer (FCB). Rename the
partition from 'nffs_partition' to 'storage_partition' and make it
depend on a new hidden Kconfig entry which the relevant users will
select (such as NFFS and FCB).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-04-26 16:06:55 +05:30
Jukka Rissanen
f59a68b6d8 samples: net: http: Add TLS compilation test
Make sure that TLS configuration is valid by adding a compilation
test for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-26 12:35:05 +03:00
Jukka Rissanen
8c561994f2 net: http: Fix client compilation if HTTPS is enabled
The http.h used HTTP server defines when compiling HTTP client.
This causes compilation error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-04-26 12:35:05 +03:00