In the flash partition definitions for ARM boards,
the link to the legacy partition macros does not
exist any more. The commit cleans up the partition
definition by removing this link.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Remove code and associated tests and Kconfig related to
SETTINGS_USE_BASE64 that was deprecated in Zephyr 2.2
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
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>
The fs_open has been extended with support for open flags.
Currently supported flags are:
FS_O_READ -- open for read
FS_O_WRITE -- open for write
FS_O_CREATE -- create file if it does not exist
FS_O_APPEND -- move to the end of file before each write
The FAT FS and LittleFS front-ends within the Zephyr has also been
modified to utilize the flags.
Signed-off-by: Dominik Ermel <dominik.ermel@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>
... because it is (required).
This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.
In this particular case, REQUIRED turns this harmless looking log
statement:
-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
Cannot specify sources for target "app" which is not built by
this project.
... into this louder, clearer, faster and (last but not least) final
error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by "Zephyr" with
any of the following names:
ZephyrConfig.cmake
zephyr-config.cmake
Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
"Zephyr_DIR" to a directory containing one of the above files. If
"Zephyr" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Added configuration which allows to run test-suite
on nrf52840dk_nrf52840 and nrf52dk_rf52832 boards.
fixes#25701
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
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>
Replace:
DT_FLASH_ERASE_BLOCK_SIZE ->
DT_PROP(DT_CHOSEN(zephyr_flash), erase_block_size)
DT_FLASH_WRITE_BLOCK_SIZE ->
DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
As this allows us to phase out the old generator.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
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>
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>
After running command --list-test-duplicates
I found out that some test cases have same names (duplicated).
To get rid of it, I decided to change names in .yaml files
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
A few test header files have C++ guards around them, but are incorrect.
Those files had a leading `#` placed before `extern`, which is
incorrect. This commit simply removes those leading `#` characters.
Signed-off-by: Brooks Prumo <brooks@prumo.org>
Before C sources can be compiled any generated header that they
include must be generated. Currently, the target 'offsets_h' happens
to depend directly or indirectly on all generated headers.
This means that to compile safely, one can simply depend on
'offsets_h'. But this is coincidental and might not be true in the
future.
To be able to safely depend on a target that represents all generated
headers being ready we introduce the target
'zephyr_generated_headers'.
Any third-party build scripts can now safely depend on
'zephyr_generated_headers' and be protected from any internal changes
to the build system, like the removal of offsets_h.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Adjust the configuration file, disable the SPI
driver and enable the QSPI driver and flash node.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Kamil Lazowski <Kamil.Lazowski@nordicsemi.no>
settings nffs targeted test were removed.
the file function settings suite was disabled as need some
rework in order to use litlefs.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.
Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.
Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Some cleanup in tests code as after duplicates filtering
was introduced there is no need to interpret 0-length readout in
settings h_set handler
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
NVS back-end initialization should fetch size of the flash erase blocks
from the flash API instead of DT. This allows to work well when used
storage partition is not located in embedded memory.
NVS back-end sector multiplier configuration was set to 8K as
DT value for native posix targets
flash sector sizes is 1 B, while its flash driver supports 8k.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Stops leaking very long source paths in build directories; makes them
deterministic. Finishes what was started in commit b4282bf72d, see
rationale and code reviews there.
See also CMake issue https://gitlab.kitware.com/cmake/cmake/issues/19475
for more details.
Use the opportunity to remove the most obvious duplication.
Test with: sanitycheck -T $ZEPHYR_BASE/tests/subsys/settings/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This commit fixes the FCB delete test after PR #19541.
Now the entity callback is not called on deleted element.
Issue: #19963
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit adds a possibility to activate duplicates filtering
during direct loading.
JIRA: NCSDK-3017
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit adds a possibility to activate duplicates filtering
during direct loading.
JIRA: NCSDK-3017
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
A few settings module variables were not initialized before used.
Normally these variable are initialized in the back-end
initialization call which couldn't be done in affected unit tests.
This path initialize these variable via assignments in test code.
fixes#19722
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Stops leaking very long source paths in build directories; makes them
deterministic.
Besides satisfying a CMake requirement, the new empty_file.c provide a
clue that the actual test code is not in the directory of the test case.
See https://github.com/zephyrproject-rtos/hal_nordic/pull/6 and
https://gitlab.kitware.com/cmake/cmake/issues/19475 for more details.
- Test with a simple:
sanitycheck -T $ZEPHYR_BASE/tests/subsys/settings/functional/
- Before:
CMakeFiles
├── app.dir
│ ├── HOME
│ │ └── JOHN
│ │ └── zephyrproject
│ │ └── zephyr
│ │ └── tests
│ │ └── subsys
│ │ └── settings
│ │ └── functional
│ │ └── src
│ │ └── settings_basic_test.c.obj
- After:
func_test_bindir/
├── CMakeFiles
│ └── settings_func_test.dir
│ └── settings_basic_test.c.obj
│
├── libsettings_func_test.a
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Application board.overlay files tend to be paired with
boards/board.conf files that extend the functionality of a board.
Move the overlay files to the same location as the config files that
they work with.
A few overlay files that are paired with a prj_board.conf file in the
application root directory are left in place.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Integrated Settings module tests with the NVS backend. The batch of
tests is shared with other backends.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Changed the name of functional tests for NVS and FCB in the test
configuration file to avoid duplication with other test suites.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
Limited the scope of helper functions that are used in the common test
source. Now it is easier to identify which functions are intended to be
used in the test suite.
Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
This commit allows loading data from settings permanent storage
directly to the given callback function.
Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
We don't allow an ifdef in ztest_test_suite because its a macro. We
usually handle this by defining multiple blocks and ifdef around them.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The test assumes that storage is clear before it runs. This
might be not true as lot of devices are only partially erased by
'west flash'.
Patch introduce procedure for testing whether test runs the first
time and clear storage if so.
The procedure uses mark which is stored inside SoC embedded program
flash. It will not work one devices on which read/write to it is
impossible.
fixes#16463
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add test for check whether deleted entry is recognized properly
after settings reload.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added tests of flash driver compatibility with fcb-backend.
For flash drivers which support write-block-size bigger than 1 B
test of unaligned data access uses native write-block-size
as it is dedicated to check whether settings works well on platform
which has 1 B access which is native on the current DUT.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>