Commit graph

96577 commits

Author SHA1 Message Date
Dominik Ermel
ea627fda7e drivers/flash: Add explict erase capability with proper values
Add explicit_erase capability and set proper value to it,
depending on type of a device.
Select FLASH_HAS_EXPLICIT_ERASE by devices that have program-erase
characteristics and FLASH_HAS_NO_EXPLICIT_ERASE, where needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
0e970c8362 drivers/flash/nrf_mram: Set no explicit erase capability to true
NRF MRAM does not require erase prior to re-programming already
written area.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
127bc5e35e drivers/flash/nrf_rram: Set no explicit erase capability to true
NRF RRAM does not require erase prior to re-programming already
written area.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
6d75bc519b drivers/flash/nrf: Mark driver as FLASH_HAS_EXPLICIT_ERASE
Select CONFIG_FLASH_HAS_EXPLICIT_ERASE for the NRF driver.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
bbb7bbe46d tests/flash_simulator: Test scenario for flash_flatten()
The commit adds test scenarios for flash_fill() and flash_flatten()
Flash API calls.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
ff81b52448 drivers/flash_simulator: Add support for non-erase device
The commit adds support for testing non-explicite-erase
device on Flash Simulator. This is addition to already supported
explicit erase before write, aka Flash, type of device behaviour.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
a5f7ceff81 storage/flash_map: Add flash_area_flatten
Add equivalent of flash_erase, from Flash API, to Flash Map API;
idea is the same: function tries to erase area if driver provides
erase function, otherwise writes erase_value across the defined
area.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
b8d073c572 drivers/flash: Add flash_fill() and flash_flatten()
The commit adds two new API calls:
 - flash_fill - that allows to fill selected part of device with
   specified value;
 - flash_flatten - that allows to erase or fill device with
   erase_value, depending on whether driver for the device provides
   erase callback.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
010b8d19e9 tests/drivers/flash: Make tests check for explicit erase capability
Test now check whether device has requirement for explicit erase
before call or not, before performing various actions.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Dominik Ermel
b3c9f957c6 drivers/flash: Add explicit_erase property
The commit adds and no_explicit_erase capability to flash_parameters,
that indicates whether device is program-erase type device; such
devices, like Flash type devices, require erase prior to writing
random data at any previously programmed location.
This capability should only be set by drivers.

The flash_params_get_erase_cap() function has been added, for parsing
flash_parameters object to obtain erase capabilities of device.
The function returns capabilities as combination of bits representing
them. Currently it will return:
 0 -- no erase capabilities
 FLASH_ERASE_C_EXPLICIT -- erase required before write of random data.
Additional capabilities have been reserved but are not yet used.

There are following Kconfig options added:
 FLASH_HAS_EXPLICIT_ERASE
 FLASH_HAS_NO_EXPLICIT_ERASE
that should be selected by device driver to indicate whether
devices served by driver needs erase prior to write.
The above Kconfigs are used to figure out whether app is built
for hardware that requires erase prior to write.
They can be also used to detect that it is attempted to build
some subsystem that will not work with provided hardware, for example
file system that has not been prepared to work with devices that
do not require erase.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-04 08:00:46 +02:00
Krystof Sadlik
fb61c7b360 tests: i2c: Fixed overlay for frdm board
Fixed overlay for frdm board as well.

Signed-off-by: Krystof Sadlik <krystof.sadlik@nxp.com>
2024-06-04 07:59:21 +02:00
Krystof Sadlik
fe60a49c67 tests: i2c: i2c_target_api: fixed sizes in ovelay
Fixed sizes in ovelay files.

Signed-off-by: Krystof Sadlik <krystof.sadlik@nxp.com>
2024-06-04 07:59:21 +02:00
Krystof Sadlik
d05cad1784 tests: i2c: i2c_target_api: added single mode testcase
Some drivers do not support dual mode testcase. It would be great to test
both signle and dual mode, even when the drivers do support this feature.

Signed-off-by: Krystof Sadlik <krystof.sadlik@nxp.com>
2024-06-04 07:59:21 +02:00
Anas Nashif
d877d29913 twister: abort on execution and retun 0 on exceptions
When something goes wrong with execution, due to twister issues and
bugs, do not continue with execution and abort the process and report
and return an error code.

