Commit Graph

85964 Commits

Author SHA1 Message Date
Patryk Koscik fa054bf9da boards: arm: nrf52840dongle_nrf52840: Enable console by default
Enables UART output for samples that do not enable `CONFIG_CONSOLE`
in their config file

Signed-off-by: Patryk Koscik <pkoscik@antmicro.com>
2023-10-21 13:06:33 +02:00
Teoh Shi Lin bfa0b52a84 drivers: serial: uart_intel_lw: add driver
Enable driver for intel lw uart.

Changes from review:
- refactor spinlock to inside of loop
- use menuconfig for kconfig
- add CONFIG_UART_INTEL_LW_AUTO_LINE_CTRL_POLL

Signed-off-by: Teoh Shi Lin <shi.lin.teoh@intel.com>
2023-10-21 11:54:23 +02:00
Flavio Ceolin 09950b6d0b drivers: entropy: Small documentation tweaks
Document driver API and moved around a flag.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-21 11:48:21 +02:00
Jacob Preston 52c55177ba drivers: uart: nrf: rx_timeout_slab incorrectly set
When rx_timeout is set to a sufficiently small value,
rx_timeout_slab could potentially get set to a greater
than necessary value that causes spurious UART_RX_RDY
events.

Fixes #62828

Signed-off-by: Jacob Preston <jacob.preston@synapse.com>
2023-10-21 11:38:46 +02:00
Karthikeyan Krishnasamy a4ad4311b2 tests: drivers: build_all: sensor: Add mc3419 sensor
Included MC3419 3-axis accelerometer sensor in build_all
test to test mc3419 driver

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2023-10-20 15:25:16 -05:00
Karthikeyan Krishnasamy f5ed51c179 drivers: sensors: add MC3419 accel sensor support
add basic sensor support for 3-axis accelerometer, currently
this driver support data acquisition and motion detection
features.

Signed-off-by: Karthikeyan Krishnasamy <karthikeyan@linumiz.com>
2023-10-20 15:25:16 -05:00
Alberto Escolar Piedras 18d6919092 tests bsim: Disable bap_broadcast_audio_assistant
The test is currently broken in main and blocking
all other development when triggered.
Let's disable it by now as a provisional measure.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:32 -05:00
Alberto Escolar Piedras 97ac96f56d bsim tests: Fix incorrect libC free call from bstests
The bstests code builds and executes with the embedded
code, but had a call into "free()" which, when building
the embedded code with an embedded C library lands
in the embedded libC free, while it should
always call into the host libC free.

Fix it by calling thru the appropriate trampoline.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:32 -05:00
Gerard Marull-Paretas 915cb05bb6 dts: drop HAS_DTS
HAS_DTS has become a redundant option. All Zephyr architectures now
select this option, meaning devicetree has become a de-facto
requirement.  In fact, if any board does not provide a devicetree
source, the build system uses an empty stub, meaning the devicetree
machinery always runs.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-10-20 12:18:17 -07:00
Gerard Marull-Paretas e1137a3e5e cmake: modules: dts: use devicetree stub file
By providing a devicetree stub file, we make sure some internal macros
required by devicetree.h are generated in devicetree_generated.h. This
makes sure that systems without devicetree can continue working without
extra ifdeffery.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2023-10-20 12:18:17 -07:00
Sebastian Bøe a4e9aed68d tfm: Enable TFM_EXCEPTION_INFO_DUMP by default
Exception info dump is a very basic feature so it should IMHO be
enabled by default.

For instance, a simple null-pointer exception in the non-secure app
will not be logged unless this option is enabled.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2023-10-20 19:29:32 +02:00
David Corbeil 0f5c6b7d74 drivers: flash: Fix union shadowing warning
Because shadow variable warning is turned on, a warning was thrown and
could fail some twister tests that don't use the -W option. This commit
gets rid of the warning.

