Commit graph

74494 commits

Author SHA1 Message Date
Keith Short 9664f863eb test: emul: Verify backend API operation
Verify backend API is functional with the emulator subsystem.

Signed-off-by: Keith Short <keithshort@google.com>
2023-01-27 01:01:06 +09:00
Keith Short 6062914cf2 emul: Add support for backend APIs
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>
2023-01-27 01:01:06 +09:00
Keith Short 2d53ce600a emul: add stub driver for emulators
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>
2023-01-27 01:01:06 +09:00
Benjamin Björnsson 500809f8fa drivers: can: can_loopback: Abort pending messages when stopped
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>
2023-01-27 00:58:59 +09:00
Seppo Takalo 03fd995fd5 samples: net: lwm2m_client: Use Ethernet in QEMU Cortex-M3
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>
2023-01-27 00:58:45 +09:00
Johann Fischer cad8ae7597 samples: hci_usb: enable new experimental USB device support
Enable Bluetooth HCI USB tranport layer from new experimental
USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2023-01-27 00:57:22 +09:00
Johann Fischer 5c077d72b5 usb: device_next: add BT HCI USB transport layer
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>
2023-01-27 00:57:22 +09:00
Johann Fischer e60a4efbb0 drivers: udc: do not update MPS for isochronous endpoints
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>
2023-01-27 00:57:22 +09:00
Chamira Perera da3e3d3ed3 drivers: ethernet: stm32: Enabling stats for the driver.
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>
2023-01-27 00:56:06 +09:00
David Leach cde1573619 drivers: entropy: use non-cache intermediate buffer for RNG
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>
2023-01-26 09:46:20 -06:00
Raphael Treccani-Chinelli 3e937da264 bluetooth: host: Added extra options to PAST subscribe
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>
2023-01-26 07:29:19 -08:00
Nicolas VINCENT 06d53b1343 settings fcb: Increase buffer for mcu with large write block size
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>
2023-01-26 22:50:40 +09:00
Tomasz Moń 18e2f44555 MAINTAINERS: Use my dedicated work GitHub account
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>
2023-01-26 21:46:37 +09:00
Jamie McCrae 65124006ca doc: release-notes 3.3: Update MCUmgr transport note
Corrects a note on the revamped bluetooth transport registration.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-26 12:36:16 +00:00
Jamie McCrae 4516e7161c mgmt: mcumgr: transport: smp_bt: Fix wrongly enabling Bluetooth
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>
2023-01-26 12:36:16 +00:00
Robert Lubos 9fef0c521d net: tcp: Remove net_tcp_unref()
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>
2023-01-26 12:34:04 +00:00
Robert Lubos 79461a378c net: tcp: Fix TCP connection ref counting
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>
2023-01-26 12:34:04 +00:00
Robert Lubos c79a25b8f9 tests: net: tcp: Fix a few issues with TCP tests
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>
2023-01-26 12:34:04 +00:00
Robert Lubos 690140baa6 tests: net: socket: tcp: Disable IPv6 ND
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>
2023-01-26 12:34:04 +00:00
Vinayak Kariappa Chettimada 47921588b4 Bluetooth: Controller: Broadcast ISO encryption support
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>
2023-01-26 13:25:11 +01:00
Vinayak Kariappa Chettimada 4d3f8697a3 Bluetooth: Controller: Make PDU octet3 vendor specific
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>
2023-01-26 13:25:11 +01:00
Vinayak Kariappa Chettimada 117bdbbf64 Bluetooth: Controller: Use len instead of length in PDU structs
To be consistent in naming as len instead of length in PDU
struct definitions.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-26 13:25:11 +01:00
Vinayak Kariappa Chettimada f4b4f30596 Bluetooth: Controller: Parse and find BIGInfo to setup ISO sync
Add implementation to parse ACAD and find the BIGInfo before
setting up Broadcast ISO Synchronization.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-26 13:25:11 +01:00
Vinayak Kariappa Chettimada c8f75de1a5 Bluetooth: Controller: Add packing sequential or interleaved comment
Add code comment related to BIG packing sequential or
interleaved being used.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2023-01-26 13:25:11 +01:00
Vinayak Kariappa Chettimada cc1f937d61 Bluetooth: Fix endianness of cryptographic toolbox function h8
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>
2023-01-26 13:25:11 +01:00
Jamie McCrae 069afbe9b3 doc: release-notes 3.3: Add note on python argument parser change
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>
2023-01-26 20:12:36 +09:00
Jamie McCrae d72e135b2b scripts: ci: Enable pylint check for argument parser abbreviations
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>
2023-01-26 20:12:36 +09:00
Jamie McCrae 101ba4ae09 scripts: pylint: Add argument parser abbreviation checker
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>
2023-01-26 20:12:36 +09:00
Jamie McCrae ec7044437e treewide: Disable automatic argparse argument shortening
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>
2023-01-26 20:12:36 +09:00
Fabio Baltieri d428c8c836 scripts: compliance: support not writing output to files
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>
2023-01-26 10:10:58 +00:00
Keith Packard 8f01e4cf22 modules/cmsis: Change libc requirement to allow picolibc
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>
2023-01-26 10:10:45 +00:00
Marin Jurjević 12ce5beacd tests: drivers: adc: add support for nucleo_g070rb
Add support for nucleo_g070rb board to adc_api test.

Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
2023-01-26 10:08:33 +00:00
Marin Jurjević be455e07da boards: arm: add nucleo_g070rb board
Added ST Nucleo G070RB board.

