Commit graph

97633 commits

Author SHA1 Message Date
Valerio Setti
9032f8d791 bt-crypto: add option to use PSA APIs instead of TinyCrypt
This commit adds CONFIG_BT_USE_PSA_API to allow the end
user to prefer PSA APIs over TinyCrypt for crypto operations
in bluetooth. Of course, this is possible only if
a PSA provider is available on the system, i.e.
CONFIG_PSA_CRYPTO_CLIENT is set.

This commit also extends tests/bluetooth/bt_crypto adding
a test case for PSA.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-14 15:41:34 +02:00
Valerio Setti
a9f7788f9f trusted-firmware-m: select PSA_CRYPTO_CLIENT when BUILD_WITH_TFM
TF-M is a PSA API provider alternative to Mbed TLS one. As
a consequence when CONFIG_BUILD_WITH_TFM is set
CONFIG_PSA_CRYPTO_CLIENT should be set as well.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2024-06-14 15:41:34 +02:00
Evgeniy Paltsev
ec72339d61 ARC: enable barriers for HS
As we start to use data memory barriers in SMP scheduler code
explicitly (not only internaly in the atomics implementation)
let's enable barriers for ARC HS.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2024-06-14 15:38:39 +02:00
Jeppe Odgaard
86fa756dde tests: drivers: dac: use zassert_ok
Replace `zassert_equal` with `zassert_ok` where return value contains 0
or errno.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2024-06-14 15:38:24 +02:00
Thibo Verheyde
ddef306394 drivers: serial: esp32: Fix next buffer release on rx disable
Set event data rx buffer as next buffer instead of current buffer.

Signed-off-by: Thibo Verheyde <thibo@dptechnics.com>
2024-06-14 15:38:02 +02:00
Sigmund Klåpbakken
6f215526d7 runners: jlink: Add support for big endian device
Sets the endianness of the JLink and the GDB Server based on if
`CONFIG_BIG_ENDIAN` is set.

Doc on JLink LE/BE option:
https://wiki.segger.com/J-Link_Commander#LE

Doc on GDB server -endian option:
https://wiki.segger.com/J-Link_GDB_Server#-endian

Signed-off-by: Sigmund Klåpbakken <sigmundklaa@outlook.com>
2024-06-14 15:37:46 +02:00
Daniel Leung
e98e4ed067 serial: convert kconfig source to rsource
Simple cosmetic change to convert all the source commands
to rsource so that includes are relative to driver/serial.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2024-06-14 15:37:31 +02:00
Dominik Ermel
a593f344b5 tests/storage/flash_map: Fix erase and flatten test
Fix offset read for verification and comparison of read to
erased value, where type mismatch has been causing fails in
comparisons.

Fixes #74066

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-06-14 15:37:10 +02:00
Marcel Birthelmer
58a54e3452 soc: samd51: Fix xosc32 initialization
At osc32k_init in the soc_samd5x.c file the start-up value of 7 which
is reserved. This fixes the startup timeout and control gain with the
correct values.

Signed-off-by: Marcel Birthelmer <marcel@carrietech.com>
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2024-06-14 15:36:55 +02:00
Yangbo Lu
b77dab6199 drivers: ethernet: phy_realtek_rtl8211f: enable RGMII TX/RX delay
The RGMII specifies output TXC/RXC and TXD/RXD without any clock skew.
Need to add skew on clock line to make sure the other side sample
right data. This can also be done in PCB traces.
This patch is to enable RGMII TX/RX delay to ensure timing.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-06-14 15:36:39 +02:00
Yangbo Lu
e5f6cee9fb drivers: ethernet: phy_realtek_rtl8211f: fix monitor work schedule
Monitor work should be scheduled for non-interrupt mode.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
2024-06-14 15:36:39 +02:00
Sebastian Głąb
48fc6877e4 samples: drivers: adc: adc_sequence: Enable test execution on nrf54h20
Add overlay file for nrf54h20 cpuapp target.
Add nrf54h20 target to platform_allow.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-14 15:36:17 +02:00
Sebastian Głąb
cc9bd6d77e samples: drivers: adc: adc_dt: Add nrf54h20 to platform_allow
Enable test execution on nrf54h20dk.
Overlay file already exists.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-14 15:36:17 +02:00
Sebastian Głąb
a3e1e398bf boards: nordic: nrf54h20: Add ADC to the list of supported peripherals
ADC driver was aligned to nrf54h20 target.
Enable ADC Twister tests on that platform.

