Commit graph

99049 commits

Author SHA1 Message Date
Marti Bolivar
0d811b9aee doc: overhaul getting_started
The getting started documentation has become a bit of a mess over
time:

- The reader needs to jump forward and backward in the documents
  depending on what their system already has installed (e.g. "start by
  cloning Zephyr, oh wait, see below if you don't have Git yet" etc.).

- The operating system setup guides, toolchain setup instructions, and
  application build and run information have each become their own
  balkanized fiefdom, with duplicated, confusing and sometimes
  inconsistent results.

- Linux documentation for all distributions is incomplete in some
  places (the Arch documentation in particular is vestigial)
  and wrong in others (platforms like Ubuntu still nominally require
  tools, like autoconf, that haven't been necessary since we stopped
  using the C Kconfig tools)

- The dependencies needed to build the documentation have
  gotten *huge* since the LaTeX additions and massively overstate the
  footprint of Zephyr's real dependencies. This is particularly a
  problem on Linux, where those dependencies were not clearly
  separated from those needed to build Zephyr.

- The toolchain setup documentation is confusing and scattered across
  the main file and the platform-specific files. There are various
  bits of incomplete and/or incorrect information. For example, the
  docs imply that you can use the Zephyr SDK on non-Linux hosts, which
  isn't true. As another example, some toolchains, such as GNU Arm
  Embedded, are documented several times. As a final example, some
  toolchains, such as Intel's ISSM, are squirrelled away in the
  Windows document when there are Linux builds available.

Overhaul the pages to fix these issues and otherwise clean up the
language. One significant side-effect is that all the
toolchain-related information is rooted in a single toctree. Another
is that it should now be possible to follow the instructions, in
order, on any supported platform.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2018-10-17 19:07:58 -04:00
Istvan Bisz
26e6162a82 cmake: Eclipse CDT4 generator amendment
1. The generator handles just the COMPILE_DEFINITIONS.
   (See: __ZEPHYR_SUPERVISOR__)
   For the defines in INTERFACE_COMPILE_DEFINITIONS
   a special handling is necessary.

   Solution:
   The amendment function generates a macro header file
   ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h
   based on INTERFACE_COMPILE_DEFINITIONS and appends the
   defines from the file to
   CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.

2. Eclipse CDT4 indexer has problems with CMake 'Eclipse CDT4 - x'
   generator projects that use mixed C/C++.
   The Eclipse CDT4 indexer is showing a lot of unresolved symbol
   errors, when the project was created with CMake generator and
   the code is a mix of C and C++.
   The root cause of the problem is the g++ built-in __cplusplus macro,
   that is passed by CMake generator in the '.cproject' file.
   The defines in '.cproject' are always the same for C and C++.
   In mixed C/C++ projects, the header files often contain the following
   lines to let C++ code call the C functions:

   #ifdef __cplusplus
   extern "C" {
   #endif

   < header content >

   #ifdef __cplusplus
   }
   #endif

   Whenever the Eclipse CDT4 indexer compiles the code for
   code analysis, it has the macro __cplusplus set,
   independent of whether standard C or C++ source files are compiled.
   The 'extern "C"' confuses the standard C compilation and the indexer
   is messed up.

   Solution:
   The amendment function deletes the __cplusplus entry from
   CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS.

3. The amendment function appends the defines from
   ${CMAKE_BINARY_DIR}/zephyr/include/generated/autoconf.h to
   CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.

Signed-off-by: Istvan Bisz <istvan.bisz@t-online.hu>
2018-10-17 18:16:55 -04:00
Johann Fischer
4ccf075d3b samples: fxos8700: add accelerometer devices to README.rst
Add information about MMA8451Q, MMA8652FC and MMA8653FC
accelerometers to README.rst

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
d294d87038 samples: fxos8700: add config for accelerometer devices
Add configuration for accelerometer devices like
MMA8451, MMA8652 and MMA8653.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
38765d2c40 drivers: fxos8700: mention compatible devices in the help section
Mention compatible devices in the Kconfig help section.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
ebe3eb21d4 tests: build_all: remove MMA8451Q from dts.fixup
Remove MMA8451Q from dts.fixup.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
ba4239f5f8 Revert "drivers: sensor: Add support for MMA8451Q (3-axis accelerometer)"
Driver fxos8700 can also be used for the MMA8451
accelerometer and offers more functionality.
Revert the commit to avoid duplicate code.

This reverts commit 9c0d7813e5.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
3ad8431f8a Revert "samples: sensors: mma8451q: Add accelerometer sample"
Driver fxos8700 can also be used for the MMA8451
accelerometer and offers more functionality.
Revert the commit to avoid duplicate code.

This reverts commit 70a35e2346.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
6ca2794a88 samples: fxos8700: revised the output of the sensor values
Revised the output of the sensor values.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
4bab5940e0 boards: bbc_microbit: use fxos8700 driver for MMA8653
Use fxos8700 driver for MMA8653 accelerometer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
8a16fa400c boards: frdm_kl25z: use fxos8700 driver for MMA8451
Use fxos8700 driver for MMA8451 accelerometer.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
5b522ef055 boards: reel_board: use MMA8652FC label
Revise accelorometer node and use MMA8652FC label.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
47bb0e1e5f drivers: fxos8700: add verification of the supported devices
Add basic verification of the supported devices.
Add IDs for MMA8451, MMA8652, MMA8653 and FXOS8700 and
remove Kconfig FXOS8700_WHOAMI option.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
9c9b4adb9e samples: fxos8700: enable pulse and motion detection in sample.yaml
Enable pulse and motion detection in sample.yaml.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
4a855eff4a samples: fxos8700: add motion detection overlay and test
Add motion detection overlay and test.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
b401f5ee38 drivers: fxos8700: add motion detection
Add basic support for motion detection.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
8e0ec542a5 drivers: fxos8700: add power mode configuration
Add power mode configuration.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
80d9ecc9db samples: fxos8700: remove DECIMATION_FACTOR
Remove DECIMATION_FACTOR from sample as the default
output data rate is set to 6.25Hz.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Johann Fischer
6bd80cdc97 drivers: fxos8700: allow to change output data rate
Add attr_set for SENSOR_ATTR_SAMPLING_FREQUENCY and
allow to change output data rate.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-10-17 14:16:02 -05:00
Pawel Dunaj
004b8b26c0 drivers: sensors: qdec_nrfx: Add support for Nordic QDEC
Add a QDEC driver that utilizes Nordic's QDEC.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00
Pawel Dunaj
ecae736e0b dts: Add support for Nordic QDEC
Add QDEC binding and entry in Nordic SoC DTSI files.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00
Pawel Dunaj
cb01d097af ext: hal: nordic: Enable building of NRFX QDEC
Allow project to use Nordic's NRFX QDEC driver.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00
Pawel Dunaj
589ed030ec include: Add rotation to sensor channels
This channel is aimed to be used by QDECs.

This closes issue #9364

Jira:DESK-259

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-10-17 13:45:51 -05:00
Tedd Ho-Jeong An
548361c4e2 net: ip: Fix compile error due to config dependency
This patch fixes the compile error when CONFIG_NET_PKT_LOG_LEVEL
is LOG_LEVEL_DBG.

> subsys/net/ip/net_shell.c: In function ‘context_info’:
> subsys/net/ip/net_shell.c:2893:106: error: ‘struct net_buf_pool’
> has no member named ‘avail_count’
> subsys/net/ip/net_shell.c:2893:125: error: ‘struct net_buf_pool’
> has no member named ‘name’

In struct net_buf_pool, 'avail_count' and 'name' are depends on
CONFIG_NET_BUF_POOL_USAGE.

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2018-10-17 21:35:24 +03:00
Jean-Paul Saman
fea87ae717 samples: blink_led: make it work for nrf52832-mdk
Add support for nRF52832-MDK to blink_led sample.

Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Jean-Paul Saman
4324333611 samples: blink_led: make it work for nrf52840-mdk
Add support for nRF52840-MDK to blink_led sample.

Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Zelin Cai
c6acdd4b3e boards: nrf52840_mdk: add board support for nRF52840-MDK
Add support for nRF52840-MDK board.

Signed-off-by: Zelin Cai <zelin@makerdiary.com>
Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Zelin Cai
db653404b0 boards: nrf52832_mdk: add board support for nRF52832-MDK
Add support for nRF52832-MDK board.

Signed-off-by: Zelin Cai <zelin@makerdiary.com>
Signed-off-by: Jean-Paul Saman <jpsaman@videolan.org>
2018-10-17 12:51:22 -05:00
Adithya Baglody
4b066212b6 kernel: sem: Fix few MISRA C violations.
This patch fixes few of the violations inside sem.c

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Adithya Baglody
21d43a6fe4 include: toolchain: gcc.h: Fixed MISRA C violation.
The macros likely() and unlikely() used by the compiler for
optimization are always used inside an if condition.
According to MISRA we need to have bool type and not long.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Adithya Baglody
6176692f4b kernel: ksched.h: Incorrect argument type in _pend_current_thread
In _pend_current_thread the argument key is always a unsigned
interger type and this function forces it to become a signed
interger. This is a dangerous behavior and cant be trusted to
work as expected.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Adithya Baglody
e9cb0ae72a arch: kernel_arch_func.h: Fix MISRA violation
Always compare unsigned interger type with another unsigned
integer type. Currently in nios2, posix, riscv32, x86 and xtensa
we were comparing the _kernel.nested variable with a signed
interger type. Fixed this violation.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Adithya Baglody
441d75770f arch: arc: arcv2_irq_unit.h: MISRA C violation fix.
The function _arc_v2_irq_unit_is_in_isr computes a Boolean
value but the function returns a integer value.
Fix the return type of the function.

This makes the zephyr api _is_in_isr() return a boolean type.
Thereby making it consistent across all the architectures.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Adithya Baglody
2d0ba50396 arch: arm: exc.h: MISRA C violation fix in _IsInIsr
The function _IsInIsr computes a Boolean value but the function
returns a integer value. Fix the return type of the function.

This makes the zephyr api _is_in_isr() return a boolean type.
Thereby making it consistent across all the architectures.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 12:17:58 -04:00
Andy Ross
386894c2fb kernel/timeout: Fix build breakage due to stdio name collision
Duh: "remove()" is a POSIX symbol, and on at least some platforms
stdio.h can be included here out of platform headers causing a name
collision.

Fixes #10669's direct issue, though the broader issue of how to choose
names for statics remains controversial.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-10-17 12:15:44 -04:00
qianfan Zhao
a52186ded2 net: shell: Return -ETIMEDOUT if ping target timeout
The previous code returned 0 even if ping failed(timeout).

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-10-17 18:04:18 +03:00
Paul Sokolovsky
b779ea2d19 kernel: syscall_handler.h: Typo fix in docstring
Should be "fails" instead of "files".

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-17 10:32:10 -04:00
Krzysztof Chruscinski
fe7416a27e tests: subsys: logging: Fix log_core test
Log_core test was failing due to test structure elements not being
correctly reset before the test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-10-17 09:13:01 -04:00
qianfan Zhao
94fa5ca91b drivers: gpio_sam: fix gpio_sam_write ACCESS_BY_PORT mode
The 'value' param in ACCESS_BY_PORT mode means the state of a port,
one bit represented one pin in param 'value'.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-10-17 08:03:38 -04:00
qianfan Zhao
ccab779b48 drivers: gpio_sam: Add ACCESS_BY_PORT mode for gpio config
ACCESS_BY_PORT mode can configure all the pins the same way in the port.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2018-10-17 08:03:38 -04:00
Adithya Baglody
28080d3896 kernel: MISRA C: Fixes a few MISRA C issues.
MISRA C guideline compliance for various rules.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 07:59:51 -04:00
Adithya Baglody
1424561252 kernel: sched: Fixed incorrect argument type of _reschedule()
This API shouldn't take a int type but instead it should take
u32_t. This argument has to be similar to irq_lock() and
irq_unlock().

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 07:59:51 -04:00
Adithya Baglody
d591588ab5 kernel: MISRA C guideline compliance for rule 11.6
This patch removes the typecast (void*). This can be better
handled by typecasting to the actual typdef. This fixes the
misra rule of 11.6 for alert.

Part of GH-10042.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-10-17 07:59:51 -04:00
Paul Sokolovsky
b9248a17ac scripts: extract_dts_includes: Read files as utf-8
Python's open() by default using "system character encoding", which
may vary from system to system (e.g. LOCALE=C aka "ascii" on bare-OS
systems, something on Windows, etc.). But Zephyr files are utf-8, so
read them as such, by explicitly specifying encoding.

This is similar to changes earlier done to another script in 94620bd.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-10-17 13:56:25 +02:00
Satya Bhattacharya
4f4c7e2b1a net: rpl: Null pointer dereferences
Check for NULL IPv6 addr values from net_if_ipv6_get_ll() in rpl.c
If NULL, print out an error statement stating that no proper IPv6
address was found
Coverity-CID: 188169

Fixes #10094.

Signed-off-by: Satya Bhattacharya <satyacube@gmail.com>
2018-10-17 14:33:36 +03:00
Sebastian Bøe
2aea475846 Bluetooth: host: Improve error feedback on invalid input
Improve the error feedback when calling bt_le_adv_start and inputting
too much data in the advertisement.

Error feedback before:

Bluetooth initialized
Advertising failed to start (err -22)

Error feedback after:

Bluetooth initialized
[bt] [ERR] set_ad: Advertising data does not fit in buffer
Advertising failed to start (err -22)

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-17 13:37:24 +03:00
Kumar Gala
e99b4235c5 dts: yaml: remove unused id field
Some new yaml bindings that got committed added back in the 'id:' field
which we have removed.  Remove it from those dts binding files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-10-16 23:20:03 -04:00
Galen Seitz
a14b3f0e37 tests: spi_loopback: Add nucleo_f302r8 configuration
Add nucleo_f302r8 board configuration for the spi loopback test.

Signed-off-by: Galen Seitz <galens@seitzassoc.com>
2018-10-16 22:52:07 -04:00
Galen Seitz
96172a1d0b samples: basic: blink_led: Add support for nucleo_f302r8
Add support for the blink_led sample code using a PWM output
from PA0 of the STM32F302R8.

Signed-off-by: Galen Seitz <galens@seitzassoc.com>
2018-10-16 22:52:07 -04:00
Galen Seitz
4566ace345 boards: arm: Add support for nucleo_f302r8
Add support for ST Micro Nucleo-64 board with the STM32F302R8
processor.  nucleo_f429zi and nucleo_f334r8 were used as
references.

Signed-off-by: Galen Seitz <galens@seitzassoc.com>
2018-10-16 22:52:07 -04:00