Commit graph

90485 commits

Author SHA1 Message Date
Aymeric Aillet fe02e32f86 drivers: clock: Rename renesas ra driver
Need this rename to be able to target this driver
in the "Renesas RA" maintainer area.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2024-01-29 11:32:46 +01:00
Fabio Baltieri 682f38fa36 tests: lib: devicetree devices: only run on native_sim
The test instantiate few vnd,i2c devices so it fails with boards with
devices that select I2C, as that causes i2c_test.c to be included with
the build that tries to redefine the same devices as well.

This is a library test anyway, so restricting to native_sim should be
good enough for it anyway.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-01-29 10:29:38 +01:00
Ping Wang c7d1dc3b42 Bluetooth: Audio: Use utf8_lcpy to copy UTF8 strings with termination.
use the function utf8_lcpy to ensure that UTF8 encoded strings are
properly copied and NULL terminated.

Fixes #42128

Signed-off-by: Ping Wang <pinw@demant.com>
2024-01-29 10:28:18 +01:00
Christopher Friedt b600e8a870 posix: timer: build timer.c using the correct kconfig option
Previously timer.c was only built with CONFIG_POSIX_CLOCK=y even
though it has had its own Kconfig symbol (CONFIG_TIMER) for a
very long time.

Make POSIX_CLOCK imply TIMER rather than control whether it is
built, and adjust Kconfig / CMake as necessary.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-29 10:28:10 +01:00
Fengming Ye 8cd61b6c66 doc: migration-guide: 3.6: zperf statistics changes
Add information about zperf ratio between mbps and kbps, kbps and bps
changes from 1024 to 1000, to align with iperf.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-01-29 10:05:35 +01:00
Fengming Ye f61a0cb1fa net: zperf: fix the calculation ratio between mbps, kbps and bps
The ratio between mbps and kbps, kbps and bps should be 1000, instead of
1024, as common sense.
The wrong ratio will decrease the Zperf throughput result.

Signed-off-by: Fengming Ye <frank.ye@nxp.com>
2024-01-29 10:05:35 +01:00
Ryan McClelland 4fb4f71f08 drivers: regulator: pca9420: implement active discharge api
Implement the api for controlling the active discharge setting within
the pca9420.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Ryan McClelland 0f8ab3cf2d drivers: regulator: add active discharge api to regulator shell
Add the active discharge functions that can be called from the
regulator shell.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Ryan McClelland 97efd21ce9 tests: drivers: regulator: add api test for active discharge
Add tests for active discharge apis not being implemented.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Ryan McClelland 5a125a619c regulator: add active-discharge api
Add an active discharge api for regulators. This uses the already
existing but previously unused regulator-active-discharge
property.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-29 09:43:39 +01:00
Jonathan Rico 2d9b56d713 Bluetooth: L2CAP: remove metadata allocation
The only thing we put in there is the CID and that fits comfortably into
the (at least) 4-byte void pointer `user_data`.

This removes the dependency between `CONFIG_BT_ATT_TX_COUNT` and
`CONFIG_BT_L2CAP_TX_BUF_COUNT` since previously there was still a need
for an L2CAP context for every TX'd buffer.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
Jonathan Rico 3a4fd5e23d Bluetooth: L2CAP: remove cb/userdata from TX metadata
They were never used.
Only thing to remove is `cid`.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
Jonathan Rico 77d8c2768e Bluetooth: L2CAP: initialize servers slist
Somehow it slipped through the cracks and didn't crash before.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-29 09:41:23 +01:00
honglin leng c9208b3864 arm64: smp: Fix cache operations in the SMP
The arm64_cpu_boot_params will be read on other cores

call sys_cache_data_flush_range flush the data from the cache to RAM.

This ensures that other cores can access the correct data.

Signed-off-by: honglin leng <a909204013@gmail.com>
2024-01-29 09:26:51 +01:00
Pavel Vasilyev 54c048989d Bluetooth: Mesh: Send provisioning PDUs with randomized delay
This implements the following statement from the section 5.3.3:
Each Generic Provisioning PDU shall be sent after a random delay between
20 and 50 milliseconds.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Pavel Vasilyev fcfc99a21d Bluetooth: Mesh: Add error code for bt_mesh_adv_terminate
Return error code to let an implementation know if the adv was actually
stopped (was scheduled) or not.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Pavel Vasilyev 9af051e349 Bluetooth: Mesh: Call bt_mesh_send_cb.end cb by the end of adv
Before this change, the bt_mesh_send_cb.end callback was called when all
references to the adv were removed. If an implementation kept more
references to the adv buffer after calling `bt_mesh_adv_send`, the end
callback would not be called when the advertiser finished advertising
this adv.