Signed-off-by: Sebastian Głąb <sebastian.glab@nordicsemi.no>
2024-06-14 15:36:17 +02:00
Piotr Kosycarz
1b3725e099 samples: sensor: accel_polling: Allow coverage calculation
Sample must end to dump coverage data.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 15:35:17 +02:00
Piotr Kosycarz
e63c691a86 samples: sensor: bme680: Allow coverage calculation
Sample must end to dump coverage data.

Signed-off-by: Piotr Kosycarz <piotr.kosycarz@nordicsemi.no>
2024-06-14 15:35:02 +02:00
Seppo Takalo
35cc774aa5 net: lwm2m: Retry DTLS handshake before dropping to bootstrap
Allow DTLS handshake to be retried before the engine
drops into bootstrap. Otherwise any termporary failure,
for example DNS failure might drop us into bootstrap
without retrying.

Now all the retry logic should be in sm_do_network_error().
sm_do_registration() should only fall back to bootstrap
if there is configuration error.

Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
2024-06-14 15:34:39 +02:00
Jens Rehhoff Thomsen
ab9fd0b5c9 Bluetooth: BAP: Add bt_bap_base_get_size function
bt_bap_base_get_size function returns the size of the BASE.

Fixes #73847

Signed-off-by: Jens Rehhoff Thomsen <jthm@demant.com>
2024-06-14 15:34:23 +02:00
Rubin Gerritsen
768c45a11d Bluetooth: Controller: Clarify that it can be overridden out of tree
Nordic devices are commonly used with the nRF Connect SDK.
There the SoftDevice Controller is set as the default
Bluetooth Controller. To avoid confusion when reading DTS
and Kconfig files, clarify this by adding a note.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
2024-06-14 15:33:59 +02:00
Andries Kruithof
811387600a Bluetooth: Audio: CAP: babblesim test for broadcast reception start
Add a babblesim test for the broadcast reception start procedure
from the CAP commander

Signed-off-by: Andries Kruithof <andries.kruithof@nordicsemi.no>
2024-06-14 15:33:34 +02:00
Alberto Escolar Piedras
9ae5352372 tests/bsim/run_parallel.sh: Do not attempt to run parallel with no tests
If there is no tests in the test list, do not attempt to run
parallel.
This avoids parallel trying to attempt to read the input from
the terminal in that case.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-14 05:31:08 -04:00
Alberto Escolar Piedras
c2950bec73 ci: bsim tests: Fix for missing result xml files
Do not fail during results merge if
twister or the bsim workflows did not run
(or produce an xml).
Depending on what has changed in a PR
and therefore what tests are run this can happen.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-06-14 05:31:08 -04:00
Yong Cong Sin
bb66d1188c arch: riscv: stacktrace: conditionally check stack_info
Check if an address is in the thread stack only when
`CONFIG_THREAD_STACK_INFO` is enabled, since otherwise the
`stack_info` will not be available.

