Commit graph

109095 commits

Author SHA1 Message Date
Frank Audun Kvamtrø
2ca64a3449 audio: liblc3: Fix global include path issue
-liblc3 added a library-internal path to zephyr_interface containing
 a file that collides with common.h required e.g. by Mbed TLS
 This commit fixes build-issues by making this include-folder
 PRIVATE to the named library liblc3

Signed-off-by: Frank Audun Kvamtrø <frank.kvamtro@nordicsemi.no>
2025-01-27 13:26:02 +01:00
Dawid Niedzwiecki
8c97ba8017 drivers: flash: stm32h7: ensure option bytes write
Make sure to submit a change of option bytes and wait for the end of
the operation. It is done by checking the OPT_BUSY bit.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-01-27 13:25:43 +01:00
Dawid Niedzwiecki
f205b57174 drivers: flash: stm32h7: use a correct register to program RDP
The RDP level is set with the FLASH_OPTSR_PRG register and read with the
FLASH_OPTSR_CUR register, not FLASH_OPTCR.

Fix that to realy change and read RDP.

Signed-off-by: Dawid Niedzwiecki <dawidn@google.com>
2025-01-27 13:25:43 +01:00
Hake Huang
a88e429f79 tests: fat: fat_fs_api reduce the wipe partition sectors
As SD partition tables, GPT or MBT, is positioned at
the beginning of a device, it is enough to wipe first 64 sectors,
of 512 bytes. Wipe of entire SD card is very slow and unnecessary.

fixes: #84428

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-01-27 13:25:31 +01:00
Hake Huang
11ddf11f3b test: vlan: fix run exception for mimxrt1060_evk
add extra size for test

fixes: #84424

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2025-01-27 13:25:17 +01:00
Nikodem Kastelik
2692f16757 drivers: clock_control: nrf: ignore XOTUNE-related events for now
New events from nrfx_clock driver are not utilized for now
by the clock_control, so should be ignored to avoid assertion.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-01-27 13:25:02 +01:00
Nikodem Kastelik
3fe559a0c6 manifest: update hal_nordic revision to integrate nrfx 3.10.0
New nrfx version contains support for nRF7120 Eng A device.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2025-01-27 13:25:02 +01:00
Joel Holdsworth
52a1db1cf3 kernel: Fixed init_delay initialization on older GCC versions
Within the K_THREAD_DEFINE macro, a nested set of macros is expanded to
populate the values of a global _static_thread_data structure.

The K_THREAD_DEFINE macro expands to statements including the
Z_THREAD_COMMON_DEFINE macro, which expands to statements including the
Z_THREAD_INITIALIZER macro, which expands to an initialization expression
of a _static_thread_data struct. The init_delay member of that struct is
then initialized with the Z_THREAD_INIT_DELAY_INITIALIZER macro, which
expands to an expression including the SYS_TIMEOUT_MS macro which
converts a number of milliseconds to a number of ticks.

For example, take the following macro:

    K_THREAD_DEFINE(
        thread_X,
        STACKSIZE,
        thread_X_entry_point, NULL, NULL, NULL,
        PRIORITY,
        0,
        0);

In abbreviated form, it expands as follows:

    typedef struct {
        int ticks;
    } k_timeout_t;

    struct _static_thread_data {
        /* ... */
        k_timeout_t init_delay;
    };

    struct _static_thread_data _k_thread_data_thread_X = {
        /* ... */
        .init_delay = (k_timeout_t){ .ticks = 0 }
    };

However, in GCC versions before 5.1, the code fails to compile with the
error "initializer element is not constant", when compiled with the
following options:

    gcc -std=gnu99 -c test.c

In the above code, the error can be corrected by replacing...

    .init_delay = (k_timeout_t){ .ticks = 0 }

...with...

    .init_delay = { .ticks = 0 }

...i.e. removing initialization with a compound literal.

In order to achieve this, this patch reworks the system of macros.

