Due to a long standing difference of requirements enabling deep sleep
will by default cause any application that delays for an unbounded
period to power down. On Nordic doing so turns the system off. Show
how to prevent this from happening while still allowing deep sleep
states to be available for the application's controlled use.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming multiple projects
"NONE" defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names, small, manual adjustments
have been done.
See also 7eabab2f5d ("samples, tests: Use semi-accurate project names")
Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Currently system power management does not automatically control
device power, and this example demonstrates high current draw due to
the UART being enabled. Enable device power management and
demonstrate how to manually turn off greedy devices.
Also remove the 60 s delay that confirms we successfully turned off
the residency policy; that's not directly relevant to the purpose of
the sample.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This makes the up_squared board default to x86_64.
This also adds a new board, up_squared_32, for when 32-bit
is desired.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Convert with a combo of scripts and by hand fixups:
git grep -l DT_FLASH_AREA_.*_ID | \
xargs sed -i -r 's/DT_FLASH_AREA_(.*)_ID/FLASH_AREA_ID(\L\1)/'
git grep -l DT_FLASH_AREA_.*_OFFSET | \
xargs sed -i -r 's/DT_FLASH_AREA_(.*)_OFFSET/FLASH_AREA_OFFSET(\L\1)/'
git grep -l DT_FLASH_AREA_.*_SIZE | \
xargs sed -i -r 's/DT_FLASH_AREA_(.*)_SIZE/FLASH_AREA_SIZE(\L\1)/'
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Clean up the board specific samples:
- Do not hard-code the i2c0 device label in the line follower sample.
- Miscellaneous docs cleanups.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Several reviewers agreed that DT_HAS_NODE_STATUS_OKAY(...) was an
undesirable API for the following reasons:
- it's inconsistent with the rest of the DT_NODE_HAS_FOO names
- DT_NODE_HAS_FOO_BAR_BAZ(node) was agreed upon as a shorthand
for macros which are equivalent to
DT_NODE_HAS_FOO(node) && DT_NODE_HAS_BAR(node) &&
- DT_NODE_HAS_BAZ(node), and DT_HAS_NODE_STATUS_OKAY is an odd duck
- DT_NODE_HAS_STATUS(..., okay) was viewed as more readable anyway
- it is seen as a somewhat aesthetically challenged name
Replace all users with DT_NODE_HAS_STATUS(..., okay), which is
semantically equivalent.
This is mostly done with sed, but a few remaining cases were done by
hand, along with whitespace, docs, and comment changes. These special
cases include the Nordic SOC static assert files.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add indication when sleep entry/exit counter do not match the test
expectations.
Measure deep sleep entry latency.
Add sleep entry/exit indication via gpios to debug.
Remove unnecessary trailing \n when using logging.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
Port the I2S and DMIC drivers to the new timeout API so that they do
not need to enable legacy timeouts.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Rename DT_HAS_NODE to DT_HAS_NODE_STATUS_OKAY so the semantics are
clear. As going forward DT_HAS_NODE will report if a NODE exists
regardless of its status.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert to use DT_IRQN() and DT_IRQ() to get the irq number and priority
for the DT_NODELABEL(gpiote) device.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert bluetooth samples or board samples using bluetooth to use the
new k_timeout_t struct.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Replace DT_FLASH_DEV_NAME with DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL.
We now set zephyr,flash-controller in the chosen node of the device
tree to the flash controller device.
NOTE: For a SoCs with on die flash, this points to the controller and
not the 'soc-nv-flash' node. Typically the controller is the
parent of the 'soc-nv-flash' node).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
According Mesh Profile 1.0.1. A application key shall
binding single network key. And Device key shall bind all
network key, and dev key only known by cfg_cli and node self,
only used by cfg_cli & cfg_srv.
Fixes: #21088
Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
Provide a description of the sample and how it works with different
power supply source configurations.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When the system is powered directly a measurement of Vdd provides the
battery voltage. This requires a different ADC configuration and
level curve.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
To obtain lower power measurements in general, we should turn off the
external flash which is on by default at boot.
Code is modeled based on examples shipped in the TI SimpleLink SDK.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Adding an example that exercises the sleep modes, then powers off the
system by going into deep sleep.
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Replace use of Kconfig UART_X symbols by calls to DT API.
Clean driver from symbols definitions
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Now the ARC SecureShield related features are experimental. The ARC
normal application cannot run alone, need the secure service example to
initialize the context and boot.
Here move ARC normal related configurations out of board dir to
avoid the impact of CI test and the confusion to users.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
The origin for sleeping for 3ms after coming out of deep sleep
was to wait for PLL to lock so that UART would not send
garbage characters due to incorrect clock. In the deep sleep
code, it spins to wait for the PLL to lock so there is no need
to wait for 3ms in the app. So shorten it like other busy wait.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Threads are being re-used for multiple runs, so it is better to
stop the threads before reusing the variables for new threads.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The board name for the Thingy:52, so far known as nrf52_pca20020, is
renamed to thingy52_nrf52832. Its documentation and all references to
its name in the tree are updated accordingly. Overlay and configuration
files specific to this board are also renamed, to match the new board
name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The board name for the nRF52 DK, so far known as nrf52_pca10040, is
renamed to nrf52dk_nrf52832. Its documentation and all references
to its name in the tree are updated accordingly. Overlay and
configuration files specific to this board are also renamed, to
match the new board name.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Kernel timeouts have always been a 32 bit integer despite the
existence of generation macros, and existing code has been
inconsistent about using them. Upcoming commits are going to make the
timeout arguments opaque, so fix things up to be rigorously correct.
Changes include:
+ Adding a K_TIMEOUT_EQ() macro for code that needs to compare timeout
values for equality (e.g. with K_FOREVER or K_NO_WAIT).
+ Adding a k_msleep() synonym for k_sleep() which can continue to take
integral arguments as k_sleep() moves away to timeout arguments.
+ Pervasively using the K_MSEC(), K_SECONDS(), et. al. macros to
generate timeout arguments.
+ Removing the usage of K_NO_WAIT as the final argument to
K_THREAD_DEFINE(). This is just a count of milliseconds and we need
to use a zero.
This patch include no logic changes and should not affect generated
code at all.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
We rename the nRF91 Dev Kit board target (nrf9160_pca10090)
to nrf9160dk_nrf9160. We update all associated references
in the supportive documentation and all nRF9160-related
cofigurations and overlay files in the samples and tests
in the tree.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Deprecate BT_LE_ADV defines in hci.h that are expected to be used by the
application in the scan received callback to identify the advertising
PDU type. These defines are mixing HCI input parameters and advertising
PDU types. Internally it is acceptable to mix these, but at the API we
should to mix in them.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Deprecate bt_create_conn_le and rename it to in order to add return
code, new arguments and to follow the established naming convention.
Add API for the application to control the scan parameters of the
initiator role. This allows the application more scheduling control
of the initiator in multi-role scenarios. Also provides options to
configure the initiator for LE Coded PHY for long range support.
We deprecate the old way of creating connection to make the name more
consistent with the rest of the API.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The nRF52840 DK board target, so far known as nrf52840_pca10056,
is renamed to nrf52840dk_nrf52840.
Its documentation and all references to its name in the tree are
updated accordingly. Overlay and configuration files specific to
this board are also renamed, to match the new board name.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Sample code that demonstrates power management features on
MEC15xx-based boards.
It showcases how an app can enter into light and deep sleep.
Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
This test can't be evaluated with sanitycheck, it
requires special set-up on multiple AMP cores to
function properly. Add build_only tag.
Fixes: #19643Fixes: #22317
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>