Commit Graph

102290 Commits

Author SHA1 Message Date
Jonathan Rico 6d5cce662a Bluetooth: buf: Put command complete/status in sync buf pool
Why is it ok to use the sync pool?

Because command complete/status is processed in prio: that means on the
same stack as the `bt_recv()` call from the driver.

Why does it fix the issue?

Because the complete/status event goes into a pool that is guaranteed to
have one free buffer any time `bt_recv()` is not executing.

Since the driver is the one calling bt_recv(), it (hopefully) will
finish one `bt_recv()` before starting another one.

Fixes #78223

Co-authored-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-09-17 17:45:50 +01:00
Robert Lubos bd56fecc61 net: iface: Add missing interface mutex locks
net_if_ipv4/6_addr_rm() were missing the iface mutex lock, this commit
adds it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-09-17 17:45:34 +01:00
Armin Kessler 2ba893e0cb drivers: video: esp32s3
Add the missing calls to the sensors`video_stream_start()`
and `video_stream_stop()` functions.

Signed-off-by: Armin Kessler <ake@espros.com>
2024-09-17 17:45:27 +01:00
Simon Walz 5af3fbadfd net: lwm2m: check each block for TLV header
For composite operations, we should always check whether the TLV header
is present. Otherwise, all blocks are assigned to one resource.

Signed-off-by: Simon Walz <simon.walz@autosen.com>
2024-09-17 17:45:17 +01:00
Simon Walz e20ef4443e net: lwm2m: check lwm2m path level while getting the block ctx
The Block1 context for composite operations is not found, as all path
levels are compared. The incoming path level should therefore always be
taken into account.

Signed-off-by: Simon Walz <simon.walz@autosen.com>
2024-09-17 17:45:17 +01:00
Jamie McCrae c41d88740a doc: release: 4.0: Add note on new MCUmgr bootloader info hook
Adds a note on this newly added hook

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-09-17 17:45:04 +01:00
Jamie McCrae 87a18400dd mgmt: mcumgr: grp: os_mgmt: Add optional bootloader info hook
Adds an optional hook that allows for appending additional
responses to the bootloader info command

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-09-17 17:45:04 +01:00
Vit Stanicek adb83d26bf soc: mimxrt685s/cm33: Fix lockup on clock config
Imply CONFIG_INIT_AUDIO_PLL on nxp,dmic driver selection on
mimxrt685s/cm33. Make DMIC clock config dependent on the use of the
RT685's audio PLL.

Fixes a regression described in #77851.

Signed-off-by: Vit Stanicek <vit.stanicek@nxp.com>
2024-09-17 17:44:48 +01:00
Fabrice DJIATSA 0df9e2536b boards: st: add die_temp or digi node
update die_temp node for some stm32 boards,
need that for run sensor die_temp_polling samples.
don't need to modify sample.yaml

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-17 17:44:39 +01:00
Fabrice DJIATSA eab0e37e68 dts: arm: st: add digi-temp node in dtsi file
add digital temperature node in board.dtsi file

Signed-off-by: Fabrice DJIATSA <fabrice.djiatsa-ext@st.com>
2024-09-17 17:44:39 +01:00
Chekhov Ma 19949a0ccf boards: imx93_evk: enable flexcan driver
Add pinctrl for flexcan2
Add EXP_SEL gpio hog for board mux selection during boot.
Add TJA1057 CAN PHY driver.
Update supported features in board document

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-17 17:44:14 +01:00
Chekhov Ma 643db3fa0b soc: imx93: enable flexcan driver
- Add flexcan dts node and pinctrl.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
2024-09-17 17:44:14 +01:00
Wilfried Chauveau 6194159608 scripts: twister: handlers: Enable BinaryHandler to run sysbuilt tests
Running sysbuilt tests fails because of missing "run" target.

This adds the default domain context to the command.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
2024-09-17 09:13:26 -05:00
Jonny Svärd bdd894ca50 modules: tflite-micro: Fix CMakeLists.txt
Add missing file to source list

Signed-off-by: Jonny Svärd <jonny.svaerd@arm.com>
2024-09-17 09:12:23 -05:00
Marcio Ribeiro de53fb471a drivers: i2s: esp32: remove unused code
Removed unused code in I2S driver.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-09-17 09:10:51 -05:00
Rubin Gerritsen f6712c43d4 tests: Bluetooth: Add some more tests for bt_le_create_conn()
Adds coverage for attempting to connect while already connecting
or connecting to a device that already exists.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-09-17 09:09:56 -05:00
Benjamin Cabé c394234305 ci: doc: build the documentation using GitHub-hosted runners
There is no reason to use our custom runners for docs build
as it's equally fast on GH default runners and allows doc CI
to be expedited more quickly even when our build farm is
busy.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2024-09-17 09:05:22 -05:00
Yuval Peress 53dd8e884b cpp: Fix warnings
Fix warnings caught by running west build. Another fix will have to go
in to see why twister was missing these.

