Commit graph

41120 commits

Author SHA1 Message Date
Martí Bolívar
258b71f8fe cmake: cache DTS bindings directory
We need this information in the cache now that we're not allowed to
parse generated_dts_board.conf from Python code after build time.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-11-15 07:53:25 -06:00
Radoslaw Koppel
86afb9c776 settings: Set a default value to name_key before processing
This commit fixes the settings_call_set_handler function
in a situation where the user calls settings_load_subtree_direct
with NULL as a subtree parameter.

Fixes: #20514

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-11-15 14:49:55 +01:00
Carlo Caione
6d9af83907 samples: philosophers: Introduce CONFIG_TEST_EXTRA_STACKSIZE
Some architectures require more space on the stack when running samples
and tests. Use the CONFIG_TEST_EXTRA_STACKSIZE also on the philosophers
sample to deal with such cases.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-11-15 08:07:28 -05:00
Anas Nashif
3a00d0ca75 sanitycheck: record results when running on devices
Write recording.csv file when running on devices.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:05:33 -05:00
Anas Nashif
28ac1634ef tests: stack: consolidate tests
consolidate both stack test applications into one.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:04:52 -05:00
Anas Nashif
7e6cd374ac tests: stack: move stack_usage into stack
Just call it stack instead of stack_usage, preprate for consolidation of
test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:04:52 -05:00
Anas Nashif
b396759984 tests: semaphore: consolidate semaphore tests
No need to have two tests for the same thing, just put everything in one
test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:04:52 -05:00
Anas Nashif
834b7744ec tests: semaphore: cleanup assert messages
Remove redundant message from asserts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:04:52 -05:00
Anas Nashif
e0f677649a tests: semaphore: cleanup asserts
Remove newline from asserts.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-15 08:04:52 -05:00
Sebastian Bøe
59abaf461b cmake: make the BT_HCI_TX_STACK_SIZE's prompt conditional
The BT_HCI_TX_STACK_SIZE is carefully calculated from other
options. When those options change, e.g. from a menuconfig update, it
is important that the stack size is re-calculated, but it is not when
there is a prompt.

Therefore, make the prompt conditional such that the previously set
value is only used when it has been explicitly configured to be so.

Now users can still change the value through menuconfig and prj.conf,
by also enabling <option>_WITH_PROMPT, but when the value is
calculated by the defaults, it will continue to be calculated by
defaults instead of inheriting the intial value.

This is AFAIK a novel approach, but testing has shown that it gives
the users the behaviour they want, at the cost of some boilerplate of
course. This pattern can be applied to other options if it proves to
work as intended.

Alternatively one could remove the prompt, but then it would no longer
be possible to override the value through menuconfig.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-11-15 13:28:56 +01:00
Andy Ross
11a050b2c3 kernel/sched: Fix edge case in MetaIRQ preemption of cooperative threads
When a MetaIRQ preempts a cooperative thread, that thread would be
added back to the generic run queue.  When the MetaIRQ is done, the
highest priority thread will be selected to run, which may obviously
be a cooperative thread of a higher priority than the one that was
preempted.

