Rewrite the "net ping" command handling, to allow the command to be
aborted during execution. This includes:
* Using shell bypass mode to capture input whilst the ping is active.
* Using system workqueue to send individual ping requestes, instead of
sending ping requests directly from shell thread, in a blocking
manner. This is needed because in order to receive input in the
registered bypass handler, the shell thread must be unblocked to
process the input.
* The bypass mode is left after receiveing `CTRL-C` character (which
cancels the ping), after receiving all expected Ping replies or after
the timeout occurs.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If bypass mode is left outside of the registered bypass handler, the
command buffer was not cleared, basically containig leftovers from the
processing of the previous command. This resulted in undefined behaviour
on consecutive shell operations.
Signed-off-by: Robert Lubos <robert.lubos@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>
The address could have changed. The issue linked (and bsim test in previous
commit) shows a scenario where that could happen:
- we start scanning, host will use NRPA
- we start advertising, host will use identity address
- a device connects (as a central)
-> advertising resume fails for some unrelated reason
- another device connects (as a peripheral)
- the central device disconnects, we resume scanning
- the peripheral disconnects, the stack resumes advertising
-> but it mistakenly advertises using the NRPA set by the scanner
Fixes#52059 .
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Prior to #41602, due to the ordering of operations (first mul,
then div), an intermediate value would overflow, resulting in
a time non-linearity.
This test ensures that time rolls-over properly.
Signed-off-by: Chris Friedt <cfriedt@meta.com>
On some STM32 series (H7, MP1), iwdg and wwdg have multiple instances.
Due to current driver implementation, these wdg instances were not
checked in the function.
Fixes#53002
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Adds two additional alh2 and alh3 "devices" to already defined
alh0 and alh1. This (seems) is a temporarily solution as
the hardware actually supports 16 streams and future update
to device tree is required.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
This patch makes IMR context save an option that can be enabled. By
default FW, after D3 state transition, will be boot using normal flow.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Add support for 3 connections. Mainly we need to support
at least 2 connection to use the CSIP Set Coordinator role,
but some sets may also be 3 or even larger.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Implement usb_dc_wakeup_request for STM32 USB DC and default to enable
remote wakeup functionality when the drivers is selected.
This allows the device to wake the host up by calling
usb_wakeup_request().
Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.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>
Add support for virtual USB host controller intended for use
together with virtual bus and virtual device controllers.
This driver is not an emulation of any real host controller.
The driver has initial support for handling control and bulk
transfers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add support for virtual USB device controller intended for use
by virtual bus and virtual UHC controllers. This driver is not
an emulation of any real host controller.
The driver has initial support for handling control and bulk
transfers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add support for virtual USB bus (UVB) intended for use
by virtual UDC and UHC controllers. UVB is not an emulation
of the USB bus or protocol but a simplified service to connect
a virtual host controller to one or more virtual device
controllers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This is initial support. Necessary to test the UHC driver API,
for the USB support test implementations, and upcoming USBIP support.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add common layer of UHC API and MAX3421E host controller driver.
This implements the bare minimum necessary to communicate with
one peripheral device.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Moved the name filter last, as that it the most expensive
to use.
The address filter has almost been moved after the more
trivial checks.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Move the check for the pa_interval to before we start
parsing the data for the name, as that is more optimized.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add filtering for the pa_interval. This can be used to
easier find devices that are advertising with periodic
advertising.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Enable Zephyr device runtime power management mechanisms in Intel HDA
DMA driver. This allows Zephyr to track usage reference for power domain
gating.
PM action handler is currently empty and will be fill out later.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
The status field is currently a uint32_t even though there are only
3 possible values. Reducing it to a uint8_t allows status to fit in
existing padding in the struct, saving 4 bytes per ticker_user_op
Updated function signatures to match; ticker_op_func left as-is
to avoid having to update a whole bunch of files for no real benefit
Signed-off-by: Troels Nilsson <trnn@demant.com>
Add entries for the BUCK0/1/2/3 and LDO0/1 regulators. Note that voltage
min/max limits have been set to the hardware limits. They can be
adjusted using overlays in applications, depending on the consumer
circuit constraints.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
There's now two google_* boards in the repository and it looks like we
are going to keep a common prefix for these.
Add an explicit maintainer entry for these with Keith and I as
maintainers so that PRs against these will get reviewers and assignees.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Update documentation for imxrt boards to reflect the default clock
source being systick, and clarify that the GPT timer will only be
used in low power modes. Add a build time warning when the GPT
timer is enabled, so that the user will be aware of the resolution
tradeoff when using the GPT timer.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Switch all imxrt boards to use the systick timer by default, and only
enable the GPT timer when using low power modes. This is desirable
because the systick has a higher resolution, but the GPT can run
while the core clock is gated, making it useful for low power modes.
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
To be able to call pm_device_runtime_put() from an IRQ context, move
from mutexes to semaphores and force the async path when the put
operation is called from an ISR.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>