Instead of passing target states, use actions for device PM control.
Actions represent better the meaning of the callback argument.
Furthermore, they are more future proof as they can be suitable for
other PM actions that have no direct mapping to a state. If we compare
with Linux, we could have a multi-stage suspend/resume. Such scenario
would not have a good mapping when using target states.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The verb tense for the suspended state was not consistent with other
states. The likely reason: state was being used as a command/action.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Since the state is no longer modified by the device PM callback, just
use the state value.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The callback is now invoked to set the device PM state in all cases, so
the usage of ctrl_command is redundant.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The device PM subsystem already holds the device state, so there is no
need to keep duplicates inside the device. The pm_device_state_get has
been refactored to just return the device state. Note that this is still
not safe, but the same applied to the previous implementation. This
problem will be addressed later.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Test for dropping log messages was expecting certain number of
dropped messages assuming that buffer size is dividable by the
message size. That was not the case when timestamp was 64 bit.
In that case, additional message is dropped.
Modified the test to take that into account.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add a real board/SoC that supports power mgmt on the STM32 side to
get some additional coverage and hopefully catch any build issues
in the future.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Define SoC hooks as weak symbols so this way applications can
overwritten them defining strong symbols.
The problem is that currently SoCs are defining these interfaces as
strong symbol inhibiting the possibility of applications bring their
own implementation.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The callback is not used anymore, so just delete it from the pm_control
callback signature.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
the device PM callback is not used anymore by the device PM subsystem,
so remove it from all drivers/tests using it.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Move all PM_DEVICE_STATE_* definitions to an enum. The
PM_DEVICE_STATE_SET and PM_DEVICE_STATE_GET definitions have been kept
out of the enum since they do not represent any state. However, their
name has not been changed since they will be removed soon.
All drivers and tests have been adjusted accordingly.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
CONFIG_DEBUG_OPTIMIZATIONS should not be enabled by default in
prj.conf for tests or samples. Remove it from a few places that it
is.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
In order to increase test coverage, this commit updates the libcxx test
to run with both full and nano variants of the newlib.
Note that C++ exception handling feature is only enabled for the newlib
full variant because the nano variant does not support C++ exception
handling.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Use the full version of newlib (i.e. not nano) for libcxx testing since
some features (e.g. C++ exception handling) require the full version of
newlib.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This board was added to test coverage feature when coverage was
introduced. This is now being testing with other boards and
configurations on a regular basis, so no need for this extra overhead in
CI.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit updates the filter for cpp.libcxx.exceptions test to allow
testing on all architectures except the ones that are known to be
broken (see #32448).
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
Increasing ZTEST_STACKSIZE to 4096.
This ensures that the riscv32 platforms can succesfully execute the
C++ exception test cases.
Also add the following platforms to allow list:
- qemu_arc_em
- qemu_arc_hs
- qemu_cortex_m0
- qemu_cortex_m3
- qemu_cortex_r5
- qemu_riscv32
- qemu_x86
- qemu_xtensa
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Most APIs have the default synchronous and an asynchronous version
with the sufix _async because that is the most common use.
All devices in tree right now are using the synchronous version, so
just change it to be consistent with the rest of the system.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
- Test two threads changing states concurrently
- Test multiple calls to get/put
- Test async / sync API
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
One of subtests had been supposed to check if log files are numbered
properly and in continuous manner, but due to logic error it would
also count non-log files.
Fixes: #33629
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The board definition provides partition configuration that is enough
for this test and does not require overlay.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Mock backend is using 32 bytes for hexdump data and
only hexdumps with less data shall be compared against
expected one. Wrong operator was used and comparing
was performed only when hexdump size exceeded 32 bytes.
Spotted by Coverity CID 236015.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Move assert check before array access to ensure that
negative index is not used in an array. Coverity CID 222151.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
There was an accidental early return in the test. Spotted by
coverity CID 235986, 236006.
Additionally, test had to be fixed because early returned covered
issues.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
When immediate mode is used CONFIG_LOG_BUFFER_SIZE is not defined
in kconfig. For proper compilation it is then defined in the test
file. Use positive value to please coverity which complains about
dead code when it is set to 0. Fixing CID 235961, 235965.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The nrf5340 cpunet based builds are excluded from this test and a new
platform bl5340_dvk_cpunet was added that needs to be excluded.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move the code responsible for aligning the flash write by writing fill
values - from stream_flash_buffered_write to flash_sync. This avoids
having to correct buf_bytes/buf_written after the write and thus
simplifies error handling.
This commit also fixes an issue where the write length passed to the
callback in flash_sync includes the fill length.
Signed-off-by: Jonathan Nilsen <Jonathan.Nilsen@nordicsemi.no>
Remove this intrusive tracing feature in favor of the new object tracing
using the main tracing feature in zephyr. See #33603 for the new tracing
coverage for all objects.
This will allow for support in more tools and less reliance on GDB for
tracing objects.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The context parameter used across device power management is
actually the power state. Just use it and avoid a lot of
unnecessary casts.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Puts all filter in common section and fix filters. Platforms in
integration_platforms must also be allowed first, otherwise the tests
will never run.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Test was failing because of uninitialized variable and wrong
pointer being used (pointer to char).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>