Commit graph

84824 commits

Author SHA1 Message Date
Henrik Brix Andersen 9783ed56d9 dts: bindings: can: deprecate the sjw and sjw-data properties
Update the descriptions for the various CAN devicetree timing properties
specified in Time Quanta (TQ) to make it clear that these, if present, are
only used for the initial timing parameters.

Deprecate the (Re-)Synchronization Jump Width (SJW) devicetree properties
for both arbitration and data phase timing as these are now only used in
combination with the other TQ-based CAN timing properties, which are all
deprecated.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-09-28 16:28:56 +02:00
Henrik Brix Andersen a9d3935fa0 drivers: can: solely use sjw from devicetree for initial timing
Update the CAN controller drivers to solely use the sjw and sjw-data
devicetree properties for setting the initial timing when devicetree timing
parameters are specified in Time Quanta (TQ).

Any timing set via the CAN timing APIs will contain either user-provided or
automatically calculated SJW values. This includes any timing parameters
calculated from bus-speed and bus-speed-data devicetree properties.

Update the CAN controller driver tests accordingly and remove the
CAN_SJW_NO_CHANGE definition as it has lost its meaning.

Fixes: #63033

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-09-28 16:28:56 +02:00
Henrik Brix Andersen e397b85eb8 drivers: can: calculate a default SJW value
Change the CAN timing calculation APIs to automatically calculate a default
(Re-)Synchronization Jump Width (SJW) value. The calculated value can be
overwritten by the caller if desired.

This allows automatically scaling the SJW according to the number of Time
Quanta (TQ) used for phase segment 2 instead of relying on a compile-time
fallback value defined in devicetree.

This reduces the can_set_timing()/can_set_timing_data() API functions to
simple setters (with validation).

Fixes: #63033

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-09-28 16:28:56 +02:00
Dominik Ermel e48354455a mgmt/MCUmgr/grp/os: Add booloader info support
Adds command allowing to query information on bootloader.
In this case support is provided to query MCUboot information.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-28 16:27:45 +02:00
Dominik Ermel 7668b4fbb3 doc/services/device_mgmt: Bootloader info request definition
Specification for MCUmgr OS group command allowing to query
for bootloader information.
Provide information on supported MCUboot parameters query by MCUmgr
group OS.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-28 16:27:45 +02:00
Dominik Ermel 83d69f50ad doc/release-notes: MCUboot overwrite mode Kconfig info
Note on CONFIG_MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-28 16:27:45 +02:00
Dominik Ermel 5d28fdea63 modules/MCUboot: Add overwrite mode for MCUboot
Add MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY mode.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-28 16:27:45 +02:00
Daniel Leung 9686f6e000 kernel: do not expose z_tls_current in kernel.h
This moves the declaration of z_tls_current inside
k_current_get() so it will not be exposed as a public
variable.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-28 16:15:46 +02:00
Daniel Leung 0a50ff366e kernel: rename z_current_get() to k_sched_current_thread_query()
The original idea of z_current_get() was to be the counterpart
of k_current_get() when thread local variable for current has
not been initialized if TLS is enabled, otherwise they are
the same function. Now since z_current_get() is being used
outside of core kernel, rename it under kernel namespace so
other subsystem can conceptually use them too.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-09-28 16:15:46 +02:00
Keith Packard 41e8b44619 kernel: Make thread 'init_delay' k_timeout_t rather than int msecs
Storing this value in milliseconds rather than using k_timeout_t requires
the system to perform division at runtime to convert types. This pulls in
the 64-bit soft division code on platforms without hardware for this.

Perform the conversion at build time instead by using the runtime time
directly.

The init_delay field was moved within the _static_thread_data structure to
avoid introducing a hole for alignment on 32-bit systems when using 64-bit
timeouts.