Signed-off-by: David Corbeil <david.corbeil@dynon.com>
2023-10-20 19:25:41 +02:00
Henrik Brix Andersen 6b60dc4e0d doc: releases: add working draft release notes + guide for v3.6.0
Add working draft for the release notes and migration guide for v3.6.0.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-10-20 15:56:41 +01:00
Fabio Baltieri 6a06d2abe6 MAINTAINERS: update "Release Notes" area maintainers
Update Release Notes maintainers to point at the 3.6 release owners
usernames.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-20 15:56:21 +01:00
Jaroslaw Stelter 02deea0e80 ace: alh: Only ACE1.5 has OSEL feature
The OSEL bits in ALHASCTL register are present only
in ACE1.5 version - MTL. Platforms ACE2.0 do not have
the OSEL bits. Therefore DAI_ALH_HAS_OWNERSHIP
configuration option should be set only for
particular ACE1.5 version

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2023-10-20 15:21:01 +02:00
Krzysztof Chruściński 94e5311215 logging: Fix logical operator use
Replace & with &&. In that case there is no difference in the
behavior but logical operator should be used here.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2023-10-20 15:20:52 +02:00
Alberto Escolar Piedras bc5da1a158 native simulator: Get latest from upstream
Align with native_simulator's upstream main
d32b2504ad2b6d6d541bc71a0f9b16ab7b6a3831

Which includes:
* d32b250 Minor format fix
* 7b4f35b native HW counter: Provide new API to reset and control
* 4f815cb INT CNTLR: Bugfix for more than 32 interrupts
* 1d36254 Provide new 64 version of nsi_find_lsb_set

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:43 +02:00
Flavio Ceolin 2d5b781e99 llext: Fix wrong check
In llext_copy_symbols the check after llext_read
was looking the result of llext_seek operation instead
of the read.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2023-10-20 15:20:35 +02:00
Alberto Escolar Piedras 9834fabe2d nrf53: Correct sync_rtc kconfig dependencies for simulation
Let's make the sync_rtc kconfig depend on the SOC_COMPATIBLE
options which are set both by the real and simulated targets,
so this code works in the same way for both.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:09 +02:00
Alberto Escolar Piedras 32d0c8d8e5 nrf53: Refactor sync RTC options to their own file
So they can be reused by the simulated board

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:20:09 +02:00
Fabio Baltieri d933e7417f doc: guidelines: add a note about specialized drivers
Add a note about requirements for specialized drivers, clarifying the
requirements about using Zephyr APIs.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-10-20 15:19:58 +02:00
Dawid Niedzwiecki eac3ba2b3d mgmt: ec_host_cmd: remove timeout for UART callback
Do not use timeout for UART callback. The UART IRQ bases on the IDLE
line, so waiting for additional bytes is not necessary and it introduce
additional latency.

Another issue with the timeout is that the UART drivers use sysworkq for
implementing timeout. The sysworkq thread may have lower prio than the
host command thread, which may cause a delay in calling the UART
callback, which gives the semaphore to the HC handler.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2023-10-20 15:17:47 +02:00
Jordan Yates 7aa34e6482 bluetooth: hci_core: handle NUM_COMPLETED_PACKETS rsp
The `BT_HCI_OP_HOST_NUM_COMPLETED_PACKETS` is not expected to generate a
response from the controller, but from the spec:

Normally, no event is generated after the
HCI_Host_Number_Of_Completed_Packets command has completed. However, if
the HCI_Host_Number_Of_Completed_Packets command contains one or more
invalid parameters, the Controller shall return an HCI_Command_Complete
event with a failure status indicating the Invalid HCI Command
Parameters error code.

In practice, this can also be generated if flow control is inadvertedly
turned off during operation. Running `hci_cmd_done` is not correct when
the event happens (as there is no corresponding command buffer), and
`ncmd` should not be returned as this command ignores the semaphore when
sending.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2023-10-20 15:16:54 +02:00
Anders Storrø fe9ffdaded tests: Bluetooth: Mesh: Op_agg coex loopback test
Adds coexistence Bsim test for Opcode Aggregator models using loopback.
The test verifies that the Opcode Aggregator server and client can send
messages to each other on the loopback interface.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-20 15:16:33 +02:00
Anders Storrø fc152c8e43 tests: Bluetooth: Mesh: Add op_agg coex test
Adds coexistence Bsim test for Opcode Aggregator models.
The test verifies that the Opcode Aggregator server and client can be
present and functional when operating on the same device.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-20 15:16:33 +02:00
Anders Storrø 0a25a61c7d Bluetooth: Mesh: Op agg mdl coex
Refactors the implementation of the Opcode Aggregator
models to allow them to coexist on the same device.

Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>
2023-10-20 15:16:33 +02:00
Jukka Rissanen 31081d8411 net: tcp: Change FL() macro to avoid runtime overhead
Instead of strlen() use sizeof() in FL() macro. This way
all the checks are done at compile time instead of runtime.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2023-10-20 15:15:28 +02:00
Martin Gritzan ff2b827143 drivers: stm32-exti: do not lock hwsem on irq disable
Remove the HWSEM locking around stm32_exti_disable().