#78348

Signed-off-by: Yuval Peress <peress@google.com>
2024-09-17 09:03:55 -05:00
Anas Nashif ca09a4b91c doc: kernel/arch: fix some wrong doxygen references
Remove non-existing references and document parameters.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-17 05:24:09 -04:00
Anas Nashif ac808d13dc doc: kernel: define additional doxygen groups
Some groups are used by multiple files/tests, define them globally in
doc/

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-17 05:24:09 -04:00
Anas Nashif 3744dd828f tests: kernel: fix test groups for semaphore/mutex
define groups for semaphores and mutexes

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-09-17 05:24:09 -04:00
Corey Wharton d80174fadf drivers: dac: add checks for internal channel config
Return -ENOTSUP if these flags are specified but not supported.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton 2b9ed72f9e drivers: dac_stm32: make pinctrl config in the device tree optional
Now that we support internally connected channels we should make the
pinctrl configuration optional.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton 834cc98f39 drivers: dac_stm32: add support for internally connected channels
Adds support for configuring the STM32 DAC channel mode for internal
connections. This is only enabled for SOCs that support it.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Corey Wharton e94e5eb10c drivers: dac: add flag to channel config to support internal connections
Allows user to connect DAC output to internal peripherals for HW and
drivers that support it.

Signed-off-by: Corey Wharton <xodus7@cwharton.com>
2024-09-17 05:23:56 -04:00
Pisit Sawangvonganan 7a59ebf6af drivers: i3c: shell: use `shell_fprintf_normal` instead of `shell_fprintf`
Due to the introduction of `shell_fprintf_normal` in PR #77192, we can
minimize caller overhead by eliminating direct `color` parameter passing.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan d539257a87 drivers: i3c: shell: align `struct shell *` argument name to `sh`
Aligned the `struct shell *` argument name from `shell_ctx` to `sh`
for consistency with other drivers' usage of `sh`, and to match
the `shell_cmd_handler` argument name.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan fdaaf3624c drivers: i3c: shell: fix unhandled `<id>` argument parsing
The `<id>` argument was included in `cmd_i3c_ccc_getvendor`,
`cmd_i3c_ccc_setvendor`, and `cmd_i3c_ccc_setvendor_bc` but
was not processed.

Utilized `shell_strtoul` for proper parsing of the `<id>` argument
in these functions.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Pisit Sawangvonganan 66bce34af2 drivers: i3c: shell: fix compilation error in `cmd_i3c_ccc_getmxds`
Resolved a compilation error where `maxwr`, `maxrd`, and
`max_read_turnaround` were incorrectly referenced.

The code was updated to correctly access these fields from
the `data_speed` structure.

Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
2024-09-17 05:23:19 -04:00
Jukka Rissanen 9acf53e412 net: context: Set IPv4 address properly for sendmsg()
When using sendmsg() and if CONFIG_NET_IPV4_MAPPING_TO_IPV6 is
enabled, then the addr4 variable was set too late which was causing
null pointer access.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-09-17 05:22:48 -04:00
Ingar Kulbrandstad d41e834bbe tests: bluetooth: mesh: Removed native_posix and renamed sim_ids
Removed deprecated native_posix as test platform.
Added unique sim_ids for tests with the psa as a overlay.
Fixed clang-format issues.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev e0f5f3acf4 bluetooth: mesh: brg_cfg_srv: ignore message with invalid parameters
When a message with invalid parameters is received, we must ignore it.

In this commit we check invalid parameters first.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev ed051cddb9 tests: bluetooth: mesh: add subnet bridge bsim tests
This commit adds the following tests:
- Simple test for bridging table
- Test bridging table state changes
- Test persistence storage of subnet bridge
- Test IV Index update with subnet bridge
- Test network key removal for subnet bridge

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev b267da33d6 tests: bluetooth: mesh_shell: add brg_cfg_srv instance
This commit adds Bridge Configuration Server to the mesh_shell sample.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev dd7b6757f4 bluetooth: mesh: brg_cfg: use IS_ENABLED macro optimally
If use `IS_ENABLED` macro inside if statements but not as preprocessor
directives, we can always compile the code for settings even if settings
are not used. This allows to reduce amount of firmwares we need to build
in CI to ensure that code compiles.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev 945e320e75 bluetooth: mesh: brg_cfg_srv: check buf tailroom before packing data
We must tcheck if buf has enough tailroom to fit another pair of keys or
pair addresses with direction.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev f44ee3c50c bluetooth: mesh: adv_ext: resched main adv set if relay doesn't have own
If relay feature doesn't have own adv set, it should use the main adv
set to send messages.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev 76f015b61f bluetooth: mesh: brg_cfg_cli: copy buf in synchronous api
When a synchronous API is used, the content of `buf` will not be
valid by the time the thread that called the synchronous API is woken up
again.