Signed-off-by: Marin Jurjević <marin.jurjevic@hotmail.com>
2023-01-26 10:08:33 +00:00
Seppo Takalo 140e466472 samples: net: lwm2m_client: Allow configuration in Kconfig
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>
2023-01-26 10:06:16 +00:00
Jonathan Rico b30ce53e1c Bluetooth: host: clarify which GATT subscribe flags are internal
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>
2023-01-26 10:05:13 +00:00
Jonathan Rico a7746ad55e Bluetooth: Host: Re-subscribe only after encrypt change
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>
2023-01-26 10:05:13 +00:00
Keith Packard 65427f47cf tests: logging: Stack overflow caught with TLS in log_core_additional
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>
2023-01-26 10:04:33 +00:00
Keith Packard e490fe0f67 tests: kernel: Provide more stack space for context test
This test overflows when TLS is used, provide plenty of extra space to
avoid that.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-01-26 10:04:33 +00:00
Keith Packard 124f10fd9c samples: subsys: zbus: Avoid stack overflow with TLS
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>
2023-01-26 10:04:33 +00:00
Keith Packard 0ee0e6562a sample/zbus: qemu_nios2 needs faster tick for zbus test with picolibc
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>
2023-01-26 10:04:33 +00:00
romain pelletant 14bcc859ca kernel: k_msgq: add peek at function
Make message queue able to peek data at the specified index.
Related to issue #53360

Signed-off-by: romain pelletant <romainp@kickmaker.net>
2023-01-26 10:00:29 +00:00
Björn Stenberg 0321ac8dbf json: Increase max number of descriptor elements from 30 to 62
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>
2023-01-26 09:51:54 +00:00
Mario Jaun ca3b8c5adb dts: stm32: add UART5 for STM32G4
According to the reference manual, all STM32G4 variants except
STM32G431/STM32G441 have the UART5 peripheral.

Signed-off-by: Mario Jaun <mario.jaun@gmail.com>
2023-01-26 09:40:44 +00:00
Brian Juel Folkmann d0a7ab529d samples: spi_flash: Add option to test multiple sectors
Add tests for erase of multiple consequtive sectors.

Signed-off-by: Brian Juel Folkmann <bju@trackunit.com>
2023-01-26 09:39:59 +00:00
Brian Juel Folkmann 8d11d183f6 drivers: flash: bug fix stm32 ospi flash erase
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>
2023-01-26 09:39:59 +00:00
Armin Brauns 219dd436d1 drivers/clock_control: stm32l4: allow enabling MCO output
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>
2023-01-26 09:39:33 +00:00
Armin Brauns 706f5caf0e drivers/clock_control: stm32f7: allow enabling MCO outputs
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>
2023-01-26 09:39:33 +00:00
Hein Wessels 1480b2083e tests: bluetooth: edtt_ble_test_app: NATIVE_TASK has no return value
Remove the return value of edtt_stop because it's ignored by NATIVE_TASK.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
2023-01-26 09:30:36 +01:00
Hein Wessels 3293d8057d soc: posix: inf_clock: add C++ support to NATIVE_TASK
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>
2023-01-26 09:30:36 +01:00
Alberto Escolar Piedras 26349193ab manifest: Use latest HW models with AES_CCM HEADERMASK support
Feature needed for BT LE Audio ISO encryption

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-01-26 09:29:18 +01:00