Fixes #72807

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-06-04 07:58:31 +02:00
Ederson de Souza
7f0b5edd8c arch/x86: Make irq_offload SMP-safe on x86_64
The irq_offload mechanism was using the same entry of the IDT vector for
all CPUs on SMP systems. This caused race conditions when two CPUs were
doing irq_offload() calls.

This patch addresses that by adding one indirection layer: the
irq_offload() now sets a per CPU entry with the routine and parameter to
be run. Then a software interrupt is generated, and a default handler
will do the appropriate dispatching.

Finally, test "kernel/smp_abort" is enabled for x86 as it should work
now.

Fixes #72172.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2024-06-04 07:57:06 +02:00
Johann Fischer
af63e488f0 usb: device_next: hid: fix Get Report buffer handling
After the get_report() callback, we need to determine how many bytes the
HID device wrote to the report buffer. Use the callback return value to
do this, and modify the net_buf data length value if get_report was
successful.

Reported-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-04 07:56:45 +02:00
Tom Chang
a33341ac66 drivers: espi: npcx: add support 66MHz eSPI clock
This CL adds support 66MHz eSPI clock for NPCX4.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
2024-06-04 07:56:19 +02:00
alperen sener
c93859c659 bluetooth: mesh: fix lpn receive window timing error
APIs for enabling and disabling the scanner may take larger time than
expected and scheduling of the lpn state machine is affected by it.
Since these type of latencies are factored into timeouts and scheduling
times, we need to call scan enable/disable APIs after scheduling the
next event time for LPN state machine to be more accurate.

Signed-off-by: alperen sener <alperen.sener@nordicsemi.no>
2024-06-04 07:55:59 +02:00
Evgeniy Paltsev
f33306ab2f MAINTAINERS: add hostlink channel sources to Synopsys Platforms
Virtual UART over ARC hostlink channel driver is used on
Synopsys platforms and maintained by Synopsys.

Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
2024-06-04 07:55:35 +02:00
Marek Pieta
059643062c usb: device_next: Update remote wakeup log level
The `Remote wakeup feature not enabled or not suspended` log is not
related to an actual error (connected host might not enable USB remote
wakeup feature). Use warning log level.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2024-06-04 07:55:22 +02:00
Valerio Setti
4fc6506a8a random: enable AES support CTR_DRBG CSPRNG when it relies on Mbed TLS
PR #72475 disabled default enabling of many Mbed TLS features
including AES. This means that now it must be explicitly added
when required.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-03 16:13:05 -04:00
Yassine El Aissaoui
73bf6f6371 samples: bluetooth: Enable PM on rd_rw612_bga
Enable PM by default for rd_rw612_bga
on peripheral_ht and central_ht
samples

Those are the BLE samples running on
the CI, so it will be better to also
check the builds with PM and also
have some BLE apps to try PM with.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
2024-06-03 16:11:49 -04:00
Luis Ubieda
3f90957e36 snippets: cdc-acm-console: Redirect Shell target to USB
To easily enable Shell over USB. Tested with:
```
west build -b nrf52840dk/nrf52840 \
           -S cdc-acm-console` \
           samples/subsys/shell/shell_module