With this change, the end callback is always called by the advertiser
when the advertisement is finished regardless of the number of
references. This allows an implementation to keep the adv buffer for the
future use. As an example, pb_adv.c keeps advs for retransmission.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2024-01-29 09:26:22 +01:00
Yasin Ustuner 6cb98162b7 scripts: ci: check_compliance.py: Add out-of-tree dts/bindings
This commit includes out-of-tree dts/bindings to
temporary Kconfig.dts for compliance checks.

Signed-off-by: Yasin Ustuner <yasin.ustuner@analog.com>
2024-01-28 22:04:16 -06:00
Jordan Yates 673009f665 drivers: power_domain: add missing dependency
The GPIO power domain driver needs device power management enabled
to compile if `PM_DEVICE_POWER_DOMAIN` is enabled.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-28 22:03:25 -06:00
Henrik Brix Andersen 64cedb5f35 drivers: can: stm32: bxcan: fix header order
Sort the included headers by name, remove unneeded includes and ensure
soc.h is included prior to the Zephyr CAN headers.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-28 20:03:34 +01:00
Christopher Friedt a37254140b scripts: checkpatch.pl: fix constant comparison false positives
Comparisons that have constants on both side of the operator
were getting flagged incorrectly. Adjust the check so that
pure constant comparisons are not flagged, reducing false
positives.

WARNING:CONSTANT_COMPARISON: \
  Comparisons should place the constant on the right side of \
  the test
+BUILD_ASSERT(CONFIG_MAX_PTHREAD_COUNT == \
  CONFIG_MAX_PTHREAD_MUTEX_COUNT - 1);

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-28 13:01:36 -05:00
Christopher Friedt 248324b67a samples: posix: implement philosphers using pthreads
This sample takes a POSIX-y spin on the existing
Dining Philosophers sample application. The objects
used in the POSIX version are pthread_mutex_t, and
the threads are pthread_t.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-28 13:01:36 -05:00
Christopher Friedt e357ba835d posix: internal: make priority / policy transforms available
Two functions can be used with relative ease to convert between
Zephyr and POSIX priorities and policies. Namely,

uint32_t zephyr_to_posix_priority(int32_t z_prio, int *policy)
int32_t posix_to_zephyr_priority(uint32_t priority, int policy)

These are not necessarily public API, but they helped with the
POSIX Philosophers Sample, which is in a subsequent commit.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2024-01-28 13:01:36 -05:00
Attie Grande cf14d4f1fd samples: drivers: uart: Add a 'passthrough' example
This sample can be used as a "virtual wire", allowing direct access to
devices connected to the target processor - for example: GPS, Cellular,
etc...

This is also useful as a utility - no other connectivity options exist
for UART, where other interfaces like SPI and I2C have shell commands.

Signed-off-by: Attie Grande <attie.grande@argentum-systems.co.uk>
2024-01-27 15:33:29 +01:00
Ryan McClelland 018dbcfd66 cmake: compiler: add double promotion warning
Too many times, code is pushed that includes floats that really
becomes doubles and C implicit promotion rules will want to make
floats into doubles very easily. As zephyr primarily targets
low-end process that may not have a double precision floating
point unit, enable this flag globally for now.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2024-01-26 21:37:24 -05:00
Tyler Ng 432f4a0b9a soc/riscv/opentitan: Kconfig.defconfig.series: Set NUM_IRQS to 256
The OpenTitan PLIC has support for up to 255 interrupt vectors, so
set it to that. Previously was set to number of IRQs used.

Signed-off-by: Tyler Ng <tkng@rivosinc.com>
2024-01-26 19:34:09 -06:00
Adam Wojasinski dc90d6ccff doc: posix: Add missing entries in POSIX supported API doc
`mq_timedsend()` and `mq_timedreceive()` are implemented but
the information is missing in the documentation.

Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
2024-01-26 22:27:07 +00:00
Ren Chen 9dfd368165 it82xx2/usb: disable 15K-ohm default pull-down if device isn't enabled
There is default 15K-ohm pull-down for USB controller.
To disable the default pull-down to avoid signal contention in GPIO mode.

