Commit graph

41120 commits

Author SHA1 Message Date
Flavio Ceolin
359adfc959 soc: arm: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
353933125f soc: x86: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
0c4bb833de lib: posix: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
6a4a86e413 kernel: Change k_is_in_isr to return bool
Change this function to return a boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
09e362e0d0 kernel: Change _is_thread_essential to return bool
Change this function to return a boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
3dcc76b6b9 arch: arc: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
81d0e1981b arch: arm: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
f342019986 log: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
6d50df212f arch: x86: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
4f2e9a792a kernel: Change is_condition_met signature
Change this function to return a boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
76b3518ce6 kernel: Make statements evaluate boolean expressions
MISRA-C requires that the if statement has essentially Boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
8a1481735b kernel: userspace: Change _thread_idx_alloc to return bool
Make this function return an essential boolean type.

MISRA-C rule 14.4

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Flavio Ceolin
c83f431769 arc: cache: Change dcache_available signature
This function returns an essential boolean type, just changing the
signature to return a boolean type.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-01-07 08:52:07 -05:00
Emanuele Di Santo
23998f9b17 doc: boards: arm: nrf52840_pca10059: add bootloader section
Add documentation on how to program the board using nrfutil
or an external debugger.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-07 14:51:09 +01:00
Emanuele Di Santo
b8d3ee8afb boards: arm: nrf52840_pca10059: update dts and overlay
Updated flash partitions to extend supported boot scenarios.

Add support for using Nordic nRF5 bootloader to:
- flash a Zephyr application
- flash a MCUboot image as an application

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-07 14:50:54 +01:00
Vinayak Kariappa Chettimada
dfe415a912 Bluetooth: shell: Changes related to controller split preparation
Changes to Bluetooth shell application related to the
controller split architecture preparation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-07 13:42:01 +01:00
Vinayak Kariappa Chettimada
87fe440f01 Bluetooth: controller: Prepare to introduce LL split architecture
Preparation to introduce the Upper Link Layer (ULL) and
Lower Link Layer (LLL) split architecture.

- Move SoC dependent HAL to vendor specific folder.
- Preparation to split data structures into ULL and LLL
  types.
- Added more role and state conditional compilations.
- Added some work-in-progress implementation of advertising
  extensions, will be used as inspiration in the new split
  architecture work.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-01-07 13:42:01 +01:00
Johan Hedberg
d57a9a648b Bluetooth: Mesh: Fix heartbeat publication storing
This fixes usage of an uninitialized variable (to_store) as introduced
by commit bfad2a0.

Fixes #12314

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-07 12:49:36 +02:00
Johan Hedberg
3d0950e59a Bluetooth: Mesh: Fix typo leading to incorrect settings storage
This was intended to be an equality comparison and not an assignment.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-07 12:49:36 +02:00
Jan Van Winkel
3034dc7dab settings: Corrected type for offset variables
Changed type of offset variables from off_t to size_t as expected
by called functions.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 11:48:35 +01:00
Aurelien Jarno
e98e6a8a87 net: openthread: remove one subcommand level in shell
Currently OpenThread commands have to be prefixed in the shell by "ot
cmd", for example "ot cmd state". With the new shell, it is possible to
remove one subcommand level and change it to "ot state".

At the same time validate the number of arguments using
SHELL_CMD_ARG_REGISTER and improve the help message.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-07 11:19:24 +01:00
Aurelien Jarno
ac3ff65a91 net: openthread: improve shell output
Following the introduction of the new shell, the OpenThread shell
wrapper is not well integrated. It outputs the answer to a command using
printk(), which is not necessarily using the same device than the shell
if "zephyr,console" does not match "zephyr,shell-uart".

OpenThread calls the otConsoleOutputCallback() function to output the
answer to the shell. It can provide a callback argument, but defined
when OpenThread is initialized, not when the command is submitted.
Workaround that by taking a copy of the shell argument in a static
variable and use it for the call to shell_fprintf(). It is not perfect
if two or more shells issue concurrent commands, but is already an
improvement compared to printk().

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-01-07 11:19:24 +01:00
Jan Van Winkel
3a8c2b8ad8 flash: Remove NRF dependency from flash shell
Removed dependency to NRF_FICR CODEPAGESIZE from flash shell erase
command

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-01-07 11:10:34 +01:00
Luiz Augusto von Dentz
330cbfa074 Bluetooth: peripheral: Fix check of BT_GATT_WRITE_FLAG_CMD
Check should be done with & instead of | otherwise it will always be
evaluated as 1/true regardless of the flags.

