Commit graph

41120 commits

Author SHA1 Message Date
Wayne Ren
eba78548da arch: arc: add the handling of mpu stack guard exception
* mpu stack guard exception is a kind of mpu violation exception
* use SW way to distingusih it from other mpu vioation exception

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-29 16:15:10 -04:00
Wayne Ren
950b5c1a7a board: nsim: add new configuration to cover mpu stack guard
* the original configurations are configured with stack checking
* the new configurations are configured with mpu stack guard

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-29 16:15:10 -04:00
Wayne Ren
48e05710f4 arch: arc: fix the bug in HW_STACK_PROTECTION
* HW_STACK_PROTECTION can be done by STACK_
  CHECKING or MPU stack guard. ARC STACK_CHECKING is prioritized
  over MPU-based stack guard

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-29 16:15:10 -04:00
Wayne Ren
3c4fc3d494 arch: arc: fix compile error
caused by typos

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-29 16:15:10 -04:00
Ramakrishna Pallala
5049694a20 doc: Add documentation for file system subsystem
Add documentation for file system subsystem.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-29 09:38:33 -04:00
Wayne Ren
d6870e408a board: emsk: fix the ddr related definitons
* add ddr fixup in dts_fixup.h
* use DT_DDR_XXX in linker.ld

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-03-29 09:37:43 -04:00
Marc Herbert
195195a4fc file2hex.py: switch from gzip.compress() to GzipFile()
Zero functional change, this is pure refactoring and preparation for
using the mtime= parameter which the gzip.compress() shortcut does not
make available.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-03-29 08:12:53 -04:00
Marti Bolivar
d3bb3cfd7a doc: west: add missing parts for zephyr v1.14
- add glossary terms for important concepts we have to explain often,
  like "west installation"

- add autodoc directives for pulling in west API docs

- add missing documentation for built-in features like west's
  configuration, extension commands, etc.

- add missing documentation for "west sign" extension

- describe the manifest in a self-contained way rather than linking to
  the relevant pykwalify schema, also adding a missing reference to
  "west manifest" in the miscellaneous multi-repo commands list

- move various details regarding history and motivation to why.rst
  among other changes to repo-tool.rst, leaving it closer to a "tell
  me what I really need to know" style overview

- update planned features

Fixes: #14992
Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-03-29 11:24:32 +01:00
Marti Bolivar
cd795195d5 doc: fix parallel builds
Several of our extensions don't declare they are parallel read or
write safe. Upon inspection, they are.

Not declaring parallel read safety defeats a lot of the speed ups that
are possible when using SPHINXOPTS="-j=auto", so mark the extensions
safe and get the performance back.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-03-29 11:24:32 +01:00
Marti Bolivar
74a2d2bfe7 west: move to version v0.5.7
This fixes some high priority issues, including syntax errors in
docstrings which prevent us from including API docs in our Sphinx
tree.

Signed-off-by: Marti Bolivar <marti@foundries.io>
2019-03-29 11:24:32 +01:00
Erwan Gouriou
45962cbe33 doc: dts: Remove orphan section
'orphan:' appears before Flash Partitions section on
https://docs.zephyrproject.org/latest/guides/dts/index.html page.
Fix this

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-29 04:56:21 -05:00
Luiz Augusto von Dentz
58baad7c5e Bluetooth: ipsp: Fix not checking return of build_reply
net_pkt_sendto uses size_t as parameter for len so the value would be
treat as unsigned which may cause and invalid memory to be read.

Fixes #14950 #14955

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-03-29 10:39:53 +01:00
Kumar Gala
c6cce7a42e doc: Update release_process to clarify about GitHub tagging
Add a note in the tagging section of the release process that explains
why using GitHub release process for tags should NOT be done.