This fixes compilation error when `CONFIG_THREAD_STACK_INFO`
is explicitly disabled.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-14 05:22:59 -04:00
Maximilian Deubel
96112ade74 drivers: swdp: document API
This patch adds documentation for the SWDP API.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Maximilian Deubel
f1b6073a27 driver: swdp_bitbang: hardcode request lut
Hardcode the lookup table for SWDP requests.
This is an optimization to save some space.
Documentation was added to understand the values.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Maximilian Deubel
05a45a19e3 dap: fix timeout handling
Use k_timepoint_t for timeout handling in the swj_pins function.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johann Fischer
94f48c7a78 samples: debug: add CMSIS DAP sample using USB as interface
Add CMSIS DAP sample using USB as interface.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johann Fischer
9a9afb0b54 dap: implement DAP SWD sequence command
DAP SWD sequence command is a requirement to support CMSIS-DAPv2.
Raise supported version to "2.1.0".

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johann Fischer
e31cdc00a0 dap: react properly to unsupported UART commands
Add ID_DAP_UART_* command definitions and react properly to
unsupported UART commands.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Maximilian Deubel
58d9d889aa dap: add support for DAP_INFO string elements
Add support for DAP_INFO string elements.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Maximilian Deubel
6522dd7f53 dap: implement wait for SWJ pins command
Implement wait for SWJ pins command.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johann Fischer
3e8f9fb7df drivers: swdp_bitbang: add SW output sequence
Add API to read count bits from SWDIO into data LSB first.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Maximilian Deubel
3ef2c66a8a driver: swdp_bitbang: rework pin configurations
Move low-level GPIO functions to a separate file and use GPIO driver
API if low-level GPIO support is not available for the platform.
Allows alternative pin configuration using only two pins, clk and dio.
Improve binding description.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johan Carlsson
f5ccc3c82c dap: do not return error in DAP connect command
If a host client crashes or fails to disconnect, the probe will
hang. Allow a new connection without raising errors.

Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Johan Carlsson
e46e72320e dap: add Konfig option to set maximum packet size
This also fixes a bug where the packet size returned was only 17 byte.

Signed-off-by: Johan Carlsson <johan.carlsson@teenage.engineering>
2024-06-14 11:14:17 +02:00
Johann Fischer
7c9259abbc dap: add CMSIS-DAP compatible controller
Add CMSIS-DAP compatible controller which is a handler between
the host interface and SWD driver. The controller follows CMSIS-DAP
reference implementation. It expects a request buffer from the host
interface, splits it to simple transfers and forwards to the DP driver,
and finally returns a response buffer to the host.
Interface to the host can be implemented with USB HID device support.

Controller implements only SW-DP support and is tested
with pyOCD and ADIv5.x.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2024-06-14 11:14:17 +02:00
Johann Fischer
3cf630fb0b driver: add SWDP driver interface API and bit-bang driver
Add Serial Wire Debug Port interface driver API and bit-bang driver.

The driver requires a simple Hardware Interface Circuits (HICs),
where signals CLK, DOUT, DIN, ENn, OE_ENn, RESETn
are connected to board GPIOs and buffered signals SWD_CLK and SWD_DIO
to the target.

Signal OE_ENn controls the direction of the Serial Wire (SWD_DIO),
ENn the buffers SWD_CLK possibly others and enables/disables HIC.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2024-06-14 11:14:17 +02:00
Francois Ramu
2146813cb3 tests: drivers: adc stm32 api testing on the stm32h7s78 disco kit
add the stm32h7s78_dk disco kit to run the tests drivers
This  testcase is executed (XiP) from the external NOR
of the stm32h7s78_dk board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
e78cdc823d boards: arm: stm32h7s78 disco kit supporting more features
Add the ADC, WDG, entropy features to the stm32h7s78_dk disco kit

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
4ade2a88e4 dts: arm: stm32h7 add wdg and adc, rng node to stm32h7R/h7S devices
Add the IWDG and WWDG watchdog peripherals
the ADC1 & 2 peripherals with sensor for die temperature and voltage
the RNG entropy generator

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
b014150508 drivers: flash: stm32h7 flash driver supports the stm32h7rs serie
Add the support of the stm32h7rs serie to the flash stm32h7 driver
Remap Flash registers to the stm32h7rs serie.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
da8a812582 drivers: adc: stm32 adc driver supporting the stm32H7RS
Introduce the stm32h7RS serie to the ADC driver,
based on the stm32h7: two ADC 12 resolution
For stm32h7rs ADC calibration, the
LL_ADC_SetCalibrationFactor is not used.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
24ff13e92c drivers: watchdog: stm32 wdg driver support stm32H7RS serie
Add the stm32h7rs serie to the stm32 WDG driver

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Francois Ramu
895ef1d6c5 drivers: hwinfo: stm32 driver supports the stm32h7rs serie
Add the support of the stm32h7rs serie to the HWinfo
driver. UID base is 0x8FFF800

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2024-06-14 11:13:54 +02:00
Luca Burelli
08eb314c35 llext: refactor: use cached section headers
The section headers are now available in the loader structure, so we can
use those directly instead of reading them from the ELF file every time.