Use SYS_TIMEOUT_MS instead of K_MSEC so that the initial delay can be set
to forever.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-28 16:15:27 +02:00
Keith Packard 477bf558de west: Pull in espressif linker alignment fix
This PR fixes the espressif esptool to deal with ELF section alignment
which would otherwise create holes in the resulting binary.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-28 16:15:27 +02:00
Keith Packard 4269bbc4ea test/kernel: Adjust timer test to deal with time_units macros
All of the time_units conversion routines are now macros which means the
test cannot reference them as functions. Instead, create local static
functions which call each one of them and use those instead.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-28 16:15:27 +02:00
Keith Packard 9c47239264 sys/time_units.h: Make SYS_TIMEOUT_MS usable as constant initializer
To make this macro usable as an initializer for static or global data, it
cannot have struct values within the expression, instead it must compute
the tick value as a primitive value and then wrap that in the struct as the
final step.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-28 16:15:27 +02:00
Keith Packard 8f5d0791bf sys/time_units.h: Convert time conversion to macros
The intent of this patch is to leave all of the semantics of the macros
unchanged, only replacing the easy-to-read static inline conversion
function with a pile of ?: operators.

Ick. This is not a cleanup. However, what it does enable is using constant
results while initializing global variables, which cannot be done with
either static inline functions or even statement expressions, even when
those generate constant results.

Signed-off-by: Keith Packard <keithp@keithp.com>
2023-09-28 16:15:27 +02:00
Grant Ramsay a8497c5216 kernel: msg_q: Remove alignment requirements from message queue docs
Alignment of the message queue's ring buffer is not necessary.
The underlying implementation uses memcpy (which is
alignment-agnostic) and does not expose any internal pointers

Signed-off-by: Grant Ramsay <gramsay@enphaseenergy.com>
2023-09-28 16:14:56 +02:00
Benjamin Cabé a46f1b9c33 kernel: Fix unused-parameter warnings
Add missing ARG_UNUSED where needed.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2023-09-28 16:14:39 +02:00
Mulin Chao 21d7c2db6d drivers: sensor: npcx: fix debug message when port B is captured
Fix wrong debug message when port B of tachometer is captured.

Signed-off-by: Evan Chang <MCCHANG1@nuvoton.com>
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
2023-09-28 09:08:29 -05:00
Andrei Emeltchenko 9e6960fe90 boards: x86: Indicate smp support for ADL and EHL boards
Indicate SMP support to be able to run related tests on the boards.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-28 15:46:07 +02:00
Andrei Emeltchenko bf4dc31015 tests: spinlock: Make local functions static
Make local functions static.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-28 15:46:07 +02:00
Andrei Emeltchenko a3959af4f5 tests: spinlock: Increase thread execution to prevent quick exit
On Intel boards (like intel_ehl_crb and intel_rpl_s_crb) for the
trylock_test some part is executed very fast and since there is no
synchronization, there might be situation when there is no
trylock_failures. Increasing time spend in this part fixes the issue.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2023-09-28 15:46:07 +02:00
Jordan Yates 2b92598df1 net: wifi: re-add WIFI_MGMT_FORCED_PASSIVE_SCAN
Re-add the `WIFI_MGMT_FORCED_PASSIVE_SCAN` option removed in #62751.
Now that `struct wifi_scan_params` is a reasonable size, we can enforce
the passive scan request even when no parameter struct is supplied by
the user.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-28 15:44:01 +02:00
Jordan Yates 3b7237e6cd net: wifi: shell: update SSID argument format
Instead of providing a comma seperated list of SSIDs, provide the SSIDs
individually. This substantially simplifies the implementation.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-28 15:44:01 +02:00
Jordan Yates a32e7aaa10 net: wifi_mgmt: update SSID storage type
Update the storage type of the SSID strings to pointers to the strings,
instead of needing to copy the strings into the struct. This
substantially reduces the parameter struct size.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-09-28 15:44:01 +02:00
Dominik Ermel 1f3605de21 drivers/flash/nrf: Workaround for nrf91 errata 7
Fix UICR read access.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2023-09-28 15:33:52 +02:00
Emil Gydesen cc5766bc4b tests: Bluetooth: Fix for btp_bap broadcast create/reconfig
This updates the struct name for the create parameter,
and fixes the call to reconfig.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 15:31:30 +02:00
Juha Ylinen 3ffa1d5550 net: coap: Fix coap client timeout
Fix bug in timeout_expired() function. Coap client was resending
pending messages after 500 ms (COAP_PERIODIC_TIMEOUT) and didn't
wait for retransmission timeout.