Fixes #12308

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-04 21:13:06 +01:00
Andy Ross
dc4151f8f3 scripts/sanitycheck: Don't build "slow" tests either
Extend the "slow" flag on tests to inhibit building too.  The original
assumption was that building would be fast but running slow, but now
We have tests using a component (OpenThread) that wants to pull and
build software from github for every app.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Andy Ross
442e7306bf samples/net/echo: Mark OpenThread test cases as "slow"
The current OpenThread integration wants to download (from github) and
configure the OpenThread source tree every time the app is build.  We
don't want to be doing this in quadruplicate every time sanitycheck is
run.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Andy Ross
5ea39b8c2d samples/net/echo: Remove duplicate test case
These tests were defining a "test_kw41z" case, but that platform is
already whitelisted in the main ("test") case, and this one defines no
different behavior.  It's just a dupe.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-04 14:59:28 -05:00
Maureen Helm
6876dc71c1 soc: nxp_imx: Fix ethernet build error
Fixes an ethernet build error introduced with MCUXpresso SDK 2.5.0,
caused by a slight change in the ethernet pll configuration structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-04 14:35:35 -05:00
Anas Nashif
fb4b33d598 boards: qemu_xtensa: support xtools
This board can now be built with xtools.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-04 14:32:30 -05:00
Anas Nashif
857644997e xtools: support xtensa hal
Xtensa toolchain has a HAL library that needs to be compiled in similar
to how we do this with the Zephyr SDK.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-04 14:32:30 -05:00
David B. Kinder
7ed0c7415c doc: add (more) missing API docs
As mentioned in issue #12265, some APIs
aren't included in the generated
API docs because doxygengroup directives were missing. Also add a
comment referencing defgroups that are just organizational and the
scanning script can ignore.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-04 13:43:47 -05:00
Alberto Escolar Piedras
32bd2df029 tests: cmsis_rtos_v2: Bugfix in test which leads to random errors
Fix a quite silly bug in the testcase which led to random failures
on execution.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-01-04 11:50:51 -05:00
Erwan Gouriou
7f4eda501a dts: stm32f1: add uart5
Add uart5 nodes to stm32f1 series dts.
Provide matching dts_fixup add-on.

Signed-off-by: Chen Han <qq1433255094@outlook.com>
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-04 10:07:54 -06:00
Tomasz Bursztyka
e82e31e351 net/icmpv4: A checksum value of 0 is valid
Introduced by commit id de78a7af28.
If the sum is 0xffff, a ~sum will give 0.

Fixes #12164

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-01-04 10:46:52 -05:00
Sebastian Bøe
5748fe11e5 cmake: Fix VERSION warning in doc build
The 'doc' build has been invoking 'project' with the argument "VERSION
${PROJECT_VERSION}". This is cargo-cult code inherited from the
toplevel build system.

This can be safely removed because in the doc build the versioning
variables that are set by 'project' are unused and PROJECT_VERSION is
not available to be de-referenced at that point in time any way ...

This fixes #12282

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-01-04 13:28:09 +01:00
Alistair Francis
41dfc4d478 libc: riscv: Fix the RISC-V ifdef
Following the standard GCC RISC-V convetion use __riscv for the RISC-V
specific define:
41d6b10e96/gcc/config/riscv/riscv-c.c (L37)

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2019-01-03 18:15:53 -05:00
Maureen Helm
011a88c744 ext: mcux: Update to MCUXpresso SDK 2.5.0
Updates the MCUXpresso SDK to version 2.5.0 for applicable SoCs.
Wireless (KW*) and legacy (KL25) SoCs were not included in this
MCUXpresso SDK release and are therefore not updated here.

New in this release is SoC-level and board-level support for external
xip flash in the i.MX RT family.