The Z_TIMEOUT_TICKS(t) macro is refactored into Z_TIMEOUT_TICKS_INIT(t)
which defines the initializer part: { .ticks = t }, and Z_TIMEOUT_TICKS(t)
which is defined as ((k_timeout_t) Z_TIMEOUT_TICKS_INIT(t)) .

For symmetry, Z_TIMEOUT_NO_WAIT_INIT is split out of Z_TIMEOUT_NO_WAIT.

Similarly, SYS_TIMEOUT_MS_INIT(ms) is split out of SYS_TIMEOUT_MS(ms) so
that the Z_THREAD_INIT_DELAY_INITIALIZER(ms) macro can use
SYS_TIMEOUT_MS_INIT(ms) which expands Z_TIMEOUT_TICKS_INIT(t) to initialize
init_delay without using a compound literal.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
3901e8b2ff include: Add support for compilers which do not define __SIZEOF_INT__
__SIZEOF_INT__ is required by zephyr_stdint.h, however the __SIZEOF_*__
macros were only introduced in GCC 4.3.

This patch adds a work-around similar to that present in picolibc's
_default_types.h which attempts to guess the correct value of the
definition based on the value of __INT_MAX__ or from INT_MAX from
POSIX <limits.h> .

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
1716bbdb19 toolchain: gcc: Added fallback for __builtin_unreachable
Support for __builtin_unreachable() was added to GCC in the 4.5.0 release.
This patch adds a fallback to __builtin_trap() for older compilers which
do not have this built-in available.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
46e37b00e7 compiler: gcc: Support versions predating include-fixed/limits.h
GCC versions starting from 4.3.0 until 12.4.0 stored the limits.h header in
a directory named include-fixed/ . Before 4.3.0 and after 12.4.0 i.e. from
13.1.0 onward, the header is stored in a directory named include/ .

Previously, target.cmake would only detect if the GCC version was 13.1.0 or
newer. This patch adds a check to also check if it is older than 4.3.0.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
1b399d78fc picolibc: Replace hard coded -fno-lto flag
GCC versions before 4.5 do not have the -fno-lto flag and give an error if
it is used. The flag may also be unavailable on various other non-GCC
compilers.

Previously, the picolibc CMakeList.txt script assumed that the flag was
available, and hard-coded it as an addition to the compiler flags.

This patch improves compatibility by making use of the already existing
"prohibit_lto" CMake target compiler property, which is set to the
appropriate flag to disable LTO support, or unset if the compiler lacks
such an option.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
6d63d4d904 cmake: modules/FindGnuLd: support an additional obselete version format
A legacy build of GNU ld emits the following version string:

GNU ld version 2.17.50.0.9 20070103

This patch fixes the regex parsing so that the version number is correctly
extracted from the string.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
8b59dcfd11 cmake: compiler: Check -fno-printf-return-value before using
GCC versions before 7.1.0 do not have the -fno-printf-return-value flag and
give an error if it is used. This patch improves compatibility with older
compilers by making CMake check for the flag's availability before using.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Joel Holdsworth
c7bc47c60d cmake: compiler: Check -fdiagnostics-color=always before using
The -fdiagnostics-color flag is only on GCC versions 4.9.0 and newer.
Previously, CMake only checked that the compiler was not the XCC compiler
before using the flag.

However, given that the flag us unavailable on compilers other than XCC,
e.g. old versions of GCC, this patch replaces the previous logic with a
flag-check using the check_set_compiler_property() CMake function.

Signed-off-by: Joel Holdsworth <jholdsworth@nvidia.com>
2025-01-27 13:24:52 +01:00
Torsten Rasmussen
f67939bf7e sysbuild: populate build_info with list of images
Populate the build_info.yml created by sysbuild CMake with list of
images and write the build info file afterwards.