But that's wrong, because the original thread was promised that it
would NOT be preempted until it reached a scheduling point on its own
(that's the whole point of a cooperative thread, of course).

We need to track the thread that got preempted (one per CPU) and
return to it instead of whatever else the scheduler might have found.

Fixes #20255

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-15 13:09:02 +01:00
Loic Poulain
14a5fcdb35 video: mt9m114: Fix integer handling issues
Fix 32-bit endian conversion.

CID: 205643

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-11-15 10:11:05 +01:00
Loic Poulain
187397ab16 boards: arm: mimxrt1064_evk: Fix display support
Delete wrong LVGL_BITS_PER_PIXEL config and add mimxrt1064_evk
to the lvgl sample platform whitelist.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-11-15 10:06:56 +01:00
Joakim Andersson
be63f42db1 Bluetooth: doc: Document HCI errors for connected callback
Add documentation for the possible HCI errors codes received for a
connected callback. The HCI error code received when the initiator is
canceled through the HCI create conn cancel operation is non-intuitive.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-11-15 10:02:24 +01:00
Jose Alberto Meza
2f1f2cb147 samples: drivers: espi: Fix #20505 and #20506 coverity issues
Abort execution if any null pointer found during espi/gpio binding.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-11-15 09:34:42 +01:00
Andrzej Puzdrowski
1c777dd52e fs/fcb: improve error handling in fcb_offset_last_n
Fix for not served error code in fcb_offset_last_n()
implementation.
Issue was reported by static code analyze scan.
Looks like the function might have failed silently
if aggressive access to the fcb instance
from another thread have been occurring while the function
have been processing the fcb storage.

fixes #20512

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-11-14 19:33:36 -05:00
Krzysztof Chruscinski
7c5a2d6d22 drivers: clock_control: Fix Coverity issue in nrf_clock_calibration
Fix issue reported by Coverity.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-11-14 19:14:07 -05:00
Andy Ross
52d6e5983f doc/kernel/smp: Add initialization diagram
Add a simple block diagram detailing the SMP initialization flow.  Not
pretty, but hopefully reasonable.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-11-14 19:13:27 -05:00
Krzysztof Chruscinski
46aae2e86a tests: drivers: counter: Fix coverity issue
Fix issue reported by Coverity - return value not checked.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-11-14 10:47:47 -06:00
Stephanos Ioannidis
2d8f71049e tests: cmsis_rtos_v2: Fix warning in old GCC.
This commit modifies the struct array initialisation expression using
the "universal initialiser" to a struct single element initialisation
expression in order to prevent old GCC versions from erroneously
reporting the "missing braces around initializer" warning.

This is an infamous bug in old GCC versions; since there is no side
effect of using this alternate initialisation expression and it does
not violate the C99 standard, this problem should be addressed in the
code for the sake of portability.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-14 09:17:49 -05:00
Kumar Gala
a4b2b5bbf8 sanitycheck: Add support for TI XDS110 to --generate-hardware-map
Add support for boards that utilize the TI XDS110 like the CC3220SF,
CC3235SF, CC1352R1 and CC26x2R1 LaunchXL boards.  The XDS110 can expose
multiple serial endpoints one for the uart device, but another for a
trace buffer.  We assume that endpoint 0 will be the UART device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-14 09:16:50 -05:00
Kumar Gala
1ad3543ada sanitycheck: add setting runner type for J-Link & STLink
Add setting runner type to jlink for 'J-Link' and openocd for
'STM32 STLink' when generating the hardware map.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-11-14 09:16:50 -05:00
Anas Nashif
8b089d2699 doc: kernel: use kconfig documentation in main kernel doc
Documentation about scheduling options was burried in the Kconfig help.
It has better visibility as part of the scheduling section of the main
kernel reference pages.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-14 09:15:38 -05:00
peng1 chen
f1afcb5376 tests/arch/x86/info: add console harness and regex
use the console handler to handle this test, parse
the output and capture the regex to pass it.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2019-11-14 09:14:53 -05:00
Shih-Wei Teng
5ebceeb8cb object tracing: Fix the issue that objects lost from trace list
Add a flag for identifing whether this object is on the trace
list. Ensure that link any object to the trace list only one time.
It will avoid the issue about lost object caused by adding a
object to trace list twice.

Fixes #19537

Signed-off-by: Shih-Wei Teng <swteng@andestech.com>
2019-11-14 09:13:56 -05:00
Ulf Magnusson
13120f7313 west.yml: Update ci-tools to run the (e)dtlib test suites in CI
Get this commit in:

    check_compliance.py: Run the dtlib/edtlib test suites on Python 3.5

    Will work once
    https://github.com/zephyrproject-rtos/zephyr/pull/20597 is in. CI
    uses Python 3.5, so they have been skipped until now.

That PR is in now.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-14 07:56:33 -06:00
Ulf Magnusson
edd8ab2a02 tests: drivers: build_all: dts_fixup.h: Fix misplaced #endif
Commit 555936f771 ("dts/Kconfig: Remove unused HAS_DTS_SPI")
accidentally removed the wrong #endif, meaning the second part of
dts_fixup.h depended on DT_ADXL372_DEV_NAME not being defined.

Discovered through the reference to the undefined HAS_DTS_SPI symbol in
the comment after the #endif at the end of the file. Adding detection of
unused symbols in samples and tests to CI.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-14 07:55:38 -06:00
Ulf Magnusson
9e87b1191e samples: CAN: kconfig: Fix ref. to CONFIG_CAN_AUTO_BUS_OFF_RECOVERY
A reference to CONFIG_CAN_AUTO_BOFF_RECOVERY was added in commit
1b88658f9f ("samples: driver: Extend CAN sample"), but it's never been
defined as a Kconfig symbol.

Should have been CONFIG_CAN_AUTO_BUS_OFF_RECOVERY according to
alexanderwachter, so change it to that.

Adding detection of unused symbols in samples and tests to CI.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-11-14 07:53:41 -06:00
Lingao Meng
ff9f208492 Bluetooth: Mesh: Fixes Config client send publish message
When Config client model send publish message, app_idx will
be need, however, currently code clear this value use `&`,
this will be generate error when app_idx not zero.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2019-11-14 14:26:21 +02:00
Vikrant More
d2737d5fac samples: mesh: nrf52: coding style improvements
Corrected spellings in printk messages plus removed
unnecessary blank lines.

In case of Gen. Move client's message to Server, reduced
values of delta & transition time to improve demonstration.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-14 14:24:29 +02:00
Vikrant More
8dabf77f08 samples: mesh: nrf52: increased main stack size
Increased main stack size. This will solve issue mentioned at
https://github.com/zephyrproject-rtos/zephyr/issues/19685 which
is only related to onoff_level_lighting_vnd_app.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-14 14:24:29 +02:00
Ioannis Glaropoulos
3c4fb60399 boards: arm: nrf5340_dk: fix nRF Cache and NVMC macro usage
We need to fix the formato of the macros for nRF CACHE and NVMC
peripherals in soc.c, so the _S and _NS suffixes are skipped.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-11-14 12:18:44 +01:00
Vinayak Kariappa Chettimada
29a1bbd24a boards: arm: nrf5340_dk: Enable DC/DC by default
Since the nRF5340 DK contains the required DC/DC circuitry,
enable it by default while keeping it configurable. This
reduces power consumption in application core , network
core and high voltage use.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-11-14 12:18:44 +01:00
Martí Bolívar
483adc984e scripts: fix misc-flasher runner
This makes the misc-flasher runner usable by passing the build
directory to the underlying tool.

Fixes: #20658
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-11-13 23:49:28 -05:00
Stephanos Ioannidis
c839d7b458 settings: Fix undefined behaviours in settings_line.c.
This commit fixes the source of potential undefined behaviours in
settings_line.c.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-11-13 17:36:36 -08:00
Andrew Boie
cb87cc8fd6 doc: add two diagrams to user mode documentation
One shows how globals are routed for automatic memory
domains. The other illustrates control flow when making
system calls.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-13 15:55:44 -08:00
Peter Bigot
86461ac559 samples: sensor: mcp9808: fix frdm_k64f devicetree overlay
The device address can only be 0x18 through 0x1F.  C6 is connected to
the FXOS870 and is not exposed on a header: switch to Arduino D0.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-13 15:16:54 -06:00
Peter Bigot
83b2bb614b drivers: sensor: mcp9808: clean up I2C API usage
The i2c_msg API details do not work correctly with Nordic TWI.  Switch
to the higher-level and simpler API for register read and write.  Also
add a tree configuration on a Nordic-based board.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-11-13 15:16:54 -06:00
Jan Van Winkel
b14d43eec7 subsys/fs/shell: Prevent buffer overrun when creating abs path
Prevent buffer overrun in function create_abs_path when a current
working directory is set.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-11-13 15:11:29 -06:00
Mieszko Mierunski
117bc6dfa4 drivers: nrf: Fix values in UARTE async API callback.
There is possibility that endrx interrupt will be triggered in the
middle of timer interrupt responsible for UARTE timeout, this
patch handles this case.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-11-13 15:09:12 -06:00
Martí Bolívar
59e2f230e0 scripts: dts: improve error message on compatible type error
Print the offending value and its type.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-11-13 15:07:29 -06:00
Andrzej Głąbek
6e8132d1ae samples: blink_led: Fix the behavior of the sample
Commit 16d8ce519c introduced changes
that caused this sample to no longer behave according to documentation
and for some hardware to no longer work at all.
On nRF51 SoCs for instance, the reported number of cycles per second
is 16M, what makes the calculated max_period and min_period to be 16
and 0 microseconds, respectively, what effectively makes it impossible
for the sample to return to the initial blinking frequency. Moreover,
with such short PWM periods, the blinking is not even noticeable.

This patch partially reverts the changes mentioned above, and instead
of calculating max_period and min_period basing on the reported clock
rate, it tries to only decrease the max_period if needed, accordingly
to what the used hardware can handle.
Documentation is also updated to mention the possible change in
observed behavior of the sample on some hardware.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-13 14:54:45 -06:00
Marcin Niestroj
44841646a1 sensors: lis2dh: use proper scale factor for lsm303agr
LSM303AGR is a special one in terms of raw value scale among all devices
supported by lis2dh.c driver. Apply proper scale factor based on
sensitivity scale provided in LIS2DH and LSM303AGR datasheets.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Marcin Niestroj
ea0b6a80a8 dts: bindings: lsm303agr: add new bindings based on lis2dh
Add new bindings for already supported (by lis2dh.c driver) lsm303agr
accelerometer. Using st,lsm303agr-accel compatible will allow in
subsequent commit to apply different sensitivity scale.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Marcin Niestroj
59648bd1a5 sensors: lis2dh: fix raw value scaling
All values were scaled by 8 instead of 12 for 16g compile-time selected
range. This resulted with values around 6.5 m/s^2. Scaling for runtime
configurable ranges was broken for all except 2g range option due to
totally broken lis2dh_range_to_reg_val().

Fix wrong scaling for 16g compile-time and all runtime selectable ranges
by reworking code that scales raw value. While doing this, change
lis2dh->scale type from 16 to 32 bits. This allows to slightly increase
final result precision by using the fact that raw values have maximum 12
bits precision, allowing us to multiply lis2dh->scale by (1 << 4)
compared to previous implementation.

Fix bug #19872.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Marcin Niestroj
27b2914da2 sensors: lis2dh: fix raw value to sensor_value conversion
According to struct sensor_value documentation, val2 should be negative
for negative result. So drop code that tries to make val2 positive.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2019-11-13 14:43:25 -06:00
Andrzej Puzdrowski
aae2c84619 setting: fix NVS error handling on write
In settings write NVS errors were not handled
in a few places.
This patch improve that.

fixes #20515

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-11-13 14:11:23 -06:00
David B. Kinder
331214704c doc: New developer getting started guide
As presented to the TSC, Zephyr's out-of-box experience for new
developers is, well, complicated.  A number of suggestions were
presented including simplifying the getting started material to present
a straight-forward path through the setup and installation steps through
to getting a sample application built, flashed, and running.

This PR is a work-in-progress towards addressing this OOB experience
with a minimal-distractions version of the GSG. Alternatives, warnings,
and material that could lead the developer astray were moved to
alternative/advanced instruction documents (based on the previous
separate Linux/macOS/Windows setup guides) and a new "Beyond the GSG"
document.

We do take advantage of a sphinx-tabs extension for synchronized tabs to
present OS-specific instructions: clicking on one tab will display all
same-named tabs throughout the doc.

We hope (and will continue evaluating) that this new GSG gets developers
set up quickly and then we can send them along to other documents to
continue learning about Zephyr and trying other sample apps.

Thanks for all your previous feedback that I've worked
into this new version.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-11-13 14:05:47 -06:00
Wayne Ren
b4ddc10b42 soc: arc: enable SYSTEM_CLOCK_SLOPPY for SMP
in SMP, arc uses gfrc as wall clock, so it's ok
to enable SYSTEM_CLOCK_SLOPPY to avoid unnecessary
interrupts

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-11-13 12:04:18 -08:00
Wayne Ren
66856e5478 drivers: timer: fix the bug for SMP
* fix the smp timer dirver bugs found in debug and test.
for smp case, GFRC is used as clock source, and local
internal timer is used to trigger time event.

* because 64-bits gfrc is used, so idle can be igored as no kernel
tick will be missed

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-11-13 12:04:18 -08:00