Use 64-bit k_uptime_get()

Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
2023-09-28 15:18:12 +02:00
Robert Lubos e836427f97 tests: net: socket: reuseaddr_reuseport: Fix userspace testing
net_context_foreach() is not a systemcall, therefore should not be used
from userspace threads. Usage of this API made SO_REUSADDR/SO_REUSEPORT
userspace tests unfunctional (crashing).

Fix this by using CONFIG_NET_TCP_TIME_WAIT_DELAY instead for tests that
involve TCP connections. Other tests don't really need to wait as
there's no teardown delay on UDP or unconnected TCP contexts.

Additionally, remove the platform exclude for qemu_x86 platform, as this
was the sole reason the tests were crashing on that platform.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-09-28 15:15:44 +02:00
Florian Grandel e63969521c doc: ieee802154: mgmt: improved docs
Hides types in the IEEE 802.15.4 net_mgmt sub-API that are of no public
interest and improves documentation of the remainder.

All constants that are not meant to be used by applications have been
hidden. Only the API actually being of relevance to application
developers is now publicly visible and documented.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Florian Grandel c315d13102 doc: ieee802154: driver: improved docs
Hides types in the IEEE 802.15.4 driver sub-API that are of no public
interest and improves documentation of the remainder.

Apart from extending and clarifying many details of the driver API, this
change also specifies certain formal properties of API calls, such as
"sleeps" or "isr-ok". Plus it removes semantic ambivalence that had been
resolved and hidden in existing implementation details but is highly
relevant to the way the API can be used and shall be implemented.

As far as possible this change introduces formal requirements language
(MAY, SHALL/MUST, SHOULD) to specify driver implementation requirements.

This change also introduces two definitions - for the moment being of
purely documentary relevance (i.e. to be referred in the documentation):
* IEEE802154_CONFIG_RX_SLOT_NONE
* IEEE802154_CONFIG_RX_SLOT_OFF

These "magic" values are required to clarify the exact semantics of RX
slots as to receiver activity.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Florian Grandel bd038fc743 doc: ieee802154: l2: improved docs
Hides types used in the IEEE 802.15.4 L2 sub-API and L2-internal APIs
that are of no public interest and improves documentation of the
remainder.

The changes are mostly minor as the API documentation had already been
improved and clarified in previous changes. Also includes non-visible
documentation to the subsystem-internal Frame API by adding references
to the specification.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Florian Grandel 9864d03c6e doc: openthread: integrate ot/ieee802154 docs
Integrates and cross-references OpenThread and native IEEE 802.15.4 docs
as they share a common driver layer.

While OpenThread is of course not an IEEE 802.15.4 subsystem API it is
still included in the ieee802154 documentation group, purely for
convenience to the documentation readers.

For organizational purposes OT is considered a separate area of
maintenance and therefore keeps its dedicated documentation page - but
the two subsystems now cross-reference each other for convenience.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Florian Grandel 80fc350849 doc: ieee802154: improved API documentation structure
Improves the API documentation including it's structure and integration
into the Zephyr documentation.

Previously the API status of the IEEE 802.15.4 API (and its sub-APIs)
was unclear.

This change adds three APIs in an "unstable" state:
- IEEE 802.15.4 L2 for subsystem developers
- IEEE 802.15.4 drivers for driver developers
- IEEE 802.15.4 net_mgmt for application developers

The corresponding APIs are documented at a group level.

These sub-APIs need to be separately versioned as they have different
audiences, change velocities and levels of stability.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Florian Grandel 0fad581211 doc: connectivity/networking/utils: minor fixes
Fixes bugs in USB and DSA group titles (networking) and a minor bug in
sys/utils.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-09-28 15:13:12 +02:00
Georges Oates_Larsen 034f0fca93 MAINTAINERS: Update maintainers/codeowners for conn_mgr docs
conn_mgr now has docs, so add them to the maintainers/codeowners files.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-09-28 15:11:14 +02:00
Georges Oates_Larsen 98a506f341 net: conn_mgr: Write documentation
Write documentation for conn_mgr and its subsystems, especially
guidelines for writing connectivity implementations

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-09-28 15:11:14 +02:00
Georges Oates_Larsen fe61d65b2e net: conn_mgr: Fix connectivity event enum type
Connectivity event enum type was erroneously named
net_event_ethernet_cmd.

