Commit graph

99049 commits

Author SHA1 Message Date
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
Spoorthi K
0f375034da tests: cmsis_rtos_v2: Add tests for kernel management APIs
Add negative scenarios, API tests and improve
test coverage for kernel management APIs supported
in CMSIS RTOS V2 portability layer.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2019-01-03 12:39:39 -05:00
David B. Kinder
67db1d5321 doc: add comment for API doxygen group check
add a comment for the scanner script for missing API doxygengroup
directives so it won't complain about a parent defgroup used only for
organization

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-03 12:38:28 -05:00
David B. Kinder
c8ba6fe41d doc: add missing networking APIs
As mentioned in issue #12265, some networking APIs
aren't included in the generated
API docs because doxygengroup directives were missing.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-03 12:38:28 -05:00
David B. Kinder
6d912bf035 doc: add missing cfb API
As mentioned in issue #12265, this API wasn't included in the generated
API docs because a doxygengroup directive was missing.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-01-03 12:38:28 -05:00
Daniel Leung
f542825558 boards: arm: nucleo_f746zg: fix empty image
The en.high-perf_nucleo-144_mbed.jpg is an empty file.
This causes error when generating PDF documentation
as the tool cannot deal with empty image files.
So replace it with the image with same filename from
nucleo_f765zg, as the images are identical from
the online product description pages.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-01-03 12:36:48 -05:00
Andrei Emeltchenko
eb6601e5f0 net: logs: Enable logging for NET_RAW
The patch allows to enable logs for NET_RAW configuration.
For example using wpanusb currently breaks build with logging enabled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-01-03 12:33:54 -05:00
Andy Ross
b748d5219a tests/kernel/timer_api: Synchronize racy subtest
The test_timer_periodicity test is racy and subject to initial state
bugs.  The operation of that test is to:

1. Start a timer with a known period
2. Take the current time with k_uptime_get()
3. Wait for the timer to fire with k_timer_status_sync()
4. Check that the current time minus start time is the period

But that's wrong, because a tick expiring between any of the first
three steps is going to skew the math (i.e. the timer will have
started on a different tick than the "start time").

And taking an interrupt lock around the process can't fix the issue,
because in the tickless world we live in k_uptime_get() is actually a
realtime quanity based on a hardware counter and doesn't rely on
interrupt delivery.

Instead, use another timer object to synchronize the test start to a
driver tick, ensuring that even if the race is unfixable the initial
conditions are always correct.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 12:29:02 -05:00
Andy Ross
9eda9350d8 kernel/timeout: Don't reset imminent timeouts
The logic in z_set_timeout_expiry() missed the case where the ticks
argument could be zero (or lower), which can happen naturally due to
timing/interrupt slop.  In those circumstances, it would still try to
reset a timer that was "about to expire at the next tick", which would
run afoul of the drivers' internal decisions about how soon a timer
interrupt could be set, and then get pushed out to the next tick.

Explicitly detect this as an "imminent" predicate to make the logic
clearer.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 12:29:02 -05:00
Andy Ross
bb86f2019c kernel/sched: Remove stale comment
The recent change that added a locked z_set_timeout_expiry() API
obsoleted the subtle note about synchronization above
reset_time_slice().  None of that matters any more, the API is
synchronized internally in a conventional way.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 12:29:02 -05:00
Andy Ross
71f5e56545 kernel/timeout: Fix "not in list" predication in timeout handling
The use of dticks == INACTIVE to tell whether or not a timeout was
already in the list was insufficient.  There is a time period between
the moment a timeout is removed from the list and the end of its
handler where it is not in the list, yet its list node pointers still
point into it.  Doing things like aborting a thread while that is true
(which can be asynchronous too!)  would corrupt the list even though
all the operations on it were "atomic".

Set the timeout node pointers to nulls atomically when removed, and
check for double-remove conditions (which, again, might be perfectly
OK).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 12:29:02 -05:00
Andy Ross
43ab8da953 kernel/timeout: Refactor z_clock_announce() loop
This loop was structured badly, as a while(true) with multiple "exit
if" cases in the body.  It was bad enough that I genuinely fooled
myself into rewriting it, having convinced myself there was a bug in
it when there wasn't.