The STM32 EXTI driver uses the core-local interrupt mask regsiters on
STM32H7x7 asym. dualcore MCUs. There is no need to lock the HWSEM
guarding the EXTI when accessing these registers.

Some sensor drivers toggle their interrupt mask every time the sensor
triggers the IRQ line. Locking the HWSEM fails e.g. in situations where
one coprocessor serivces the sensor and the other coprocessor sets up
its interrupts initially during bootup. This prevents the sensor driver
from locking the HWSEM and causes a kernel panic on the corresponding
CPU.

Note: The opposing stm32_exti_enable() was already correctly without
locking.

Signed-off-by: Martin Gritzan <martin.gritzan@gmail.com>
2023-10-20 15:15:15 +02:00
Håvard Reierstad 765b31979f Bluetooth: mesh: update model extension
Adds a goto statement to ensure that model extensions are registered
in Composition Data Page 1 if it is enabled.

Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
2023-10-20 15:14:41 +02:00
Alberto Escolar Piedras 7e852d1708 drivers timer nrf: Correct dependencies for simulation
Let's make the nrf rtc kconfig depend on the SOC_COMPATIBLE
options which are set both by the real and simulated targets
so the configuration matches in both cases.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2023-10-20 15:14:30 +02:00
Daniel Leung d1813e547e arm: using -EAGAIN directly instead of _k_neg_eagain
_k_neg_eagain is there for used in assembly where including
errno.h is not possible. However, the usage in ARM was simply
to assign value to swap_return_value in a C file, which is
no need to use _k_neg_eagain as errno.h can be included.
So change that to use -EAGAIN directly. Saves 4 bytes in
built binaries in rodata.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2023-10-20 15:14:13 +02:00
Dennis Grijalva 2516aa8b0b drivers: regulator: pca9420: Add support for configuring ASYS UVLO
Add support for configuring ASYS UVLO (under voltage lock out) threshold

Signed-off-by: Dennis Grijalva <dennisgrijalva@meta.com>
2023-10-20 15:14:04 +02:00
Ludvig Jordet c613e23b4a Bluetooth: Mesh: Fix issue where dfu_cli could get stuck
This fixes an issue where the DFU client could get stuck trying to
transmit a message to servers if the DFU client was misconfigured, for
instance missing application key or network key.

Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
2023-10-20 15:13:53 +02:00
Mariusz Skamra 281ffe5b4f tests: Bluetooth: tester: Fix bt_micp_mic_ctlr_mute_get invalid usage
The call to bt_micp_mic_ctlr_mute_get function will return the value of
mute state in bt_micp_mic_ctlr_cb.mute callback. This fixes invalid
function calls by storing the recent mute state value in the
application.

Fixes: MICP/CL/SPE/BI-01-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
2023-10-20 15:13:46 +02:00
Pavel Vasilyev 337ba330a2 Bluetooth: Mesh: Allow to set the extension list size to zero
If instantiated models don't have any relations at all, then the
extensions list will be empty. We should allow to disable it at all
to not waste RAM.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
2023-10-20 15:13:35 +02:00
Robert Lubos 822a82d619 tests: lib: thrift: Fix timing issues with TCP
The test delegates putting the server socket into listening (i. e.
calling listen() on the socket) to a separate thread, which did have a
chance to run before client attempted to establish TCP connection.