This commit contains no logic changes; it removes all copies of the
header loading code and replaces them with direct access to the cached
section headers.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-14 11:13:44 +02:00
Luca Burelli
817bbda5cc llext: read all section headers at once
This change reads all section headers at once, instead of reading them
one by one. This is more efficient and allows to further simplify the
code downstream.

The section headers are directly accessed from the file buffer if the
llext_peek() function is supported by the loader. Otherwise, they are
read into a buffer allocated on the heap and used only during the
llext_load() function.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-14 11:13:44 +02:00
Luca Burelli
a976a1a25c llext: llext_load: document memory management policy
The do_llext_load function is responsible for loading an extension from a
file, and for this purpose it calls a number of functions that a) allocate
memory, and b) can fail. This creates the opportunity for memory leaks if
the error paths are not handled correctly.

This commit adds a comment at the beginning of the function to document
the memory management policy that has to be followed in this file:
cleanup is not performed in the error paths, and all memory is freed at
the end of the do_llext_load() function, both in the case of error and of
successful loading.

As an improvement, the symbol table is not freed if the LLEXT log level
is set to debug, so that it can be used, for example, to inspect the
symbols of the loaded extension.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-14 11:13:44 +02:00
Luca Burelli
89e27b9312 llext: improve debug messages
The recent llext_map_sections() rework changed the way debug messages
are output so that the names of most skipped sections are not printed
at all. This makes debugging harder since the section names are useful
to identify the contents at a glance.

Also print a few additional fields from the section header, and use 0x
prefixes for hex numbers.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2024-06-14 11:13:44 +02:00
Sercan Erat
0666fe2a35 boards: rak: Add Rak11720 board
Added support for the Rak11720 board. Rak11720 is a WisBlock Core module
with Apollo3 Blue SoC from Ambiq and a Semtech SX1262 LoRa® transceiver.
For more information about this board please check:
https://docs.rakwireless.com/Product-Categories/WisDuo/RAK11720-Module/Overview/#product-description

There are known issues that have been identified while communicating
with SX1262 transceiver:

- Gpio interrupt handling error: ambiq_gpio_pin_interrupt_configure
function is not able to configure SX1262 Dio1 interrupt pin correctly.
Please check issue 73958.
- Spi communication error: Rak11720 uses a custom CS pin.
Firstly, custom CS pin support is necessary. Secondly, spi_ambiq_xfer
function is not able to communicate with SX1262 transceiver.
Please check issue 73959.

These issues have been documented for future solutions. Despite these
limitations, the current support enables basic functionality.

Examples can be build by below command for Rak11720:
west build -b rak11720 samples/hello_world

Signed-off-by: Sercan Erat <sercanerat@gmail.com>
2024-06-14 11:13:27 +02:00
Declan Snyder
163ddc0e84 boards: lpcxpresso5s69//ns: Fix mbedtls build err
Fix issue where when building with TFM and PSA client
there is an error from want RSA key type not being
defined in mbedTLS library.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2024-06-14 11:13:05 +02:00