Signed-off-by: Ren Chen <Ren.Chen@ite.com.tw>
2024-01-26 22:26:55 +00:00
John Whittington 3f282da22d west: runners: blackmagicprobe: elf_file fallback
Building the HEX file is optional (CONFIG_BUILD_OUTPUT_HEX), so
`bmp_flash` will fallback to elf_file if missing. Additionally, to
maintain section names the HEX is only used if it is signed.

Signed-off-by: John Whittington <git@jbrengineering.co.uk>
2024-01-26 14:24:05 -05:00
John Whittington 10183797a1 west: runners: blackmagicprobe: flash hex_file
The cfg.elf_file is not signed, so `west flash` with a sysbuild will
not run the application if MCUboot image signature checking is on. Using
the cfg.hex_file for `bmp_flash` resolves since as the signed hex is
used when using sysbuild. Symbols are not required for flashing so the
switching from elf to hex is not an issue.

Signed-off-by: John Whittington <git@jbrengineering.co.uk>
2024-01-26 14:24:05 -05:00
Tim Lin a0a599b54b ITE: drivers/pinctrl: Distinguish between func3-gcr and func3-ext settings
This PR separates the GCTRL settings from func3-gcr to func3-ext.

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
2024-01-26 14:21:34 -05:00
Daniel DeGrasse 5808018b05 drivers: i2s: i2s_mcux_flexcomm: Guard use of I2S_EnableSecondaryChannel
Guard use of I2S_EnableSecondaryChannel behind the SDK feature macro
that determines if this support is available, since when this macro is
not defined the SDK function is not implemented.

Fixes #68136

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-01-26 19:41:03 +01:00
Jukka Rissanen a1d0764922 net: wifi: Make sure scan band string is null terminated
Make sure that scan band string is properly terminated when
parsing user supplied string.

Fixes: #67944
Coverity-CID: 342930

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2024-01-26 19:40:16 +01:00
Grzegorz Chwierut cca78041f8 twister: pytest: Fix failing tests of mcumgr fixture.
Updated tests of mcumgr fixture in pytest-twister-harness
plugin.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-01-26 19:36:01 +01:00
Seppo Takalo 992936300b net: lwm2m: Use CID_SUPPORTED instead of CID_ENABLED
When ENABLED flag is used, we generate 32 byte DTLS
Connection Identifier and include that in our
DTLS Client HELO. This has no benefit as client only
has one connection toward the server, it does not need
any identification.

When SUPPORTED flag is used, we just include
zero length Connection Identifier in the handshake,
which tell server that we support Connection Identifier
and server can generate one for it.
We then use the CID in the packets that we send towards
server, but response packets don't contain any CID.
This gives all the benefit of CID as server is able to
identify us even when NAT mapping have changed.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-26 12:00:51 -06:00
Seppo Takalo 53705c062e samples: lwm2m: Clarify DTLS settings
Clarify some documentation regarding DTLS settings.
Set default QUEUE uptime to 30s, which would be same as
most cellular networks use, and  nRF SDK use.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-26 12:00:51 -06:00
Seppo Takalo 2deb3d5b0c samples: lwm2m: Set default bootstrap URI
Don't rely on just port number to select a bootstrap server.
Use full URI.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-01-26 12:00:51 -06:00
Jordan Yates 0ac5835c59 doc: release-notes: document spi_nor sleep changes
Document the changes to sleeping in `spi_nor_wait_until_ready`.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2024-01-26 11:59:04 -06:00
Sateesh Kotapati 3391730512 gecko: Update BG22, BG27 and MG24 Device files | Update to GSDK 4.4.0
Update the EFR32BG22, BG27 and MG24 device files inside
gecko/Device/SiliconLabs/ from gecko_sdk to align the codebase of
hal_silabs with gecko_sdk 4.4.0.

Signed-off-by: Sateesh Kotapati <sateesh.kotapati@silabs.com>
2024-01-26 11:57:44 -06:00
Jonathan Rico d75b44327a Bluetooth: ATT: don't callback if bearer is invalid
If an att buf is destroyed during bearer teardown, we want to avoid
using and passing invalid references to the application.