This allows users and external tools to examine which images was
included in the build even if one or more of those images fails CMake
configure or generate stage.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-01-27 13:24:23 +01:00
Torsten Rasmussen
034c36cfad scripts: support list of images in build info
Add 'images' as valid list in build info schema.
This allow sysbuild and regular Zephyr images to populate build_info.yml
with images included in the build.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-01-27 13:24:23 +01:00
Torsten Rasmussen
f24f5288f3 cmake: support array of maps in yaml module
This commit introduce support for maps in a yaml list.

The yaml_set() function has been extended with the following signature:
> yaml_set(NAME <name> KEY <key>...
>          [APPEND] LIST MAP <map1> MAP <map2> MAP ...
> )

where a `MAP <map>` has the form:
`MAP "<key1>: <value1>, <key2>: <value2>, ...`

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-01-27 13:24:23 +01:00
Torsten Rasmussen
b1a27a77a2 cmake: store board directories in build_info
The schema for build info already contained a `board:path` sequence tag
definition, but boards.cmake did not populate this in the generated
build_info.yml.

Fix this by correctly populating the `board:path` with list of board
directories.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2025-01-27 13:24:23 +01:00
Valerio Setti
222f8d87b5 Bluetooth: Host: add PSA_WANT_xxx_IMPORT/EXPORT to BT_ECC
The BT Host module also uses import/export PSA functions alongside the
generate one, so these PSA_WANT should be added as well.

Previously it happened to work only because Mbed TLS is enabling
IMPORT/EXPORT internally whenever GENERATE/DERIVE is set. However the
same might not be true for all PSA Crypto providers.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-01-27 11:07:07 +01:00
Sadik Ozer
6932885996 tests: subsys: secure_storage: Add filter for small profile
TF-M small profile does not support secure storage (know as Protected
storage), this commit add filter for tfm test case to pass it
incase of small profile been set, see tf-m profiles in below link

https://tf-m-user-guide.trustedfirmware.org/configuration/profiles/index.html

Signed-off-by: Sadik Ozer <sadik.ozer@analog.com>
2025-01-27 11:03:17 +01:00
Jasen Liu
c2df6b0dd1 soc: nxp: rw: fix stack overflow in BLE samples
mbedtls is now used in BLE samples, increasing the stack depth needed
of the calling threads. This was causing stack overflows in several BLE
samples.
Increasing the BT_LONG_WQ_STACK stack size for peripheral_sc_only sample,
 and the SYSTEM_WORKQUEUE stack size for ibeacon sample.

Signed-off-by: Jasen Liu <jasen.liu@nxp.com>
2025-01-27 11:03:05 +01:00
Jasen Liu
f18fed1a0e soc: nxp: mcxw: fix stack overflow in BLE samples
mbedtls is now used in BLE samples, increasing the stack depth needed
of the calling threads. This was causing stack overflows in several BLE
samples.
Increasing the BT_LONG_WQ_STACK stack size for peripheral_sc_only sample,
and the SYSTEM_WORKQUEUE stack size for ibeacon sample.

Signed-off-by: Jasen Liu <jasen.liu@nxp.com>
2025-01-27 11:03:05 +01:00
Luis Ubieda
832810e650 spi: shell: Add command to include CS GPIO in SPI device
This allows to configure a GPIO pin as a CS line, in order to perform
spi transfers to a particular device in the bus.

Example usage for using GPIO1.12 with GPIO_ACTIVE_LOW:
`spi cs gpio1 12 0x01`