This PR corrects the name to net_event_conn_cmd.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
2023-09-28 15:11:14 +02:00
Gerard Marull-Paretas c9686e18b6 dts: bindings: nxp,kinetis-*: do not re-specify pinctrl-0 type
It's already defined in pinctrl-device.yaml.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-09-28 14:46:16 +02:00
Jamie McCrae 86763727f0 west.yml: MCUboot synchronization from upstream
Update Zephyr fork of MCUboot to revision:
  ae2aeedfe8bb66f7fdddc25271689144d3579959

Brings following Zephyr relevant fixes:
 - 268433e zephyr: Allow user-defined boot serial extensions
 - 50f8b5f bootutil: Add shared data support for XIP with revert
   mode
 - 8d0b35a bootutil: Add mode for XIP with revert

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-09-28 14:10:56 +02:00
Emil Gydesen 85bb2624bc Bluetooth: Audio: Refactor codec_cfg_get_freq
Refactor the codec_cfg_get_freq function to return the assigned
numbers value, instead of a converted value, but with
support for converting the value.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2023-09-28 14:05:18 +02:00
Erik Brockhoff 551b9afe11 Bluetooth: controller: adding unittest for Central CIS Create
Adding unittests for basic Central CIS Create functionality

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-09-28 14:05:00 +02:00
Erik Brockhoff 1de8a76f58 Bluetooth: controller: adding API for unmasking peer features
For asymetrical features there needs to be a separate mechanism to
unmask features in peer. This must be used in central for unmasking in case
of 'unsupported in peer' condition for CIS Create.

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-09-28 14:05:00 +02:00
Erik Brockhoff 730f7caa21 Bluetooth: controller: add missing NTF alloc in central CIS Create
If a CIS create is requested prior to having a complete feature exchange
the central will initiate a feat exch before enqueing the CIS create.
IF then the feature exchange results in peripheral NOT supporting
CIS create the central needs to allocate an RX node for the NTF

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
2023-09-28 14:05:00 +02:00
Alberto Escolar Piedras 25897f8baa tests bluetooth mesh: Fix ASSERT_TRUE/FALSE with messages
The previous ASSERT_TRUE/FALSE macros looked like
they could take extra printf like parameters but did not
(those extra arguments were just dropped).

Define 2 new macros that can take those extra parameters
and fix all uses that intended to print those extra messages.

Also add an extra "\n" as the underlaying print functions
do not add end of lines on their own.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-28 13:43:51 +02:00
Alberto Escolar Piedras 146d025aa0 tests bluetooth mesh: Fix a incorrect assert
This ASSERT_TRUE should have been an assert equal
(ASSERT_TRUE checks that the first paramters != 0)
and the condition was not correct.
Fix it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-09-28 13:43:51 +02:00
honglin leng c4f102fd8b boards: arm64: add support for Raspberry Pi 4 Model B
This is an AArch64 board. We also add BCM2711 SoC support

Signed-off-by: honglin leng <a909204013@gmail.com>
2023-09-28 13:40:45 +02:00
Yonatan Schachter 859be8cb73 tests: bindesc: Added definition tests
Added tests for the bindesc subsystem, testing definition of
binary descriptors on several qemu architectures, and using
several C standards (c99, c11, etc.).

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Yonatan Schachter 726e14e475 doc: bindesc: Add documentation for binary descriptors
Add documentation for binary descriptors under "OS Services"

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Yonatan Schachter fd5fe8fe10 samples: bindesc: Add hello_bindesc sample
Add the hello_bindesc sample which shows the basic usage of
binary descriptors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Yonatan Schachter c42a7dff4d west: commands: Add bindesc command
Added the bindesc command to west, for working with binary
descriptors. Currently it supports dump, list and search
subcommands, for bin, hex, elf and uf2 file types.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00
Yonatan Schachter 5508b17fb4 bindesc: Add initial support for binary descriptor definition
Binary descriptors are data objects stored at a known location
of a binary image. They can be read by an external tool or image,
and are used mostly for build information: version, build time,
host information, etc.
This commit adds initial support for defining such descriptors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2023-09-28 07:39:09 -04:00