Add a device driver to read events from a Linux evdev device node and
inject them back as Zephyr input events.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Not clearing that lock lead to the fs_mgmt commands being useless, after
the mgmt callback returned `MGMT_CB_ERROR_RC` once, since the lock is now
occupied and never cleared.
Fixes#66581
Signed-off-by: Ruben Völl <ruben.voell@grandcentrix.net>
Add DT overlay to be able to support and test UDC DWC2 driver
(snps,dwc2) on nucleo_f413zh board. This disables STM32 shim
driver described and configured on the SoC and board level.
Obviously,it should work with other STM32F4 boards as well and we
could have a mechanism to apply it generically using snippets.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The driver currently supports only dedicated FIFO mode (with
dynfifosizing if enabled). Control, bulk and interrupt transfers are
supported, isochronous transfers are not yet supported. The driver
accesses controller registers using sys_io.h, but for debugging purposes
one can get a register map from the driver's config, similar to the
usb_dc_dw.c driver.
Initial support also has vendor quirks for the STM32F4 SoC family.
Tested on NUCLEO-F413HG.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Use new common header and remove usb_dw_registers.h.
No functional changes, only renaming of registers and field identifiers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This header is based on drivers/usb/device/usb_dw_registers.h and
describes registers of the DWC2 controllers IP and is intended for use
in both device controller drivers and a host controller driver. The
difference to usb_dw_registers.h is that this header does not confuse
offsets with bit positions, contains all the definitions required for
device mode, has register and bit field names identical to the databook
and no annoying underscores.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit adds implementation of GDB stub for 32-bit ARM. It has been
tested only on the Zynq-7000 SoC and I would like to get any feedback
from others.
The stub still has these issues:
- To implement single stepping, it uses instruction address mismatch
breakpoint, as recommended in ARMv7 reference. The breakpoint control
register is configured (the state control fields) for the "PL0,
Supervisor and System modes only" option. Otherwise the breakpoint
would also halt the processor in abort mode, in which the stub loop
runs. Zephyr kernel runs in the system mode. This works well until the
kernel enables interrupts, as interrupt handlers typically run in
Supervisor mode. Single stepping therefore sometimes "catches" a
handler instead of the next application instruction. I have not tried
User mode, because Cortex-A SoCs do not appear to have the
ARCH_HAS_USERSPACE flag.
Cc: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
This commit adds a devicetree overlay file and an extra condition in the
CMakeLists.txt file to allow remote debugging for the qemu_cortex_a9
board.
Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
If GDBSTUB is enabled and the kernel runs in tickless mode, the timer
must not convert the delta cycles to a 32-bit data type (cycle_diff_t in
this case). The delta_ticks variable would overflow and the next timeout
would be set before the current timestamp, thus generating an interrupt
right after leaving the handler. As a result, the system would receive
tens of thousands of interrupts per second and would not boot.
Cc: Michal Sojka <michal.sojka@cvut.cz>
Signed-off-by: Marek Vedral <marek.vedral@gmail.com>
rtc_get_time() on STM32 does not implement the -ENODATA return code.
This prevents testing the initialisation status of the RTC.
Fixed by reading INITS flag and adding a error path in
rtc_stm32_get_time().
Signed-off-by: Adrien Bruant <adrien.bruant@aalberts-hfc.com>
This reverts commit bffa0c6bdd.
This FIFO implementation causes a regression by which the SPI
peripheral generates several spurious SCK cyles after the last
data has been sent.
Signed-off-by: Daniel Gaston Ochoa <dgastonochoa@gmail.com>
Pin configuration value generated by RA_PINCFG_xxx macro is incorrect if
pin number is greater than 9 due to a mistake in the pin numbering.
Signed-off-by: Ian Morris <ian.d.morris@outlook.com>
pm_suspend_devices() could return an error. Set timeout using
sys_clock_set_timeout() to after this error is handled so that
we have the accurate power state when calling the timeout function.
This is useful in cases where we wish to compensate the
system timer for certain power modes.
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
Adds test that verifies correct Proxy advertisement behavior for
a device where the Proxy adv requirements changes over time,
both for single and multiple subnets.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
Refactors proxy advertising implementation to allow fair sharing of
advertising resources between all subnets.
In the new implementation, each subnet is agnostic to any other subnet
that might have active proxy advertisement work. When proxy
advertisement is triggered, the implementation will first check how
many subnets that has active work. If there are more than one active
subnet, a maximum timeslot will be calculated to ensure that all active
subnets get access to the medium. The implementation will then poll
the next eligible subnet for a proxy advertising request. If the
duration of this request exceeds the maximum timeslot, the duration
for the next advertisement will be set to the maximum value.
If a proxy advertisement for a subnet is interrupted by other
advertising activity, the implementation will now ensure that the
interrupted proxy adv continues from the point where it was
interrupted so that the subnet gets to utilize the entire allocated
timeslot.
This PR also alters the priv_proxy_net_id_multi Bsim test to align
with the refactored proxy advertising scheme.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
The section 3.7.3.1 of the mesh specification recommends to delay
a message publication in certain cases:
- at power-up or upon state change for a time between 20 to 500 ms
- for periodic publications for a time between 20 to 50 ms
This change implements this recommendation by adding the
`CONFIG_BT_MESH_DELAYABLE_PUBLICATION` Kconfig option which enables
the randomization code and by adding the `bt_mesh_model_pub.delayable`
bit field which allows each model decide whether the publications
should be delayed for this model or not.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
Its default value (100 ms) resulted in PDUs big enough to never make it
through on a slow enough UART (e.g. ~1152-byte PDUs on a UART@115200).
The UART TXs were silently aborted.
A no-timeout value is now allowed and made the default.
Additional warnings are logged when it is likely that a UART TX
was aborted due to a too low timeout for the used baud rate.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
- Disable UART when the PPP interface is brought down.
This prevents an error when it is next brought up.
- Change the level of certain logs to be less concerning
and less verbose.
- Fix warnings regarding the passed parameter types of %p conversions.
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
* Add a subsection linking to the emulators section.
* Added more internal links
* Fixed EPROM simulator/emulator mix, and added link
to simulator
* For the RTC peripheral, mention there is no driver for
it yet.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Zephyr does not support MLDv1 (which has a shorter header than MLDv2),
and this resulted in log errors being printed on header access if MLDv1
queries were received. Since receiving such packet is not really an
error, just drop it silently.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add an entry to indicate the changes to the coap_service_send and
coap_resource_send API functions.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
Update coap_service_send and coap_resource_send to take an optional
pointer argument to the newly introduced coap_transmission_parameters.
Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
AP enable takes the same parameters as connect, so, update the help and
also fix the optional parameter count when security is involved.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Updates the app_kernel benchmark so that its default configuration
does not enable timeslicing. As it is still valuable to know what
kind of performance overhead is incurred by enabling timeslicing,
new test configurations have been added.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Updates the latency_measure benchmark so that its default
configuration does not enable timeslicing. As it is still
valuable to know what kind of performance overhead is
incurred by enabling timeslicing, new test configurations
have been added.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
Add a config entry for the keyboard matrix thread priority. This
changes the current default, but that was pretty much an arbitrary numbe
anyay and the exact one should be picked the application so it should be
alright to do so.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Add power management support to the gpio keys driver. When in suspend,
disable all the button gpios and interrupts.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Removes the _mailbox from the k_mbox_msg structure. This field
is not used and only existed for legacy API support while Zephyr
was transitioning from the split microkernel/nanokernel to the
current unified kernel design.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
As the pointer to the data buffer passed to k_pipe_put() is now a
'const', that buffer must be initialized before calling k_pipe_put()
to avoid a compiler warning.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
The pointer parameter 'data' in the function 'k_pipe_put()' ought to
use the const modifier as the contents of the buffer to which it
points never change. Internally, that const modifier is dropped as
both 'k_pipe_get()' and 'k_pipe_put()' share common code for copying
data; however 'k_pipe_put()' never takes a path that modifies those
contents.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This is just as arbitrary as what was before, but simpler.
Before this change, the callback were invoked upon receiving the num
complete packets event.
This did not necessarily work with all spec-compliant controllers.
Now the callback is invoked as soon as the lower layer destroys the
buffer. ATT shouldn't care whether L2CAP sends it over RFC1149 or
something else after that point.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Why?
- metadata is easier to manage as an array + index
- less error-prone -> less memory-management bugs
- we can. because of the previous refactor
- PDU allocations are more predictable
- ATT buffer size can be optimized by app
- isolates ATT from the rest of the ACL users
- decouples ATT PDU size from e.g. SMP w/ LESC
Drawbacks:
- higher memory usage
- kconfig change
The higher memory use is only temporary, as this will be followed-up
with more refactors that should bring it back down.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Resolve wrong documentation c function links for
irq: z_shared_isr, rtio: rtio_cqe_get_mempool_buffer
and sensor: sensor_read
Signed-off-by: Simon Hein <Shein@baumer.com>
Firstly, COMMENT does not work for ninja.
Therefore, change COMMENT to echo.
With the addition of sysbuild, several memory reports can be printed
for one build.
Because of this, it is useful to know which executable each memory
report is printed for, so adding full path to elf file.
Signed-off-by: Sigurd Hellesvik <sigurd.hellesvik@nordicsemi.no>
Add the possibility to flash stm32f429i_disc1 board using
STM32CubeProgrammer & patch the OpenOCD cfg.
Signed-off-by: Abderrahmane Jarmouni <abderrahmane.jarmouni-ext@st.com>
Allow using the C pre-processor to generate a
`rimage/config/platform.toml` file from a "source"
`rimage/config/platform.toml.h` file.
This is optional and fully backwards compatible.
To use, do not use `-c` and point west sign at a configuration directory
instead or let it use the default `rimage/config/` directory and change
the files there.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
rimage is very verbose by default and has no -q(uiet) option, so saving
one line out of more than 100 lines is pointless.
RimageSigner.sign() was already very complex and suffering from
combinatorial explosion of parameters. With .toml
pre-processing (#65411) it's getting worse, so we really need all build
logs to show the complete rimage command.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In the following command, the first argument `for_rimage` is passed to
`rimage` whereas `--for west` goes to west.
```
west sign for_rimage --for west
```
This is somehow valid but we really don't want anyone to do that.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero functional change, preparation for the .toml modularization.
RimageSigner.sign() is also way too long and too complex and this helps.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
`west sign` has been invoked by `west build` (through CMake) since
commit fad2da39aa, almost one year ago. During that time, this new
workflow has been refined and successfully used by at least two vendors,
multiple CIs across both SOF and Zephyr and many developers.
At the time, the ability to sign from `west flash` was preserved for
backwards compatibility. This means rimage parameters can come from many
different places at once and that rimage can be invoked twice during a
single `west flash` invocation!
Now that Zephyr 3.5 has been released, we need to reduce the number of
rimage use cases and the corresponding validation complexity and
maintenance workload to simplify and accelerate new features like
splitting rimage configuration files (#65411)
Signed-off-by: Marc Herbert <marc.herbert@intel.com>