Signed-off-by: Luis Ubieda <luisf@croxel.com>
2025-01-27 11:02:55 +01:00
Ibrahim Abdalkader
2924a99cd1 drivers: video: gc2145: Add support for YUV format.
Can be used to get a fast grayscale image.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2025-01-27 11:02:44 +01:00
Ryan McClelland
5b74f00068 drivers: i3c: stm32: implement hj_response api
Implement the hj_response api for STM32 I3C. This also implements
the PM calls for enabling and disabling runtime PM. For HJ to work
the device must be powered on and be receiving a clock.

Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
2025-01-27 11:02:34 +01:00
TOKITA Hiroshi
da6bf19560 drivers: spi: pl022: Enable PINCTRL conjuction with dt prop 'pinctrl-0'
If there is a pinctrl-0 property, PINCTRL will be enabled in
conjunction with it.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2025-01-27 11:02:23 +01:00
Declan Snyder
8978f663ae spi_nxp_lpspi: Save RAM by having driver data ptr
Make a pointer to data that is specific to a certain type of LPSPI
driver, instead of having all of it in the struct whether it is used
or not.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-27 08:55:31 +01:00
Declan Snyder
31a2b4f374 drivers: spi_nxp_lpspi: Add tristate output config
Add DT property to configure the LPSPI instance to use tristated output
instead of retained output when PCS is negated.

Turn on the config on a couple boards for test coverage.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
2025-01-27 08:55:13 +01:00
Luca Burelli
00ccbce2c4 doc: llext: add extension debugging guide
Add a new section to the llext documentation that explains how to debug
extensions and how to address the issues that may arise when doing so.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
8660020205 llext: group LLEXT output files in a subdirectory
LLEXT-related files are currently scattered in multiple locations in the
build directory. For easier access, this patch groups the outputs in a
subdirectory named 'llext' at the root of the build binaries, alongside
the 'zephyr' directory. This directory will thus contain the generated
debug ELF and the final .llext file for each compiled extension.

Note that this does not affect out-of-tree projects that use LLEXT,
since they already pass the full LLEXT file path to add_llext_target().

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
7094eae111 llext: support multiple string and symbol tables
The ELF format allows for multiple string and symbol tables with
complex references between them. This is especially evident when
debugging information is included.

This patch fixes the issues that have been identified with multiple
string tables to allow LLEXT to properly parse those files:

* The symbol table used by LLEXT (LLEXT_MEM_SYMTAB) is now chosen
  depending on the loaded file type, and other tables are ignored.
  This change is also applied to the SLID injection script.

* The LLEXT string table (LLEXT_MEM_SYMTAB) is now correctly identified
  by the symbol table reference, instead of picking the first one.

* VMA range checks only make sense for allocated sections.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
61c61a5528 llext: display section addresses in gdb-compatible format
This patch adds a debug log message to display the addresses of the
sections in a format that can be used with the gdb 'add-symbol-file'
command to properly inform the debugger about the final addresses for
the loaded sections.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
cf11ab4b0f llext: ignore relocations on non-allocated sections
When building an ELF file with debugging information, the compiler
places this data in sections that do not need to be loaded in memory for
the program to run. These sections are marked as "not allocated" in the
ELF section header, and can be safely ignored when loading the file.

This patch adds a check to the relocation processing code to skip
relocations acting on those non-allocated sections, allowing to load ELF
files with debugging information.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
5b66af8adb llext: build with debug info, strip at packaging time
This patch changes the way extensions are built to allow for debugging
information to be collected. Debug flags are now used when compiling and
linking the extension source code, generating a debuggable ELF file.
The final .llext file is then stripped of unneeded symbols, including
all debugging information, at packaging time.

The debugging flag is still removed from the EDK-exported flags.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Luca Burelli
dda8d776ab cmake: bintools: add --strip-unneeded flag to elfconvert
This flag is used by LLEXT to strip all unreferenced symbols and
debugging information from a binary.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
2025-01-27 08:54:44 +01:00
Fabian Barraez
3585c37437 sensor: bmp180: fix: untrusted divisor caught by coverity
- Checking the value before applying it as a divisor

Signed-off-by: Fabian Barraez <fabianbarraez@gmail.com>
2025-01-27 04:16:45 +01:00
Raphael Zimmerer
4209d78eaf esp32c3_supermini: Switch from SRAM0 to SRAM1 for correct SRAM usage
SRAM0 is dedicated to IBUS and caching, whereas SRAM1 is assigned to
DBUS.