Fixes #14985

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-29 10:36:01 +01:00
Kumar Gala
9e81cbea7d release: Zephyr 1.14-rc3
Bump to 1.14-rc3.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-28 18:02:26 -05:00
Patrik Flykt
21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt
2fb87b9dd2 scripts/coccinelle: Update unsigned suffix script
Update unsigned suffix script to properly match multiplication.
Fix provided by Himanshu Jha.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt
24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt
caebf204c6 scripts/coccinelle: Update Coccinelle script for unsigned values
Update the script to detect and update more instances of unsigned
variable assignments when using all four simple rules of arithmetics.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Aaron Tsui
f7e7f0f55e tests: watchdog: Debug for boards enabled TEST_WDT_CALLBACK_2
The original code cannot go to the next step on those boards enabled
TEST_WDT_CALLBACK_2 macro, because of the flow control issue. So the
test function cannot finish, and the board keeps restart. As a result,
failure on the test.

Fixes #13468

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-28 16:47:06 -05:00
Andrzej Głąbek
ebfd8533d8 boards: nrf52840_pca10090: Force GPIO to be always enabled
The GPIO driver is required by this board's initialization code, hence
it is forced to be enabled always, not only enabled by default like on
other boards equipped with an nRF SoC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-28 16:46:39 -05:00
Andrzej Głąbek
32223bd2ae boards: Enable GPIO by default on boards with nRF SoCs
This patch enables the GPIO driver by default on all boards equipped
with an nRF SoC (all boards having `CONFIG_SOC_FAMILY_NRF=y` in their
`_defconfig` file).
In vast majority of cases the driver is needed, so it is more
convenient to enable it at board level than in particular
applications.
And if the driver is undesired for some reason, it can be still
disabled in the application config.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-03-28 16:46:39 -05:00
Piotr Zięcik
bd24b31139 Revert "soc: arm: nordic: provide custom busy_wait implementations"
This reverts commit d4b4b99272 as it
introduced unwanted side effect: It moved the k_busy_wait() to other
clock that the one driving system timer and k_cycle_get_32(). As result,
delays created using these interfaces not matched each other.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2019-03-28 15:09:32 -05:00
Ulf Magnusson
a449c98db2 scripts: Fix risky uses of non-raw regex strings in Python scripts
Fixes pylint warnings like this one:

    doc/conf.py:325:0: W1401: Anomalous backslash in string: '\s'.
    String constant might be missing an r prefix.
    (anomalous-backslash-in-string)

The reason for this warning is that backslash escapes are interpreted in
non-raw (non-r-prefixed) strings. For example, '\a' and r'\a' are not
the same string (first one has a single ASCII bell character, second one
has two characters).

It just happens that there's no \s (or \., or \/) escape for example,
and '\s' turns into two characters (as needed for a regex). It's risky
to rely on stuff like that regexes though. Best to make them raw strings
unless they're super trivial.

Also note that '\s' and '\\s' turn into the same string.

Another tip: A literal ' can be put into a string with "blah'blah"
instead of 'blah\'blah'.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 14:41:32 -05:00
Aaron Tsui
3c45eb45d6 samples: sensor: fix hardware fault when no sensor connected
There are two sensor samples be modified for a more explicit log when
no sensor connected or not connected correctly. Rather than a horrible
hardware fault, which may misleading beginner.

1. bme280
2. sx9500

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-03-28 14:32:17 -05:00
Marc Herbert
915a353255 extensions.cmake: need unique strings, not random ones
1. To support being called multiple times, the function
zephyr_library_compile_options() uses unique
options_interface_lib_${random} names. These only need to be unique, not
random. So replace them with a simple MD5 hash of the ${item} argument.

To reproduce quickly run:
  sanitycheck -b -p qemu_xtensa --tag shell
... a few times and compare the output directories.

This bug sits for now at the top of the list of build reproducibility
issues the most bizarre and difficult to root cause. When running
sanitycheck over a large sample of configurations it was affecting
only qemu_xtensa/**/zephyr/arch/arch/xtensa/core/startup/Makefile
files (and their corresponding CMakeFiles/TargetDirectories.txt),
randomly ordering the following three Make targets and only these
three: rebuild_cache, edit_cache, arch__xtensa__core__startup.

The key to root causing was cmake --trace-expand which prints the random
string.