```

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2024-06-03 16:11:18 -04:00
Hess Nathan
aaec285cd5 coding guidelines: comply with MISRA Rule 12.1.
-added parentheses verifying lack of ambiguities

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-06-03 16:10:33 -04:00
Hess Nathan
209a3bd40a coding guidelines: comply with MISRA Rule 11.8
- modified parameter types to receive a const pointer when a
  non-const pointer is not needed

Signed-off-by: Hess Nathan <nhess@baumer.com>
2024-06-03 16:09:51 -04:00
Maciej Perkowski
a9565f7a96 docs: Add pytest files to a scope triggering doc-build workflow
Those files are used with autoclass to use their docstrings
in docs.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2024-06-03 16:08:50 -04:00
Tom Burdick
90c1aaad69 tests: i2c_ram: Add fixture for i2c_ram testing
i2c_ram expects that a ram-like part is connected to an i2c bus and
therefore requires a hardware fixture setup much like spi_loopback.

Adds a fixture that must be designated when running twister tests on a
board with -X i2c_ram.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
2024-06-03 16:07:59 -04:00
Henrik Brix Andersen
e087d1bbb3 tests: drivers: can: api: add test for frame without data
Add test for sending/receing a CAN classic frame with no data.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-03 16:07:47 -04:00
Kai Vehmanen
1541fe9e2f intel_adsp/ace: power: fix address space annotation for powerdown
power_down() expects a cached pointer. Fix the sparse annotation
to match the implementation (sys_cache_cached_ptr_get() returns a cached
pointer so this is correct).

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-06-03 16:07:28 -04:00
Luca Burelli
0d2b3e1f36 samples: add IS31FL3194 RGB LED driver sample
This sample app cycles several colors on an RGB LED forever using the LED
API. It can be built and executed on an Arduino Nicla Sense ME, or on any
board where the devicetree has a similar compatible I2C device node.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-03 15:30:01 -04:00
Luca Burelli
5fea5c4358 arduino_nicla_sense_me: add RGB LED support to the device tree
This patch enables the user to control the RGB LED on the Arduino Nicla
Sense ME board. The RGB LED is controlled by the IS31FL3194 LED driver
and is connected to the I2C0 bus.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-03 15:30:01 -04:00
Luca Burelli
912a581a95 drivers/led: add IS31FL3194 LED driver
Add support for the IS31FL3194 3-channel LED driver. This driver can be
configured to handle its outputs as either a single RGB LED or (up to)
three independent LEDs.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-03 15:30:01 -04:00
Mathieu Choplain
8aa6ae43ce llext: add support for SLID-based linking
This commit introduces support for an alternate linking method in the
LLEXT subsystem, called "SLID" (short for Symbol Link Identifier),
enabled by the CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID Kconfig option.

SLID-based linking uses a unique identifier (integer) to identify
exported symbols, instead of using the symbol name as done currently.
This approach provides several benefits:
 * linking is faster because the comparison operation to determine
   whether we found the correct symbol in the export table is now an
   integer compare, instead of a string compare
 * binary size is reduced as symbol names can be dropped from the binary
 * confidentiality is improved as a side-effect, as symbol names are no
   longer present in the binary

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
2024-06-03 15:29:34 -04:00
Joel Guittet
05ad2565fa llext: add _POSIX_C_SOURCE definition to build shell
Fix implicit-function-declaration warning while building the llext shell.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2024-06-03 15:28:33 -04:00
Luca Burelli
435b72dc18 llext: add a test for the pre_located feature
This test checks that the pre_located feature works as expected. It
creates a new extension that is manually relocated to a specific address
via the add_llext_command() CMake function invoking a custom linker
command. The test then loads the extension setting the pre_located
option and checks that the symbol is resolved properly.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-03 15:28:18 -04:00
Emil Gydesen
92002b2dff Bluetooth: CAP: Implement bt_cap_initiator_unregister_cb
Implement function to unregisterd the CAP initiator callbacks.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-03 15:28:05 -04:00
Alberto Escolar Piedras
68adc77cbd boards nrf_bsim: Add NVIC_GetEnableIRQ()
Provide a replacement for CMSIS' NVIC_GetEnableIRQ()
as some applications use it.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-03 15:27:48 -04:00
Francois Ramu
5bd1689ac8 boards: st: stm32c0116_dk defines the select pin with zephyr,code
Define the select_key with the correct zephyr,code
which is <INPUT_KEY_ENTER>

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-03 15:27:36 -04:00
Henrik Brix Andersen
64e9ba3742 dts: bindings: can: native linux: the CAN Linux driver supports CAN FD
The native Linux CAN driver supports CAN FD. Change the binding to reflect
this. No functional changes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-03 15:27:17 -04:00
Henrik Brix Andersen
8edbbdf332 dts: bindings: can: loopback: the CAN loopback driver supports CAN FD
The CAN loopback driver supports CAN FD. Change the binding to reflect
this. No functional changes.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-06-03 15:27:17 -04:00
Maureen Helm
6305c17d6e manifest: Update hal_adi to pick up newlib compatibility fix
Updates the hal_adi module to pick up a fix for building with newlib.

Signed-off-by: Maureen Helm <maureen.helm@analog.com>
2024-06-03 15:27:00 -04:00
Tomasz Moń
8d344cc9d8 usb: device_next: Rename usbd_contex to usbd_context
Add the missing "t" to struct usbd_contex. No functional changes.

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2024-06-03 06:43:20 -07:00
frei tycho
b76fde64a1 include: kernel: added missing parenthesis
- added missing parenthesis around macro argument expansion

Signed-off-by: frei tycho <tfrei@baumer.com>
2024-06-03 15:43:09 +02:00
Emil Gydesen
d2fbeffaa9 Bluetooth: BAP: Unicast client Split start and connect
Removes the CIS connection establishment from bt_bap_stream_start
and move the behavior to a new funciton bt_bap_stream_connect.

This has 2 advantages:
1) The behavior of bt_bap_stream_start is much more clear and more aligned
with the spec's behavior for the receiver start ready opcode.
2) It is possible to connect streams in both the enabling
and the QoS configured state with bt_bap_stream_connect as
per the spec. This allows us to pass additional PTS test cases.

To implement this new behavior, samples and tests have been updated.

The CAP Initiator implementation has also been updated
to accomodate for the change in BAP, but the CAP
initiator implementation should work the same for application, except
that it's now possible to do unicast start on ASEs in any order
(https://github.com/zephyrproject-rtos/zephyr/issues/72138).

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2024-06-03 15:42:33 +02:00
Ioannis Karachalios
5b0cc42968 drivers: clock_control: smartbond: Update clock control driver
This commit should deal with the followings:

1. PLL requires that VDD level be changed to 1V2 and then released
   to 0V9 when it's turned off. Changing the VDD level should be
   done when the regulator driver is available. Otherwise, the VDD
   level will be fixed to 1V2 (reset value).

2. Check if PLL is allowed to be turned off as it might happen that
   USB is enabled which is clocked by PLL.

3. Do not wait for the PLL to lock. This is now performed silently
   when PLL is requested.

4. Before switching to PLL we should check if PLL is already enabled
   as it might happen that PLL node is initially disabled.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:41:20 +02:00
Ioannis Karachalios
570a508633 drivers: regulator: smartbond: Regulator driver update
This commit should deal with the followings:

1. Change regulator's driver priority as it should now
   be used by the clock control driver.
2. Check if the VDD level is permitted to change when PLL
   is the system clock. This is because the PLL requires
   that VDD be 1.2V.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:41:20 +02:00
Ioannis Karachalios
c1fecdc2e3 west: Update manifest revision
Update the manifest SHA to point to the HAL PR
that introduces the PLL clock handling updates.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:41:20 +02:00
Ioannis Karachalios
8c651be4ef drivers: counter: smartbond: Add support for PM
This commit should add all the functionality needed for the counter
driver to work when PM is enabled. The sleep state is bound to the
counter start/stop functionality. TIMER3/4 block instances are
powered by PD_SYS and so sleep should be constrained when they are
up and running. On the other hand TIMER1/2 block instances are
powered by PD_TMR which is always on (used to generate the os tick).

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
2024-06-03 15:40:24 +02:00
Erwan Gouriou
a8b04606af west.yml: hal_stm32: Don't include legacy headers anymore
We're not supposed to rely on symbols provided by these files.
In case it is required stm32 zephyr code base should be updated rather
than relying on legacy definitions.

Additionally:
Fixes #70136

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2024-06-03 15:39:51 +02:00
Rubin Gerritsen
3609d97c95 Bluetooth: Document reasons for HCI command timeouts
When reading the error message:
"ASSERTION_FAIL: command opcode 0x0c03 timeout with err -11" it may not be
obvious what is wrong with their setup unless you are very familiar
with HCI.

This commit adds some more documentation to make this more obvious.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-06-03 15:39:23 +02:00