Therefore, the simplest way to solve this is when a user allocates the
buffer which will be filled up with the content of the buffer passed to
the model callback.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev 6c94d3bec6 bluetooth: mesh: net: bridge traffic regardless of relay state
The Subnet Bridge node must bridge traffic regardless of the Relay
state.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev 957bb4754a bluetooth: mesh: net: use subnet credentials when relaying
When relaying a Network PDU to another subnet, we need to update sub
field of rx structure so that correct credentials are used. We also need
to update NID field of the Network PDU.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev 96cb386f39 bluetooth: mesh: brg_cfg: add constants for directions
Add constants for directions so that they can be used in the
subnet bridge client api.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev abf02719c4 bluetooth: mesh: rpl: fix rpl for subnet bridge
The initial implementation of RPL check for Subnet Bridge wasn't fully
correct. It decides whether to relay or not a PDU based on RPL of only
received messages. However, the spec section 3.9.8 says:

```
In addition, a Subnet Bridge node shall implement replay protection for
all Access and Transport Control messages that are sent to bridged
subnets.

A Subnet Bridge node shall maintain the most recent IVISeq value for
each source address authorized to send messages to bridged subnets.
Messages received by the Subnet Bridge node with the IVISeq value less
than or equal to the last stored value from that source address shall
be discarded immediately upon reception. When a message is retransmitted
to a bridged subnet, the stored IVISeq value shall be updated. In this
way, bridged subnets are protected against replay attacks from other
subnets.
```

This was noticed with MESH/NODE/SBR/NET/BV-02-C test. It passes when
PTS misses the message at step 3 and 4, and fails when PTS manages to
receive the message.

This commit fixes the wrong behavior by removing argument for
`bt_mesh_rpl_check` function making store a new message and bypassing
`local_match` check in case of Subnet Bridge node.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev f06f69a8b8 bluetooth: mesh: brg_cfg: store tbl when changed only
Though nvs backend checks whether the data passed to it is identical to
the stored one, this isn't guaranteed by other the settings api. We can
also avoid going into the settings subsystem since we know what was
actually changed.

This commit adds 2 flags that allow to control whether Subnet Bridge
or Bridging Table states were changed and skips storing if the certain
state was not changed.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Pavel Vasilyev ceba348ca4 bluetooth: mesh: brg_cfg: fix restoring bridging table
We store only filled up entries, but want to restore the entire table.
`bt_mesh_setting_set` fails if the restored length didn't match the
provided length.

This commit fixes the restoring of the bridging table by allowing to
restore any size as long as the stored size is less than the allocated
one and it is a multiple of the size of a single entry.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Stine Åkredalen e1232a45e2 docs: Bluetooth: Mesh: add Subnet Bridge doc
Added high-level documentation for Subnet Bridge,
connecting models together and explaining usage.

Signed-off-by: Stine Åkredalen <stine.akredalen@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Ingar Kulbrandstad 0e2f8b21cf Bluetooth: Mesh: Fixed bugs found in PTS testing
Fixed bugs found while running PTS test.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Ingar Kulbrandstad 21fa5c81d2 Bluetooth: Tester: Mesh: Added support for Bridge client/server
Added support for the Bridge Configuration client and server
to the tester application.

Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Omkar Kulkarni fc4576ce3f Bluetooth: Mesh: Add bridging functionality
Adds subnet bridging functionality to the network layer.
Also fixes brg_cfg_srv for minor issues to get it working.

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Omkar Kulkarni 8210d2da1b Bluetooth: Mesh: Populate Bridge Config Server
Adds implementation for the Bridge Configuration Server model.

Updates `brg_cfg` module to add sanity check for
bt_mesh_brg_cfg_tbl_remove() API. Also, updates the unit test
accordingly.

Adds documentation for the Bridge Configuration Server model

Signed-off-by: Omkar Kulkarni <omkar.kulkarni@nordicsemi.no>
2024-09-17 05:22:32 -04:00
Håvard Reierstad 50a4c2d17a Bluetooth: Mesh: Add brg_cfg_cli commands to shell
Adds the Bridge Configuration Client commands to Mesh shell.

Unifies documentation for shell Kconfig options.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2024-09-17 05:22:32 -04:00