2. generate_unique_target_name_from_filename() also generated a random
string for the same uniqueness reason. This one was easier to root cause
and reproduce with: sanitycheck --tag gen_inc_file

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-03-28 14:27:47 -05:00
Emanuele Di Santo
500fa722fb boards: arm: nrf52840_pca10059: correctly set FLASH_LOAD_OFFSET
Set FLASH_LOAD_OFFSET correctly (accounting for Nordic MBR) when
BOARD_HAS_NRF5_BOOTLOADER is defined and we're not compiling MCUboot.
MCUboot will select USE_CODE_PARTITION, which will make it link
correctly regardless of which board DTS is used (stock/debugger).

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-03-28 17:54:25 +01:00
Ulf Magnusson
0e8e92cd87 scripts/dts: Fix bug in dead /memreserve/ code
The /memreserve/ code would crash if it ever ran, because 'name' isn't
defined (seems to be some copy-paste here). There are no /memreserve/s
in Zephyr though, so it works out.

'name' seems to be the node name. Not sure what to put for a
/memreserve/, but make it '<memreserve>' to make it stand out.

Fixes a pylint warning.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:11:13 -05:00
Ulf Magnusson
7ffd628dac scripts: elf_helper: Remove undefined var ref. in ArrayType.__repr__()
self.num_members doesn't exist. This commit just removes the reference,
because I didn't want to guess a proper fix.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:07:42 -05:00
Ulf Magnusson
425998bd79 scripts: elf_helper: Tidy up get_symbols() to eliminate pylint warning
Using a member variable in the dict comprehension was probably a typo
(can't see 'sym' referenced elsewhere). Use a local variable instead.

Made pylint spit out these warnings (which might be spurious though):

    scripts/elf_helper.py:535:24: E0203: Access to member 'sym' before
    its definition line 536 (access-member-before-definition)

    scripts/elf_helper.py:535:39: E0203: Access to member 'sym' before
    its definition line 536 (access-member-before-definition)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:33 -05:00
Ulf Magnusson
d5b0bd14e3 scripts: Remove unused imports in all Python scripts
Discovered with pylint3.

Upstream open-amp PR: https://github.com/OpenAMP/open-amp/pull/168

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:20 -05:00
Ulf Magnusson
12ba9dfa52 scripts: Remove unused variables in all Python scripts
Discovered with pylint3.

Use the placeholder name '_' for unproblematic unused variables. It's
what I'm used to, and pylint knows not to flag it.

Python tip:

    for i in range(n):
        some_list.append(0)

can be replaced with

    some_list += n*[0]

Similarly, 3*'\t' gives '\t\t\t'.

(Relevant here because pylint flagged the loop index as unused.)

To do integer division in Python 3, use // instead of /.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:20 -05:00
Ulf Magnusson
399c04ce5a scripts/dts: Remove unused variables and imports
Discovered with pylint3.

Use the placeholder name '_' for unproblematic unused variables. It's
what I'm used to, and pylint knows not to flag it.

Also improve the naming a bit in devicetree.py. If a key/value is known
to be a specific thing (like a node), then it's helpful to call it that
instead of something generic like "value".

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:06:01 -05:00
Ulf Magnusson
95650fdefa ext: open-amp: Fix broken typo'd sys.exit()
s/exist/exit/

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-28 11:05:38 -05:00
Song Qiang
cb26591fc7 sensor: fxos8700: add forgot int2 defines to dts_fixup.h
The last commit changes FXOS8700 to use new DT defines in its
dts_fixup.h, and the build was also succeeded after it. But
DT_NXP_FXOS8700_0_INT2_GPIOS_CONTROLLER and
DT_NXP_FXOS8700_0_INT2_GPIOS_PIN were missed so the build_all project
is still failing.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-03-28 10:54:31 -05:00
Yannis Damigos
5f83759c1b i2c_ll_stm32_v2: Disable ReloadMode, if needed, when error occurs
Disable ReloadMode, if needed, when error occurs in polling mode.

Fixes #14568

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2019-03-28 09:42:35 -05:00
Johan Hedberg
49a34244be Bluetooth: Mesh: Remove redundant LOCAL_PUB_KEY flag
There's no need to track this info in prov.c since hci_core.c is
already doing it. Just query hci_core.c always using the
bt_pub_key_get() API.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:39:59 +01:00
Johan Hedberg
c6fa295e6a Bluetooth: Mesh: Fix disconnecting existing provisioning bearers
If PB-GATT is disabled while there are connected clients, those
clients must be disconnected. Add a 'disconnect` parameter to
bt_mesh_proxy_prov_disable() to handle scenarios when we don't want to
disconnect (e.g. right after successfully finishing provisioning) and
tose where we do want to disconnect (e.g. user requesting to disable
the provisioning bearer).

Also make sure that we always update advertising, so that a stale
advertising set isn't left in the controller.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:39:59 +01:00
Johan Hedberg
7d3b627e19 Bluetooth: Mesh: Fix re-initializing provisioning state upon reset
If both PB-ADV and PB-GATT are supported, we need to properly
re-initialize variables such as link.rx.prev_id and (particularly
importantly) link.rx.buf. If we don't do this it may lead to the
following fault when trying to reprovision again:

***** USAGE FAULT *****
  Illegal use of the EPSR
***** Hardware exception *****
Current thread ID = 0x20001f10
Faulting instruction address = 0x0
Fatal fault in thread 0x20001f10! Aborting.

Fixes #14928

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:39:59 +01:00
Johan Hedberg
87fe134e65 Bluetooth: Mesh: Fix gen_prov struct definition
Remove unnecessary const keywords (the entire struct is const) and use
bool instead of u8_t for the require_link member.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:39:59 +01:00
Cinly Ooi
097a71cbfe samples: watchdog: Confirm that reset occured
Updated test harness to check for a second instance of
"Watchdog sample application". This is to confirm the
board did reset itself.

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-03-28 09:35:30 -05:00
Johan Hedberg
672607c68a samples: reel_board/mesh_badge: Fix IV Index type
The IV Index is always a 32-bit value, so using u16_t for it was
confusing. Create a define for it, similar to other constant values,
to get rid of this confusion.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:29:54 +01:00
Anas Nashif
0b9dda321e CODEOWNERS: add owner for /dts/bindings/
@galak is now the proud owner of /dts/bindings/.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-28 10:25:02 -04:00
Johan Hedberg
b40235b3e0 Bluetooth: Mesh: Take advantage of settings_delete() when possible
Using settings_delete() makes it much easier to understand what the
code is doing, and actually also reduces the amount of code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:23:46 +01:00
Johan Hedberg
35ebacbe06 Bluetooth: Clean up settings related code
Add error checking, remove redundant code, and improve the logging for
settings related functionality.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:23:46 +01:00
Johan Hedberg
f9450f072f Bluetooth: Remove unused ID_SIZE_MAX macro
There are no more user for this macro - just remove it.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:23:46 +01:00
Johan Hedberg
bcc2d8f0a9 Bluetooth: GATT: Fix attribute read return parameter type
The read() callback of attributes returns ssize_t and not size_t. Fix
this, which also fixes a Coverity warning.

Fixes Coverity CID 197457
Fixes #14958

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 15:22:22 +01:00
Johan Hedberg
12bf7e6ead Bluetooth: Use bt_addr_le_copy() instead of direct assignment
The convention in the code is to use the appropriate address copying
functions instead of direct assignments. Even when a specific copying
function doesn't exist the convention is to use memcpy.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-03-28 09:02:00 -05:00
Takumi Ando
bdde5fd984 driver: usb: nordic: Enable USB DC when VBUS is Hi
We want to enable USB DC at not only VBUS detection event
but also it has been already high.

Signed-off-by: Takumi Ando <takumi.ando@atmark-techno.com>
2019-03-28 14:59:01 +01:00
Daniel Leung
416d94cd30 kernel/mutex: remove object monitoring empty loop macros
There are some remaining code from object monitoring which simply
expands to empty loop macros. Remove them as they are not
functional anyway.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-03-28 08:55:12 -05:00
David Brown
22029275d3 kernel: Clarify warning about no multithreading
Clarify the warning in the help for CONFIG_MULTITHREADING to make it
clear that many things will break if this is set to 'n'.

Signed-off-by: David Brown <david.brown@linaro.org>
2019-03-28 09:49:59 -04:00