For RT1050, we are now using the MCUXpresso SDK for the EVKB version of
the board, which correponds to an upgrade from A0 to A1 silicon.
However, we don't yet have Kconfigs in place to support A1 silicon part
numbers, and therefore add a simple cmake hack to convert A0 part
numbers to A1 part numbers.

The SDK flash driver interface also changed slightly in this release,
and thus the zephyr flash shim driver is updated accordingly.

Origin: MCUXpresso SDK
License: BSD 3-Clause
URL: mcux.nxp.com
Purpose: Provide device header files and bare metal peripheral drivers
for Kinetis, LPC, and i.MX SoCs.
Maintained-by: External

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-03 17:25:28 -05:00
Maureen Helm
1ad71108fc ext: mcux: Enhance import script to include external xip flash support
Devices with external xip flash like the rt1050 and rt1060 have
additional support files in the MCUXpresso SDK. Enhance the mcux import
script to pick up these files.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-03 17:25:28 -05:00
Maureen Helm
1870910797 ext: mcux: Update import script for fsl_iomuxc
Updates the mcux import script to place fsl_iomuxc.* files into the
device-specific folder rather than the shared driver folder.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-03 17:25:28 -05:00
Maureen Helm
fb55f00a9a ext: mcux: Refactor import script
Refactors the mcux import script to streamline some repetitious code.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-03 17:25:28 -05:00
Maureen Helm
36669e5d82 ext: mcux: Remove duplicate fsl_iomuxc.h
This file was moved into a device-specific folder in commit
282d95f655 but inadvertantly added back to
the imx driver folder in commit
a4633da9f5.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-03 17:25:28 -05:00
Andy Ross
9c9162dfd9 sanitycheck: Add --disable-size-report option
The segment size computation has value, but it's actually a very slow
process that parallizes poorly.  It seems to be bound by the Python
GIL doing the parsing, so never sees more than about 150% of CPU in
use even on wildly parallel systems.  And it takes about 75-80
seconds, which is 15-20% of the entire runtime of the test on that
box!

And the only "failure" case this can detect (unexpected sections in
the output file) is now a duplicate of the orphan section warning
we've since enalbled at the linker level.

This defaults to enabling the test to preserve behavior (as I don't
know where all the existing users of the size report are to change
them), but long term we might consider making "disabled" the default
and switching this to an --enable flag.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 16:06:28 -05:00
Adithya Baglody
4c1667fbfa tests: Updated all the tests which use k_thread_access_grant.
With the new implementation we do not need a NULL terminated list
of kobjects. Therefore the list will only contain valid entries
of kobjects.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-01-03 12:35:14 -08:00
Adithya Baglody
392219eab8 kernel: Change the prototype of k_thread_access_grant.
This API was using variable number of arguments. Which is not
allowed according to misra c guidelines(Rule 17.1). Hence making
this API into a macro and using the util macro FOR_EACH_FIXED_ARG
to get the same functionality.

There is one deviation from the old function. The last argument
shouldn't be NULL.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-01-03 12:35:14 -08:00
Adithya Baglody
9febb6577b include: misc: util: Added new util macros FOR_EACH_FIXED_ARG
This new macro will be able to do FOR_EACH with a fixed argument.
This fixed argument will always be called as the 2nd argument
to the function call(_fn).

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2019-01-03 12:35:14 -08:00
Anas Nashif
4be3515c53 CODEOWNERS: update code owners
Both @pswarnak and @lpereira do not work on Zephyr any more.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-03 15:09:57 -05:00
Spoorthi K
319e87a78c tests: cmsis_rtos_v2: Enhance semaphore tests
Add negative tests for semaphore APIs supported in
CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K
9bf535eede tests: cmsis_rtos_v2: Enhance msgq tests
Add negative tests for msgq APIs supported
in CMSIS RTOS v2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K
9296114fc2 tests: cmsis_rtos_v2: Enhance mempool tests
Add negative tests for mempool APIs supported
in CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
Spoorthi K
f45eb2ac6f tests: cmsis_rtos_v2: Enhance event flags tests
Add negative tests for event flags supported in
CMSIS RTOS V2 layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00