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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add error checking, remove redundant code, and improve the logging for
settings related functionality.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
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>
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>
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>
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>
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>
nrf52840_pca10056 and nrf52_pca10040 was enabling RTT by default
for all samples. It has some implications like forwarding printk
to logger and that, as a default behavior, may not be welcomed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The master is using unknown rsp to terminate slave side initiated
procedures that has collided with the encryption procedure initiated by
the master.
We need to handle an unknown response that is sent in unencrypted during
the encryption procedure, even though we have already set up to receive
encrypted packets.
Fixes#14044
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Updating the Resolvable Private Address when advertising and
active scanning in progress fails and clears the RPA_VALID
flag; making the next bt_le_scan_start while continuing to
advertise to fail.
This is fixed by keeping the RPA_VALID flag remain set.
Stopping and starting active scanning to update RPA can be
implemented in a separate commit.
Fixes#9463.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
The nRF91 DK User Guide clearly says "the LEDs are active high,
meaning that writing a logical one ('1') to the output pin will
illuminate the LED".
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Enable TIMER1 by default in nrf9160_pca10090 so it can be selected
by user for hardware byte counting in UARTE or other purpose.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
Replaced by the new CONFIG_LOG system.
Also remove the "Logging Options" menu and turn the LOG symbol into a
'menuconfig', with prompt "Logging", which appears in the top menu. LOG
and its dependent symbols make up all of the logging Kconfig symbols
now.
Piggyback some minor cleanup.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Fix --help message. Also rename run_report() to save_tests() as it's
used only once by --save-tests and nowhere else. Maybe the code was
shared with some --other-report feature in the past but not any more.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Currently, the Kconfig.modules file is placed in the build directory
relative to the CMake "project". But technically, the file is not
project-specific, but global, or build-directory specific.
So we move it up one level to the CMAKE_BINARY_DIR instead. Currently,
there is only one project, so this change has no effect, but this
enables us to have multiple projects in the future, which again
enables multi-image builds.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
According to nrf51 and nrf52 specifaction every peripheral is
assigned a fixed block of 0x1000 bytes. Due to that dts for
nrf51 and nrf52 chips have been updated.
The only exception is gpio for nrf52840 where gpio0 and gpio1
share the same memory regions. For this reason, the definition
of gpio for nrf52840 is different from the others.
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>