The emulator structure currently initializes a bus-level API that is
used to communicated register accesses to the emulator from the parent
bus.
Add support for declaring a backend API for emulators. This provides
tests a common way to interact with emulators of the same device type.
Signed-off-by: Keith Short <keithshort@google.com>
Not all emulators correspond to a real driver. Notably some tests don't
require a real driver. Provide a macro that initializes a stub driver.
Signed-off-by: Keith Short <keithshort@google.com>
This commit aims at updating the drivers stop function to better
follow the CAN header file which specifiec that stopping the CAN
controller should "abort any pending CAN frame transmissions".
Signed-off-by: Benjamin Björnsson <benjamin.bjornsson@gmail.com>
By default, qemu_coxtex_m3 target selected SLIP driver as
a network backend. This requires some unstandard tool (tunslip6),
which are error prone and might not necessary work.
Ethernet backend work equally well as in native_posix so
use the same for both.
Change the default emulation platform from X86 to Cortex-M3
because it supports Ethernet by default.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add Bluetooth HCI USB transport layer implementation for the new
experimental USB device support based on the existing implementation
subsys/usb/device/class/bluetooth.c.
This implementation, unlike existing one, contains the interface
descriptors for isochronous endpoints. Since we do not support voice
channels, these are just there to avoid issues with Linux kernel btusb
driver when this implementation is part of a composite configuration.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Zero data payload size for isochronous endpoints is a
is a valid setting for default interface.
Also do not update MPS of control endpoint since it is
set by the driver.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
The change enables the ethernet driver to save statistics in a
structure in the ethernet driver API structure. In addition, the
change also attempts to update error statistics based on errors
reported in the STM32 ethernet HAL API.
Fixes#53995
Signed-off-by: Chamira Perera <chamira.perera@audinate.com>
The CAAM hardware needs to read RNG values into a non-cache
buffer. Since the contract to Zephyr RNG functions do not
require non-cache buffers, we use an intermediate non-cache
buffer to retrieve results.
Added a Kconfig to control the size of the intermediate buffer.
Fixes#53035
Signed-off-by: David Leach <david.leach@nxp.com>
allow disabling reports (synchronise but don't generate sync reports)
and allows enabling sync reporting with filtering of duplicates.
the default option remains to establish sync, with sync reports,
but without duplicate filtering.
Signed-off-by: Raphael Treccani-Chinelli <raphael.treccani@nordicsemi.no>
Devices with write block size greater than 16 could not use settings_fcb
due to small buffer size.
Update value in test as well.
Signed-off-by: Nicolas VINCENT <nicolas.vincent@vossloh.com>
While GitHub encourages using single account for both personal and work
purposes (even recommends merging multiple accounts into one), there are
some serious downsides when doing so.
The biggest disadvantage of using one account is the inability to select
which email address the "Rebase and merge" action will use. GitHub, at
least as of today, always uses primary email address for "Rebase and
merge" action.
Another issue is selecting email for notification based on organization.
Custom email routing can only be configured if you are organization
member (or at least outside collaborator). While this works reasonably
fine for zephyrproject-rtos organization, I cannot route e.g. mcu-tools
organization emails to my work email.
To avoid the issues I have decided to use dedicated GitHub account for
my Nordic Semiconductor related work activities: tmon-nordic
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Bluetooth does not need to be enabled to register services,
therefore the newly introduced automatic bluetooth SMP transport
registration system can be simplified by returning enabling of
bluetooth back to the application.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
There is a pending TODO regarding unifying net_tcp_unref() and
net_tcp_put(). Given that net_tcp_unref() is no longer used by the upper
layer (it should only use get/put APIs), the function can be removed
from external TCP API, as referencing/dereferencing is now only used
internally by the TCP stack.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The net_context/TCP connection context ref counting needed to be fixed,
to avoid situation where TCP connection context could be released
before net_context is released.
Generally, this commit modifies the ref counting of the above as
follows:
* net_context is referenced both by the application and TCP stack, when
created.
* TCP context is referenced by the application when created. The TCP
stack adds ref to the TCP context only after connection has been
established.
* TCP stack needs to call the final upper layer callback when connection
is closed, but before the TCP context is released (i. e. to give upper
layer chance to dereference the context on its side). For this,
tcp_conn_close() was introduced which is called from within TCP stack
instead of directly dereferencing the TCP context.
* TCP stack dereferences the net_context only after the TCP context has
been released (i. e. upper layer has dereferenced TCP context on it's
side and connection has been tear down, if established).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The net_context-based TCP tests required some adjustments/fixes:
* seq number was not incremented for the final ACK after FIN
* accepted net_context was not dereferenced (with net_context_put())
* net_context_put() should be used instead of net_tcp_put(), as it's the
net_context that is allocated in the test (with net_context_get())
* out of order tests depend on each other, therefore it must be assured
they're executed in the correct order
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
There is a test case which verifies that no new packets show up on the
interface, assuming that the only source of the packets is TCP stack.
ND protocol could interfere with that assumption, sending
advertisements.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Implementation of Broadcast ISO encryption using crypto
toolbox function h8. And support for encryption in lower
link layer for nRF5x series.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Make Data, ISO, BIS and CIS PDU structure's octet 3 vendor
specific.
This will allow vendors not supporting the octet 3 or
CTEInfo (8 bits) to save 1 octet in their PDU structures.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation to parse ACAD and find the BIGInfo before
setting up Broadcast ISO Synchronization.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Convert endianness of supplied parameters before calculating
the AES-CMAC. Bluetooth stores values in little-endian and
crypto traditionally operates on big-endian storage.
Relates to commit e9c542ab5b ("Bluetooth: Add the
cryptographic toolbox function h8").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Adds a note that python command line argument abbreviations have
been disabled, are no longer allowed in future and instructions of
how to update out-of-tree scripts that used abbreviated arguments.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Enables running CI checks which will now search for initialisation
of argument parser where abbreviations are not disabled.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Adds a pylint checker for ensuring that the argument parser
library is setup with abbreviations disabled.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Disables allowing the python argparse library from automatically
shortening command line arguments, this prevents issues whereby
a new command is added and code that wrongly uses the shortened
command of an existing argument which is the same as the new
command being added will silently change script behaviour.
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
Support running the compliance check script without writing the output
to any file.
This adds a check for the --output flag to not write to the output file
if the value is empty, and add a second flag for inhibiting the
individual case files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Change from depending on newlib to requiring a full libc, this allows use
with picolibc or any other C library providing a complete implementation.
Signed-off-by: Keith Packard <keithp@keithp.com>
Allow endpoint name, PSK and TLS tag and server address
to be configured in Kconfig.
When endpoint name is not defined, use CONFIG_BOARD.
Also use endpoint name as a PSK ID instead of hard coded
"Client_identity" which would collide if more than one instance
is ran against same server. Now we could define different identity
for each endpoint.
Also, as a mininal refactor, allow DNS names to be used in
server address, instead of assuming IP address.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Add a note to the GATT subscription flags' docstring to indicate what flags
are used internally and are not part of the API.
We might want to move them in their own struct member, something like
`internal_flags` in a subsequent change.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Wait until encrypt change to trigger the re-subscription quirk.
Otherwise it could fail with insufficient security.
Also gate it behind a kconfig to make apparent its dependencies:
If `add_subscriptions()` is executed in the first place, that means that
the device was bonded and thus that it has to encrypt the link eventually.
`BT_GATT_AUTO_SEC_REQ` should take care of that.
Also add a new flag to `bt_gatt_subscribe_params` to not send the same CCC
write multiple times in some cases.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
When thread local storage is enabled, log_core_additional generates stack
overflows in the main thread on several architectures. Increase the stack
size to 4096 bytes for this thread.
Signed-off-by: Keith Packard <keithp@keithp.com>
Enabling TLS increases stack usage by a small amount as that is where any
TLS variables are stored. When enabled, this sample ends up overflowing the
512-byte subscriber task stack and the IDLE_STACK_SIZE consumer stacks
Replace the fixed 512-byte subscriber stack allocation with
CONFIG_MAIN_STACK_SIZE so that it adopts a value controlled by the
configuration in case it needs to be adjusted further.
Increased CONFIG_IDLE_STACK_SIZE to 1024 to provide more space in each
consumer stack.
Signed-off-by: Keith Packard <keithp@keithp.com>
Picolibc is enough faster than the minimal C library that the zbus
benchmark will likely complete in well under 10ms on qemu_nios2. As this
target cannot provide a clock at higher resolution than the system tick, we
need to increase that rate to get a non-zero runtime for this benchmark.
Add new nios2-specific config variables that change the
CONFIG_SYS_CLOCK_TICKS_PER_SEC value, leaving all other platforms using the
standard value. We cannot just increase it for every platform as
qemu_arc_hs6x fails with a 1kHz rate.
Signed-off-by: Keith Packard <keithp@keithp.com>
The limiting factor is the output bitmask that says which elements have
been filled in by the parser. This patch changes the bitmask type from int
to int64_t.
Signed-off-by: Björn Stenberg <bjorn@haxx.se>
According to the reference manual, all STM32G4 variants except
STM32G431/STM32G441 have the UART5 peripheral.
Signed-off-by: Mario Jaun <mario.jaun@gmail.com>
This commit fixes a bug in the STM32 ospi flash driver when attempting
to erase an area that spans more than one erase sector.
Without this fix, only the first sector is actually erased, the rest
silently fails the erase.
Issue is that the write enable latch command is only sent for the first
erase command.
Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
This enables the MCO clock output pin to be configured through Kconfig on
stm32l4 devices.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
This enables the MCO clock output pins to be configured through Kconfig on
stm32f7 devices.
Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
Explicitly define function pointer as (void*)() and not (void*).
In C this cast is done implicitly, but C++ does not allow it.
Also, the const is moved to the correct location. Now it's a constant
pointer to a function(void) that returns void, instead of a pointer
to a function(void) returning (const void).
Signed-off-by: Hein Wessels <heinwessels93@gmail.com>