This change corrects an incorrect SRAM usage that previously triggered
the following assertion due to invalid heap size calculations:

Despite of invalid SRAM usage, that triggered following assertion due
to invalid heap size calucaltions:

ASSERTION FAIL [bytes / 8U <= 0x7fffU] @ .../zephyr/lib/heap/heap.c:491
        "heap size is too big"

Signed-off-by: Raphael Zimmerer <killekulla@rdrz.de>
2025-01-27 04:16:36 +01:00
David Brown
1b9408bbdd submanifests: optional: Hotfox for rust trying to build on too many targets
commit c94328f3671a671ac215885c6986b0359a6a37b8
    Author: David Brown <david.brown@linaro.org>
    Date:   Fri Jan 24 23:32:21 2025 -0700

        samples: Properly filter samples by supported Rust targets

A few new samples in the Rust module were added, but missed the proper
filter and platform list, resulting in the daily twister run trying to
build these.

Signed-off-by: David Brown <david.brown@linaro.org>
2025-01-27 01:17:14 +01:00
Dominik Ermel
e8ab14d4bd manifest: Update LittleFS revision
Update LittleFS to bring in fixed module definition.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2025-01-26 20:30:56 +01:00
Ruijia Wang
f0d0264c05 manifest: hal_nxp: update NXP HAL to include support for RTWDOG driver
Update the NXP HAL revision to include support for building the RTWDOG
driver.

Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
2025-01-25 20:07:05 +01:00
Ruijia Wang
8c9b226900 mcux: soc: rt1180 unmask reset event when rtwdog is using
RT1180 takes reset event mask feature which should be unmasked when
watch dog is enabled.

Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
2025-01-25 20:07:05 +01:00
Ruijia Wang
b1395eabce drivers: rtwdog: add NXP rtwdog driver
Port NXP rtwdog driver to Zephyr.

Signed-off-by: Ruijia Wang <ruijia.wang@nxp.com>
2025-01-25 20:07:05 +01:00
Thomas Stranger
e643b286df drivers: bluetooth: hci: h4_ifx_cyw43xxx: add missing hci includes
Add missing bluetooth/hci.h and hci_types.h include to fix the build
error and warnings of the infineon h4 ble driver.

The driver is using bt_hci_cmd_create() and bt_hci_cmd_send_sync()
from bluetooth/hci.h, and BT_HCI_OP_RESET from bluetooth/hci_types.h

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2025-01-25 20:06:34 +01:00
Benjamin Cabé
7b1031a233 drivers: dac: rename max22017 dac binding file to max22017-dac.yaml
Avoid clashing with the existing max22017.yaml binding file used for the
MFD.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-25 20:06:19 +01:00
Øyvind Rønningstad
4738173276 zcbor: Improve kconfig help text
ZCBOR_CANONICAL text was outdated.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2025-01-25 20:06:05 +01:00
Benjamin Cabé
6894fce411 samples: net: openthread: update README to use correct code block syntax
Update the ot-coap sample README so that code blocks have proper syntax
highlighting.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-25 01:41:11 +01:00
Benjamin Cabé
7c50cb4d3a samples: net: openthread: ot-coap README should not be orphan
This prevented the sample to show up properly in the sample
catalog.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-01-25 01:41:11 +01:00
Nikola Petrovic
f48d6ff762 docs: Adapt ICM42688 example to new dt option names.
Example for creating ICM42688 dt node uses old dt option names.
Fix by changing to newest dt option names.

Signed-off-by: Nikola Petrovic <nikolaptr6@gmail.com>
2025-01-25 01:40:58 +01:00
Nicolas Pitre
3075a7d906 ring_buffer: factorize almost identical code
Factorize almost identical code. May even improve performance due to
CPU cache locality.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-01-25 01:40:03 +01:00