Add stub code for SDIO support, capable of verifying card responds to CMD5.
This commit also changes the architecture of the SDIO probe step to make
adding new protocol support more streamlined, and enable compiling out
support for undesired protocols.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit updates all in-tree code to use `CONFIG_CPP` instead of
`CONFIG_CPLUSPLUS`, which is now deprecated.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit moves the C++ library tests under `tests/subsys/cpp` to
`tests/lib/cpp` now that the C++ library has been relocated to
`lib/cpp`.
Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
Function cbpprintf() returns int type and may return negative error
code. Fixes static tool warnings.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Changes one of the callback register/unregister functions to use
2 events OR'd together instead of 2 events registered separately,
this is to help test that grouped events are working.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
When a libc partition exists, all user mode threads will need access to
libc variables. Add the libc partition in this test case to allow that.
This was detected by running the test on ARM32 with thread local storage
enabled as that uses z_arm_tls_ptr which is included in the libc partition.
Signed-off-by: Keith Packard <keithp@keithp.com>
Test had by accident an early return and after removal case was failing
in certain configurations. It was failing because set of long messages
was not fitting into the logging buffer used in the test. Fixed the
test by adding more frequent processing between the messages.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The FlexSPI pins are reconfigured before going into Deep
Sleep mode to save power. The requires enabling
CONFIG_PM_DEVICE so we can access the flexspi pin settings.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Drop duplicate entry for
logging.log_api_deferred_override_level_rt_filtering, it's already
declared with the same settings on line 106.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Fix all hyphens errors detected by yamllint:
yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
grep '(comments)'
Default config would be to require two spaces after the start of the
comment, proposing to keep it on 1, inline with the Linux binding
config, that is:
```
- comments:
- min-spaces-from-content: 1
```
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Test started to fail after updated in mpsc_pbuf. It was failing for
two reasons:
- Expected capacity was not updated after change in mpsc_pbuf which now
has full capacity (does not use extra byte for empty vs full
distinction).
- Messages were claimed without freeing. It was faulty even before the
update since mpsc_pbuf is single consumer so only one message can be
claimed at a time. However, test was passing before unexpectedly.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Use flag instead of word in the buffer. Using this method allows
to dedicate full buffer capacity for data.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Remove extra string size addition to the log message size when posix
is used. First string is considered as read-only also for posix so it
does not add to the message size. Test was passing before but change
in data handling in mpsc_pbuf revealed bug in the test.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
There are scenarios when it is necessary to globally redefine
a log macro. The existing logging frontend is not sufficient since
it redirects at the function level.
One example is using pigweed_tokenzier. The pigweed tokenizer depends
on intercepting log strings at the macro level to function.
Introduce an option to include a custom application provided header
named "zephyr_custom_log.h" at the end of log.h. This allows an
application to extend the LOG_* macros globally.
This change includes a simple test that redefines the core LOG macros
to include a custom prefix.
Signed-off-by: Rob Barnes <robbarnes@google.com>
This replaces the requirement for applications to manually
register MCUmgr handlers by having an iterable section which
then automatically registers the handlers at boot time.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The MKFS portion of the test is still was being included
in the build when it shouldn't because of a file glob
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There were some requests from users for adding the possibility
of setting default openthread tx output power using kConfig.
It is possible by adding the CONFIG_OPENTHREAD_DEFAULT_TX_POWER
kConfig and assigning it to the tx_power variable in the radio.c
file in the Openthread module.
Added the possibility to set default openthread power using
kConfig.
Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The scratch partition is not needed since MCUboot now operates in
swap using move mode instead of swap with scratch, as a result, the
main partitions on Nordic nRF51, nRF52, nRF53 and nRF91 boards can be
expanded to help in fitting large applications to them.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
The PM subsystem should not call the PM control callbacks on
uninitialized devices when entering low-power states.
Signed-off-by: Corey Wharton <xodus7@cwharton.com>
All per-platform prj_*.conf files are the same as prj.conf, so there is no
need to duplicate those configuration files.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
This option is selected by default, so there is no need to select it
explicitly. Additionally, selecting this option for native_posix platforms
results in configuration time warning due to unsatisfied
!NATIVE_APPLICATION dependency.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Remove CONFIG_ARM_MPU=n from all settings tests. This is possible due to
CONFIG_MPU_ALLOW_FLASH_WRITE=y automatically being enabled, which was not
true some time ago.
Enabling ARM MPU allows to detect stack overflows during tests runtime.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Running tests on `nrf52840dk_nrf52840` with ARM MPU enabled results in
following error:
Running TESTSUITE settings_config_fs
===================================================================
I: LittleFS version 2.5, disk version 2.0
I: FS at mx25r6435f@0:0x0 is 16 0x1000-byte blocks with 512 cycle
I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
E: WEST_TOPDIR/modules/fs/littlefs/lfs.c🔢 Corrupted dir pair at \
{0x0, 0x1}
W: can't mount (LFS -84); formatting
E: ***** MPU FAULT *****
E: Stacking error (context area might be not valid)
E: Data Access Violation
E: MMFAR Address: 0x20001f78
E: r0/a1: 0x00000000 r1/a2: 0x00000000 r2/a3: 0x00000000
E: r3/a4: 0x0000b461 r12/ip: 0x00000000 r14/lr: 0x0000da8d
E: xpsr: 0x00003800
E: Faulting instruction address (r15/pc): 0x00000000
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x20000468 (main)
E: Halting system
Increase main stack size to 2kB to prevent stack overflow.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Tests are passing now on `nrf52840dk_nrf52840` platform, just because ARM
MPU is disabled and stack overflow is not detected. When running those
tests on `qemu_x86` there is following error during runtime:
START - test_config_compress_reset
E: Double Fault
E: EAX: 0x0011c1c8, EBX: 0x00000002, ECX: 0x00000002, EDX: 0x0000100a
E: ESI: 0x0000000a, EDI: 0x0021f370, EBP: 0x0021f000, ESP: 0x0021f000
E: EFLAGS: 0x00000202 CS: 0x0008 CR3: 0x0022b000
E: call trace:
E: EIP: 0x001075be
E: corrupted? (bp=0x21f000)
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x11b140 (test_config_compress_reset)
E: Halting system
Same happens on `nrf52840dk_nrf52840` when ARM MPU is enabled:
START - test_config_compress_reset
E: ***** MPU FAULT *****
E: Stacking error (context area might be not valid)
E: Data Access Violation
E: MMFAR Address: 0x20008cb8
E: r0/a1: 0x39beca54 r1/a2: 0x9abe9566 r2/a3: 0xe333d994
E: r3/a4: 0x41387fc2 r12/ip: 0x7c2e5c00 r14/lr: 0xdc5006d9
E: xpsr: 0x81000000
E: Faulting instruction address (r15/pc): 0x0000b50e
E: >>> ZEPHYR FATAL ERROR 2: Stack overflow on CPU 0
E: Current thread: 0x200001d8 (test_config_compress_reset)
E: Halting system
Increase ZTEST stack size to 2kB to prevent stack overflow.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
MKFS testing inappropriately uses flash API in the FAT FS API test,
causing build errors for the test when testing file systems on storage
devices other than flash. Hotfix by making this part of the test
conditional on CONFIG_FLASH.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There is already CONFIG_SETTINGS_FILE_PATH, which is set to full file path,
while CONFIG_SETTINGS_FILE_DIR is required to be set to its parent
directory. This is redundant, as parent directory path can be easily found
out either during runtime or optionally during buildtime by CMake.
CONFIG_SETTINGS_FILE_DIR was actually introduced recently after Zephyr 3.2
release as a replacement of deprecated CONFIG_SETTINGS_FS_DIR. This means,
that there is no need to deprecate it for 3.3 release and dropping it
should be fine. Adjust 3.3 release notes accordingly, so that
CONFIG_SETTINGS_FILE_PATH will be used directly.
This patch stops using deprecated CONFIG_SETTINGS_FS_DIR. There is actually
no value in respecting it, as setting anything other than parent directory
of CONFIG_SETTINGS_FS_FILE makes no sense.
There is actually one use of CONFIG_SETTINGS_FILE_DIR in file backend
tests, to derive directory for files containing tested settings.
CONFIG_SETTINGS_FILE_PATH is not used there, so it makes little sense to
derive directory name from it. Instead, just use hardcoded "/settings"
subdirectory, as this was the default value of CONFIG_SETTINGS_FILE_DIR.
Deriving parent directory can be done either in runtime or in
buildtime (e.g. using some helper CMake function). Doing it in runtime
however allows to create directory recursively (which this patch actually
implements), e.g. for some more nested FS tree structure. Additionally it
will simplify migration of settings configuration from Kconfig to
device-tree (yet to be developed feature).
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Allow allow-cpp.libcxx.arcmwdtlib for all arc targets in case of
ARC MWDT toolchain.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
There is little point in keeping separate:
* tests/subsys/settings/file
* tests/subsys/settings/file_littlefs
directories, `file_littlefs` is just a thin layer used to setup test suites
for tests implemented in `file` directory.
Merge both directories together. Support for new FS can be added by simply
adding:
* new `settings_setup_<FS_OF_CHOICE>.c` which implements
`config_setup_fs()` function
* expanding `testcase.yaml` to add new tests with
`CONFIG_FILE_SYSTEM_<FS_OF_CHOICE>=y` extra config option
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Do some internal renaming to relax dependency on using LittleFS
specifically, making this test likely to be run on any FS.
Rename device-tree partition name `littlefs_dev` ->
`settings_file_partition`, so as does not need to be LittleFS to be
mounted and used for File settings storage.
Rename `config_setup_littlefs()` to `config_setup_fs()`, which can be
implemented for any other FS of choice.
Change FS mount point from '/littlefs' to '/fs'.
Rename `settings_test_littlefs.c` -> `settings_test_fs.c`, as this one just
defines test suites and there is nothing LittleFS specific.
Build `settings_setup_littlefs.c` only when
`CONFIG_FILE_SYSTEM_LITTLEFS=y`, so that any other FS can be added at a
later point with its specific implementation of `config_setup_fs()`
function.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Move `config_setup_littlefs()` prototype to header file, so that potential
type mismatch will be detected by both `settings_setup_littlefs.c`
implementing it and `settings_test_littlefs.c` using it.
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
Replaces ZCBOR_MAP_DECODE_KEY_VAL with ZCBOR_MAP_DECODE_KEY_DECODER
in test and adds equivalency test between
ZCBOR_MAP_DECODE_KEY_VAL and ZCBOR_MAP_DECODE_KEY_DECODER.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The zcbor_map_decode_bulk is able to decode embedded CBOR types
like maps in maps, but this has been missing proper tests.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This file was just built, but none of its functions were executed since the
commit 84a88f107c ("tests: subsys: settings: stream encoding tests"),
which introduced it.
At this point it makes little sense to make it run/working, mainly because
of:
* "line" encoding, which this module intends to test, behaves differently
based on Kconfig options like `bool SETTINGS_ENCODE_LEN`; this is set
differently based on (FCB/File) backend used, so it is hard to make this
"generic" tests work, because it is shared by all storage backends tests
* base64 encoding is expected in this test module, which was dropped 2
years ago in [1]
* settings subsystem has changed a lot during last 4 years, so those tests
might no longer be valid with current implementation.
[1] commit 55be783c85 ("settings: Remove deprecated SETTINGS_USE_BASE64
support")
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>