So keep the rewritten loop which expresses the iteration in a more
invariant way (i.e. "while we have an element to expire" and not "test
if we have to exit the loop").  Shorter and easier.  Also makes the
locking clearer as we can simply release the lock around the callback
in a natural/obvious way.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-03 12:29:02 -05:00
Anas Nashif
52b23a3b08 ext: fix path to source files with new cmake
New cmake does not like source files not relative to current directory.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-03 11:51:29 -05:00
Anas Nashif
5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Vasili Slapik
b29a79402f boards: arm: stm32: Fix openocd warning
interface/stlink-v2-1.cfg and interface/stlink-v2.cfg are wrappers
around interface/stlink.cfg, their inclusion trigger warning which
this change addresses. Besides the warning there is nothing there
except sourcing iterface/stlink.cfg directly.

Signed-off-by: Vasili Slapik <vslapik@gmail.com>
2019-01-03 10:24:49 -06:00
Ulf Magnusson
cf3cddd1cd menuconfig: Prompt for save when Kconfig files change
Update menuconfig and Kconfiglib to upstream revision 16539b4f223fa, to
add the commit below.

    menuconfig: Prompt for save if a different .config would be saved

    Previously, menuconfig.py only prompted for saving the configuration
    if .config didn't exist or the user changed symbol values within the
    interface.

    Also make it prompt for save if Kconfig symbols have been added,
    removed, or have had their defaults changed, provided it would make
    the saved .config differ from the loaded one.

    This usually won't matter for correctness, because loading an
    outdated configuration performs an implicit olddefconfig, but it's
    less confusing.

    Also add a Kconfig.missing_syms attribute that records all
    assignments to undefined symbols in the most recently loaded .config
    file. This is needed to implement the check for whether the saved
    .config would be different.

    As an unrelated change, always prompt for saving if a .config has
    been loaded from within the menuconfig interface. The intention is
    probably often to save the configuration somewhere else, even if it
    isn't modified.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-01-03 13:55:31 +01:00
Luiz Augusto von Dentz
80bc21e03c Bluetooth: GATT: Fix warning when attempting to use read callback
When using bt_gatt_discover with BT_GATT_DISCOVER_CHARACTERISTIC the
read callback would be set to bt_gatt_attr_read_chrc which would attempt
to access the next attribute which in this case would not be set since
the value attribute is no fetched by the discovery, the spec actually
omit the value handle saying it should always be the first attribute to
appear after the characteristic thus we can assume it to be handle + 1.

Fixes #12159

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-03 12:12:10 +01:00
Luiz Augusto von Dentz
f06a20c25c Bluetooth: GATT: Add groups for server and client APIs
This should make it more clearer what APIs are intended to be used with
server and client instances, in addition to that mention on the function
documentation when operation is valid only for local attributes.

Fixes #12138

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-01-03 12:12:10 +01:00
Anas Nashif
07b221c24d ci: update to v0.5-rc5 docker file
New docker file with latest cmake 3.13.1.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-02 16:44:57 -05:00
Andrei Emeltchenko
e8ecd275a0 doc: usb: Move API documentation to usb_api
Move API documentation text to the right place.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-01-02 11:53:44 -05:00
Loic Poulain
1782e383a6 boards: disco_l475_iot1: Enable MSI PLL-Mode config
This mode allows the USB driver to use MSI clock as source clock.
MSI PLL-Mode permits +/-0,25% accuracy.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-01-02 09:33:21 -05:00
Loic Poulain
a32a39f3d2 drivers: usb_dc_stm32: Add support for MSI clock
When MSI clock is available and in PLL-Mode (high accuracy), use it as
USB source clock. This allows to enable USB on STM34l475 disco iot
board without having to add external oscillator.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-01-02 09:33:21 -05:00