Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.
A coccinelle rule is used for this:
@r_const_dev_1
disable optional_qualifier
@
@@
-struct device *
+const struct device *
@r_const_dev_2
disable optional_qualifier
@
@@
-struct device * const
+const struct device *
Fixes#27399
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This patch removes unused Kconfig option from console
subsystem. If application wants to wait until the console
port is connected, enabled and ready to receive data
it should use uart_line_ctrl_get() API function and
check for DTR flag.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
usb_enable() must be called once by the application.
The application may want to register usb_dc_status_callback
and trace usb status codes (usb_dc_status_code).
After this patch all pre APPLICATION messages will be dropped
as USB console device is enabled in the application.
Application waits for console device until its ready by checking DTR
flag - uart_line_ctrl_get(). This function could be dropped but then
some log messages that were generated before USB device is ready
could also be dropped.
Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
There is an additional prj_smp_svr.conf configuration file provided,
which builds an image with mcuboot support. Enable it in sample.yaml,
so sanitycheck can detect build failures in future.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
There is an optional mcumgr enabled prj_smp_svr.conf configuration
file. Using it results in following errors:
.../src/smp_svr.c:12:10: fatal error: mgmt/buf.h: No such file or \
directory
12 | #include <mgmt/buf.h>
|
Fix include paths to keep sample buildable with mcumgr enabled.
Fixes: c200b1c5e6 ("mgmt: Move mcumgr into its own folder")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Fix smp_svr Bluetooth configuration for when BT_HCI_ACL_FLOW_CONTROL
option has been enabled. In this case the CONFIG_BT_L2CAP_RX_MTU
is used instead of CONFIG_BT_RX_BUF_LEN to set the RX MTU.
This lead to a negotiated MTU of 23, which is not supported by
the SMP_SVP protocol.
Removed the board specific configuration files as these are just
duplications of the overlay-bt.conf or overlay-bt-tiny.conf and
the readme specifies how these should be used.
Reduced the TX MTU to end up with the same value as the RX MTU,
CONFIG_BT_RX_BUF_LEN - 4 (HCI ACL header) - 4 (L2CAP header).
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
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>