Double-check that the current bearer, the ATT object and the ACL conn
objects it is attached to are not NULL before proceeding.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
2024-01-26 11:57:10 -06:00
Francois Ramu 29b0cd4278 drivers: clock_control: stm32h5 driver input vco range
Set the correct VCO input range for the PLL frequency
with each bit PLL1RGE of the PLL1CFGR register
This get_vco_input_range is similar to the stm32h7 one.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-01-26 15:55:42 +00:00
Robert Lubos 154e415c36 tests: net: dhcpv4_server: Add test suite for DHCPv4 server library
Add test suite covering DHCPv4 server library functionality.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-26 15:55:36 +00:00
Robert Lubos 9f1e1b4c60 tests: net: dhcpv4: Move DHCPv4 client tests to subdirectory
Move DHCPv4 client tests to subdirectory, to make room for DHCPv4 server
tests.

Rename test project to dhcpv4_client to better reflect its purpose.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-01-26 15:55:36 +00:00
Peter Mitsis 7d762050ba tests: smp_suspend: Add configurable delay
Adds a configurable delay to the test threads. It exists to keep
thread0 from hogging the scheduler's spin lock and giving threads
on another core a better chance to obtain that lock and not starve.

Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
2024-01-26 15:55:27 +00:00
Henrik Brix Andersen ffa3e415a0 doc: releases: migration-guide: 3.6: list CAN transceiver API change
Add a note about the addition of a can_mode_t argument to the
can_transceiver_enable() API call.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 15:55:18 +00:00
Henrik Brix Andersen 5e9da13200 drivers: can: propagate CAN controller operation mode to CAN transceiver
Propagate the current CAN controller operation mode to the CAN transceiver
when enabling it.

Some more advanced CAN transceivers, especially those supporting Partial
Networking (CAN PN), require knowledge of the intended CAN operation mode
(e.g. normal mode vs. listen-only mode).

This commit simply prepares the CAN transceiver API for supporting such CAN
transceivers, although no in-tree drivers require this information yet.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-01-26 15:55:18 +00:00
Lukasz Mrugala 03bd8d0dd2 scripts: tests: Blackbox - make clear_log fixture autouse
clear_log is used to prevent a common pytest log error,
which makes logs unusable in testing.
Such a fix is useful for all tests,
 so it should be autouse by default.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2024-01-26 15:54:25 +00:00
Javad Rahimipetroudi ce4cdd8d37 boards: arm: b_u585i_iot02a: add bluetooth support
This commits makes it possible to use the onboard bluetooth
module (STM32WB5MMG) with existing zephyr bluetooth samples.
Note that there was no hardware flow control wiring
available on the board, which is why it has been disabled
in the both main board and BLE module Device Tree. As the
board doesn't support HW flow control, users must set
CONFIG_BT_HCI_ACL_FLOW_CONTROL=n in project files.

Signed-off-by: Javad Rahimipetroudi <javad.rahimipetroudi@mind.be>
2024-01-26 15:54:04 +00:00
Javad Rahimipetroudi 67caa1c5ab boards: arm: stm32wb5mmg: add Bluetooth support
This patch introduces the Bluetooth Low Energy (BLE) feature to the board.
The board utilizes the STM32WB5MMG as the BLE module. However, As there
was no BLE controller available for this module. Therefore, a board
support package has been added to enable the STM32WB5MMG module to act as
a BLE controller. This is achieved by running Zephyr's hci_uart example on
the STM32WB5MMG module which enables communication with the main
microcontroller over the H:4 HCI transport protocol. So, users must first
build the BLE controller for the BLE module and upload it via on board
ST-Link,then they can uses Zephyr Bluetooth demos on the development board
Note that there was no hardware flow control wiring available on the
board, which is why it has been disabled in the both main board and BLE
module Device Tree.

Signed-off-by: Javad Rahimipetroudi <javad.rahimipetroudi@mind.be>
2024-01-26 15:54:04 +00:00
Mykola Kvach 413059df84 drivers: pinctrl: pfc_rcar: add mapping of memory for Spider ARM64
Add mapping of PFC device memory for Spider ARM64.
Make mapping code common for all RCar boards.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
2024-01-26 15:53:41 +00:00