This was not visible before, as we did not reply with RST to a
connection attempt on a closed port, so the connection was eventually
establish after SYN retransmission. But as we do reject such a
connection now with RST, the connection attempt failed. Therefore, a
small delay was added after spawning the server thread, to give it a
chance to configure the server socket.

Additionally, lower the CONFIG_NET_TCP_TIME_WAIT_DELAY value so that TCP
contexts are released earlier, and add a respective delay in the test
teardown function. Not doing so also triggered unneeded SYN
retransmissions, as there were no enough TCP context to accept the
incoming connection, before freeing the resources allocated for the
previous one.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Robert Lubos 4ea3d247d0 net: tcp: Add Kconfig option to enable TCP RST on unbound ports
Add Kconfig option to control TCP RST behavior on connection attempts on
unbound ports. If enabled, TCP stack will reply with RST packet (enabled
by default).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Robert Lubos 2b601b34ff tests: net: tcp: Add tests to cover improved RST handling
Add tests which verify that Zephyr's TCP stack replies with RST packet
as expected.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Robert Lubos 95d9543e2e net: tcp: Send RST reply for unexpected TCP packets
Send RST as a reply for unexpected TCP packets in the following
scenarios:
1) Unexpected ACK value received during handshake (connection still open
   on the peer side),
2) Unexpected data packet on a listening port (accepted connection
   closed),
3) SYN received on a closed port.

This allows the other end to detect that the connection is no longer
valid (for example due to reboot) and release the resources.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Robert Lubos a28215d028 net: tcp: Add helper function to send RST packet w/o active connection
Add a helper function which allows to send a RST packet in response to
an unexpected TCP packet, w/o associated connection or net context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2023-10-20 15:13:22 +02:00
Tahir Akram 7c7c8f193e drivers: modem: introducing config for cereg/creg for gsm
This contribution addresses the support for various types of modems in
gsm driver. As some 4G modems have failed to return correct output
from AT+CREG?, so AT+CEREG? is the right AT command in such situation.
This commit provides the possibility for user to select one type of
AT command. This PR fixes zephyrproject-rtos#63917

Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
2023-10-20 15:13:08 +02:00
Tomasz Leman adf6d0e3d8 soc: intel_adsp: lpsram enable retention mode
This patch enables memory retention mode on lpsram.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman eeb4f2f76d soc: intel_adsp: hpsram enable retention mode
This patch enables memory retention mode on hpsram.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman 16f729214b soc: intel_adsp: lpsram init refactor
This patch contains small refactor of lpsram init function (defines
registers and adds new macro).

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Tomasz Leman 112611378f soc: intel_adsp: hpsram init refactor
This patch reuse existing macro for better readability.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-10-20 15:12:53 +02:00
Seppo Takalo a95bafec74 net: lwm2m: Check access rights on composite operations
Composite operations need to check read/write access
rights as well.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:12:39 +02:00
Seppo Takalo 77ea861f12 net: lwm2m: Fix composite operations
As composite operations don't have path in CoAP packet,
it wrongly triggered a check for security object and got
denied the access.

Fixes #64012

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:12:39 +02:00
Seppo Takalo bd0ad5bd66 net: lwm2m: Initialize empty string sizes correctly on objects
When objects are initialized, empty strings should be set to length of
zero, instead of length of the full buffer.

So use INIT_OBJ_RES_DATA_LEN() to give both, the buffer size and data
length.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:11:32 +02:00
Seppo Takalo 015b1103fb net: lwm2m: Properly initialize buffers for resource instance
When resource instances are initialized, we must calculate
beginning of the data buffer using the index and maximum
data length. Otherwise buffers would overlap with previous.

Fixes #64011

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:11:32 +02:00
Seppo Takalo 36d6a7257b net: lwm2m: Count null-terminator in string size
As the lwm2m_registry.c and specificly lwm2m_set()
functions already ensure null-terminator on string and
count that into string lenght, the content type handlers
should do the same.

When string is written, strlen()+1 is the data length.
When string is read, use the data length, so we don't
leak uninitialized strings. If buffer overrun have
removed the null-terminator the strlen() migh be larger
than data_len.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2023-10-20 15:11:32 +02:00