Compare commits

...

396 Commits

Author SHA1 Message Date
Tomi Fontanilles
cef5c14c1e manifest: tf-m: update to 2.1.4
From 2.1.2.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2026-01-13 09:20:16 -05:00
Stephanos Ioannidis
011d1dcf1e ci: twister: Trigger on pull_request event
As of 2025-12-08, GitHub no longer allows `pull_request_target` events to
be triggered from non-default branches [1] and this effectively rendered
the `pull_request_target` trigger for the Twister workflow in the
v3.7-branch unfunctional.

This commit reworks the Twister workflow to trigger on the `pull_request`
event instead of the `pull_request_target` event to work around the above
issue; as part of this, the Elasticsearch test result upload step, which
requires a secret access and hence `pull_request_target`, is dropped.

[1] https://github.blog/changelog/2025-11-07-actions-pull_request_target-and-environment-branch-protections-changes/

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2025-12-12 10:09:00 -05:00
Mathieu Choplain
c3be04dc03 drivers: udc: stm32: fix clock configuration for STM32F7 w/ USBPHYC
OTGHS using the USBPHYC on STM32F723 and some STM32F730 requires
special clock configuration to work.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-10 15:32:01 -05:00
Mathieu Choplain
8e658b51cb drivers: usb: dc: stm32: fix clock configuration for STM32F7 w/ USBPHYC
OTGHS using the USBPHYC on STM32F723 and some STM32F730 requires
special clock configuration to work.

Signed-off-by: Mathieu Choplain <mathieu.choplain-ext@st.com>
2025-12-10 15:32:01 -05:00
Robert Lubos
2dd00c4204 net: websocket: Fix truncated string warning on copying
WS_MAGIC is a constant string and when calculating lengths for copying
we always exclude the NULL terminator. In result, using strncpy() for
copying can generate a warning about truncated string, as WS_MAGIC will
always be truncated from the NULL terminator. Therefore replace
strncpy() with memcpy() as it seems more appropriate for this case.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 8b91d3abc3)
2025-12-10 15:26:47 -05:00
Fabian Blatz
8220fd3785 modules: lvgl: Prevent false pointer input events
Fixes an issue where input events which have the sync flag set but are
neither X/Y coordiante updates nor press/release updates triggers a false
reporting of input to LVGL.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
(cherry picked from commit 25d96b2589)
2025-12-04 17:09:24 -05:00
Sudan Landge
483124b36a arch: arm: fix start of the privileged stack
Make sure that arch.mode is set with appropriate flags before setting up
the privileged stack start.

Fixes #99895

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit 9962bc12cf)
2025-12-02 12:19:23 -05:00
Robert Lubos
0004e41a5d net: dns: Fix potential buffer overflow when unpacking labels
As the loop unpacking the DNS name from records checks the current
label length on each iteration, it's also needed to update the remaining
buffer length on each iteration, otherwise the buffer length checks
doesn't work as expected.

Additionally, the remaining buffer checks while technically worked, they
were conceptually wrong and unintuitive. The buf->data pointer doesn't
move, so comparing against this pointer when adding new labels doesn't
make sense. It's more intuitive to simply compare the label size vs
the remaining buffer space.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 7bd45cd39b)
2025-12-01 07:32:01 -05:00
Valerio Setti
5ef39dbc2c doc: release-notes: add note for Mbed TLS version bumping to 3.6.5
Update release notes to include changes from Mbed TLS 3.6.4 to 3.6.5.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-12-01 07:30:47 -05:00
Valerio Setti
360a55e652 manifest: mbedtls: bump version to 3.6.5
Update Mbed TLS revision from 3.6.4 to 3.6.5.

Fixes #100227

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-12-01 07:30:47 -05:00
Anas Nashif
58765dff59 release: bump release to 3.7.2-rc1
Mark version as RC1.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-14 05:06:36 -05:00
Anas Nashif
2356c09154 doc: update 3.7.2 release notes with fixed bugs
Update release notes for 3.7.2 with all fixed bugs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-11-14 05:06:36 -05:00
Jean Nanchen
5d6cbce872 drivers: i2c: stm32: fix build error after timeout patch
Follow-up to PR #88631: fix missing variable declarations introduced in
the STM32 I2C LL driver after adding timeouts to blocking loops.

The missing declarations caused a build failure when interrupts were
disabled (CONFIG_I2C_STM32_INTERRUPT=n).

Fixes a regression introduced in #88631.

Signed-off-by: Jean Nanchen <jean.nanchen@gmail.com>
(cherry picked from commit bc097a6fe6)
2025-11-12 06:50:07 -05:00
Aditya Bhutada
2b9be29f77 drivers: espi: Add return value to eSPI send_vwire API
Added note about return value to the eSPI send_vwire API in the header:
-ETIMEDOUT & _EINVAL.

Signed-off-by: Aditya Bhutada <aditya.bhutada@intel.com>
(cherry picked from commit 4102010456)
2025-11-12 06:32:23 -05:00
Aditya Bhutada
f9ef3f0427 drivers: espi: espi_mchp_xec: Fix the VW change check time
Adjusted the VW change check timings:
- Polling time changed from 100 uSec to 1 uSec.
- Timeout value changed from 10 mSec to 1 mSec.

This is to achieve the lowest possible pulse width for SCI VW in S0,
while ensuring that the VW change check is still reliable for S0iX
where SoC may take longer to process upstream events.

Also added -ETIMEDOUT error when failure.

Signed-off-by: Aditya Bhutada <aditya.bhutada@intel.com>
(cherry picked from commit 2c36616dd2)
2025-11-12 06:32:23 -05:00
Khaoula Bidani
c186d83613 drivers: gpio: stm32: Fix gpio_pin_get_config
This commit updates the function to only set output-related flags
(GPIO_OUTPUT_INIT_HIGH, GPIO_OUTPUT_INIT_LOW) when the pin
is actually configured as output. For input pins, only GPIO_INPUT and
other relevant flags are set.

Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
(cherry picked from commit e803a10b91)
2025-11-12 06:31:22 -05:00
Sudan Landge
652de8dfac tests: arm: exclude mps2/an385 on user stack test
Temporarily disable running the user stack tests on mps2/an385 to
unblock ci issues reported in #98494.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit 2408b808d2)
2025-11-12 06:30:53 -05:00
Sudan Landge
3f0f832186 tests: fix arch.arm.user.stack test failure
Fixes #97473 by:
- Marking the test as passed if the hardware executes user threads for a
  while without triggering a stack corruption, instead of waiting
    indefinitely.
- Adding a timeout to ensure the test exists gracefully if the issue is
  not reproduced.

Also fixes a stack corruption issue on QEMU targets, caused by
insufficient stack size and revealed by the timer change.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit a55053b216)
2025-11-12 06:30:53 -05:00
Jukka Rissanen
1f67ed44bb net: context: Make sure TCP allocation is not leaked
If we have allocated a TCP connection, and if after that
we get an error like EADDRINUSE, then we must de-allocate
the TCP connection otherwise there is a buffer leak.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 909710b598)
2025-11-12 06:30:17 -05:00
Jamie McCrae
e7a0c77dd9 doc: hardware: porting: board_porting: Fix outdated merged info
Fixes some information that is very outdated to do with board
Kconfig files, which are not merged, and multiple dts files

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 88176a795d)
2025-11-12 06:26:20 -05:00
Robert Lubos
b06f55f7a4 tests: net: icmp: Add test cases for ICMP family mismatch
Add test cases that respective ICMPv4/ICMPv6 handlers are not called for
packets where address family doesn't match (i.e. malformed ICMPv4 packet
imitating ICMPv6 one).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 486e8247c6)
2025-11-12 06:24:14 -05:00
Robert Lubos
164f7356ff net: icmp: Verify the address family before calling the callback
Check the address family of the packet before passing it to a ICMP
handler, to avoid scenarios where ICMPv4 packet is paseed to a ICMPv6
handler and vice versa.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 587d9e6a4a)
2025-11-12 06:24:14 -05:00
Sudan Landge
e4d3915454 arch: arm: start threads on privileged stack
Use the privileged stack when starting K_USER threads in arch_new_thread().
Threads entering user mode with k_thread_user_mode_enter() keep their
existing flow. To support both cases, z_arm_userspace_enter() now takes an
internal ABI flag (sp_is_priv) indicating whether PSP already points to
the privileged stack.

Also fix calculation of the privileged stack top: use priv_stack_end
directly instead of priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE, which
failed to account for guard/FPU offsets applied to priv_stack_start.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit 0438b9f29e)
2025-10-20 11:35:50 -04:00
Sudan Landge
1773c944cf arch: arm: switch to privilege stack in SVC handler
Initialize the privilege stack and switch PSP to it early in the SVC
handler to ensure `z_arm_do_syscall` does not start on a user-accessible
stack frame.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit 319c697286)
2025-09-19 13:12:30 -04:00
Sudan Landge
0603419523 boards: arm: mps2: Add dependency to empty_cpu0 for an521/cpu1's app
`west build` does not build the `empty_cpu0` application making
`west build -b mps2/an521/cpu1 -t run` fail because of the missing
empty_cpu0's binary.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit 52151d0b23)
2025-09-19 13:12:30 -04:00
Sudan Landge
3abc5ace7f tests: overwrite return address of stack frame
Introduce a test to overwrite the return address in the exception
stack frame of a lower-priority thread performing an SVC call.

Signed-off-by: Sudan Landge <sudan.landge@arm.com>
(cherry picked from commit f80bef31ef)
2025-09-19 13:12:30 -04:00
Ilya Tagunov
ada192a3f2 soc: snps: rmx: replace custom buildlib with generic RMX linker option
Do not use the custom buildlib configuration for the RMX series as it
was replaced with several even more specific configurations in the
recent MWDT release. Pass the generic RMX option to the linker instead.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
(cherry picked from commit 6a427995b0)
2025-09-19 13:11:07 -04:00
Ilya Tagunov
e4f2417e39 arcmwdt: linker: append -Hlld option only for ARC architecture
The option -Hlld of the MWDT linker is relevant only for classic ARC.
It is incompatible with ARC-V platform options like -av5rmx.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
(cherry picked from commit d8a1e858a1)
2025-09-19 13:11:07 -04:00
Jamie McCrae
08f934deab cmake: mcuboot: Add dependency to keys
Adds a dependency that causes CMake to re-configure if the input
key files for MCUboot signing/encryption have changed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 271dbb4015)
2025-09-19 13:09:32 -04:00
Chekhov Ma
f8e980312a drivers: gpio_adp5585: fix input register address
The input register address was somehow missing, fix it.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
(cherry picked from commit 7726b70033)
2025-09-13 21:23:11 -04:00
Chekhov Ma
80f2bfde85 drivers: gpio_adp5585: fix non-contiguous pin layout issue
Fixes #90988. The pin gap handling is wrong in the original code.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
(cherry picked from commit 41950cab0f)
2025-09-13 21:23:11 -04:00
Ilya Tagunov
ae52d17ac0 libc: arcmwdt: grant all threads access to stdio locks
Some of the locks are created in supervisor mode (i.e. stdout one),
but should be accessed from user mode too. Unfortunately, there is
no way to distinguish these locks, so grant the access to all of them
as the actual reads and writes should end up as syscalls anyway.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
(cherry picked from commit e22ca6b132)
2025-09-13 18:15:17 -04:00
Bas van Loon
c847cb7470 fs/ext2: Fix NULL dereference when fs_stat queries root.
When fs_stat() queries the root / mountpoint it should return its root
i_node but instead it tries to return the parent i_node which does not
exist. Fix this by checking if parent is set otherwise return the root
i_node.

Fixes https://github.com/zephyrproject-rtos/zephyr/issues/94000.

Signed-off-by: Bas van Loon <bas@arch-embedded.com>
(cherry picked from commit 1dcf123e2d)
2025-09-13 18:15:04 -04:00
Ilya Tagunov
cccd50489e linker: arc: add .rodata_in_data section to avoid unexpected placement
The .rodata_in_data section is produced by MWDT toolchain with -Hccm
option enabled. This option moves read-only data from the executable
memory (ICCM) to the data memory (DCCM), improving performance by
reducing conflicts between instruction fetches and data fetches.

Signed-off-by: Ilya Tagunov <Ilya.Tagunov@synopsys.com>
(cherry picked from commit 708c1dc488)
2025-09-13 12:08:27 -04:00
Jamie McCrae
4b84d5569a west.yml: MCUboot synchronization from v3.7-branch
Update Zephyr fork of MCUboot to revision:
  6127fc06a54d7a364626a96a33ae652703b505e4

Brings following Zephyr relevant fixes:

  - 6127fc06 bootutil: Fixed security counter overflow detected to
    late
  - 45f96eb7 boot/boot_serial: build-time skip of the erasing of
    img status page
  - a3166c52 boot: zephyr: boards: nrf52: Fix minimal config
  - 29ea8ef4 boot: zephyr: Remove reference to old Kconfigs
  - 0c1950df boot: bootutil: image_validate: Add error on security
    counter fail
  - 4d2f3b7f bootutil: Remove pointless includes of asn1 headers
  - 9d7d58d9 boot: bootutil: declare fih_panic_loop() as noreturn
  - 11c0611a bootutil: Unify app_max_size() implementations

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-13 12:06:04 -04:00
Johann Fischer
1d335dee71 doc: update pyOCD repository links
The repository has been moved to a new organization, see
https://pyocd.io/. Update links to the pyOCD repository.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
(cherry picked from commit 617b71bc17)
2025-09-13 12:04:38 -04:00
Jamie McCrae
10c1f871fe mgmt: mcumgr: smp: Fix custom payload size
Fixes an issue when using custom payloads where the size was still
using the zcbor buffer instead of the size of the network buffer

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 13ac8fe1f5)
2025-09-12 14:24:00 -04:00
Jukka Rissanen
70b7e8376c tests/samples: net: Fix the max number of file descriptors
Make sure that CONFIG_ZVFS_OPEN_MAX in the tests and samples is at
least the same value as CONFIG_NET_SOCKETS_POLL_MAX so that we
cannot have more polled sockets than there are available file
descriptors.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 759f3a0c7c)
2025-09-10 10:03:18 -04:00
Jukka Rissanen
cc01bf767a net: dns: Check that dispatcher table is not overflowing
Add CHECKIF() checks that verify that dispatcher table is
not overflowing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 2ff26674a2)
2025-09-10 10:03:18 -04:00
Jukka Rissanen
edcd03d12f net: dns: Increase the size of dispatcher table
The dispatcher table needs to be large enough to have support
for all file descriptor values.

Fixes #79042

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 077dd8f142)
2025-09-10 10:03:18 -04:00
Dominik Ermel
81b6d4f2c9 storage/flash_map: Fix is_in_flash_area_bounds
Prevent possible overflow in is_in_flash_area_bounds while
validating offset and length of an operation.

Fixes #89349

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 3d4b427245)
2025-09-06 06:37:42 -04:00
Flavio Ceolin
85f003c804 west: mbedtls: Bump to 3.6.4
Bump mbedtls to 3.6.4.

Fixes: #94925

Signed-off-by: Flavio Ceolin <flavio@hubblenetwork.com>
2025-09-03 09:13:20 -04:00
Stephanos Ioannidis
9405eaf174 arch: arm: cortex_m: Force literal pool placement in inline asm block
When LTO is enabled, linker may relocate literal pools out of Thumb LDR
instruction's reach causing "offset out of range" errors while linking.

This commit adds `.ltorg` directive in the inline asm blocks where absolute
addresses are loaded using the `ldr` instructions, in order to ensure that
the literal pool containing the absolute addresses are placed near the
`ldr` instructions.

Note that the `.ltorg` directive is recognised by all toolchains supported
by Zephyr and no toolchain abstraction is provided for now.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
(cherry picked from commit d7d3ae5c3b)
2025-08-11 10:05:00 +02:00
Henrik Brix Andersen
f88a83a2db drivers: console: posix_arch_console: remove build warning
Remove build warning when building the posix_arch_console driver with
CONFIG_PRINTK=n and CONFIG_STDOUT_CONSOLE=n.

Fixes: #93790

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
(cherry picked from commit 3eedebe031)
2025-08-11 10:04:15 +02:00
Kevin ORourke
9cd8d8f41d shell: backend: telnet: Don't assert if connection closed
The code in shell_ops.c that calls telnet_write will assert if it
returns non-zero. For a telnet shell it's normal that the
network might disconnect unexepectedly, so that should not
trigger an assert.

Fixes #67637

Link: https://github.com/zephyrproject-rtos/zephyr/issues/67637

Signed-off-by: Kevin ORourke <kevin.orourke@ferroamp.se>
(cherry picked from commit 3399e0614a)
2025-07-20 20:02:02 -04:00
Eric Mechin
cea4a1949f drivers: flash: STM32WBA flash_stm32wba_fm.c: fix sector erase error
The STM32WBA Flash Manager driver is failing to erase a sector, instead of
erasing one sector, two sectors are erased.
Fix it by correctly calculating the number of sectors to erase

Signed-off-by: Eric Mechin <eric.mechin@st.com>
(cherry picked from commit 62a1b8a306)
2025-07-20 20:01:11 -04:00
Daniel DeGrasse
6239b5740a cmake: arm: linker: remove usage of ld-specific ADDR() function
Remove usage of ld-specific ADDR function within the cmake linker
generator scripting. Since the linker generator scripting doesn't
support MPUs, we can simply set the __ramfunc_region_start symbol to be
equal to __ramfunc_start

Fixes #87200

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
(cherry picked from commit b84076a192)
2025-07-20 19:59:24 -04:00
Daniel DeGrasse
3d955caf3b arch: common: fix copy for ramfunc region during XIP init
ramfunc region is copied into RAM from FLASH region during XIP init. We
copy from the loadaddr of the region, and were previously loading to the
symbol __ramfunc_start. This is incorrect when using an MPU with
alignment requirements, as the __ramfunc_start symbol may have padding
placed before it in the region. The __ramfunc_start symbol still needs
to be aligned in order to be used by the MPU though, so define a new
symbol __ramfunc_region_start, and use that symbol when copying the
__ramfunc region from FLASH to RAM.

Fixes #75296

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 6023d6a142)
2025-07-20 19:59:24 -04:00
Fabio Baltieri
0ce01a16f2 ci: pr_metadata_check: convert DNM logic to python
GitHub seems to have issue with workflow state caching that causes the
DNM step to not work properly in few cases and not detecting changes in
the DNM tag, forcing people to mess with tags or close/opening PRs,
which in turns restarts all workflows.

Convert the script to Python so that the tag data is guaranteed to be
fresh.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2025-07-20 19:58:54 -04:00
Anas Nashif
944d900fa6 ci: workflows: rename do_not_merge workflow
Add more functionality to the workflow, it is not only about not-merging
anymore.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-07-20 19:58:54 -04:00
Jamie McCrae
1ddf975853 west.yml: MCUboot synchronization from v3.7-branch
Update Zephyr fork of MCUboot to revision:
  7a29b5a6a10f9179cac3935645c2a1356dafb2b6

Brings following Zephyr relevant fixes:

  - 70ad2d44 boot: bootutil: Fix serial recovery issues
  - 4e659a94 boot: bootutil: Fix wrong define for single loader
    mode
  - 8f6f4b4b boot: bootutil: Fix single loader trailer size
  - 99cecb5a boot: boot_serial: Fix wrong slot ID for hook calls
  - 3519605c zephyr: cleanup removed
    CONFIG_BOOT_MGMT_CUSTOM_IMG_LIST
  - 86dc36ed boot_serial: Avoid re-initializing state in
    boot_image_validate_encrypted
  - 16472e08 boot_serial: Initialize a bootloader state for bs_list
    and bs_set
  - 5ee8ede0 zephyr: Fix pinreset trigger
  - f448629c bootutil: boot_decrypt_key: Only one
    bootutil_hmac_sha256_drop needed
  - 2f5d6bf9 imgtool: fix dependency on click version
  - 50c14ceb boot: bootutil: bootutil_misc: Fix max image size for
    single images
  - 18d9df1f bootutil: Fix crash when bootutil_sha_init() is called
    in loop
  - c2f2f90d boot: bootutil: Only update the security counter for
    confirmed images
  - 5a7ee345 boot: bootutil: Fix max image size computation for
    swap-move/swap-offset
  - 116925f7 boot/zephyr/main: fix placement of pointer to arm
    vector
  - b4cff578 boot: bootutil: swap_scratch: Fix issue with bricking
    device
  - 480464d2 boot: bootutil: Refactor erase functionality to fix
    watchdog feeding
  - cc38cc27 boot: Use boot erase function instead of flash erase
    function
  - bb148939 boot: zephyr: flash_map: Fix missing include
  - 51620768 boot: boot_serial: Fix issue with CBOR and setting
    image state
  - a277cf03 zephyr: Fix trailer size computation for swap-scratch
  - ac0ac75e zephyr: Fix TLV area was included in trailer size when
    rounding up
  - 25922090 boot: bootutil: swap_move: Fix maximum application
    size

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-04 17:23:06 +02:00
Jamie McCrae
3cd7ed6dc8 manifest: Updated trusted-firmware-m
Updates TF-M to bring in flash function cherry pick

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-07-04 17:23:06 +02:00
Kalle Kietäväinen
c291ed46f9 tests: kernel: metairq: Ensure meta-IRQ can preempt a cooperative thread
The intention of the test is to have a meta-IRQ preempt a cooperative
thread, then ensure the same cooperative thread is resumed back to instead
of a higher priority thread. Thus, the test needs to assert that the lower
priority cooperative thread is not yet complete when it makes the higher
priority thread ready to run.

This change reveals bugs like #80574, where the meta-IRQ is unable to
preempt a cooperative thread.

Signed-off-by: Kalle Kietäväinen <kalle.kietavainen@silabs.com>
(cherry picked from commit 52b8e3d370)
2025-07-03 16:27:46 -04:00
Kalle Kietäväinen
e011c60592 Revert "arch: arm: cortex_m: Only trigger context switch if thread is preemptible"
This reverts commit 42036cdbca.

Architecture specific code should not do preemption checking before context
switch. This is already handled by the scheduler, so duplicating it would
be redundant and error prone. These checks used to be necessary, but the
scheduler has been rewritten since then and the checks were removed in
3a0cb2d35d (kernel: Remove legacy preemption checking, 2018-05-23).

The check this reverts was also incorrect, as it didn't take scheduler
locking nor meta-IRQs into account.

Fixes #80574

Signed-off-by: Kalle Kietäväinen <kalle.kietavainen@silabs.com>
(cherry picked from commit d929b8a9fa)
2025-07-03 16:27:46 -04:00
Joel Guittet
f7a2eb9f69 eswifi: fix include path to use tls credentials
Include path is missing when CONFIG_TLS_CREDENTIALS is set.

Fixes #92243

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
2025-07-01 16:04:15 -04:00
Benjamin Cabé
018d91a02e doc: _templates: show correct version in sidebar in case of releases
Ensure that version indicator in sidebar is correct in case of releases.

Fixes zephyrproject-rtos/zephyr#91799.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit bbfaf8adec)
2025-06-27 09:08:48 -10:00
Benjamin Cabé
5e6962cefb boards: seagate: legend: Add board revision configurations
board.yml file was missing the list of custom revisions of this board.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 9c803c02b5)
2025-06-18 09:21:05 -04:00
Pieter De Gendt
30cc718855 net: lib: coap: Return an error on removing a non-existing observer
If we're parsing a CoAP request with an observe option of '1', but there is
no matching observer, return an error instead of returning a zero.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
(cherry picked from commit d5931bae93)
2025-06-18 09:20:19 -04:00
Piotr Ciura
be9fab39b9 drivers: usb: Prevent from perpetual locked state
The USB CDC driver is unable to process any bulk IN transfers
after receiving spurious 'Clear Feature - Endpoint Halt' request
from host due to perpetual locked state caused by previously
scheduled transfer, that will never be finished, as the endpoint's state
is set to NAK. Fix by ignoring spurious request.

Signed-off-by: Piotr Ciura <piotr.ciura@hidglobal.com>
(cherry picked from commit 29a191ad38)
2025-06-18 09:19:23 -04:00
Jun Lin
528d13912f drivers: watchdog: npcx: fix T0 timer reload procedure
The correct procedure to reload the T0 timer is:
    1. Load TWDT0 register with the new value or write 1 to RST bit in
       T0CSR register to load the old value.
    2. Wait until RST bit in T0CSR register becomes 1.
    3. Wait until RST bit in T0CSR register becomes 0.
The current watchdog driver misses step 2.
Fix the issue in this commit.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 6c3b617bca)
2025-06-18 09:18:25 -04:00
Jun Lin
bc26e1a407 drivers: flash: npcx: add k_usleep when polling busy status
Adding k_usleep while polling the flash's busy status yields the CPU
resource, giving lower-priority threads the opportunity to run.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit dee7927a21)
2025-06-18 09:17:40 -04:00
Yong Cong Sin
7cfc15395d logging: log_cmds: init uninitialized backend on log_go()
For backends that do not autostart themselves, initialize
& enable them on `log backend <log_backend_*> go`, so
that they function properly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-06-18 09:15:20 -04:00
Yong Cong Sin
97976e7421 logging: init backend id regardless of autostart
The `id` is basically a compile-time constant. Setting it every
time the backend is enabled is unnecessary. Instead, set it on
`log_core_init()` regardless of whether or not it requires to be
`autostart`ed.

Fixes an issue where the `filter_get`/`filter_set`
accessed the wrong index and displayed the wrong log level when
user accesses the status of an uninitialized backend via:
`log backend <uninitialized_backend> status`.

Also fixes an issue when user tries to list the backends via:
`log list_backends`, where all uninitialized backends will have
ID = 0.

This commit is a combination of 8dd9d92 & dd9fd7d.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2025-06-18 09:15:20 -04:00
Jean Nanchen
e2444509ab drivers: i2c: stm32: add timeout to avoid infinite loop
Fix issue where STM32 I2C LL driver could block forever when SDA and SCL
are shorted and interrupts are disabled (CONFIG_I2C_STM32_INTERRUPT=n).

Added timeouts to all blocking wait loops in the STM32 LL I2C driver to
avoid indefinite blocking.

Fixes #88506

Signed-off-by: Jean Nanchen <jean.nanchen@hevs.ch>
(cherry picked from commit 2066b8c7b9)
2025-06-18 09:14:13 -04:00
Glenn Andrews
b45ca8df4c boards: disco_l475_iot1: fix arduino_i2c assignment
0f05f58bf5 assigned the `arduino_i2c` to the incorrect pins for the Arduino UNO connector. This assigns them back.

signed-off-by: Glenn Andrews <glenn.andrews.42@gmail.com>
(cherry picked from commit a2da571172)
2025-06-17 16:04:13 +02:00
Fabian Blatz
9a69db7201 modules: lvgl: Register print callback after lv_init
Move initialization of the print callback handler after calling lv_init, as
the latter zeroes the global callback structure.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
(cherry picked from commit 5cffb8e5a6)
2025-06-04 18:40:43 -04:00
Jun Lin
e3248cda99 driver: timer: npcx: bypass timer counter reading issue
Originally, when the timer's source clock is 32.768 kHz, the timer driver
uses two consecutive reads to ensure the timer reading is correct.
However, it is not robust enough due to an asynchronous timing issue in
the chip. The workaround is to add at least two NOPs between the
LDR and CMP instructions. This commit implements the workaround in the
assembly code to ensure it is not affected by the compiler toolchain
or optimization flags.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 2bda7b87ee)
2025-06-04 18:39:49 -04:00
Jun Lin
4286a3c7a5 driver: timer: npcx: fix possible vulnerabilities
This commit fixes some potential leakage in the timer driver.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit bdf0500497)
2025-06-04 18:39:49 -04:00
Henrik Brix Andersen
8b7305d22f tests: drivers: virtualization: qemu_kvm_arm64.overlay: fix SPDX license
"UNLICENSED" is not a valid SPDX License Identifier. Remove it from the
list and just keep "Apache-2.0".

Fixes: #89413

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
(cherry picked from commit b240f11592)
2025-06-04 18:39:26 -04:00
Emil Gydesen
9844851b3e Bluetooth: BAP: SD: Fix missing clear of notify flag on reject
For add and modify source, if the request was rejected by the
application layer, the BASS_RECV_STATE_INTERNAL_FLAG_NOTIFY_PEND
would be set but not unset.

Add unsetting the flag on reject.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-06-04 17:03:34 +02:00
Josh DeWitt
f630c6f60f kernel/sched: Re-sort waitq on priority change
k_thread_priority_set() on a pended thread wasn't re-inserting into the
waitq, causing the incorrect thread to run based on priority. When using
the scalable waitq config, this can also break assumptions of the tree
and leave the owner of a waitq still being in the waitq tree, cycles in
the tree, or a crash.

Remove and re-add a thread to a waitq to ensure the waitq remains in
order and the tree's assumptions are not violated.

To illustrate the issue, consider 4 threads in decreasing priority
order: A, B, C, and D along with two mutexes, m0 and m1. This is
implemented in the new complex_inversion mutex_api test.
1. D locks m1
2. C locks m0
3. C pends on m1
4. B pends on m1
5. A pends on m0, boosts C's priority, now tree on m1 is not sorted
6. D unlocks m1, left-most thread on tree is B. When removing B from
   tree it cannot be found because it searches to the right of C due to
   C's boosted priority when the node is actually on the left. rb_remove
   silently fails.
7. B unlocks m1, left-most thread on tree is still B and it tries to
   unpend itself, resulting in a NULL pointer dereference on
   B->base.pended_on.

Signed-off-by: Josh DeWitt <josh.dewitt@garmin.com>
(cherry picked from commit c05cfbf15e)
2025-05-31 06:38:41 -04:00
Robert Lubos
be6b87c005 tests: net: dhcpv4: client: Verify Request xid
According to RFC 2131 Request message Exchange ID should be the same as
the one received in the Offer message from the server. Modify test to
verify that.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 1c46508c54)
2025-05-28 13:20:11 -04:00
Robert Lubos
32d5b59a18 tests: net: dhcpv4: client: Verify that Pad option is handled
Add Pad option to the DHCP packets generated by the fake server, to
verify the client processes them correctly.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit eabeb84350)
2025-05-28 13:20:11 -04:00
Robert Lubos
2a5b891a79 net: dhcpv4: client: Do not generate new xid for Request message
According to RFC 2131, DHCP clients should use the same xid as
received in the Offer message when sending DHCP Requests. Therefore,
when generating DHCP Request message, the xid value should not be
incremented.

One vague topic is whether the xid value should be updated when
sending Requests from Renewing or Rebinding states, however RFC makes no
exception for those states, and other implementations (dhclient, lwip)
seem to reuse the same xid in such cases, so comply with this behavior.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 45a1cf7fcc)
2025-05-28 13:20:11 -04:00
Robert Lubos
db8c09832a net: dhcpv4: client: Handle Pad option
Pad option (option code 0) can be present in between other options for
alignment. The option has a fixed 1-byte length (i. e. no length field),
therefore it did not fall under the common processing code for
unrecognized options (which include the length field at the second
byte). Therefore, not processing this option explicitly could disturb
other options processing, as the parser would wrongly interpret the next
option code as the length field. This commit adds Pad option handling to
fix the issue.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 9d54465559)
2025-05-28 13:20:11 -04:00
Robert Lubos
532d11bf48 net: dhcpv4: client: Prevent asserting on malformed message
In case the received DHCP message is malformed and contains invalid
message type, the code responsible for matching message type with a
string would assert. This shouldn't be the case that external conditions
(like receiving malformed packet) trigger asserts in the system.
Therefore modify that code, to return "invalid" string in such case
instead.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit f4408c088c)
2025-05-28 13:20:11 -04:00
Tom Chang
3ef6fe9481 mgmt: ec_host_cmd: npcx: workaround for backend SHI
There is an issue on the SHI hardware peripheral to detect CS
rising/failing with bits CSnFE/CSnRE in the EVSTAT2 register in
npcx9m7fb chip. This commit workarounds it by using MIWU to detect the
CS rising and failing.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 0726198776)
2025-05-28 12:41:56 -04:00
Tom Chang
46edf3b42e dts: npcx: change the default memory configuration of npcx9m7fb
The internal flash size of npcx9m7fb is 512KB. Reduce the default
Code RAM size from 320KB to 256KB because the Code RAM size is limited
by FLASH_SIZE/2 in the Chromebook EC application.

Signed-off-by: Tom Chang <CHChang19@nuvoton.com>
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit f2e11e424e)
2025-05-28 12:41:56 -04:00
Jukka Rissanen
815102387c net: http: server: Select POSIX_C_LIB_EXT instead of FNMATCH
The CONFIG_POSIX_C_LIB_EXT will get support for fnmatch() function.
The old CONFIG_FNMATCH is deprecated.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-28 12:41:37 -04:00
Jukka Rissanen
5b82a68ab1 net: http: server: The detail length of wildcard detail was wrong
The path length of the detail resource was not set properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-05-28 12:41:37 -04:00
Tomi Fontanilles
cab2f9d27f doc: releases: add entry for TF-M 2.1.2 update
Document the update of TF-M to 2.1.2.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-04-30 08:45:49 +02:00
Tomi Fontanilles
ff7e187124 modules: tf-m: update to 2.1.2
Update TF-M to 2.1.2 from version 2.1.1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-04-30 08:45:49 +02:00
Jamie McCrae
610a26ab83 manifest: Remove wrong remote
Removes a remote which was accidentally included

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-16 05:18:16 -04:00
Jamie McCrae
92e879b8a2 west.yml: MCUboot synchronization from v3.7-branch
Update Zephyr fork of MCUboot to revision:
  58538ddfe21843edb39d7e7502812e61696e55c4

Brings following Zephyr relevant fixes:

  - 58538ddf swap_move: correct appsize calcs and warning
  - 5ce8b311 zephyr: flash map: fix comparison signedness
  - 7d4de010 boot: bootutil: Fix usage of flash_area object
  - 61e1264b boot: bootutil: Take into account scratch trailer
    when computing max image size
  - 1a50ec2f boot: bootutil: Ensure the whole trailer is erased
    when it is large
  - c81ba032 boot: bootutil: Fix scratch trailer overwritten if
    image trailer is large
  - 913e9162 boot: bootutil: Fix underflow in swap-scratch when
    trailer is large
  - 509834cd boot: bootutil: Fix invalid last sector computation
    for swap-scratch
  - 834a0afa mynewt: Add flash_sector_get_size
  - ad7a2dd9 doc: imgtool: importance of clear flag
  - 50b727e7 docs: release-notes: Add note on fix for revert issue
  - 014d436c boot: bootutil: loader: Fix issue with stuck revert
  - 0c3ecbef boot: bootutil: Refactor some functions to have state
  - 78bb9c09 zephyr: Fix image encryption configuration for
    mbedTLS.
  - d8647ed3 zephyr: Fix usage of CONFIG_MBEDTLS_BUILTIN and ASN1
  - 41c82413 bootutil: Add missing MBEDTLS_ASN1_PARSE_C
  - 6f61d4fc zephyr: Remove scratch from
    flash_area_id_from_multi_image_slot
  - f48f5c5a boot: boot_serial: Fix uninitialised variables for
    upload
  - f40c2430 added missing MCUBOOT_VERSION_TWEAK in Zephyr port
  - a49a0337 boot: bootutil: loader.c: Add check if has upgrade
    before pushing state change
  - 664093d0 bootutil: Fix device brick after power failure during
    swap-move revert
  - c50b332b bootutil: Fix the reading of image headers after
    partial swap completion
  - 172694ea boot: zephyr: Fix
    sample.bootloader.mcuboot.usb_cdc_acm_recovery
  - 226a9a70 Allow bootstrapping for multiple images

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-04-15 15:35:12 -04:00
Ivan Wagner
8bb572c431 drivers: sensor: meas: ms5837 supporting 02 and 30 variants via dt
Fixes #87870

This patch adds support via dt compatible property.

Signed-off-by: Ivan Wagner <ivan.wagner@tecinvent.ch>
2025-04-14 15:10:02 -04:00
Chekhov Ma
6eda124b70 drivers: gpio: adp5585: fix wrong reg during pin configure
The ADP5585_GPO_OUT_MODE_A is used when configuring initial output
during pin configuration, causing pins configured HIGH is incorrectly
configured as open-drain. Replacing the reg with ADP5585_GPO_DATA_OUT
fixes the issue.

Signed-off-by: Chekhov Ma <chekhov.ma@nxp.com>
(cherry picked from commit c87900aa40)
2025-04-14 15:03:49 -04:00
Jukka Rissanen
f23e4e1d34 tests: net: dns: packet: Add test case for compression bit in CNAME
Add checks that we will be able to catch invalid compression bit in
response CNAME handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-14 15:01:39 -04:00
Jukka Rissanen
92602700dd net: dns: Check compression flag properly
Allow only 0xc (0b11) as two highest bit to mark the compression
when parsing the CNAME response. See RFC 9267 ch. 2 for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-14 15:01:39 -04:00
Jukka Rissanen
3f751d85fb tests: net: dns: packet: Add test case for recursive name in CNAME
Add checks that we will be able to catch recursive name pointers and
abandon the response for CNAME handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-14 15:01:39 -04:00
Jukka Rissanen
1500de818b net: dns: Check recursive pointers for CNAME handling
Make sure that the CNAME handling checks recursive name pointers
and fails the response if recursion is detected.
See RFC 9267 ch. 2 for details.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-14 15:01:39 -04:00
Jukka Rissanen
9adcb8db4c net: dns: Use DNS_EAI_SYSTEM error properly
The DNS_EAI_SYSTEM error value tells that the errno value
contains the actual system error value. So set the errno
properly when there is a system error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-14 15:01:39 -04:00
Luis Ubieda
446d227b19 rtio: workq: Select Early P4WQ threads init
Otherwise the RTIO Workqueue is not functional for devices during init.

An example of this issue is devices using SPI transfers with default
spi_rtio.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit 2ce2794987)
2025-04-14 07:03:56 -04:00
Luis Ubieda
5e6362ba52 p4wq: Add Kconfig to perform early init on threads
In order to make them functional for devices during init. Default
behavior is to keep late initialization, as before.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit ec45b29ea3)
2025-04-14 07:03:56 -04:00
Anas Nashif
8912bb475d twister: tests: set ZEPHYR_BASE using export
Use export to set ZEPHYR_BASE.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Lukasz Mrugala
fe674b4d11 twister: Remove C object buildlist from -i test
The disparity in C objects built causes
the test to fail.
This removes those lines from the log
to inline log comparison.

Let's disable it in the relevant test.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
a2c712a351 twister: tests: do not error on warnings when testing asan
In case of warning turning into errors which is expected, do not error
out and continue with execution.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
2a109583d2 ci: twister/blackbox: pin pip modules
Rework workflow to use pinned python packages and zephyr setup action.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
16a31355a7 ci: twister/tests: install pinned pip packages
Install packages from scripts/requirements-actions.txt.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
a4f72e825f ci: twister_blackbox: do not fetch HALs and unused modules
Those would fill the runner disk space and would abort the workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
9b03f0318f ci: update workflows to use docker v0.26.18
This docker image version contains the 0.16.9 SDK which is the supported
SDK version for v3.7.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
e87830437a ci: remove workflow from branch
Remove action intended to run on main branch and avoid unneeded
exposure.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
7604bf9b2d ci: pin more actions across various workflows
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
5aaf347fa8 ci: pin backport action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
046d6183a4 ci: pin cache action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
6cf7ea3cd0 ci: pin stale-workflow-queue-cleanup action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
ff2ed0317b ci: pin zephyrproject-rtos/action_scancode action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
a2d2af0375 ci: pin dawidd6/action-download-artifact action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
50f295f76f ci: pin codecov/codecov-action action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
c29efe3d2b ci: pin tj-actions/changed-files action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
3232f97f1c ci: pin EnricoMi/publish-unit-test-result-actiom action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
78b9235f37 ci: pin actions/download-artifact action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
b624dced8a ci: pin actions/upload-artifact action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
2e6ed1656b ci: pin zephyrproject-rtos/action-zephyr-setup action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
11560e288c ci: pin actions/setup-python action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
b15fb08b73 ci: pin actions/checkout action
Pin actions to a specific sha to avoid supply chain attacks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
5a718811b3 ci: use gh managed tokens in workflows
Do not use custom tokens, rely on GH provided and managed tokens.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Anas Nashif
dd2bdfbcec ci: remove all workflows intended for main branch
Reduce exposure by removing all those workflows that do not make sense
on a release branch.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-14 06:28:39 -04:00
Jun Lin
1be7a2044c soc: npcx: scfg: select host interface type in global
The Host Interface Type in the DEVCNT register sets the HIF type
(either eSPI or LPC).
Currently, it is configured in the host-interface-related drivers like
eSPI or SHI. However, some I/O pads sourced from VHIF in the other
modules such as GPIO and I3C also rely on this field. It might be
problematic when using those I/Os without enabling eSPI or SHI drivers.
This commit moves the setting from the specific drivers to the global
system initialization function scfg_init().

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 1aff275642)
2025-04-13 13:40:39 +02:00
Robert Lubos
66acbd5332 net: coap_client: Fix CoAP client thread priority
The default thread priority for the CoAP client thread is set to
NUM_PREEMPT_PRIORITIES which is not a valid thread priority, as the
lowest application thread priority is actually
NUM_PREEMPT_PRIORITIES - 1. Because of this, CoAP client library gave an
assert on boot if assertions were enabled.

Kconfig does not allow for arithmetics when setting integer defaults,
therefore handle this at the preprocessor stage by limiting the actual
priority assigned to the CoAP client thread to a valid range.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit cf0b6068d2)
2025-04-13 13:40:21 +02:00
Tomi Fontanilles
06cec72faf modules: mbedtls: update to 3.6.3
Update Mbed TLS to 3.6.3.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-04-13 13:40:00 +02:00
Tomi Fontanilles
80c0e7d324 doc: releases: add release notes template for 3.7.2
Add the boilerplate for 3.7.2.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2025-04-13 13:40:00 +02:00
Michal Myczkowski
bf440dec23 dts: atmel sam4s: fix sram address
Changed Atmel SAM4S series sram adress from 0x20100000 to 0x20000000. Now
it matches what is in Atmel SAM4S Series Datasheet chapter 8
section 1.1 Internal SRAM:

https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/Atmel-11100-32-bitCortex-M4-Microcontroller-SAM4S_Datasheet.pdf#G1.1069257

Fixes #85211.

Signed-off-by: Michal Myczkowski <mmyczkowski@antmicro.com>
(cherry picked from commit 3a53845fad)
2025-04-01 09:56:47 -04:00
Benjamin Cabé
0e686addf7 doc: Update Graphviz font configuration
Customize Graphviz dot rendering to use same font stack as our Sphinx
theme.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit c0f76d9363)
2025-04-01 09:55:17 -04:00
Benjamin Cabé
f639801afa doc: make graphviz diagrams look good in dark theme
Add filter to invert colors in dark mode.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit fd919b5160)
2025-04-01 09:55:02 -04:00
Anas Nashif
81337c6880 ci: assigner: harden workflow
Various improvements:

- pin actions and pip packages
- set permissions
- use gh token instead of custom token.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 09:53:17 -04:00
Anas Nashif
d4b62d497a ci: add requirements for gh action
Add pinned python requirements for github actions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-04-01 09:53:17 -04:00
Jukka Rissanen
7fb377a30f net: if: Release the interface lock early when starting IPv4 ACD
In order to avoid any mutex deadlocks between iface->lock and
TX lock, release the interface lock before calling a function
that will acquire TX lock. See previous commit for similar issue
in RS timer handling. So here we create a separate list of ACD
addresses that are to be started when network interface comes up
without iface->lock held.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:52:53 -04:00
Jukka Rissanen
1ab995a235 net: if: Release the interface lock early when starting IPv6 DAD
In order to avoid any mutex deadlocks between iface->lock and
TX lock, release the interface lock before calling a function
that will acquire TX lock. See previous commit for similar issue
in RS timer handling.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:52:53 -04:00
Jukka Rissanen
9d55a6010a net: if: Release the interface lock early in IPv6 RS timeout handler
The net_if.c:rs_timeout() is sending a new IPv6 router solicitation
message to network by calling net_if_start_rs(). That function will
then acquire iface->lock and call net_ipv6_start_rs() which will try
to send the RS message and acquire TX send lock.
During this RS send, we might receive TCP data that could try to
send an ack to peer. This will then in turn cause also TX lock
to be acquired. Depending on timing, the lock ordering between
rx thread and system workq might mix which could lead to deadlock.
Fix this issue by releasing the iface->lock before starting the
RS sending process. The net_if_start_rs() does not really need to
keep the interface lock for a long time as it is the only one sending
the RS message.

Fixes #86499

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:52:53 -04:00
Jukka Rissanen
6ce77c29e6 net: if: Documentation missing for IPv4 ACD timeout variable
Add documentation for ACD timeout variable as it was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:52:53 -04:00
Jukka Rissanen
60e664181c net: if: Documentation missing for IPv6 DAD start time variable
Add documentation for DAD start time variable as it was missing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:52:53 -04:00
Dong Wang
a5880423f6 logging: Ensure atomic update of log filter slot in LOG_FILTER_SLOT_SET
Replaced the read-modify-write sequence with a single read and write
operation, preventing the intermediate value is wrongly used to filter
out logs of another thread with higher priority that preempts the current
thread.

Signed-off-by: Dong Wang <dong.d.wang@intel.com>
(cherry picked from commit 872f363696)
2025-04-01 09:51:08 -04:00
Jukka Rissanen
5e5baa5ddc net: core: Free packet properly if TTL/hop limit is 0
We drop the packet if TTL or hop limit is 0, but we should
also unref the packet in this case because we return 0 to
the caller which is not then able to free the packet because
it thinks that the packet was sent properly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-04-01 09:50:39 -04:00
Robert Lubos
7dcd584429 net: if: Setup DAD timer regardless of DAD query result
In rare occasions when sending DAD NS packet fails, we should still
setup the DAD timer, unless we implement some kind of more advanced
retry mechanism. If we don't do that, the IPv6 address added to the
interface will never be usable in such cases.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 008a7ca202)
2025-03-02 16:25:03 -05:00
Robert Lubos
64fa3d8923 net: if: Clear neighbor cache when removing IPv6 addr with active DAD
DAD creates an entry in the neighbor cache for the queried (own)
address. In case the address is removed from the interface while DAD is
still incomplete, we need to remove the corresponding cache entry (just
like in case of DAD timeout) to avoid stale entries in the cache.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit a09fd8e97f)
2025-03-02 16:25:03 -05:00
Robert Lubos
7e8af7c380 tests: net: conn_mgr: Use valid LL address in tests
Using L2 address of length 1 (invalid/unsupported one) confused IPv6
layer during LL address generation - since that length was not a valid
one, the address was not initialized properly and a part of it was set
semi-random. This could result for example in filling out the neighbor
tables.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 3089a5d116)
2025-03-02 16:25:03 -05:00
Derek Snell
120267bc34 soc: nxp: rw: Update system core clock frequency
After updating the main_clk, need to update the frequency tracked in
HAL MCUXpresso SDK framework for other drivers.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
(cherry picked from commit 793e44afdd)
2025-03-02 16:24:06 -05:00
Jukka Rissanen
0ea086845b net: Update IP address refcount properly when address already exists
If an IP address already exists when it is tried to be added to the
network interface, then just return it but update ref count if it was
not updated. This could happen if the address was added and then removed,
but for example an active connection was still using it and keeping the
ref count > 0. In this case we must update the ref count so that the IP
address is not removed if the connection is closed.

Fixes #85380

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-02-20 21:16:47 -05:00
Robert Lubos
764bc21073 net: iface: Add missing interface mutex locks
net_if_ipv4/6_addr_rm() were missing the iface mutex lock, this commit
adds it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-02-20 21:16:47 -05:00
Robert Lubos
77775858cd net: ipv6: Fix Neighbor Advertisement processing w/o TLLA option
According to RFC 4861, ch. 7.2.5:

 "If the Override flag is set, or the supplied link-layer address
  is the same as that in the cache, or no Target Link-Layer Address
  option was supplied, the received advertisement MUST update the
  Neighbor Cache entry as follows

  ...

  If the Solicited flag is set, the state of the entry MUST be
  set to REACHABLE"

This indicates that Target Link-Layer Address option does not need to be
present in the received solicited Neighbor Advertisement to confirm
reachability. Therefore remove `tllao_offset` variable check from the
if condition responsible for updating cache entry. No further changes in
the logic are required because if TLLA option is missing,
`lladdr_changed` will be set to false, so no LL address will be updated.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 02c153c8b1)
2025-02-20 20:40:15 -05:00
Robert Lubos
816b782299 net: ipv6: Send Neighbor Solicitations in PROBE state as unicast
According to RFC 4861, ch. 7.3.3:

 "Upon entering the PROBE state, a node sends a unicast Neighbor
  Solicitation message to the neighbor using the cached link-layer
  address."

Zephyr's implementation was not compliant with behavior, as instead of
sending a unicast probe for reachability confirmation, it was sending a
multicast packet instead. This commit fixes it.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 8cd213e846)
2025-02-20 20:40:15 -05:00
Robert Lubos
8e4856c913 net: ipv6: Fix neighbor registration based on received RA message
When Router Advertisement with Source Link-Layer Address option is
received, host should register a new neighbor marked as STALE
(RFC 4861, ch. 6.3.4). This behavior was broken however, because
we always added a new neighbor in INCOMPLETE state before processing
SLLA option. In result, the entry was not updated to the STALE state,
and a redundant Neighbor Solicitation was sent.

Fix this by moving the code responsible for adding neighbor in
INCOMPLETE state after options processing, and only as a fallback
behavior if the SLLA option was not present.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit fce53922ef)
2025-02-20 20:40:15 -05:00
Jamie McCrae
32f69a4d8a mgmt: mcumgr: grp: img_mgmt: Fix calling confirm
Fixes calling the registered callbacks for image being confirmed
if the confirmation was not successful

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 98d5aa3792)
2025-02-20 20:39:55 -05:00
Jukka Rissanen
28f139801f net: socket: Release packets in accepted socket in close
If we have received data to the accepted socket, then release
those before removing the accepted socket. This is a rare event
as it requires that we get multiple simultaneous connections
and there is a failure before the socket accept is called by
the application.
For example one such scenario is when HTTP server receives multiple
connection attempts at the same time, and the server poll fails
before socket accept is called. This leads to buffer leak as the
socket close is not called for the accepted socket because the
accepted is not yet created from application point of view.
The solution is to flush the received queue of the accepted socket
before removing the actual accepted socket.

Fixes #84538

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 535e70a298)
2025-02-20 20:39:41 -05:00
Jordan Yates
0e5cda3505 bluetooth: increment BT_BUF_CMD_TX_COUNT
The extended advertising start procedure can consume both command
buffers in a single API call, resulting in `bt_le_create_conn_cancel`
being unable to claim a buffer to terminate the connection request.

Increase the command count if both extended advertising and Bluetooth
central are enabled in an application.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-02-20 20:39:28 -05:00
Jordan Yates
322ec30af3 bluetooth: host: hci_core: add missing NULL check
Add check that the command buffer claimed in `bt_le_create_conn_cancel`
is not `NULL`. Fixes a fault caused by providing the `NULL` buffer to
`bt_hci_cmd_state_set_init`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2025-02-20 20:39:28 -05:00
Florian Weber
4d489098b1 rtio: workq: bugfix of memory allocation
This commit fixes the bug that the memory of the work request is
freed up in the work handler, before it is not needed anymore by the p4wq.
This is fixed now, by using the new done_handler in the p4wq
for freeing up that memory.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
(cherry picked from commit b55b9ae72b)
2025-02-20 20:39:09 -05:00
Florian Weber
2479683f77 lib: os: p4wq: add done handler
Add an optional handler to the p4wq to give the submitting code
(e.g. rtio workq) a possibility execute code after the work was
succesfully executed.

Signed-off-by: Florian Weber <Florian.Weber@live.de>
(cherry picked from commit 093b29fdb5)
2025-02-20 20:39:09 -05:00
Erwan Gouriou
30102936bc west.yml: hal_stm32: stm32h7: Fix ethernet load issue
Point to fix cherry picked from hal_stm32 main branch to fix
a ethernet load issue.

Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
2025-02-08 19:46:04 -05:00
Vinayak Kariappa Chettimada
b6c8212c7a Bluetooth: Controller: Fix regression in connection update
The connection event at the connection update instant was
skipped due to previous ticker node in use that is being
stopped was registering a relative occupied time that
overlapped with the new ticker node being started for
scheduling the connection with new interval.

Added mock interface for ticker_stop_abs() hence needed by
the Controller unit testing.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 5dffad061c)
2025-01-29 11:10:55 -05:00
Mayank Narang
8bbbf1d5b6 drivers: sensor: lis2de12: add length check in spi write incr routine
Added a length check in the spi write incr routine to handle both
single and multi byte write operations properly.

Signed-off-by: Mayank Narang <narang.may77@gmail.com>
(cherry picked from commit cb608812cf)
2025-01-29 10:11:57 -05:00
Mayank Narang
ba7c85d6f7 drivers: sensor: lis2de12: fix read accel via spi
The lis2de12 sensor driver spi interface was calling spi read api.
This leads to a single byte operation on reading acceleration data
which is a multi byte operation. Fix it by adding a call to spi read
incr api instead. Added a length check to handle both single and multi
byte read properly.

Signed-off-by: Mayank Narang <narang.may77@gmail.com>
(cherry picked from commit 7b062f5b09)
2025-01-29 10:11:57 -05:00
Jordan Yates
4aa3e56238 net: nsos_sockets: free allocated socket on close
Free the socket object allocated in `nsos_socket_create` when closing
the socket.

Signed-off-by: Jordan Yates <jordan@embeint.com>
(cherry picked from commit c22233a1af)
2025-01-29 10:11:31 -05:00
Jakub Rzeszutko
9cc6307f17 shell: fix unsafe API calls and add configurable autoflush behavior
Fixes an issue where the shell API could block indefinitely when called
from threads other than the shell's processing thread, especially when
the transport (e.g. USB CDC ACM) was unavailable or inactive.

Replaced `k_mutex_lock` calls with an indefinite timeout (`K_FOREVER`)
by using a fixed timeout (`K_MSEC(SHELL_TX_MTX_TIMEOUT_MS)`) in shell
API functions to prevent indefinite blocking.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
(cherry picked from commit b0a0febe58)
2025-01-29 10:11:03 -05:00
Jakub Rzeszutko
2f93ce6c5d shell: add Kconfig option for configurable autoflush behavior
Introduced a new Kconfig option `SHELL_PRINTF_AUTOFLUSH` to allow
configuring the autoflush behavior of shell printing functions.

Updated `Z_SHELL_FPRINTF_DEFINE` to use the
`CONFIG_SHELL_PRINTF_AUTOFLUSH` setting instead of hardcoding
the autoflush behavior to `true`.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
(cherry picked from commit 8991b954bc)
2025-01-29 10:11:03 -05:00
Krzysztof Chruściński
4ef146d12c pm: device_runtime: Fix bitfields misuse
PM_DEVICE_FLAG_ISR_SAFE is an enum and it must be converted to
a bit mask before masking with flags.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 581c55496d)
2025-01-23 19:58:17 -05:00
Yong Cong Sin
afdd87e509 lib: os: mpsc_pbuf: do not wait when spinlock is held
Check if the spinlock is held before attempting to wait by
taking the semaphore, as that would cause a context switch which
isn't allowed and will trigger an assertion error when
`CONFIG_SPIN_VALIDATE` is enabled.

Logging in spinlock-held context when the log buffer is full can lead
to an infinite assertion error loop, as the logging subsys attempts to
allocate buffer when there's none available, it will try to wait for
one and thus triggers the assertion error, the error message will be
printed through the logging sybsys but there's no buffer available,
so it will try to wait for one and triggers another assertion error..
This loop just goes on and on forever, and nothing gets printed to
the terminal.

Added a test to validate the fix.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Maxim Adelman <imax@meta.com>
(cherry picked from commit 1a578eb72c)
2025-01-23 18:55:08 -05:00
Alberto Escolar Piedras
e6d5b78a24 tests/subsys/lorawan/frag_decoder: Change random seed
These tests are quite sensitive to the exact random sequence.
After a change of the native_sim entropy generation 2 of them
started failing. Let's set a random seed which avoids the failure.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit 64d4fcd8cb)
2025-01-23 18:53:32 -05:00
Alberto Escolar Piedras
d776876a70 drivers: entropy: fix native_posix driver for more than 3 byte requests
Fix the native_posix fake entropy driver for more than 3 byte requests,
and specially for native_sim//64 builds.

The host random() provides a number between 0 and 2**31-1 (INT_MAX),
so bit 32 was always 0.
So when filling a buffer with more than 3 bytes we would be filling
each 4th byte with a byte which always had its MSbit as 0.

For LP64 native_sim//64 builds, this was even worse, as the driver had
another bug where we assumed random() returned the whole long filled,
and therefore all 4 upper bytes would be 0.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit b3407f04e7)
2025-01-23 18:53:32 -05:00
Chen Shu
78f87d566c fs: ext2: Fix nbytes_to_read calculation in ext2_inode_read()
Fix incorrect nbytes_to_read calculation in ext2_inode_read() function.
Previously nbytes_to_read was decremented by read value which caused
incorrect calculation of bytes to read in subsequent iterations.
Now nbytes_to_read is decremented by to_read value which represents
the actual number of bytes read in current iteration.

This fixes potential data corruption issues when reading files from
ext2 filesystem.

Signed-off-by: Chen Shu <751541594@qq.com>
(cherry picked from commit 5a5f05ba4e)
2025-01-23 18:48:11 -05:00
Emil Gydesen
c3e4c50866 samples: Bluetooth: TMAP periph: Handle empty URI string
The supported URI list may be empty which the sample did not
properly support.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-23 18:47:24 -05:00
Emil Gydesen
b1dc99d0c1 Bluetooth: TBS: Return empty string instead of NULL for empty data
If we read an empty GATT characteristic that should contain a
string value, then we provide the empty string, instead of NULL,
to be true to the API.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
2025-01-23 18:47:24 -05:00
Luis Ubieda
2aee9e34ed samples: sensor🐚 test all channels
Loop through all of the channels and make sure that each
channel has an output.

Changes in patch originally present in #72972.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit 1e64d7bea1)
2025-01-23 09:19:03 -05:00
Luis Ubieda
9c24c4a998 tests: sensor: generic_test: Remove special-handling for axis values
Since now they're treated as q31 values when individually queried, as
opposed to lump them in a triplet.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit 19a4261517)
2025-01-23 09:19:03 -05:00
Luis Ubieda
1443e29701 sensor: default_rtio_sensor: fix: Treat individual axis data as q31_t
Instead of assuming that an individual axis must contain all
data-values. Additionally, for determining that there's XYZ data, all
three channels must be present in the header.

Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit 5a1dfc82c3)
2025-01-23 09:19:03 -05:00
Luis Ubieda
3029229422 sensor: shell: Allow individual axis data to be processed
For the supported channels, instead of just allowing 3-axis data being
printed out, allow individual channels to be processed (e.g: accel_x,
gyro_y, etc).

Signed-off-by: Luis Ubieda <luisf@croxel.com>
(cherry picked from commit 36dfea121d)
2025-01-23 09:19:03 -05:00
Jonathan Rico
e6598030a8 Bluetooth: L2CAP: Downgrade user_data API error to a warning
When user_data is not zeroed-out, the API returns an error. Downgrade
the API error to a warning log instead.

Introducing this check (#76489) broke a few PTS tests, as user_data is
not initialized by `net_buf_alloc()`. Doing so is in discussion:

https://github.com/zephyrproject-rtos/zephyr/issues/77088

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 6fa6c4c256)
2025-01-23 09:18:26 -05:00
Derek Snell
6a519f6d94 drivers: flash: soc_flash_mcux: remove CMD_MARGIN_CHECK
The CMD_BLANK_CHECK can return errors when the flash is readable, and
should only be used after programming, not in is_area_readable().  From
the LPC55S69 datasheet: "As cells age and lose charge, a correctly
programmed address will fail this check, while still being able to be
read successfully for the remaining duration of the data retention time."

Signed-off-by: Derek Snell <derek.snell@nxp.com>
(cherry picked from commit 88b9cb6efc)
2025-01-22 15:13:41 -05:00
Pieter De Gendt
8b5fee6186 drivers: spi: spi_mcux_ecspi: Fix data size when using 16/32 bit transfers
The data size is set using a burst length, the data size for 8/16/32 is
always 1 in those cases.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
(cherry picked from commit 0e8aed7393)
2025-01-22 15:11:24 -05:00
Pieter De Gendt
ad8fd5da35 drivers: spi: spi_mcux_ecspi: Ignore chip select channel with cs-gpios
The internal chip selects are limited to 4, however when using GPIOS
does not pose this limitation.
Also set internal channel to 0 if GPIOS are used.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
(cherry picked from commit 7250e987e5)
2025-01-22 15:11:24 -05:00
Tomislav Milkovic
0010b775f1 drivers: can: can_tcan4x5x: fix compiler build warning/error
Fix compiler warning when optional property reset-gpios
is not supplied in the ti,tcan4x5x-compatible device tree
node

Signed-off-by: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
(cherry picked from commit fb98387f4d)
2025-01-22 15:10:26 -05:00
Erik Tamlin
1182a4ca73 manifest: update percepio
Update the percepio module to use TraceRecorder v4.10.2

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
(cherry picked from commit 91b2156398)
2025-01-07 09:19:39 -05:00
Jamie McCrae
7c0a74e708 samples: mgmt: mcumgr: smp_svr: Fix re-advertise issue on connection
Fixes an issue introduced with commit
c6ad4a7927 which wrong restarts
advertising after a device connects when it should only restart
advertising if a device fails to connect

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 655be99fa7)
2025-01-07 09:17:19 -05:00
Jilay Pandya
d790dcc0f8 drivers: auxdisplay: jhd1313: fix Out-of-bounds read
fix out of bounds read by doing the comparison with ARRAY_SIZE correctly

Signed-off-by: Jilay Pandya <jilay.pandya@outlook.com>
(cherry picked from commit 3202773b11)
2025-01-07 09:16:51 -05:00
Dominik Ermel
228f1406c3 drivers/flash: Correct flash_erase userspace handler
As the erase callback is optional, handler should not check
if it is not NULL.

Fixes #81777

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 486428951b)
2025-01-07 09:16:19 -05:00
DEVER Emiel
f02f2837a5 fs: ext2: Fix ext2 read buffer overflow
Keep track of the amount of bytes read so no buffer overflow occurs.

Signed-off-by: DEVER Emiel <emiel.dever@psicontrol.com>
(cherry picked from commit 336c650646)
2024-12-16 16:14:13 -05:00
Marcio Ribeiro
73abf94f8a drivers: uart: esp32: reset tx fifo during driver init
Resets uart tx fifo during driver initialization to have a well defined
initial condition mainly preventing unwanted characters being sent

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
(cherry picked from commit f0516ead27)
2024-12-16 16:14:00 -05:00
Daniel DeGrasse
c52903cbda drivers: flash: flash_mcux_flexspi_nor: check all 3 bytes of JEDEC ID
The FlexSPI NOR driver should verify all 3 bytes of the JEDEC ID match
the expected value before attempting to use a custom LUT table with a
flash chip. This reduces the odds that an incompatible LUT will be used
with a flash chip, as some flash chips may share the same first byte of
their device ID but not be compatible with the custom LUT table.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-12-14 14:09:05 -05:00
Jukka Rissanen
7109586f8e tests: net: dns_dispatcher: Add tests for dispatcher
Make sure that the socket service is properly unregistered when
dispatcher is unregistered.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit d98fe73684)
2024-12-14 14:07:40 -05:00
Jukka Rissanen
c8e2e4605c net: dns: Close socket service properly from dispatcher
We need to close the socket service context when dispatcher is
unregistered.

Fixes #82652

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit da148ab3bc)
2024-12-14 14:07:40 -05:00
Jukka Rissanen
830126b573 net: dns: Avoid errors when DNS dispatcher is already registered
Skip error prints and extra DNS events if DNS dispatcher was already
registered.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit c110331507)
2024-12-14 14:07:40 -05:00
Jukka Rissanen
9265176867 net: dns: Fix the debug print when dispatcher fails
Depending on DNS type, print the output (mDNS vs DNS) correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit efcfcfe292)
2024-12-14 14:07:40 -05:00
Jakub Rzeszutko
c26e6e7074 lib: shell: replace strtol with strtoul in cmd_load for address parsing
Addresses in cmd_load() should always be unsigned. Previously, strtol()
was used, which is limited to signed long values, causing issues with
addresses >= 0x80000000. This commit replaces strtol() with strtoul(),
ensuring proper handling of the full 32-bit address space.

Fixes #81343

Signed-off-by: Aaron Fontaine <aaron.fontaine@dojofive.com>
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@verkada.com>
(cherry picked from commit 1aaf08f7f1)
2024-12-14 14:07:03 -05:00
Steven Poon
40851dc2c6 net: lib: lwm2m: Fix missing mutex unlock
lwm2m_engine_set() and lwm2m_engine_get() locks
the registry_lock mutex, but this is not unlocked
when setting or getting a time resource where the buffer
lengths are invalid resulting in an early return without
unlocking the mutex. This results in a deadlock when
attempting to lock the registry in another thread.

Signed-off-by: Steven Poon <steven-github@outlook.com>
(cherry picked from commit 30b30c29a3)
2024-12-04 17:11:31 -05:00
Jukka Rissanen
d4631eaa8a tests: net: dns: Add test for invalid DNS answer parsing
Make sure we catch invalid answer during parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 16669ec4d5)
2024-12-04 06:26:31 -05:00
Jukka Rissanen
4556aa9941 net: dns: Check DNS answer properly
The dns_unpack_answer() did not check the length of the message
properly which can cause out of bounds read.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 6e7fcff579)
2024-12-04 06:26:31 -05:00
Jukka Rissanen
347ea04384 net: dns: Validate source buffer length properly
Make sure that when copying the qname, the source buffer is large
enough for the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 43c2b9cfe8)
2024-12-04 06:26:31 -05:00
Jukka Rissanen
26e3be8508 tests: net: dns: Add checking of malformed packet
Make sure we test malformed packet parsing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 6f96915a14)
2024-12-04 06:26:31 -05:00
Jukka Rissanen
72603173c6 net: dns: Check parsing error properly for response
If the packet parsing fails in dns_unpack_response_query(), then
do not continue further but bail out early.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit eb2550a441)
2024-12-04 06:26:31 -05:00
Jukka Rissanen
df28014805 tracing: segger-sysview: Fix compilation issues with networking
The networking tracing function definitions were missing for sysview.

Fixes #79805

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 8134673309)
2024-12-04 06:25:38 -05:00
Jerzy Kasenberg
cc3d24a69e i2c: target: eeprom_target: Fix buffer write
When larger buffer index was introduced only function:
eeprom_target_write_received() was updated to handle
address-width = 16

This adds the same functionality when buffered API is used,
enabled by CONFIG_I2C_TARGET_BUFFER_MODE.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
(cherry picked from commit e6c9e9a2dd)
2024-11-29 14:08:03 -05:00
Matthias Alleman
6051bfc95d posix: fpu: Fix compiler error when enabling fpu on posix boards
Enabling CONFIG_FPU and CONFIG_FPU_SHARING requires the
definition of `arch_float_disable` and `arch_float_enable`.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
(cherry picked from commit e7c353bf14)
2024-11-29 09:26:56 -05:00
Gerson Fernando Budke
5ee1a27e7c drivers: rtc: sam: Fix missing function
The #64939 introduced a few convenience function like
rtc_utils_validate_rtc_time. However the PR did not replace all
occurrences which result on a build error. This add the missing
header include to remove a building warning and replace the old
function by the new one.

Fixes #81454

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
(cherry picked from commit d71d4c0e80)
2024-11-29 09:26:27 -05:00
Anas Nashif
9f824289b2 release: Bump version to 3.7.1
Update version to 3.7.1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-21 19:13:14 -05:00
Anas Nashif
bce2eb00eb doc: release notes: update with new issues resolved
Updated issue list with latest changes.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-21 19:13:14 -05:00
Szymon Janc
2c6e41cfe7 bluetooth: gatt: Fix ATT Read By Type by DB change unaware client
When change unaware client send ATT request it shall get Database
Out of Sync error. Reading GATT database hash is an exception here.

This was affecting GATT/SR/GAS/BV-05-C qualification test case.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
(cherry picked from commit 77cbd27a80)
2024-11-19 19:07:58 -05:00
Armin Kessler
4404621e82 scripts: twister: Fix serial_py referenced before assignment
This fixes `serial_py referenced before assignment` if `flash_before`
is set.

Signed-off-by: Armin Kessler <ake@espros.com>
(cherry picked from commit 78f688a3e7)
2024-11-19 19:06:30 -05:00
Sylvio Alves
6a50fd3ca8 [v3.7-branch] west.yml: fix phy nested critical section
PHY section needs nested locking/unlocking control, which was
wrongly removed from v3.7.x.

Fixes #81570

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-11-19 19:06:02 -05:00
Jamie McCrae
33fce6ad48 doc: release: 3.7: Add MCUboot/TF-M updates for 3.7.1
Adds update notes for what has been fixed in 3.7.1

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-15 11:03:08 -05:00
Jamie McCrae
b2a3811342 west.yml: MCUboot synchronization from v3.7-branch
Update Zephyr fork of MCUboot to revision:
  ea2410697dd0262edec041a0ccb07fdbde7c1aff

Brings following Zephyr relevant fixes:

  - ea241069 boot: bootutil: boot_record: Fix issue with saving
    image data
  - 03b64828 boards: mcxn947_qspi: fix mcuboot partition allocation
  - 4a0f42c0 doc: remove repetition
  - 1c47465c boot: zephyr: use EXTRA_CONF_FILE instead of
    deprecated OVERLAY_CONFIG
  - 8e8ecd91 boot: zephyr: Fix serial recovery for NXP IMX.RT
    platforms
  - 52c7231a boot: zephyr: Fix Warning 'boot_serial_enter defined
    but not used'
  - a58d9026 zephyr: hello_world: Fix the main() return type
    warning
  - 50b7b9ee bootutil: Fix AES and SHA-256 contexts not zeroized
    with mbedTLS
  - 9b1b95c1 ci: Fix zephyr workflow
  - 809b0e42 bootutil: Add better mode selection checks
  - 0fe7ffd8 ci: Fix FIH Docker image release usage
  - a990c6b6 ci: Update FIH docker to Ubuntu Jammy (22.04)
  - 03d1a443 boot: zephyr: board: Fix nrf54l15pdk Kconfig fragment
  - 323eb8d1 boot: zephyr: MCXN947 currently only does not support
    swap mode
  - 0a88733d boot_serial: Fix `format` warning
  - 157547c8 boot_serial: Fix `incompatible-pointer-types` warning
  - 60ac682a bootutil: loader: Verify image header before checking
    image
  - 1cd53982 boot: main: avoid unused build warning
  - 587289d6 bootutil: Fix missing include
  - 610b8e2b bootutil: Fix swap move max app size calculation
  - a4800ce0 imgtool: Add missing encodings to emitter tests
  - 80397e0f imgtool: Fix getpub fails for ed25519 key
  - e29a123d docs: release-notes: Add note on name clash fix
  - a375a14d zephyr: Fix issue with sysbuild if something else is
    named mcuboot
  - 77b03c7f Fix style issues
  - 35bf48c5 boot: Change boot_enc_load to take slot number instead
    of image
  - 90836499 docs: release-notes: Add note on fixed zephyr RAM load
    address
  - 24de0fbc boot: zephyr: Fix RAM load chain load address
  - 197287ce imgtool: Bump cryptography library version
  - 7566edaf boot: Move encryption context invalidation to
    boot_enc_drop.
  - 86b1ef19 boot: Rename boot_enc_decrypt to boot_decrypt_key
  - 597a1996 boot: boot_serial: change logging to debug level
  - 2fa42bfa doc: readme-zephyr: fix the scratch partition example
  - f2971d20 boot: Add missing boot_enc_init
  - 071b3b8e boot: Remove pointless slot identification
  - 2cd6ce9f sim: Fix MCUBOOT_SWAP_USING_SCRATCH defined in
    direct-xip and ram-load
  - 3c2f8375 bootutil: Properly retrieve image headers after
    interrupted swap-scratch
  - fb2cf0ec docs: release-notes: Add note on fixed nordic boards
  - 89807992 boot: zephyr: Fix build for nrf9160dk
  - 2f5a7f47 boot: zephyr: Fix build for thingy53
  - c9e4ab8b boot: zephyr: Fix build for thingy52
  - c06f7bb3 Revert "boot: Add MCUBOOT_HW_KEY support for image
    encryption"
  - 1d79ef35 boot: Fix ASN.1 for mbedtls >= 3.1
  - 86acda9e ext: fiat: Use user-defined assert macro

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-15 11:03:08 -05:00
Jamie McCrae
d3395d4b6f manifest: Update TF-M
Updates TF-M to pull in fixes from 2.1.1, and updates the tests
revision to work with this version

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-11-15 11:03:08 -05:00
Ioannis Karachalios
88b1906052 drivers: counter: Fix unbalanced policy state lock
This commit should deal with fixing unbalanced policy state locks.
When PM and PM_DEVICE are declared, default state, policy locks
should be given only when  active.

Signed-off-by: Ioannis Karachalios <ioannis.karachalios.px@renesas.com>
(cherry picked from commit a66c070598)
2024-11-15 11:02:20 -05:00
Ioannis Damigos
8cd40948c7 driver/dma_smartbond: Fix driver initialization when PM_DEVICE is set
Fix DMA driver initialization when PM_DEVICE is set.
Don't put PM policy state lock if it is not active.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit 135214d844)
2024-11-15 11:00:22 -05:00
Fabio Baltieri
37363d5eb6 arch: arm: cortex_m: add memory to the clobber list
Add "memory" to the clobber list"

From GCC 14 the compiler optimizes away memory accesses that do not
impact the asm block. Adding the memory to the clobber list lets the
compiler know that the memory state is to be preserved.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
(cherry picked from commit 63890e2526)
2024-11-14 16:58:35 -05:00
Fabio Baltieri
8926e65d35 arch: arm: cortex_m: move _main in input list
Move the _main argument to the input list rather than the output one on
the asm block and change the spec to "r". The ASM block does not return,
so it does not make sense for it to expect any output.

Signed-off-by: Wilfried Chauveau <wilfried.chauveau@arm.com>
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
(cherry picked from commit 7015a0ee37)
2024-11-14 16:58:35 -05:00
Daniel Leung
8bae4f2490 xtensa: remove mem_domain excess padding
The ptables field in arch_mem_domain for Xtensa has excessive
padding as it is incorrectly marked with needing page size
alignment. This is simply a pointer and not the actual page
table so there is no need for that alignment. So remove it.

Fixes #71896

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit eb9fc642b9)
2024-11-14 16:57:39 -05:00
Daniel Leung
558658e64e tests: thread_error_case: no ICOUNT for qemu/xtensa/dc233c/mmu
For some weird reasons, enabling ICOUNT would result in some
tests crashing QEMU. So disable ICOUNT.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit 0e9376ebff)
2024-11-14 16:57:39 -05:00
Yong Cong Sin
c1eab8272a tests: arch: riscv: make sure that gp reg can't be corrupted
Add a test to make sure that the `gp` global pointer register used for
relative addressing when `CONFIG_RISCV_GP` is enabled can't be
corrupted by a rogue user thread.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 408c151282)
2024-11-14 16:56:33 -05:00
Yong Cong Sin
f3c39c704c arch: riscv: reset global pointer on exception
Reset the gp on exception entry from u-mode to protect the kernel
against a possible rogue user thread.

Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit e30db2d53f)
2024-11-14 16:56:33 -05:00
Yong Cong Sin
69e62ed8cd arch: riscv: add macro to access hardware registers
Add macros to read / write hardware registers.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit de3a845612)
2024-11-14 16:56:33 -05:00
Anas Nashif
321e39a457 release: bump version to 3.7.1-rc1
Bump version to 3.7.1-rc1

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 14:56:52 -05:00
Anas Nashif
7be15c0bd9 doc: releases: update release notes for 3.7.1
Add list of fixed bugs in the 3.7.1 release section.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2024-11-12 14:56:52 -05:00
Krzysztof Chruściński
f7e9a609ed kernel: fatal: Fix NO_OPTIMIZATIONS build
When logging is on and optimization and multithreading is off then
build fails to link because unoptimized compiler/linker seems to not
look beyond the function and it fails trying to link k_thread_name_get.
Reworking the code to make it known to the compiler without optimization
that k_thread_name_get is not needed and not logging current thread
name in that case.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
(cherry picked from commit 28b4bab01c)
2024-11-11 10:06:03 -05:00
Simon Moser
c480aa3e96 doc: fix body length in SMP UART transport
In the description of the partial-final frame of the SMP UART transport
specification was a typo in the maximum allowed raw body size. The size
must not be larger than MTU - 5 because there are 5 bytes occupied by
total length (2), frame termination (1) and crc (2).

Signed-off-by: Simon Moser <simon.github@mailbox.org>
(cherry picked from commit a77d499e2d)
2024-11-11 10:04:43 -05:00
Declan Snyder
713d8c8a62 drivers: nxp_enet: Fix tx error handling
The code path for error handling and timestamping in tx path
was meant to be identical in function to old eth_mcux driver,
but there is actually a discrepancy causing no error handling
for timestamped frames, fix it.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit b29190c314)
2024-11-11 10:04:14 -05:00
Declan Snyder
4c806352bd drivers: ethernet: ksz8081: RMII override RNB part
I for the life of me do not know what is going on here with the RNB chip
but it seems this override must be set in order for the chip to work,
regardless of strap-in configuration, and if not set explicitly, the
value after a reset for these two bits will be seemingly random and
inconsistent. And it was working before by luck before removing a second
redundant reset in a recent commit, because apparently the register
was getting the opposite of the reset value according to the datasheet
which makes it work. The result of these bits after reset seem to vary
depending on host mcu, board, debugger, number of times reset, type of
reset, and with a pinch of random chance after keeping all variables
seemingly the same, so let's just set it to the value that works
explicitly, even if it doesn't make sense. The bit here doesn't have
clear documentation but it seems it's for using RMII regardless of the
strap in option, which is what we want to do anyways if we know the
interface type from DT, so I think it's fine, considering it is making
this driver work again.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 495a374a0d)
2024-11-11 10:03:51 -05:00
Declan Snyder
efb8a1d030 drivers: ethernet: ksz8081: Fix reset times
500 ms reset time is only for software reset and comes from IEEE spec.
Datasheet mentions for hardware reset the assertion of the signal should
only need to be 500 us, and 100 us after deassert to wait to access
programming interface.

Also remove an unused macro.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 96877736e4)
2024-11-11 10:03:51 -05:00
Declan Snyder
7098b56481 drivers: mdio_nxp_enet: Don't disable IRQ
No real need to be enabling and disabling IRQs, this logic has been
reported to be causing spurious interrupts and strange behavior, we can
just enable the interrupt and switch to interrupt based logic one time
and keep the interrupt enabled at that point.

Also, fix a W1C bug where |= was used instead of = to clear a flag.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 2ab104625e)
2024-11-11 10:03:28 -05:00
Zak Portnoy
1aa25cc633 mgmt: smp: shell: Respond on uart shell device when changed at runtime
Responses are currently set to the shell device that was configured
in the device tree.

The shell_uart driver allows for changing it's device during runtime
which leads to a situation where we recieve packets on one device
and respond on another.

This patch causes smp_shell_tx_raw to use the shell_uart device

Signed-off-by: Zak Portnoy <zakportnoy@gmail.com>
(cherry picked from commit 32b1140066)
2024-11-11 09:54:19 -05:00
Dominik Ermel
30af4b2696 tests/storage/stream_flash: Add erase range check test
The commit adds test for stream_flash_erase_page range check.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 23805301b0)
2024-11-08 12:26:20 -05:00
Dominik Ermel
219d0343fa storage/stream_flash: Fix range check in stream_flash_erase_page
Added check where stream_flash_erase_page checks if requested
offset is actually within stream flash designated area.

Fixes #79800

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
(cherry picked from commit 8714c172ed)
2024-11-08 12:26:20 -05:00
Anas Nashif
064fcfca6b arm: cortex_m: restore fix for loading z_arm_int_exit
This change was in the same commit previously reverted and seem to be
unrelated and should not be reverted.

Fixes the problem:

..... /swap_helper.S:432:(.text.z_arm_svc+0x26):
relocation truncated to fit: R_ARM_THM_JUMP11 against symbol
`z_arm_int_exit' defined in .text._HandlerModeExit section in
....core/cortex_m/libarch__arm__core__cortex_m.a(exc_exit.c.obj)

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit d9bc0b60b9)
2024-11-05 21:07:46 -05:00
Anas Nashif
3993287ce4 Revert "arch: arm: cortex_m: move part of swap_helper to C"
This reverts commit 773739a52a.

Fixes #80701

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit e646b7f3bb)
2024-11-05 18:58:59 -05:00
Anas Nashif
c6635808de Revert "arch: arm: cortex_m: restore comment lost in translation"
This reverts commit 7d7616214b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 7aa4032ac6)
2024-11-05 18:58:59 -05:00
Mathieu Choplain
0b41a2713e tests: dma/chan_blen_transfer: move buffer to DMA-accessible memory
This commit moves the test buffer from ITCM (not accessible by DMA) to DTCM
on several NXP boards, to make the test successful.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
(cherry picked from commit eaa799a9b5)
2024-11-05 10:53:37 -05:00
Mathieu Choplain
a23758dbb1 tests: dma/chan_blen_transfer: relocate TX and RX buffers
This commit places the chan_blen_transfer DMA test's TX and RX buffers
in a separate file that gets entirely relocated. This ensures that the
buffers reside in the correct memory, without breaking other things
due to relocation of test data/code.

Fixes #75676.

Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
(cherry picked from commit 3099491f3e)
2024-11-05 10:53:37 -05:00
Yong Cong Sin
422657bc7f shell: shell_help: fix width for subcommands help text
The terminal offset for subcommands' help text isn't
computed correctly, fix it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit fd1be9849c)
2024-11-05 10:53:22 -05:00
Yong Cong Sin
480fa71ca5 shell: devmem: minor optimizations
- Use `SHELL_CMD_ARG_REGISTER` for the main cmd to state the
  required number of arguments, this helps to remove the
  runtime check from the command, and also print the help
  message to the terminal when the argument count is
  unexpected.
- Some changes to the help text that hopefully makes the
  mandatory and optional arguments more obvious to the user

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 276ccd04e7)
2024-11-05 10:53:22 -05:00
David Leach
05acdcfbe4 soc: nxp: lpc55s69: Fix part number typo
There is a typo in the part number list for LPC55S69. The
LPC55S69JET98 should be LPC55S69JEV98.

Fixes #80541

Signed-off-by: David Leach <david.leach@nxp.com>
(cherry picked from commit 46042f73cf)
2024-11-05 10:52:34 -05:00
Abderrahmane Jarmouni
6fc41c1cce drivers: display: stm32_ltdc: fix return value
Blanking On/Off calls should not return 0 when there is no panel
controller to forward them to, instead they should return ENOSYS to
signal to the application that they were not actually executed.

"device_is_ready" does check for null, but also for
"dev->state->initialized == false", so we need to isolate the
"dev == NULL" case.

Signed-off-by: Abderrahmane Jarmouni <git@jarmouni.me>
(cherry picked from commit f7de44dfaf)
2024-11-05 10:52:08 -05:00
Andrej Butok
b258fb0230 samples: smp_svr: fix overlay-udp.conf build
- fixes overlay-udp.conf build for platforms without TRNG.
- adds TEST_RANDOM_GENERATOR, as for most network samples.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
(cherry picked from commit 5c376ad24c)
2024-11-05 10:51:34 -05:00
Henrik Brix Andersen
c125e3b80f drivers: can: sam: fix sys_write32() arguments order
Fix the order of the arguments to sys_write32().

Fixes: #80750

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
(cherry picked from commit 0bb5270f7b)
2024-11-05 10:51:16 -05:00
Fin Maaß
aa18fb8d1f drivers: flash: spi_nor: simplify defines
simplify defines by using `DT_INST_**_OR` macros.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
(cherry picked from commit 83c3b1c708)
2024-11-04 09:25:14 -05:00
Fin Maaß
3c242d5eaf drivers: flash: spi_nor: fix config struct
lots of values from the DT where not set corretly, if
`CONFIG_SPI_NOR_SFDP_RUNTIME` was
enabled. This fixes it.

Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
(cherry picked from commit 27aeabb5b2)
2024-11-04 09:25:14 -05:00
Artur Wilczak
debf3e0ffc boards: Fix to accommodate for slowly tests on UP2
To accommodate for some slow tests on up2.
For example: tests/arch/x86/info/arch.x86.info.userspace
Execution time of this test is close to 55s and sometimes
above up to the 60s.
Related issue: #80134

Signed-off-by: Artur Wilczak <arturx.wilczak@intel.com>
(cherry picked from commit 9cce72daa1)
2024-11-04 09:24:50 -05:00
Gerson Fernando Budke
739247e680 mgmt: mcumgr: stat: Fix stat_mgmt_list behavior
The MCUmgr statistics only work correctly when selecting
MCUMGR_SMP_LEGACY_RC_BEHAVIOUR option. Checks the option
flag on the stat_mgmt_list and fix the behavior.

Fixes: 80476

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
(cherry picked from commit b46e176704)
2024-11-04 09:24:35 -05:00
Daniel DeGrasse
04bbca7464 boards: nxp: frdm_rw612: correct max frequency for WS25Q512JV
WS25Q512JV can only run at 104MHz at 3.3V, unless the read parameter
bits are changed. Since we don't reprogram these currently, reduce max
frequency to safe value

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 23d253727c)
2024-11-04 09:24:07 -05:00
Daniel DeGrasse
29b2bf89f8 drivers: flash: flash_mcux_flexspi: add support for W25Q512JV
Add support for the W25Q512JV with the FLEXSPI, using a custom
LUT table.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 6bc73df06b)
2024-11-04 09:24:07 -05:00
Andreas Huber
96a05d09f2 net: ipv4: Fix ARP probe check in address conflict detection
The second condition needs to check ARP probes only

The ACD is not properly implemented as described in RFC5227 ch. 2.1.1
The implementation incorrectly detects an IP conflict, if an ARP request
is received for the target IP.
The reason is that the current implementation checks for ARP requests
instead of ARP probes.

Signed-off-by: Andreas Huber <andreas.huber@ch.sauter-bc.com>
(cherry picked from commit 27d93f8b6c)
2024-11-04 09:23:45 -05:00
Alberto Escolar Piedras
a3315af1d1 manifest: Update EDTT to latest version
Update the EDTT module to:
b9ca3c7030518f07b7937dacf970d37a47865a76

Including the following:
* b9ca3c7 Fix for for python >= 3.11
* fe9b1d1 Corrected ISO interval for LL/CIS/PER/BV-05-C

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit 59685b512e)
2024-11-04 09:22:34 -05:00
Daniel Leung
db2df7129f xtensa: mpu: update hardware if manipulating current domain
If adding/removing to the domain of the current running
thread, we need to update the hardware MPU regions or else
the addition or removal would not be reflected to current
running thread.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit da5f7e1816)
2024-11-04 09:20:49 -05:00
Daniel Leung
5d466aad19 xtensa: mpu: make sure write to MPU regions is atomic
This adds a spinlock to make sure writing to hardware MPU
regions is atomic, and cannot be interrupted until all
regions are written to hardware.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
(cherry picked from commit 6bd0dcf920)
2024-11-04 09:20:49 -05:00
Yong Cong Sin
4aa56071f1 testsuite: coverage: fix typo in the CMakeLists.txt
`zephyr_BASE` should have been `ZEPHYR_BASE`, fix it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit a5555ab077)
2024-11-04 09:20:21 -05:00
Benjamin Cabé
61c2965c65 doc: css: fix styling of signatures
Sync the section of the custom.css dedicated to object
signatures with Godot custom CSS.

Fixes #80005.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit c7f1f32ebe)
2024-11-04 09:20:06 -05:00
Henrik Brix Andersen
30b0a75429 ci: build samples/cpp/hello_world as part of the multiplatform test
Build the C++ version of the Hello, World sample as part of the
multiplatform (build) test in CI.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
(cherry picked from commit cd543887f4)
2024-11-04 09:19:36 -05:00
Henrik Brix Andersen
1f93bd74b3 SDK_VERSION: Use Zephyr SDK 0.16.9
This commit updates ZEPHYR_SDK to point to the Zephyr SDK 0.16.9 release.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2024-11-04 09:19:36 -05:00
Torsten Rasmussen
6da35a811a cmake: limit Zephyr SDK to 0.16.x series for Zephyr 3.7 LTS
Zephyr SDK compatibility level 0.16 is now an LTS intended for
Zephyr v3.7 LTS.

Thus, limit the upper Zephyr SDK lookup to <0.17, so that developers
working with Zephyr v3.7 LTS and latest Zephyr main can install both
Zephyr SDK 0.16.x along side Zephyr SDK >=0.17 and have the Zephyr SDK
0.16.x series being used for v3.7 LTS development.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-24 14:05:16 +02:00
Torsten Rasmussen
c94fee82c1 cmake: support range for find_package(Zephyr-sdk)
Fixes: #80200

CMake `find_package(<package> <version>)` support the use of ranges,
like `1.0.0...4.0.0`.

Update the FindZephyr-sdk.cmake module to support this.
This allows looking up the Zephyr SDK with an upper boundry, for example
`find_package(Zephyr-sdk 0.16...<0.17)`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2024-10-24 14:05:16 +02:00
Jakub Topic
f5e54e6255 drivers: rtc: rv3028: preserve CLKOUT when enabling callbacks
This commit addresses an issue where enabling the alarm or update
callbacks unexpectedly disabled the RTC's programmable clock output
during runtime.

The interrupt configuration has been moved to the driver's init
function.

Signed-off-by: Jakub Topic <jakub.topic@anitra.cz>
(cherry picked from commit f395519104)
2024-10-23 20:10:18 -04:00
Tomi Fontanilles
d662d62ef0 mbedtls: update to 3.6.2
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-10-23 20:09:42 -04:00
Jun Lin
a3266a8b62 drivers: espi: host_subs: npcx: fix LDN register definition of PMCH
The register offset definition of the I/O port Data Base Address
register (0x60, 0x61) and Command/Status Base Address register
(0x62, 0x63) are reversed. This commit fixes it to avoid confusion.

Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
(cherry picked from commit 51cfbd8c5f)
2024-10-17 23:20:45 -04:00
Yong Cong Sin
793065cc19 irq: multilevel: fix irq_parent_level_3()
The IRQ for level 1 and above is incremented by 1 when encoded
with Zephyr's multilevel IRQ scheme, so it should be
decremented by 1.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-17 23:20:08 -04:00
Laurentiu Mihalcea
22b72e62d3 drivers: dai: sai: don't crash on underrun/overrun
TX/RX FIFO underrun shouldn't crash the RTOS when it occurs.
Also, since this can also happen under "normal" conditions
(i.e: DMA doesn't copy data fast enough from/to SAI's FIFOs)
the software should be able to recover from it.

As such:
	1) Remove `z_irq_spurious()` call.
	2) Clear error flag
	3) De-escalate error message to warning message

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
(cherry picked from commit e224a41ec8)
2024-10-17 23:19:03 -04:00
Ibe Van de Veire
ff72087063 test: net: igmp: Add extra IGMPv3 testcase
Added extra testcases for the IGMPv3 protocol. The IGMP driver is
supposed to send an IGMPv3 report when joining a group.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit e6dd4cda89)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
29f425f687 net: ip: igmp: Add igmp.h for definitions
Add igmp.h file to declare definitions for IGMP that are not meant te be
included by the application but can be used in e.g. tests.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit ba9eca3181)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
a126a0858c net: ip: igmp: Remove too strict length check
According to RFC2236 section 2.5, the IGMP message may be longer then 8
bytes. The rest of the bytes should be ignored.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit c646dd37e5)
2024-10-17 23:18:32 -04:00
Ibe Van de Veire
ea219dbb82 net: ip: igmp: Fix wrong header length
The header length of the net ip packet was calculated using only the
net_pkt_ip_hdr_len function. The correct header length should be
calculated by adding net_pkt_ip_hdr_len and net_pkt_ipv4_opts_len. This
resulted in an incorrect IGMP version type in case of IGMPv2 message
(when IGMPv3 was enabled). The IGMP message was not parsed correctly and
therefore dropped.

Signed-off-by: Ibe Van de Veire <ibe.vandeveire@basalte.be>
(cherry picked from commit f852c12360)
2024-10-17 23:18:32 -04:00
Marcio Ribeiro
c69bea047f sample: input_dump: enables INPUT_ESP32_TOUCH_SENSOR for Espressif boards
.conf files added to enable INPUT_ESP32_TOUCH_SENSOR during sample build.
The absence of these files incorrectly prevented the input_dump sample
build from failing due to missing required hal files.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-10-17 23:17:53 -04:00
Marcio Ribeiro
a3f574e5dd manifest: esp32: update hal_espressif
Update to fix regression regarding to touch_sensor on hal_espressif.

Signed-off-by: Marcio Ribeiro <marcio.ribeiro@espressif.com>
2024-10-17 23:17:53 -04:00
Johann Fischer
1c9470285a drivers: udc: add opaque pointer to store upper layer private data
Add an opaque pointer to store upper layer private data and initialize
it with the USB device context during controller initialization. Use the
pointer in event processing to get the correct context.

Fixes commit 48f2a4bc1a
("usb: device_next: remove initialized state checks in event processing")

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
(cherry picked from commit 5ddaa3b1a1)
2024-10-17 23:16:08 -04:00
Daniel DeGrasse
da137a587a soc: nxp: lpc55xxx: fix dependencies for SOC_FLASH_MCUX
SOC_FLASH_MCUX has additional dependencies for LPC55xxx CPUs, due to the
fact that the flash should be disabled when executing in nonsecure mode.

Since the merge of HWMv2, this dependency has been set incorrectly at
the SOC level, resulting in the IAP flash driver being enabled when
targeting CPU1, which is incorrect. Fix the Kconfig dependency to
resolve this issue.

Fixes #79576

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit feb0241536)
2024-10-17 23:15:29 -04:00
Gero Schwäricke
69f61ebcaa boards: hardkernel: odroid_go: fix PSRAM size
Booting the hello world sample fails with an error on the odroid go:

  I (124) quad_psram: This chip is ESP32-D0WD
  I (124) esp_psram: Found 4MB PSRAM device
  I (124) esp_psram: Speed: 40MHz
  I (125) esp_psram: PSRAM initialized, cache is in normal (1-core) mode.
  SPIRAM size is less than configured size, aborting.
  abort()

The device features only 32 Mbit PSRAM (4 MiB), see

  dts/xtensa/espressif/esp32/esp32_wrover_e_n16r4.dtsi

included from

  boards/hardkernel/odroid_go/odroid_go_procpu.dts

Signed-off-by: Gero Schwäricke <gero.schwaericke@posteo.de>
(cherry picked from commit db1adf4c7e)
2024-10-16 13:35:09 -04:00
Benjamin Cabé
65cc5d4d31 doc: fix issue with keydown/keyup being ignored
Ensure initial search menu visibility is properly set so that key
events don't get trapped preventing arrow key navigation on the
document.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit b3776ca97c)
2024-10-16 13:34:53 -04:00
Jamie McCrae
cd43f1be07 sysbuild: cmake: Fix ExternalZephyrProject_Add() revision handling
Fixes an issue with HWMv2 boards whereby the specified board
revision was not applied at the correct place, which would cause
the target image to fail configuration

Fixes #79208

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit 96c6c7863a)
2024-10-16 13:34:37 -04:00
Abram Early
32029b8dd0 modbus: reset wait semaphore before tx
A response returned after a request times out would increment the
semaphore and stay until the next request is made which will immediately
return when k_sem_take is called even before a response is returned. This
will once again have the same problem when the actual response arrives.
So the wait semaphore just needs to be reset before transmitting.

Signed-off-by: Abram Early <abram.early@gmail.com>
(cherry picked from commit 583f4956dc)
2024-10-16 13:33:55 -04:00
Jonathan Rico
02352b35a2 Bluetooth: L2CAP: document memset requirement
The `struct bt_l2cap_le_chan` and `struct bt_l2cap_br_chan` objects
should be memset before passing them to the stack.

This was not stated anywhere, but all the in-tree users are doing it, so
it must be API.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit e1ac3866ee)
2024-10-15 19:07:56 -04:00
Yong Cong Sin
34a68c47d7 tests: arch: common: stack_unwind: add qemu_riscv32e
qemu_riscv32e uses a different ISA and is kinda special, add it
to the testcase for better coverage.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-15 19:07:37 -04:00
Yong Cong Sin
d1a519e1a5 arch: riscv: stacktrace: fix output without ra on the stack top
Account for the scenario when we are doing `esf`-based
unwinding from a function which doesn't have any callee.
In this case the `ra` is not saved on the stack and the
second function from the top of the frame could be missing.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
2024-10-15 19:07:37 -04:00
Simone Orru
7caed78e47 modules: mbedtls: Enable PEM writing when PEM cert format is selected
Enable the `MBEDTLS_PEM_WRITE_C` mbedtls configuration option when
`CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT` is selected.

Signed-off-by: Simone Orru <simone.orru@secomind.com>
(cherry picked from commit ad208e1e7c)
2024-10-15 19:07:02 -04:00
Kurtis Dinelle
29a84b13ec sensor: tsl2591: fix: Address CID 353644 & 353654
Fixes implicit sign-extension/potential overflow by explicitly casting
to int64_t.

Signed-off-by: Kurtis Dinelle <kurtisdinelle@gmail.com>
(cherry picked from commit 5eeff698ca)
2024-10-15 19:06:46 -04:00
Declan Snyder
46a13006d0 ethernet: phy_mc_ksz8081: Don't reset in cfg link
No need to reset in cfg link, this was blocking system workqueue during
phy callbacks that call cfg link, since this happens from monitor work
handler which is in the system workqueue.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit e904743152)
2024-10-15 19:06:32 -04:00
Christophe Dufaza
9739759fef west: blobs: verify fetched blobs after downloading
Running 'west blobs fetch' does not verify the digest of downloaded files:
1. if the checksum of the previously downloaded file does match
   that in the blob metadata (status BLOB_PRESENT), do nothing
2. if the checksum of the previously downloaded file does not match
   that in the blob metadata (status BLOB_OUTDATED),
   download the "up to date" file
3. if the blob has not yet been downloaded (status BLOB_NOT_PRESENT),
   download it

None of the 2) and 3) code paths will verify that the checksum of the file
just downloaded actually matches the digest in the blob's metadata.

In the event that the metadata of a module is incorrect, then the user
will not notice anything, and may rely on an unexpected binary,
e.g. a static library for a different architecture.

According to the Binary Blobs documentation [1], the expected
behavior is to check the blob digest after downloading.

[1] Fetching blobs, Zephyr 3.6.0 (still applies to Zephyr 3.7.0rc3)
docs.zephyrproject.org/3.6.0/contribute/bin_blobs.html#fetching-blobs

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
(cherry picked from commit 2b2a0e04b2)
2024-10-05 16:11:41 -04:00
Christophe Dufaza
0e62cd5831 west: blobs: prefer constants to literals for blob status
Replace blob status literals with the corresponding
constants defined in zephyr_module.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
(cherry picked from commit ae9326c920)
2024-10-05 16:11:41 -04:00
Martin Stumpf
2da1ef8677 drivers: cc: mcux: Fix incorrect clock source of FlexSPI2
The clock control mcux rev2 returns FlexSPI1 clock rate when FlexSPI2
clock rate is requested.

Signed-off-by: Martin Stumpf <martin.stumpf@vected.de>
(cherry picked from commit 4ec266152d)
2024-10-05 16:11:27 -04:00
Jamie McCrae
68247afbae doc: services: device_mgmt: mcumgr: Correct license for tool
Corrects an incorrect license for a tool

Fixes #78927

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-10-05 15:58:02 -04:00
Sylvio Alves
53a9f6b7ca soc: esp32s3: fix initialization code
ESP32-S3 initialization code should apply the errata
after cache initialization. This fixes it making sure
data and cache instruction are properly
handled and let following calls to work as needed.

This also update hal_espressif to force gcc to treat
register bitfield structs declared as volatile to
ensure writes on 32 bit peripheral registers.

Fixes #71397
Fixes #76325

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-10-05 15:57:39 -04:00
Grzegorz Swiderski
1c3cb74c67 cmake: Require Python >= 3.10
The minimum Python version was bumped for Zephyr LTSv3, but only in the
documentation and CI. The build system would still accept Python 3.8,
yet some scripts in tree have already broken support with that version.
Incompatibility errors should be prevented early.

Signed-off-by: Grzegorz Swiderski <grzegorz.swiderski@nordicsemi.no>
(cherry picked from commit 9d1b361265)
2024-10-05 15:57:04 -04:00
Daekeun Kang
bc18a9a7c0 net: fix handle unaligned memory access in net_context_bind()
This commit addresses an issue in net_context_bind() where unaligned
memory access was not properly handled when checking for INADDR_ANY.
The problem primarily affected MCUs like ARMv6 that don't support
unaligned memory access.

- Use UNALIGNED_GET() to safely access the sin_addr.s_addr field
- Ensures correct behavior on architectures with alignment restrictions

This fix improves compatibility and prevents potential crashes or
unexpected behavior on affected platforms.

Signed-off-by: Daekeun Kang <dkkang@huconn.com>
(cherry picked from commit b24c5201a0)
2024-10-05 15:56:30 -04:00
Yong Cong Sin
5e4e4bf511 tests: arch: riscv: test csf registers value
Test if callee-saved-registers values are as expected.

Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 4da4ee8ece)
2024-10-05 15:56:08 -04:00
Yong Cong Sin
6a1f9982ff arch: riscv: isr.S: restore s0 before jumping to z_riscv_fatal_error_csf
Restore the s0 we saved early in ISR entry so it shows up
properly in the CSF.

Signed-off-by: David Reiss <dreiss@meta.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 4bbc2a7893)
2024-10-05 15:56:08 -04:00
Alexi Demers
b26773fc08 usb: fix wrong capacity report for USB mass storage device
Usb "write" method never copies the input data buffer, it uses the
buffer pointer directly. The fact that it was on the stack made
the buffer ephemeral, and could disappear before the USB transfer
actually occurred. The data transmitted was then random. This commit
converts the transfer buffer to a static buffer, so that it always
exists for the duration of the USB transfer.

Known side-effect: if "read capacity" command is read twice
simultaneously, the same buffer will be used twice. As the capacity of a
USB drive should not change between 2 calls, this side effect can be
ignored.

Signed-off-by: Alexi Demers <alexi.demers@axceta.com>
(cherry picked from commit 32481b6418)
2024-10-02 14:41:57 +01:00
Lyle Zhu
53738cf924 bluetooth: AVDTP: Check buffer len before pulling data
Check the remaining buffer length is not less than
required data length before pulling data from the
buffer.

Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
(cherry picked from commit 8113ff7e9c)
2024-09-26 09:22:20 -04:00
Yong Cong Sin
448cb69a78 drivers: intc: plic: fix IRQ on every hart regardless of mapping
Allow IRQs to work on every hart regardless of the mapping
of the contexts.

Add a test to validate the hart-context mapping.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 475ff826d6)
2024-09-26 09:21:59 -04:00
Robert Lubos
60fe9f9d91 net: sockets: tls: Prevent infinite block during handshake
In case peer goes down or we disconnect from the network during the
TLS handshake, the TLS socket may block indefinitely during
connect()/accept(), waiting for data from the peer. This should be
avoided, hence use the preconfigured timeout for the TLS handshake,
same as we use for TCP-level handshake.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit fc007eeef5)
2024-09-26 09:21:29 -04:00
Florian Grandel
60fb882739 net: l2: ieee802154: decouple frame decryption from upper layer fields
The L2 function `ieee802154_decipher_data_frame()` relied on upper layer
LL address fields which breaks encapsulation.

Also fixes a bug introduced in another fix that went overboard (#53734).

Fixes: #78490

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit da0371accf)
2024-09-26 09:21:09 -04:00
Florian Grandel
110eb533a8 net: l2: ieee802154: move vars to top of block
Found a few variable declarations that were not yet moved to the top of
the function/block. Doing this before actually fixing #78490 so that the
fix becomes more readable.

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit 766fda06c2)
2024-09-26 09:21:09 -04:00
Florian Grandel
3c3d2a26dc net: l2: ieee802154: fix typo
renamed ieeee802154 to ieee802154

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit a7f235596c)
2024-09-26 09:21:09 -04:00
Lukasz Mrugala
a0ee633030 scripts: Remove wrong bz package
Package in the requirements-run-test.txt file, bz,
is not package enabling bz2 support.
It is a security concern and must be removed.

Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
(cherry picked from commit cbe5d9833b)
2024-09-26 09:20:44 -04:00
Jukka Rissanen
a62c741720 net: if: Check chksum offloading properly for VLAN interfaces
Make sure we check the checksum offloading capabilities correctly
for VLAN interfaces. Use the real Ethernet interface when doing the
check.

Fixes #78724

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 00bb90a42e)
2024-09-26 09:19:59 -04:00
Florian Grandel
86e62dd482 net: l2: ieee802154: fix deadlock
When an incoming PAN ID does not match or when an error occurs while
sending association requests, then locks were not properly released.

Fixes #78495

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
(cherry picked from commit 041d8c707c)
2024-09-25 04:02:38 -04:00
Jeppe Odgaard
d826a69a88 dts: arm: st: stm32h5: fix spi 1-3 clocks
The STM32 SPI driver, `spi_ll_stm32.c`, reads the clock frequency via
`clock_control_get_rate()`. The first `clocks` index is used as subsystem
argument if there is no second index, but this is not the source clock for
SPI 1, 2, and 3.
This causes the prescaler value calculation to be incorrect, resulting in a
frequency potentially above the `spi-max-frequency` value.

Add clock source for SPI instances 1, 2 and 3, that matches the default
clock configuration register reset value, which resolves the issue.

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
(cherry picked from commit 40cae2d281)
2024-09-23 06:56:20 -04:00
Jukka Rissanen
db20aca2c7 net: mdns_responder: Set socket of service for statistics purposes
If the dispatcher is muxing the connection i.e., so there are two
services for the same port, then mark service socket descriptor
of the service with the socket number so that "net sockets" shell
command can show a proper value for it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit 1f627e3a1b)
2024-09-23 06:56:05 -04:00
Jukka Rissanen
50227e38f6 net: dns: Add per socket user data for the dispatcher
The socket services API has a limitation where the user data is shared
between file descriptors described in the same service.

This can cause problem in DNS dispatcher where each listened socket
needs to have their own dispatcher struct set as user data so that we
can map between dispatcher context and socket. Solve this by always
have a dispatcher table as user data, and then have the actual mapping
done via the dispatcher table when receiving data to the dispatcher socket.

Fixes #78146

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit caf9fd345f)
2024-09-23 06:56:05 -04:00
Yong Cong Sin
51b53de08e arch: riscv: fill all IRQ stacks with 0xAA
Fill the memory of all CPU's IRQ stack with 0xAA on init, so
that `z_stack_space_get` can calculate the remaining space
correctly.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 035c822253)
2024-09-23 06:55:25 -04:00
Yong Cong Sin
331ad9956a devicetree: add DT_INST_NUM_IRQS()
Add `DT_INST_NUM_IRQS()` to get the number of interrupt lines
of the current `DT_DRV_COMPAT`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit ee08ebd9ca)
2024-09-23 06:54:09 -04:00
Maxime Vincent
f2ef1c8cd8 soc: arm: nxp: fix USB w/ SPEED_OPTIMIZATIONS
Fix USB w/ SPEED_OPTIMIZATIONS for LPC55xxx SoCs
Root cause was non-volatile register access,
which could get optimized by the compiler
(by -fschedule-insns, specifically)

Signed-off-by: Maxime Vincent <maxime@veemax.be>
(cherry picked from commit f86f98fa2e)
2024-09-23 06:52:28 -04:00
Sylvio Alves
ed1db9695e bugfix: soc: esp32: disable interrupts in flash operation
When interrupts are placed in flash, it needs to be disabled
when flash operations are called. This is not happening in current
v3.7.0 release, causing system to crash whenever flash operations
and interrupts happens simultaneously.

Fixes #77952

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-09-17 20:43:09 -04:00
Flavio Ceolin
062d4d5e11 serial: uart_async_rx: Avoid possible division by zero
Ensures that config->but_cnt is not zero.

Fixes #66800
CID #338107

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
(cherry picked from commit 5822267c23)
2024-09-17 15:05:06 -04:00
Luca Burelli
2b4e3274f2 samples/llext/modules: sample.yaml fixes
Apply cleanups suggested by Anas in a Github discussion to the
sample.yaml file.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
(cherry picked from commit f889c4e288)
2024-09-17 15:04:51 -04:00
Luca Burelli
e6599a1e30 samples/llext/modules: build hello_world as built-in by default
This commit changes the default value of CONFIG_HELLO_WORLD_MODE to 'y'
so that the hello_world function is compiled as a built-in part of the
Zephyr image by default. This is the simplest possible configuration,
that works for all architectures.

To build hello_world as an llext module, the user must either follow the
commands in the documentation or set CONFIG_HELLO_WORLD_MODE=m in the
project file along with additional architecture-specific settings that
may be required for proper LLEXT support on the target.
Leave a note in the prj.conf and sample.yaml files to remind the user.

Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
(cherry picked from commit 030c1c8308)
2024-09-17 15:04:51 -04:00
Tomi Fontanilles
ef5f7bb9ee doc: release notes: add 3.7.1
And the Mbed TLS update entry.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-09-16 06:49:19 -04:00
Tomi Fontanilles
bff2e8d1a5 manifest: mbedtls: update to 3.6.1
Brings in Mbed TLS 3.6.1.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
(cherry picked from commit b9b166c7f8)
Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-09-16 06:49:19 -04:00
Matthias Alleman
42bffa7eee drivers: ethernet: nxp_enet: Fused MAC address fixes
Add required initialisation of OCOTP. The IMXRT10XX
variants don't support fuseWords to be greater than 1.
MAC0 fuse map address is 0x22 instead of 0x620.
Fill in mac_addr buffer correctly.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
(cherry picked from commit 931628a78a)
2024-09-11 07:40:49 -04:00
Martin Stumpf
5c8d7b2671 linker: section_tags: fix missing include
If using `<zephyr/linker/section_tags.h>` without including
`zephyr/linker/sections.h` as well, we get a warning an the linker fails
to place the data in the desired section.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
(cherry picked from commit 77eafac1bf)
2024-09-06 13:06:45 -04:00
IBEN EL HADJ MESSAOUD Marwa
b8fa7eec2e drivers: i2s: i2s_ll_stm32: Handle single clock source
Modify the function "i2s_stm32_set_clock" to handle the case where pclk_len
it is not greater then 1 and to ensure that the freq_in
variable is correctly set in both cases.

Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <marwa.ibenelhadjmessaoud-ext@st.com>
(cherry picked from commit 2353b9391b)
2024-09-06 13:06:22 -04:00
Pavel Vasilyev
d4a551437e bluetooth: host: adv: Release buf if failed to set addr
The `bt_id_set_adv_own_addr` function itself tries to allocate a buffer
for the command and it failes due to lack of buffers, it returns error.
However, the `le_ext_adv_param_set` function doesn't handle the error
properly and keeps its own allocated buffer.

This commit releases the allocated buffer.
Partially fixes mesh in #77241.

Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
(cherry picked from commit 2f02474448)
2024-09-06 13:06:03 -04:00
Erik Tamlin
2d75520b66 modules: percepio: Fix python executable name
Fix python executable name in percepio module's CMakeLists.txt

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
(cherry picked from commit bb784c45dd)
2024-09-02 18:28:30 -04:00
Axel Le Bourhis
9f39eb92c5 tests: net: socket: udp: clear control data buffer before recvmsg
Currently, the test doesn't clear the control data buffer before
calling recvmsg. This leads to recvmsg being unable to add the new
control data, which corresponds to the current received data.
This commit aims to clear the control data buffer to match most use
cases, when the control data buffer is empty before calling recvmsg.

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
(cherry picked from commit 179c85aa06)
2024-08-31 06:51:43 -04:00
Axel Le Bourhis
ae03e45bf5 net: sockets: Update msg_controllen in recvmsg properly
According to recvmsg man page, msg_controllen should be set to the sum
of the length of all control messages in the buffer.
This is missing from the current recvmsg implementation.
This commit aims to fix this by updating msg_controllen each time control
data are added to the buffer.
This commit also fixes cases where the msg_controllen is cleared
incorrectly.

Fixes #77303

Signed-off-by: Axel Le Bourhis <axel.lebourhis@nxp.com>
(cherry picked from commit 5d643f4b00)
2024-08-31 06:51:43 -04:00
Jonathan Rico
574a6dff57 tests: Bluetooth: disable optimizations in unit test
Very very weird behavior.

Deleting the `options & BT_LE_ADV_OPT_USE_NRPA` branch in
`id.c:bt_id_set_adv_own_addr` makes the test pass. But add a log in that
branch, and you'll see that we never take it in the UT binary..

I don't have time for this, maybe some compiler guru or C language
lawyer can look at that decompiled function and figure out the root
cause.

Someone should also really fix the Bluetooth unit tests and make them
run on any Bluetooth related PR. Also nightly.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 4ab8073b87)
2024-08-31 06:51:32 -04:00
Johan Hedberg
7378a05350 Bluetooth: Host: Fix incorrect build assert
We want to make sure `struct closure` fits in the user data, so a user data
size of `sizeof(struct closure)` is valid.

Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
(cherry picked from commit 5736b71193)
2024-08-31 06:51:32 -04:00
Daniel DeGrasse
cc62418d75 drivers: sdhc: imx_usdhc: assume card is present if no detection method
The imx USDHC driver previously queried the peripheral's internal card
detect signal to check card presence if no card detect method was
configured. However, some boards do not route the card detect signal and
do not work correctly with the DAT3 detection method supported by this
peripheral. As a fallback, assume the card is present in the slot but
log a warning to the user.

Fixes #42227

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
(cherry picked from commit 17f71e19f0)
2024-08-31 06:51:21 -04:00
Armando Visconti
d800ccea86 drivers/sensor/st: Fix wrong data byte swap for be
A 16-bit value built using byte shifts and ORs from a given
couple of lsb and msb bytes will result to be the same on both
little-endian and big-endian architectures, e.g.

    uint8_t lsb, msb;
    int16_t val;

    /* val is the same number on both le and be archs, but has
       different layout in memory */
    val = (msb << 8) | lsb;

All the xyz_raw_get() APIs of stmemsc sensor module build the sensor
data using the above method and DO NOT hence require (it actually leads
to wrong values on big-endian machines) to use any le/be swap routines,
such as sys_le16_to_cpu().

Fix #75758

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 9ea4cb96cd)
2024-08-31 06:51:05 -04:00
Anas Nashif
df9a905979 ci: rerun issue check on PR edit
Re-run issue check when a PR is updated, i.e. when someone adds
'Fixes...` to the PR body.

This is mostly for release branches and has no effect on main branch.

Also, add concurrency check in the workflow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 4077249cc7)
2024-08-27 21:33:23 -04:00
Dat Nguyen Duy
e84c516589 dts: nxp_rt1010: mark edma channel has separate interrupt entry
In SoC imxrt1010, edma channel has separate interrupt entry,
not like the rest of in-tree imxrt SoC series

Signed-off-by: Dat Nguyen Duy <dat.nguyenduy@nxp.com>
(cherry picked from commit b7b17fa0eb)
2024-08-26 20:58:46 -04:00
Joel Guittet
57a0dbd729 net: websocket: fix undefined reference
Fix undefined reference to MSG_DONTWAIT while building websocket client.

Signed-off-by: Joel Guittet <joelguittet@gmail.com>
(cherry picked from commit 4c16ec1fba)
2024-08-26 20:58:31 -04:00
Peter van der Perk
9b58209b01 soc: rt11xx: Fix bus clocking
IMXRT117X bus clock should be 240MHz and IMXRT116X should be 200MHz

Signed-off-by: Peter van der Perk <peter.vanderperk@nxp.com>
(cherry picked from commit d1a6b45345)
2024-08-26 20:58:09 -04:00
Anders Bjørn Nedergaard
abf93151c2 soc: rt11xx: Fix dual core ENET PLL
IMXRT11XX secondary core should not deinit ENET PLL
as it could be configured by primary core.

Signed-off-by: Anders Bjørn Nedergaard <abn@polytech.com>
(cherry picked from commit 29dc419ad2)
2024-08-26 20:57:47 -04:00
Jonathan Rico
afedbb419e Bluetooth: Host: Add missing bt_tx_irq_raise()
Trigger the TX processor on connection teardown.

When a disconnection happens before the controller has acknowledged some
ACL fragments the host has sent, we run `process_unack_tx()` to free
those unacknowledged buffers and their associated TX contexts.

The problem is that the TX processor still holds a reference to the conn
object. That reference is not released until the TX processor is
triggered again and figures out that the connection is invalid.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 80a92f51a5)
2024-08-22 14:22:15 -04:00
Jonathan Rico
22877ed2ae Bluetooth: Host: Add disconnection during TX fragmentation test
Verifies that we don't leak connection references when the peer goes out
of range whilst we are fragmenting and sending data to the controller.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 043de7da2a)
2024-08-22 14:22:15 -04:00
Ioannis Damigos
6c4a190a31 gpio_smartbond: Fix port_set_masked_raw
Writing directly to Px_DATA_REG modifies pins which are not
indicated by mask, causing gpio_basic_api test to fail.

Use Px_SET_DATA_REG and Px_RESET_DATA_REG to modify only
pins indicated by mask.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit 782967a1e3)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
da2d5e6fbe gpio_smartbond: Remove pdc entry only if it exists
Remove pdc entry only if index exists when CONFIG_PM
is set.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit 82d17f1f2c)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
7a24c590cf gpio_smartbond: Set pin to input when it is configured as GPIO_DISCONNECTED
Set pin to input with no resistors selected when it is configured as
GPIO_DISCONNECTED.

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit df86860319)
2024-08-21 21:07:25 -04:00
Ioannis Damigos
c0ed85cb60 entropy_smartbond: Clear pending interrupts after disabling TRNG
Clear pending interrupts after disabling TRNG to avoid
smartbond_trng_isr getting called with TRNG disabled

Signed-off-by: Ioannis Damigos <ioannis.damigos.uj@renesas.com>
(cherry picked from commit bacd6c31d6)
2024-08-21 21:07:25 -04:00
Jonathan Rico
9584ac74d6 Bluetooth: Host: Free ACL RX fragments on disconnection
This function call frees the buffer kept by the host for reassembling L2CAP
PDUs into.

Without this call, the current buffer will eventually be
leaked, leading to a non-functional host due to lack of RX buffers.

The effect is worse when host flow control is not enabled, as the RX
buffer pool is shared with events, which means communication with the
controller is essentially dead.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 8a2fe27c00)
2024-08-21 16:50:44 -04:00
Jonathan Rico
01dc4e1adc Bluetooth: hci_common: Add assert on buf allocation
`net_buf_alloc(K_FOREVER)` can now return NULL if running in the system
workqueue. `bt_hci_evt_create()` is called in that context in a few cases.

Since we can't really do anything about it, add a (default-on) assert.

This should ideally never fail. I saw it fail because of a leak in the ACL
buffer pool, which is also shared with events when host flow control is not
enabled.

In that particular case, the host is rendered non-functional, so trying to
recover using error handling is futile.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 5a4fdfbf3e)
2024-08-21 16:50:44 -04:00
Jonathan Rico
fb270828a6 Bluetooth: L2CAP: Add re-assembly stress test
Add a test that verifies no resources are leaked when re-assembling L2CAP
PDUs over an unreliable channel (ie. lots of disconnects).

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit e489ec2b95)
2024-08-21 16:50:44 -04:00
Benjamin Cabé
25adea3428 fs: fuse: ensure S_IFxxx macros are available
set _XOPEN_SOURCE appropriately to avoid compilation errors
due to missing S_IFxxx macros on some systems.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 4458a05ec2)
2024-08-20 14:53:13 -04:00
Théo Battrel
4f0e8a80f3 Tests: Bluetooth: Add another ISO frag test
This test create a setup where an ISO broadcaster will send fragmented
data and get stopped after sending the first fragment and repeating that
operation multiple time to verify that buffers are not leaked.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit f3dcaaee35)
2024-08-20 14:51:41 -04:00
Théo Battrel
7e17f1e4ed Bluetooth: Host: Unref ISO fragments after disconnection
When sending data using ISO and the data is fragmented, if the
connection is cut before all the fragments are sent, the data buffer
will be leaked.

Fix the issue by unref'ing the buffer when ISO is not in a connected
state.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit 3a098c9f61)
2024-08-20 14:51:41 -04:00
Théo Battrel
5bd5bf8530 Bluetooth: Host: Free ISO TX context
When disconnected while sending data, if ISO doesn't get the number of
completed packets it will not call `process_unack_tx` and thus will leak
TX context.

Fix that by setting the connection state in ISO disconnection which will
trigger a call to `process_unack_tx`.

Signed-off-by: Théo Battrel <theo.battrel@nordicsemi.no>
(cherry picked from commit 70696f5b0f)
2024-08-20 14:51:41 -04:00
Maxime Vincent
748ccc1661 soc: arm: nxp lpc55xx: fix nxp,ctimer-pwm init procedure (attach clock)
Add clock init for nxp-ctimer-pwm DTS nodes.

Signed-off-by: Maxime Vincent <maxime@veemax.be>
(cherry picked from commit 3a895ecea8)
2024-08-19 17:23:02 -04:00
Robert Lubos
20e7ef389d net: lib: http_server: Clear http1_headers_sent flag on new request
http1_headers_sent flag has to be cleared when entering
HTTP_SERVER_REQUEST_STATE and not only on the client init. Otherwise,
serving multiple HTTP1 POST requests over the same connection does not
work as intended (headers were not sent for the second and further
requests).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 086faa56aa)
2024-08-18 16:00:45 -04:00
Henrik Brix Andersen
6c4d9e0b59 dts: arm: nxp: lpc55sxx: fix sram node address
Add missing "0" to the SRAM devicetree node addresses.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
(cherry picked from commit ec85b0b4ef)
2024-08-17 08:54:19 -04:00
Ryan Erickson
b421ca7b7e drivers: modem: cellular: hl7800 fix enter cmux
The OK response should be processed before entering CMUX mode.

Use UART ISR mode by default.

Fix warnings and errors produced by the sample.

Signed-off-by: Ryan Erickson <ryan.erickson@ezurio.com>
(cherry picked from commit bbcf23e95e)
2024-08-17 08:54:01 -04:00
Alberto Escolar Piedras
37cea05f5d Bluetooth: drivers: userchan: Fix gcc 13 overflow warning
gcc 13 produces a build warning (see below), as it seems to
believe the number of read bytes may overflow the frame_size
type.
Let's increase the frame_size bitwidth to avoid this.
(Any 32bit type, signed or unsigned, avoids this warning)

The build warning:
```
In file included from /usr/include/features.h:502,
                 from bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from include/stdint.h:9,
                 from zephyr/include/zephyr/types.h:11,
                 from zephyr/include/zephyr/kernel_includes.h:21,
                 from zephyr/include/zephyr/kernel.h:17,
                 from zephyr/drivers/bluetooth/hci/userchan.c:9:
In function ‘read’,
    inlined from ‘rx_thread’ at drivers/bluetooth/hci/userchan.c:201:9:
/usr/include/i386-linux-gnu/bits/unistd.h:28:10: warning: ‘__read_alias’
specified size between 4294902273 and 4294967295 exceeds maximum object
size 2147483647
[-Wstringop-overflow=]
   28 |   return __glibc_fortify (read, __nbytes, sizeof (char),
      |          ^~~~~~~~~~~~~~~
drivers/bluetooth/hci/userchan.c: In function ‘rx_thread’:
drivers/bluetooth/hci/userchan.c:187:32: note: destination object allocated
  here
  187 |                 static uint8_t frame[512];
      |                                ^~~~~
/usr/include/i386-linux-gnu/bits/unistd-decl.h:29:16: note: in a call to
  function
‘__read_alias’ declared with attribute ‘access (write_only, 2, 3)’
   29 | extern ssize_t __REDIRECT_FORTIFY (__read_alias, (int __fd, void
      |                ^~~~~~~~~~~~~~~~~~
```

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
(cherry picked from commit ee08327b4c)
2024-08-16 14:08:00 -04:00
Vinayak Kariappa Chettimada
c823c550b0 Bluetooth: Controller: Relax radio packet pointer assignment deadline
Relax the radio packet pointer assignment deadline assertion
until access address being transmitted. The PDU buffer is
probably only needed just after access address is being
transmitted or received by the radio. This will give some
more breathing room for slow CPUs like in nRF51x SoCs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 4dbfb22a7e)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
dcc9255796 Bluetooth: Controller: Fix regression using speed optimization
Fix regression using speed optimization introduced in
commit 1b7fe792e0 ("Bluetooth: Controller: Support Link
Time Optimizations (LTO)").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 642d4be940)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
f5fd647605 Bluetooth: Controller: nRF51x: Fix regression in encrypted connection
Fix regression in encrypted connection introduced in
commit f3deccda91 ("Bluetooth: Controller: CCM read data
to early when DF enabled on PHY 1M").

Due to this nRF51x SoC hang waiting to encrypt and/or
check MIC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit b9a7a64563)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
17f0ec9900 Bluetooth: Controller: Fix PDU length in case of ISR latency issue
In case of ISR latencies, if packet pointer has not been
set on time then we do not want to check uninitialized
length in rx buffer that did not get used by Radio DMA.
This would help us in detecting radio ready event being
set? We can not detect radio ready if it happens twice
before Radio ISR executes after latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 40b71c9773)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
5e00ea9e4f Bluetooth: Controller: Fix empty PDU buffer overrun under ISR latency
Only 3 bytes (PDU_EM_LL_SIZE_MAX) is required for empty PDU
transmission, but in case of Radio ISR latency if rx packet
pointer is not setup then Radio DMA will use previously
assigned buffer which can be this empty PDU buffer. Radio
DMA will overrun this buffer and cause memory corruption.
Any detection of ISR latency will not happen if the ISR
function pointer in RAM is corrupted by this overrun.
Increasing ISR latencies in OS and CPU usage in the
ULL_HIGH priority if it is same as LLL priority in
Controller implementation then it is making it tight to
execute Controller code in the tIFS between Tx-Rx PDU's
Radio ISRs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit e36ddffa7a)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
3125273a78 Bluetooth: Controller: Fix ISR profiling for single timer use
Fix ISR profiling when using single timer for tIFS radio
switching wherein in the timer is cleared on every radio
end. Hence, the captured timer value is the latency and
does not required the radio end timestamp to be subtracted.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 8ef919a7a4)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
269c91850a Bluetooth: Controller: Verbose radio is ready assertion
Provide Radio ISR latency in microseconds when asserting due
to high ISR latency.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 53b6bc56fc)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
680779e5f5 Bluetooth: Controller: Add ISR profiling using ticker ticks
Add ISR profiling using ticker ticks, hence profile ISR
CPU use outside radio events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 409402f0cc)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
e06bbce3e7 Bluetooth: Controller: Use uint16_t to store ISR profiling value
Use uint16_t to store ISR profiling value to avoid overflow
in case of higher latencies.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 56ca9b873d)
2024-08-16 09:56:50 -04:00
Vinayak Kariappa Chettimada
efb3576a54 Bluetooth: Controller: Fix in-system ISR profiling for adv and conn
Fix in-system ISR profiling for advertiser and connection
role for the missing implementation when there is CRC error.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
(cherry picked from commit 90bc2b2064)
2024-08-16 09:56:50 -04:00
Erik Tamlin
6c454a6edc manifest: update percepio
Update the percepio module to use TraceRecorder v4.9.2.hotfix1

Signed-off-by: Erik Tamlin <erik.tamlin@percepio.com>
(cherry picked from commit 858a687052)
2024-08-16 09:56:37 -04:00
Jonathan Rico
a58f407367 Bluetooth: L2CAP: Set NULL callback for PDUs
It was not being set, and thus if the user_data contained garbage from
before, then conn.c would attempt to call that garbage.

Static channels don't have this issue, as every "SDU" fits into one PDU.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Co-authored-by: Huajiang Zheng <nxf88597@lsv051208.swis.nl-cdc01.nxp.com>
(cherry picked from commit 1c6510312d)
2024-08-09 08:39:09 -04:00
Jonathan Rico
fcc3a7e483 Bluetooth: remove forgotten TODO
It's already done.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 8d7c1bc7bc)
2024-08-09 08:39:09 -04:00
Jonathan Rico
afb8c8922a Bluetooth: adapt l2cap/userdata test
Modify the test so it checks that user_data is used and then cleared by
the stack.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 08706f98bc)
2024-08-09 08:39:09 -04:00
Jonathan Rico
45a6994f5c Bluetooth: L2CAP: Mark user_data as owned by the stack
Storing stuff in user_data? That's a paddlin'

We have been debugging issue after issue because ownership of this
"user" data is not clearly defined. Now it is. L2CAP owns the user_data
field entirely, as soon as `send()` is called.

Also add a warning and retval using CHECKIF.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit ea9449979b)
2024-08-09 08:39:09 -04:00
Jonathan Rico
e41c69a3c5 Bluetooth: allow compiling host with CONFIG_NO_RUNTIME_CHECKS
Werror fails the build on that function.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit 5c6cd27723)
2024-08-09 08:39:09 -04:00
Jonathan Rico
350f9fbc2e Bluetooth: host: add more info to conn.c log
Print user_data and callback pointers.

Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
(cherry picked from commit d02a13d726)
2024-08-09 08:39:09 -04:00
Sylvio Alves
296983709a linker: esp32: fix cpp rom region
cplusplus-rom linker initialization was wrongly placed
in RAM area when it should be in ROM area.

Fixes #75853

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
(cherry picked from commit c374d3147b)
2024-08-07 08:26:49 -04:00
Armando Visconti
3cd429f0e0 drivers/sensor: lis2dux12: fix mode when setting odr
In lis2dux12_set_odr(), the call to stmemsc module lis2dux12_mode_set()
API is done with the .fs field left uninitialized, so setting the
underlying device regs in an unproper way.

Suggested-by: Luis Ubieda <luisf@croxel.com>
Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 8bc00e1420)
2024-08-07 08:26:13 -04:00
Thales Bacelar
b8010bf19d logging: Trigger logging thread when we start to drop messages
Wake up logging thread when we start to drop messages.

Signed-off-by: Thales Bacelar <thalesbacelar@duck.com>
(cherry picked from commit d6429431d6)
2024-08-07 08:25:49 -04:00
Yong Cong Sin
2600eaf6de tests: gdbstub: add build-only test
Add build-only test for existing boards.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 58f66623aa)
2024-08-06 13:04:37 -04:00
Yong Cong Sin
f9770bd48e tests: gdbstub: minor refactor to the testcase.yaml
Change the `platform_allow` to multi-line format so that newly
supported archs/boards can be added as a new line.

Refactor the tags out to `common`, and add
`CONFIG_ARCH_HAS_GDBSTUB` filter

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit b97d97ff17)
2024-08-06 13:04:37 -04:00
Yong Cong Sin
0299538a11 arm: debug: gdbstub: fix header
`exc.h` should be `exception.h` now, fix  it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
(cherry picked from commit 79ed64909f)
2024-08-06 13:04:37 -04:00
Jukka Rissanen
5470dc3f62 net: context: Check null pointer in V6ONLY getsockopt
Make sure we are not accessing NULL pointer when checking
if the IPv4 mapping to IPv6 is enabled.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
(cherry picked from commit cf552905f4)
2024-08-06 13:02:10 -04:00
Rubin Gerritsen
a58e039b6a Bluetooth: Host: Fix compiling PAwR Sync without PAST RX
The function `bt_hci_le_past_received_v2()` is not compiled
in for this configuration, so the reference needs to be removed.

Fixes #76268.

Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
(cherry picked from commit e23345b4d1)
2024-08-06 13:01:44 -04:00
Jamie McCrae
37e5eb997e samples: tfm_integration: psa_crypto: Disable sample
Disables running this sample as doing so requires qcbor, which
is not apache licensed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
(cherry picked from commit db5a5fa109)
2024-08-06 13:01:05 -04:00
Daniel Berlin
ff02673d6e bl5340_dvk: Move MIPI_DBI interface back to spi4
Commit 3dbbb73 accidentally changed the MIPI_DBI spi interface from
spi4 to spi2 for this board during conversion to use the MIPI_DBI wrapper.

This does not work, and this change reverts it back to spi4.

Tested on actual boards (bl5340, bl5340pa).
Before this change LVGL demo displays nothing, after this change it works
fine again.

Signed-off-by: Daniel Berlin <dberlin@dberlin.org>
(cherry picked from commit 08e44f9dae)
2024-08-06 13:00:40 -04:00
Robert Lubos
4ac4795945 net: tcp: Keep track of recv window size change since last ACK
Windows TCP stack has a peculiar behavior - when running iperf, it will
fill out the RX window almost entirely, but will not set PSH flag on
packets. In result, our stack would delay the ACK and thus window
update, affecting throughputs heavily.

In order to avoid that, keep track of the most recent window size
reported to the peer, and reduce it when receiving new data. In case the
RX window, as seen from the peer perspective, drops below certain
threshold, and the real RX window is currently empty, send an ACK
immediately when updating window, so that peer can continue
with sending data.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit 349bf81e00)
2024-08-06 13:00:21 -04:00
Chris Friedt
905f22b018 tests: posix: net: open native_sim in c++,posix,net,native case
Prior to the fixes in the previous commits, combining a build
for native_sim with

CONFIG_CPP=y
CONFIG_POSIX_API=y
CONFIG_STD_CPP20=y
CONFIG_REQUIRES_FULL_LIBCPP=y

would fail.

It succeeds now.

This change adds a testcase to monitor that scenario in CI.

Note: this was partially necessary because the deprecation of
CONFIG_NET_SOCKETS_POSIX_NAMES is not yet complete, so there
is a dependency cycle, and also because <sys/types.h> was
pulling in the host <sys/types.h> instead of Zephyr's or one
of the embedded OSes we support.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit d0808473f2)
2024-08-06 13:00:03 -04:00
Chris Friedt
fe0b5ab37b posix: posix_types.h: simplify conditions on pthread types
Simplify the conditions for pthread type declaration

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6cf557d64a)
2024-08-06 13:00:03 -04:00
Chris Friedt
ab836482f0 posix: sys/stat.h: move declarations to posix_types.h
A number of types such as uid_t, gitd_t, etc, were defined in
sys/stat.h to workaround compatibility issues many years ago.

Since posix_types.h is slated to become equivalent to
sys/types.h in terms of standard headers, move these types
to where they belong.

For more information, please see

https://pubs.opengroup.org/onlinepubs/9699919799/\
 basedefs/sys_types.h.html

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6667b500c6)
2024-08-06 13:00:03 -04:00
Chris Friedt
117fb6c27f net + posix: avoid host includes when building for native_sim
A corner case involving C++, posix, networking, and native_sim
was causing problems.

Even though C and C++ builds should include zephyr/posix/.. in
the default search path with `CONFIG_POSIX_API=y`, for some
reason, the native compiler pulls in /usr/include first anyway.

The stat.h header pulled in <sys/types.h> (which is normally
fine) but due to the native build, it was pulling in
/usr/include/sys/types.h, from the host toolchain.

Explicitly include <zephyr/posix/posix_types.h> instead of
<sys/types.h> from stat.h, and continue using the workarounds
for native builds (explicitly including zephyr/posix/arpa/net.h
from net/sockets.h .

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 81f5205006)
2024-08-06 13:00:03 -04:00
Chris Friedt
8fff3c24a4 Revert "net: socket: fix sys/_timespec.h not found error"
This reverts commit 269729a5db.

Signed-off-by: Chris Friedt <cfriedt@tenstorrent.com>
(cherry picked from commit 6a0593d554)
2024-08-06 13:00:03 -04:00
Tim Sørensen
13a8b9dcd3 bluetooth: avoid USB starvation in bap_broadcast_sink
fix to ensure that USB audio interface is not starved when
no audio data is received over bluetooth.

Signed-off-by: Tim Sørensen <tims@demant.com>
(cherry picked from commit 86032bcf85)
2024-08-06 12:59:25 -04:00
Declan Snyder
b8c126abfc drivers: mdio: Clear interrupt signal in ISR
Apparently, disabling the intterupt is not enough,
because without clearing the flag, some errors are occurring.

Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
(cherry picked from commit 9f56ff5d64)
2024-08-06 12:58:47 -04:00
Tom Burdick
79b78b8201 icm42688: Fix divide by zero potential
There were code paths that could have lead to divide by zero given an
invalid scale setting for accel or gyro. In practice this should be an
invalid setup even before getting to these conversion functions. The
conversion functions now better show all valid values are accounted for
by using CODE_UNREACHABLE in the default case.

Signed-off-by: Tom Burdick <thomas.burdick@intel.com>
(cherry picked from commit 5474b611cb)
2024-08-06 12:58:25 -04:00
Armando Visconti
29c3fc13db boards: st: sensortile_box_pro: remove hts221 sensor
Remove HTS221 sensor support from sensortile_box_pro as it has been ruled
out from final version. In fact, HTS221 is in the process of being
terminated and is not recommended for new design. The candidate replacement
is SHT40 from Sensirion, which is available also as a DIL24 adapter, which
can be plugged on sensortile_box_pro board.

See SENSEVAL-SHT4XV1:
https://www.st.com/en/partner-products-and-services/senseval-sht4xv1.html

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit cdce68e4c8)
2024-08-06 12:57:51 -04:00
Francois Ramu
8a98c84647 drivers: usb: stm32 udc driver get the global otg interrupt
The global otg interrupt hs/fs is enabled by the udc_stm32
driver. Get it in the list of interrupts of the OTG node.
Use UDC_STM32_IRQ naming.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
(cherry picked from commit 9ec7697bdb)
2024-08-06 12:57:35 -04:00
Martin Stumpf
bb65669a94 dts: fix warnings in nxp_rt11xx.dtsi
Caused by a simple typo.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
(cherry picked from commit 706ba43bb5)
2024-08-06 12:56:40 -04:00
Jose Alberto Meza
4744f569ef drivers: i3c: common: Do not tread GETCAPS failure as error for 1.0 device
If it's a I3C v1.0 device without any HDR modes do not treat as an error
if GETCAPS gives no valid response.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
(cherry picked from commit c76e776b67)
2024-08-06 12:50:58 -04:00
Armando Visconti
ee6c00843a drivers/sensor: lis2dux12: fix temperature conversion
Return to sensor_api i/f the temperature in Celsius instead
of the register raw value in LSB.

Fixes #75686

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit a1f9793e0e)
2024-08-06 12:49:31 -04:00
Armando Visconti
a6cbc326e3 drivers/sensor: lis2dux12: fix odr and range
The current implementation assumes that sensor odr and range are
always configured in the Device Tree at compile time which might
not be the case.

Instead, application can set odr and range either at compile time
through the DT or using SENSOR_ATTR_SAMPLING_FREQUENCY and
SENSOR_ATTR_FULL_SCALE attributes at runtime, so each driver instance
must keep trace of the latest values set and use them in the sensor
APIs which require them (e.g. lis2dux12_mode_set).

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit cf20aa050d)
2024-08-06 12:49:31 -04:00
Armando Visconti
81e8c6dc5c sensor: lis2dux12: fix SENSOR_ATTR_FULL_SCALE case
When setting the full scale through SENSOR_ATTR_FULL_SCALE the
driver must convert the g value (i.e. one of 2g/4g/8g/16g) to
the corrispondent sensor fs raw value.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 2eaec8b779)
2024-08-06 12:49:31 -04:00
Armando Visconti
57ef4996f5 samples/shields: x-nucleo-iks4a1: Add lsm6dsv16x temp display
Extended the x-nucleo-iks4a1 shield standard sample adding lsm6dsv16x
sensor die temperature display.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
(cherry picked from commit 878b5a9d2e)
2024-08-06 12:49:31 -04:00
Anas Nashif
085bf35912 device: remove const qualifier from node label copy
k_usermode_string_copy does not accept const in its arguements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit 2a39132645)
2024-08-06 12:47:58 -04:00
Anas Nashif
508d402aad tests: device: test CONFIG_DEVICE_DT_METADATA=y
Looks like this option is not tested with userspace enabled.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
(cherry picked from commit c5e6416a65)
2024-08-06 12:47:58 -04:00
Alessandro Manganaro
d947fbb378 drivers: bluetooth: hci: Fix stm32wb BLE behavior
Enabling BT_HCI_SETUP for STM32WB55 to have a
correct and proper initialization procedure to fix
#75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
(cherry picked from commit 4fc77248de)
2024-08-06 12:45:25 -04:00
Alessandro Manganaro
d698d40bb7 drivers: bluetooth: hci: Fix stm32wb BLE behavior
Implementing HCI setup function to have a correct and proper
initialization procedure to fix #75318 issue

Signed-off-by: Alessandro Manganaro <alessandro.manganaro@st.com>
(cherry picked from commit 7ca2072ed0)
2024-08-06 12:45:25 -04:00
Robert Lubos
67a6217906 doc: migration-guide-3.7: Add entry about CoAP block API change
Add entry about the coap_get_block1_option() and
coap_get_block2_option() API change.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Robert Lubos
0807227653 net: coap: Parse more flag in coap_get_block2_option()
Parse the more flag in coap_get_block2_option(), so that the function
can be used not only with requests but also with replies (where the more
flag should not be ignored).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Robert Lubos
bc1c81bc00 net: coap: Fix underlying type for block number
The block number in block1/2 options can be encoded on up to 20 bits
according to RFC 7959, therefore the underlying type used in helper
functions to retrieve the block number should be large enough to hold
the result. Therefore, replace the container for block number with
uint32_t instead of uint8_t.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-08-06 12:44:17 -04:00
Julia Azziz
c5472feea3 drivers: adc: fix missing ref_internal in adc_sam0
The .ref_internal field in the adc_driver_api
struct was previously unset.
Now it's set to the proper value, 1 V.

Signed-off-by: Julia Azziz <juliaazziz7@gmail.com>
(cherry picked from commit e7cfb05c72)
2024-08-06 12:42:22 -04:00
Georges Oates_Larsen
c5de8ab5d1 net: net_if: fix net_if_send_data for offloaded ifaces
Some offloaded ifaces have an L2, but lack support for
net_l2->send. This edge case is not handled by
net_if_send_data, resulting in a NULL dereference under
rare circumstances.

This patch expands the offloaded iface guard in
net_if_send_data to handle this edge case.

Signed-off-by: Georges Oates_Larsen <georges.larsen@nordicsemi.no>
(cherry picked from commit 1c79445059)
2024-08-06 12:41:41 -04:00
Benjamin Cabé
c394cdb0fa net: ptp: Properly handle second overflow/underflow
Fixes issues with net_ptp_time arithmetic where second
overflow/underflow would not be handled properly.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
(cherry picked from commit 43b948f9a8)
2024-08-06 12:41:07 -04:00
Benjamin Cabé
ec8dc79124 net: ptp: Adjust clock using correct offset
Offset should be *subtracted* from current clock value, not added.
This was causing clock to accumulate error instead of actually
"converging".

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit dff19c3ac6)
2024-08-06 12:41:07 -04:00
Maochen Wang
642b308bfc net: wifi: Fix the nm type check error
Fix the NM iface type check error, should use (1 << WIFI_TYPE_STA),
instead of WIFI_TYPE_STA. Same for WIFI_TYPE_SAP.

Signed-off-by: Maochen Wang <maochen.wang@nxp.com>
(cherry picked from commit bf42164084)
2024-08-02 22:11:51 -05:00
Robert Lubos
3a6653a7a9 net: sockets: tls: Fix poll update event check
In case POLLIN is set, and no new application data has been detected,
the ztls_poll_update_ctx() should only return -EAGAIN if no other events
are available for the socket. Otherwise, the function may end up
busy-looping, in case for example POLLOUT is also monitored for the
socket.

Current check verifying that was wrong, as it caused to function to
return -EAGAIN even if some other events could've been reported for the
socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
(cherry picked from commit bfe958a7f1)
2024-08-02 22:11:03 -05:00
Manuel Argüelles
7d59805274 soc: s32k3: fix RAM retention
Initialize TCM and SRAM contents only after a destructive reset (e.g.
PoR reset). SRAM retains content during functional reset through a
hardware mechanism, therefore accesses do not cause content
corruption errors.

Fixes #75912

Signed-off-by: Manuel Argüelles <marguelles.dev@gmail.com>
(cherry picked from commit ec7289039b)
2024-08-02 22:10:45 -05:00
Yong Cong Sin
57c1f22178 arch: riscv: stacktrace: fix user thread stack bound check
According to the riscv's `arch.h`:

 +------------+ <- thread.arch.priv_stack_start
 | Guard      | } Z_RISCV_STACK_GUARD_SIZE
 +------------+
 | Priv Stack | } CONFIG_PRIVILEGED_STACK_SIZE
 +------------+ <- thread.arch.priv_stack_start +
                   CONFIG_PRIVILEGED_STACK_SIZE +
                   Z_RISCV_STACK_GUARD_SIZE

The start of the privilege stack should be:

  `thread.arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE`

Instead of

  `thread.arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE`

For the `end`, use the same equation of `top_of_priv_stack` in
the `arch_user_mode_enter()`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
(cherry picked from commit 7db18ab721)
2024-08-02 22:10:08 -05:00
Benjamin Cabé
dc7129bd20 boards: disco_l475_iot1: fix arduino_i2c config
disco l475 board exposes I2C3 on standard Arduino Uno pins A4/A5,
not I2C1.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
(cherry picked from commit 0f05f58bf5)
2024-08-02 22:09:41 -05:00
467 changed files with 9101 additions and 2201 deletions

View File

@@ -15,24 +15,36 @@ on:
types:
- labeled
permissions:
contents: read
jobs:
assignment:
name: Pull Request Assignment
if: github.event.pull_request.draft == false
runs-on: ubuntu-22.04
permissions:
pull-requests: write # to add assignees to pull requests
issues: write # to add assignees to issues
steps:
- name: Install Python dependencies
run: |
sudo pip3 install -U setuptools wheel pip
pip3 install -U PyGithub>=1.55 west
- name: Check out source code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt
- name: Install Python packages
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run assignment script
env:
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
FLAGS="-v"
FLAGS+=" -o ${{ github.event.repository.owner.login }}"

View File

@@ -24,8 +24,8 @@ jobs:
)
steps:
- name: Backport
uses: zephyrproject-rtos/action-backport@v2.0.3-3
uses: zephyrproject-rtos/action-backport@7e74f601d11eaca577742445e87775b5651a965f # v2.0.3-3
with:
github_token: ${{ secrets.ZB_GITHUB_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
issue_labels: Backport
labels_template: '["Backport"]'

View File

@@ -2,18 +2,26 @@ name: Backport Issue Check
on:
pull_request_target:
types:
- edited
- opened
- reopened
- synchronize
branches:
- v*-branch
jobs:
backport:
name: Backport Issue Check
concurrency:
group: backport-issue-check-${{ github.ref }}
cancel-in-progress: true
runs-on: ubuntu-22.04
if: github.repository == 'zephyrproject-rtos/zephyr'
steps:
- name: Check out source code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Python dependencies
run: |
@@ -22,7 +30,7 @@ jobs:
- name: Run backport issue checker
env:
GITHUB_TOKEN: ${{ secrets.ZB_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/release/list_backports.py \
-o ${{ github.event.repository.owner.login }} \

View File

@@ -13,12 +13,12 @@ jobs:
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9
with:
run_id: ${{ github.event.workflow_run.id }}
- name: Publish BabbleSim Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
with:
check_name: BabbleSim Test Results
comment_mode: off

View File

@@ -34,7 +34,7 @@ jobs:
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--entrypoint /bin/bash'
env:
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
@@ -63,7 +63,7 @@ jobs:
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
@@ -85,7 +85,7 @@ jobs:
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
- name: Check common triggering files
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3
id: check-common-files
with:
files: |
@@ -100,7 +100,7 @@ jobs:
tests/bsim/*
- name: Check if Bluethooth files changed
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3
id: check-bluetooth-files
with:
files: |
@@ -109,7 +109,7 @@ jobs:
subsys/bluetooth/
- name: Check if Networking files changed
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3
id: check-networking-files
with:
files: |
@@ -122,7 +122,7 @@ jobs:
include/zephyr/net/ieee802154*
- name: Check if UART files changed
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3
id: check-uart-files
with:
files: |
@@ -168,7 +168,7 @@ jobs:
- name: Upload Unit Test Results in HTML
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: HTML Unit Test Results
if-no-files-found: ignore
@@ -176,7 +176,7 @@ jobs:
junit.html
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
with:
check_name: Bsim Test Results
files: "junit.xml"
@@ -184,7 +184,7 @@ jobs:
- name: Upload Event Details
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: event
path: |

View File

@@ -1,67 +0,0 @@
# Copyright (c) 2021, 2022 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
# Make a snapshot of open bugs as a python pickle file, compressed
# using xz. Upload the xz file to Amazon S3.
name: Bug Snapshot
on:
workflow_dispatch:
branches: [main]
schedule:
# Run daily at 14:05
- cron: '5 14 * * *'
jobs:
make_bugs_pickle:
name: Make bugs pickle
runs-on: ubuntu-22.04
if: github.repository_owner == 'zephyrproject-rtos'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python dependencies
run: |
sudo pip3 install -U setuptools wheel pip
pip3 install -U pygithub
- name: Snapshot bugs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BUGS_PICKLE_FILENAME="zephyr-bugs-$(date -I).pickle.xz"
BUGS_PICKLE_PATH="${RUNNER_TEMP}/${BUGS_PICKLE_FILENAME}"
set -euo pipefail
python3 scripts/make_bugs_pickle.py | xz > ${BUGS_PICKLE_PATH}
echo "BUGS_PICKLE_FILENAME=${BUGS_PICKLE_FILENAME}" >> ${GITHUB_ENV}
echo "BUGS_PICKLE_PATH=${BUGS_PICKLE_PATH}" >> ${GITHUB_ENV}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_BUG_SNAPSHOT_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Upload to AWS S3
run: |
REPOSITORY_NAME="${GITHUB_REPOSITORY#*/}"
PUBLISH_BUCKET="builds.zephyrproject.org"
PUBLISH_DOMAIN="builds.zephyrproject.io"
if [ "${{github.event_name}}" = "schedule" ]; then
PUBLISH_ROOT="${REPOSITORY_NAME}/bug-snapshot/daily"
else
PUBLISH_ROOT="${REPOSITORY_NAME}/bug-snapshot"
fi
PUBLISH_UPLOAD_URI="s3://${PUBLISH_BUCKET}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}"
PUBLISH_DOWNLOAD_URI="https://${PUBLISH_DOMAIN}/${PUBLISH_ROOT}/${BUGS_PICKLE_FILENAME}"
aws s3 cp --quiet ${BUGS_PICKLE_PATH} ${PUBLISH_UPLOAD_URI}
echo "Bug pickle is available at: ${PUBLISH_DOWNLOAD_URI}" >> ${GITHUB_STEP_SUMMARY}

View File

@@ -12,7 +12,7 @@ jobs:
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--entrypoint /bin/bash'
strategy:
fail-fast: false
@@ -49,7 +49,7 @@ jobs:
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
@@ -125,7 +125,7 @@ jobs:
- name: Upload Unit Test Results
if: always() && steps.twister.outputs.report_needed != 0
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Unit Test Results (Subset ${{ matrix.platform }})
path: twister-out/twister.xml
@@ -137,7 +137,7 @@ jobs:
if: (success() || failure() ) && needs.clang-build.outputs.report_needed != 0
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
path: artifacts
- name: Merge Test Results
@@ -148,7 +148,7 @@ jobs:
- name: Upload Unit Test Results in HTML
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: HTML Unit Test Results
if-no-files-found: ignore
@@ -156,7 +156,7 @@ jobs:
junit-clang.html
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
if: always()
with:
check_name: Unit Test Results

View File

@@ -14,7 +14,7 @@ jobs:
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--entrypoint /bin/bash'
strategy:
fail-fast: false
@@ -61,7 +61,7 @@ jobs:
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
@@ -121,7 +121,7 @@ jobs:
- name: Upload Coverage Results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Coverage Data (Subset ${{ matrix.normalized }})
path: |
@@ -137,12 +137,12 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
path: coverage/reports
@@ -209,7 +209,7 @@ jobs:
- name: Upload Merged Coverage Results and Report
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Coverage Data and report
path: |
@@ -220,7 +220,7 @@ jobs:
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5.4.0
with:
env_vars: OS,PYTHON
fail_ci_if_error: false

View File

@@ -8,13 +8,13 @@ jobs:
name: Run coding guidelines checks on patch series (PR)
steps:
- name: Checkout the code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: cache-pip
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/coding_guidelines.yml') }}

View File

@@ -18,18 +18,18 @@ jobs:
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Checkout the code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: 3.11
- name: cache-pip
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/compliance.yml') }}
@@ -82,7 +82,7 @@ jobs:
-c origin/${BASE_REF}..
- name: upload-results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
continue-on-error: true
with:
name: compliance.xml

View File

@@ -1,38 +0,0 @@
# Copyright (c) 2020 Intel Corp.
# SPDX-License-Identifier: Apache-2.0
name: Publish commit for daily testing
on:
schedule:
- cron: '50 22 * * *'
push:
branches:
- refs/tags/*
jobs:
get_version:
runs-on: ubuntu-22.04
if: github.repository == 'zephyrproject-rtos/zephyr'
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: install-pip
run: |
pip3 install gitpython
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Upload to AWS S3
run: |
python3 scripts/ci/version_mgr.py --update .
aws s3 cp versions.json s3://testing.zephyrproject.org/daily_tests/versions.json

View File

@@ -35,14 +35,14 @@ jobs:
python-version: 3.6
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
- name: cache-pip-linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
@@ -50,7 +50,7 @@ jobs:
${{ runner.os }}-pip-${{ matrix.python-version }}
- name: cache-pip-mac
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/Library/Caches/pip
# Trailing '-' was just to get a different cache name
@@ -59,7 +59,7 @@ jobs:
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: cache-pip-win
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ matrix.python-version }}

View File

@@ -1,20 +0,0 @@
name: Do Not Merge
on:
pull_request:
types: [synchronize, opened, reopened, labeled, unlabeled]
jobs:
do-not-merge:
if: ${{ contains(github.event.*.labels.*.name, 'DNM') ||
contains(github.event.*.labels.*.name, 'TSC') ||
contains(github.event.*.labels.*.name, 'Architecture Review') ||
contains(github.event.*.labels.*.name, 'dev-review') }}
name: Prevent Merging
runs-on: ubuntu-22.04
steps:
- name: Check for label
run: |
echo "Pull request is labeled as 'DNM', 'TSC', 'Architecture Review' or 'dev-review'."
echo "This workflow fails so that the pull request cannot be merged."
exit 1

View File

@@ -32,12 +32,12 @@ jobs:
file_check: ${{ steps.check-doc-files.outputs.any_changed }}
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Check if Documentation related files changed
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@823fcebdb31bb35fdf2229d9f769b400309430d0 # v46.0.3
id: check-doc-files
with:
files: |
@@ -86,7 +86,7 @@ jobs:
echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
@@ -104,7 +104,7 @@ jobs:
git log --graph --oneline HEAD...${PR_HEAD}
- name: cache-pip
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('doc/requirements.txt') }}
@@ -154,13 +154,13 @@ jobs:
tar cfJ api-coverage.tar.xz coverage-report
- name: upload-build
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: html-output
path: html-output.tar.xz
- name: upload-api-coverage
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: api-coverage
path: api-coverage.tar.xz
@@ -180,7 +180,7 @@ jobs:
echo "API Coverage Report will be available shortly at: ${API_COVERAGE_URL}" >> $GITHUB_STEP_SUMMARY
- name: upload-pr-number
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: github.event_name == 'pull_request'
with:
name: pr_num
@@ -212,7 +212,7 @@ jobs:
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: install-pkgs
run: |
@@ -220,7 +220,7 @@ jobs:
apt-get install -y python3-pip python3-venv ninja-build doxygen graphviz librsvg2-bin imagemagick
- name: cache-pip
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: pip-${{ hashFiles('doc/requirements.txt') }}
@@ -259,7 +259,7 @@ jobs:
- name: upload-build
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: pdf-output
if-no-files-found: ignore

View File

@@ -21,7 +21,7 @@ jobs:
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9
with:
workflow: doc-build.yml
run_id: ${{ github.event.workflow_run.id }}
@@ -32,7 +32,7 @@ jobs:
- name: Check PR number
id: check-pr
uses: carpentries/actions/check-valid-pr@v0.14.0
uses: carpentries/actions/check-valid-pr@e27aa6c531dadd357d2aa4c9a21e90849e23e963 # v0.14.0
with:
pr: ${{ env.PR_NUM }}
sha: ${{ github.event.workflow_run.head_sha }}
@@ -51,7 +51,7 @@ jobs:
fi
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
aws-access-key-id: ${{ vars.AWS_BUILDS_ZEPHYR_PR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_BUILDS_ZEPHYR_PR_SECRET_ACCESS_KEY }}

View File

@@ -24,7 +24,7 @@ jobs:
steps:
- name: Download artifacts
uses: dawidd6/action-download-artifact@v3
uses: dawidd6/action-download-artifact@07ab29fd4a977ae4d2b275087cf67563dfdf0295 # v9
with:
workflow: doc-build.yml
run_id: ${{ github.event.workflow_run.id }}
@@ -37,7 +37,7 @@ jobs:
fi
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
with:
aws-access-key-id: ${{ vars.AWS_DOCS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_DOCS_SECRET_ACCESS_KEY }}

View File

@@ -10,7 +10,7 @@ jobs:
check-errno:
runs-on: ubuntu-22.04
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.13
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
steps:
- name: Apply container owner mismatch workaround
@@ -22,7 +22,7 @@ jobs:
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Environment Setup
run: |

View File

@@ -1,95 +0,0 @@
name: Footprint Tracking
# Run every 12 hours and on tags
on:
schedule:
- cron: '50 1/12 * * *'
push:
paths:
- 'VERSION'
- '.github/workflows/footprint-tracking.yml'
branches:
- main
- v*-branch
tags:
# only publish v* tags, do not care about zephyr-v* which point to the
# same commit
- 'v*'
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
footprint-tracking:
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
if: github.repository_owner == 'zephyrproject-rtos'
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
options: '--entrypoint /bin/bash'
strategy:
fail-fast: false
env:
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
steps:
- name: Apply container owner mismatch workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Print cloud service information
run: |
echo "ZEPHYR_RUNNER_CLOUD_PROVIDER = ${ZEPHYR_RUNNER_CLOUD_PROVIDER}"
echo "ZEPHYR_RUNNER_CLOUD_NODE = ${ZEPHYR_RUNNER_CLOUD_NODE}"
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Update PATH for west
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y python3-venv
sudo pip3 install -U setuptools wheel pip gitpython
- name: checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Environment Setup
run: |
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
- name: west setup
run: |
west init -l . || true
west config --global update.narrow true
west update 2>&1 1> west.update.log || west update 2>&1 1> west.update2.log
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Record Footprint
env:
BASE_REF: ${{ github.base_ref }}
run: |
export ZEPHYR_BASE=${PWD}
./scripts/footprint/track.py -p scripts/footprint/plan.txt
- name: Upload footprint data
run: |
python3 -m venv .venv
. .venv/bin/activate
pip3 install awscli
aws s3 sync --quiet footprint_data/ s3://testing.zephyrproject.org/footprint_data/

View File

@@ -12,7 +12,7 @@ jobs:
if: github.repository == 'zephyrproject-rtos/zephyr'
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: zephyrproject-rtos/action-first-interaction@v1.1.1-zephyr-5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -30,7 +30,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: zephyr
fetch-depth: 0
@@ -49,12 +49,12 @@ jobs:
git log --graph --oneline HEAD...${PR_HEAD}
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: 3.11
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
with:
app-path: zephyr
toolchains: all
@@ -68,12 +68,13 @@ jobs:
elif [ "${{ runner.os }}" = "Windows" ]; then
EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out"
fi
./scripts/twister --force-color --inline-logs -T samples/hello_world -v $EXTRA_TWISTER_FLAGS
./scripts/twister --force-color --inline-logs -T samples/hello_world -T samples/cpp/hello_world -v $EXTRA_TWISTER_FLAGS
- name: Upload artifacts
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
if-no-files-found: ignore
path:
zephyr/twister-out/*/samples/hello_world/sample.basic.helloworld/build.log
zephyr/twister-out/*/samples/cpp/hello_world/sample.cpp.helloworld/build.log

View File

@@ -1,54 +0,0 @@
name: Issue Tracker
on:
schedule:
- cron: '*/10 * * * *'
env:
OUTPUT_FILE_NAME: IssuesReport.md
COMMITTER_EMAIL: actions@github.com
COMMITTER_NAME: github-actions
COMMITTER_USERNAME: github-actions
jobs:
track-issues:
name: "Collect Issue Stats"
runs-on: ubuntu-22.04
if: github.repository == 'zephyrproject-rtos/zephyr'
steps:
- name: Download configuration file
run: |
wget -q https://raw.githubusercontent.com/$GITHUB_REPOSITORY/main/.github/workflows/issues-report-config.json
- name: install-packages
run: |
sudo apt-get update
sudo apt-get install discount
- uses: brcrista/summarize-issues@v4
with:
title: 'Issues Report for ${{ github.repository }}'
configPath: 'issues-report-config.json'
outputPath: ${{ env.OUTPUT_FILE_NAME }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: upload-stats
uses: actions/upload-artifact@v4
continue-on-error: true
with:
name: ${{ env.OUTPUT_FILE_NAME }}
path: ${{ env.OUTPUT_FILE_NAME }}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ vars.AWS_TESTING_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_TESTING_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Post Results
run: |
mkd2html IssuesReport.md IssuesReport.html
aws s3 cp --quiet IssuesReport.html s3://testing.zephyrproject.org/issues/$GITHUB_REPOSITORY/index.html

View File

@@ -8,16 +8,16 @@ jobs:
name: Scan code for licenses
steps:
- name: Checkout the code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Scan the code
id: scancode
uses: zephyrproject-rtos/action_scancode@v4
uses: zephyrproject-rtos/action_scancode@23ef91ce31cd4b954366a7b71eea47520da9b380 # v4
with:
directory-to-scan: 'scan/'
- name: Artifact Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: scancode
path: ./artifacts

View File

@@ -8,7 +8,7 @@ jobs:
name: Manifest
steps:
- name: Checkout the code
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: zephyrproject/zephyr
ref: ${{ github.event.pull_request.head.sha }}
@@ -28,7 +28,7 @@ jobs:
- name: Manifest
uses: zephyrproject-rtos/action-manifest@v1.2.2
with:
github-token: ${{ secrets.ZB_GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
manifest-path: 'west.yml'
checkout-path: 'zephyrproject/zephyr'
use-tree-checkout: 'true'

49
.github/workflows/pr_metadata_check.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: PR Metadata Check
on:
pull_request:
types:
- synchronize
- opened
- reopened
- labeled
- unlabeled
- edited
permissions:
contents: read
jobs:
do-not-merge:
name: Prevent Merging
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: 3.12
cache: pip
cache-dependency-path: scripts/requirements-actions.txt
- name: Install Python dependencies
run: |
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run the check script
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/ci/do_not_merge.py -p "${{ github.event.pull_request.number }}"
empty_pr_description:
if: ${{ github.event.pull_request.body == '' }}
name: PR Description
runs-on: ubuntu-24.04
steps:
- name: Check for PR description
run: |
echo "Pull request description cannot be empty."
exit 1

View File

@@ -29,14 +29,14 @@ jobs:
os: [ubuntu-22.04]
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
- name: cache-pip-linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}

View File

@@ -10,7 +10,7 @@ jobs:
release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
@@ -21,12 +21,12 @@ jobs:
echo "TRIMMED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: REUSE Compliance Check
uses: fsfe/reuse-action@v1
uses: fsfe/reuse-action@bb774aa972c2a89ff34781233d275075cbddf542 # v5.0.0
with:
args: spdx -o zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
- name: upload-results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
continue-on-error: true
with:
name: zephyr-${{ steps.get_version.outputs.VERSION }}.spdx
@@ -38,7 +38,7 @@ jobs:
- name: Create Release
id: create_release
uses: actions/create-release@v1
uses: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
@@ -50,7 +50,7 @@ jobs:
- name: Upload Release Assets
id: upload-release-asset
uses: actions/upload-release-asset@v1
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5 # v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:

View File

@@ -29,7 +29,7 @@ jobs:
os: [ubuntu-20.04]
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
@@ -46,13 +46,13 @@ jobs:
git log --graph --oneline HEAD...${PR_HEAD}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
- name: cache-pip-linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}

View File

@@ -18,7 +18,7 @@ jobs:
steps:
- name: Delete stale queued workflow runs
uses: MajorScruffy/delete-old-workflow-runs@v0.3.0
uses: MajorScruffy/delete-old-workflow-runs@78b5af714fefaefdf74862181c467b061782719e # v0.3.0
with:
repository: ${{ github.repository }}
# Remove any workflow runs in "queued" state for more than 1 day

View File

@@ -1,24 +0,0 @@
name: Merged PR stats
on:
pull_request_target:
branches:
- main
- v*-branch
types: [closed]
jobs:
record_merged:
if: github.event.pull_request.merged == true && github.repository == 'zephyrproject-rtos/zephyr'
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: PR event
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
PR_STAT_ES_INDEX: ${{ vars.PR_STAT_ES_INDEX }}
run: |
pip3 install pygithub elasticsearch
python3 ./scripts/ci/stats/merged_prs.py --pull-request ${{ github.event.pull_request.number }} --repo ${{ github.repository }}

View File

@@ -6,7 +6,7 @@ on:
- main
- v*-branch
- collab-*
pull_request_target:
pull_request:
branches:
- main
- v*-branch
@@ -25,7 +25,7 @@ jobs:
runs-on:
group: zephyr-runner-v2-linux-x64-4xlarge
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--entrypoint /bin/bash'
outputs:
subset: ${{ steps.output-services.outputs.subset }}
@@ -56,22 +56,22 @@ jobs:
echo "ZEPHYR_RUNNER_CLOUD_POD = ${ZEPHYR_RUNNER_CLOUD_POD}"
- name: Clone cached Zephyr repository
if: github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request'
continue-on-error: true
run: |
git clone --shared /repo-cache/zephyrproject/zephyr .
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v4
if: github.event_name == 'pull_request'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
persist-credentials: false
- name: Environment Setup
if: github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request'
run: |
git config --global user.email "bot@zephyrproject.org"
git config --global user.name "Zephyr Bot"
@@ -87,7 +87,7 @@ jobs:
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
- name: Generate Test Plan with Twister
if: github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request'
id: test-plan
run: |
export ZEPHYR_BASE=${PWD}
@@ -103,7 +103,7 @@ jobs:
- name: Determine matrix size
id: output-services
run: |
if [ "${{github.event_name}}" = "pull_request_target" ]; then
if [ "${{github.event_name}}" = "pull_request" ]; then
if [ -n "${TWISTER_NODES}" ]; then
subset="[$(seq -s',' 1 ${TWISTER_NODES})]"
else
@@ -129,7 +129,7 @@ jobs:
needs: twister-build-prep
if: needs.twister-build-prep.outputs.size != 0
container:
image: ghcr.io/zephyrproject-rtos/ci-repo-cache:v0.26.13.20240601
image: ghcr.io/zephyrproject-rtos/ci:v0.26.18
options: '--entrypoint /bin/bash'
strategy:
fail-fast: false
@@ -172,7 +172,7 @@ jobs:
git remote set-url origin ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
@@ -180,7 +180,7 @@ jobs:
- name: Environment Setup
run: |
if [ "${{github.event_name}}" = "pull_request_target" ]; then
if [ "${{github.event_name}}" = "pull_request" ]; then
git config --global user.email "bot@zephyrproject.org"
git config --global user.name "Zephyr Builder"
rm -fr ".git/rebase-apply"
@@ -236,7 +236,7 @@ jobs:
fi
fi
- if: github.event_name == 'pull_request_target'
- if: github.event_name == 'pull_request'
name: Run Tests with Twister (Pull Request)
run: |
rm -f testplan.json
@@ -271,7 +271,7 @@ jobs:
- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Unit Test Results (Subset ${{ matrix.subset }})
if-no-files-found: ignore
@@ -293,7 +293,7 @@ jobs:
- if: matrix.subset == 1 && github.event_name == 'push'
name: Upload the list of Python packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Frozen PIP package set
path: |
@@ -301,9 +301,6 @@ jobs:
twister-test-results:
name: "Publish Unit Tests Results"
env:
ELASTICSEARCH_KEY: ${{ secrets.ELASTICSEARCH_KEY }}
ELASTICSEARCH_SERVER: "https://elasticsearch.zephyrproject.io:443"
needs: twister-build
runs-on: ubuntu-22.04
# the build-and-test job might be skipped, we don't need to run this job then
@@ -313,30 +310,16 @@ jobs:
# Needed for opensearch and upload script
- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
persist-credentials: false
- name: Download Artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
path: artifacts
- if: github.event_name == 'push' || github.event_name == 'schedule'
name: Upload to opensearch
run: |
pip3 install elasticsearch
# set run date on upload to get consistent and unified data across the matrix.
run_date=`date --iso-8601=minutes`
if [ "${{github.event_name}}" = "push" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-push-1 artifacts/*/*/twister.json
elif [ "${{github.event_name}}" = "schedule" ]; then
python3 ./scripts/ci/upload_test_results_es.py -r ${run_date} \
--index zephyr-main-ci-weekly-1 artifacts/*/*/twister.json
fi
- name: Merge Test Results
run: |
pip3 install junitparser junit2html
@@ -345,7 +328,7 @@ jobs:
- name: Upload Unit Test Results in HTML
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: HTML Unit Test Results
if-no-files-found: ignore
@@ -353,7 +336,7 @@ jobs:
junit.html
- name: Publish Unit Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
uses: EnricoMi/publish-unit-test-result-action@170bf24d20d201b842d7a52403b73ed297e6645b # v2.18.0
with:
check_name: Unit Test Results
files: "**/twister.xml"

View File

@@ -36,34 +36,31 @@ jobs:
os: [ubuntu-22.04]
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
- name: cache-pip-linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}
- name: install-packages
cache: pip
cache-dependency-path: scripts/requirements-actions.txt
- name: Install Python packages
run: |
pip3 install -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
pip install -r scripts/requirements-actions.txt --require-hashes
- name: Run pytest for twisterlib
env:
ZEPHYR_BASE: ./
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
run: |
export ZEPHYR_BASE=${PWD}
echo "Run twister tests"
PYTHONPATH=./scripts/tests pytest ./scripts/tests/twister
- name: Run pytest for pytest-twister-harness
env:
ZEPHYR_BASE: ./
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
PYTHONPATH: ./scripts/pylib/pytest-twister-harness/src:${PYTHONPATH}
run: |
export ZEPHYR_BASE=${PWD}
echo "Run twister tests"
pytest ./scripts/pylib/pytest-twister-harness/tests

View File

@@ -15,63 +15,52 @@ on:
- 'scripts/tests/twister_blackbox/**'
- '.github/workflows/twister_tests_blackbox.yml'
permissions:
contents: read
jobs:
twister-tests:
name: Twister Black Box Tests
runs-on: ${{ matrix.os }}
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-22.04]
container:
image: ghcr.io/zephyrproject-rtos/ci:v0.26.13
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Apply Container Owner Mismatch Workaround
run: |
# FIXME: The owner UID of the GITHUB_WORKSPACE directory may not
# match the container user UID because of the way GitHub
# Actions runner is implemented. Remove this workaround when
# GitHub comes up with a fundamental fix for this problem.
git config --global --add safe.directory ${GITHUB_WORKSPACE}
- name: Checkout
uses: actions/checkout@v4
- name: Environment Setup
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
west init -l . || true
west config --global update.narrow true
west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || west update --path-cache /github/cache/zephyrproject 2>&1 1> west.update.log || ( rm -rf ../modules ../bootloader ../tools && west update --path-cache /github/cache/zephyrproject)
west forall -c 'git reset --hard HEAD'
echo "ZEPHYR_SDK_INSTALL_DIR=/opt/toolchains/zephyr-sdk-$( cat SDK_VERSION )" >> $GITHUB_ENV
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: zephyr
fetch-depth: 0
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: scripts/requirements-actions.txt
- name: Go Into Venv
shell: bash
- name: install-packages
working-directory: zephyr
run: |
python3 -m pip install --user virtualenv
python3 -m venv env
source env/bin/activate
echo "$(which python)"
pip install -r scripts/requirements-actions.txt --require-hashes
sudo apt-get update -y
sudo apt-get install -y lcov
- name: Install Packages
run: |
python3 -m pip install -U -r scripts/requirements-base.txt -r scripts/requirements-build-test.txt -r scripts/requirements-run-test.txt
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@f7b70269a8eb01f70c8e710891e4c94972a2f6b4 # v1.0.6
with:
app-path: zephyr
sdk-version: 0.16.9
toolchains: all
- name: Run Pytest For Twister Black Box Tests
working-directory: zephyr
shell: bash
env:
ZEPHYR_BASE: ./
ZEPHYR_TOOLCHAIN_VARIANT: zephyr
run: |
export ZEPHYR_SDK_INSTALL_DIR=${{ github.workspace }}/zephyr-sdk
echo "Run twister tests"
source zephyr-env.sh
PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox
PYTHONPATH="./scripts/tests" pytest ./scripts/tests/twister_blackbox/

View File

@@ -38,14 +38,14 @@ jobs:
python-version: 3.6
steps:
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
with:
python-version: ${{ matrix.python-version }}
- name: cache-pip-linux
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
@@ -53,7 +53,7 @@ jobs:
${{ runner.os }}-pip-${{ matrix.python-version }}
- name: cache-pip-mac
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~/Library/Caches/pip
# Trailing '-' was just to get a different cache name
@@ -62,7 +62,7 @@ jobs:
${{ runner.os }}-pip-${{ matrix.python-version }}-
- name: cache-pip-win
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ matrix.python-version }}

View File

@@ -1 +1 @@
0.16.8
0.16.9

View File

@@ -1,5 +1,5 @@
VERSION_MAJOR = 3
VERSION_MINOR = 7
PATCHLEVEL = 0
PATCHLEVEL = 2
VERSION_TWEAK = 0
EXTRAVERSION =
EXTRAVERSION = rc1

View File

@@ -1,6 +1,7 @@
/*
* Copyright (c) 2013-2014 Wind River Systems, Inc.
* Copyright (c) 2021 Lexmark International, Inc.
* Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -37,6 +38,34 @@
*/
#define DEFAULT_EXC_RETURN 0xFD;
#ifdef CONFIG_USERSPACE
static void setup_priv_stack(struct k_thread *thread)
{
/* Set up privileged stack before entering user mode */
thread->arch.priv_stack_start = (uint32_t)z_priv_stack_find(thread->stack_obj);
/* CONFIG_PRIVILEGED_STACK_SIZE does not account for MPU_GUARD_ALIGN_AND_SIZE or
* MPU_GUARD_ALIGN_AND_SIZE_FLOAT. Therefore, we must compute priv_stack_end here before
* adjusting priv_stack_start for the mpu guard alignment
*/
thread->arch.priv_stack_end = thread->arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE;
#if defined(CONFIG_MPU_STACK_GUARD)
/* Stack guard area reserved at the bottom of the thread's
* privileged stack. Adjust the available (writable) stack
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
thread->arch.priv_stack_start +=
((thread->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
thread->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
}
#endif
/* An initial context, to be "restored" by z_arm_pendsv(), is put at the other
* end of the stack, and thus reusable by the stack when not needed anymore.
*
@@ -78,9 +107,24 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
#endif /* FP_GUARD_EXTRA_SIZE */
#endif /* CONFIG_MPU_STACK_GUARD */
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
thread->arch.mode = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
#endif
#if FP_GUARD_EXTRA_SIZE > 0
if ((thread->base.user_options & K_FP_REGS) != 0) {
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
}
#endif
#endif
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, stack_ptr);
#if defined(CONFIG_USERSPACE)
thread->arch.priv_stack_start = 0;
if ((thread->base.user_options & K_USER) != 0) {
setup_priv_stack(thread);
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, thread->arch.priv_stack_end);
iframe->pc = (uint32_t)arch_user_mode_enter;
} else {
iframe->pc = (uint32_t)z_thread_entry;
@@ -112,20 +156,6 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
thread->callee_saved.psp = (uint32_t)iframe;
thread->arch.basepri = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
thread->arch.mode = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
#endif
#if FP_GUARD_EXTRA_SIZE > 0
if ((thread->base.user_options & K_FP_REGS) != 0) {
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
}
#endif
#if defined(CONFIG_USERSPACE)
thread->arch.priv_stack_start = 0;
#endif
#endif
/*
* initial values in all other registers/thread entries are
* irrelevant.
@@ -196,10 +226,8 @@ static inline void z_arm_thread_stack_info_adjust(struct k_thread *thread,
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3)
{
uint32_t sp_is_priv = 1;
/* Set up privileged stack before entering user mode */
_current->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(_current->stack_obj);
#if defined(CONFIG_MPU_STACK_GUARD)
#if defined(CONFIG_THREAD_STACK_INFO)
/* We're dropping to user mode which means the guard area is no
@@ -216,29 +244,29 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
_current->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
_current->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_THREAD_STACK_INFO */
/* Stack guard area reserved at the bottom of the thread's
* privileged stack. Adjust the available (writable) stack
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
_current->arch.priv_stack_start +=
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
_current->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
_current->arch.priv_stack_end =
_current->arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE;
#endif
/* 2 ways how arch_user_mode_enter is called:
* - called as part of context switch from z_arm_pendsv, in this case privileged stack is
* already setup and stack pointer points to privileged stack.
* - called directly from k_thread_user_mode_enter, in this case privileged stack is not
* setup and stack pointer points to user stack.
*
* When called from k_thread_user_mode_enter, we need to check and setup the privileged
* stack and then instruct z_arm_userspace_enter to change the PSP to the privileged stack.
* Note that we do not change the PSP in this function to avoid any conflict with compiler's
* sequence which has already pushed stuff on the user stack.
*/
if (0 == _current->arch.priv_stack_start) {
setup_priv_stack(_current);
sp_is_priv = 0;
}
z_arm_userspace_enter(user_entry, p1, p2, p3,
(uint32_t)_current->stack_info.start,
_current->stack_info.size -
_current->stack_info.delta);
_current->stack_info.delta,
sp_is_priv);
CODE_UNREACHABLE;
}

View File

@@ -55,13 +55,8 @@ FUNC_ALIAS(z_arm_exc_exit, z_arm_int_exit, void);
Z_GENERIC_SECTION(.text._HandlerModeExit) void z_arm_exc_exit(void)
{
#ifdef CONFIG_PREEMPT_ENABLED
/* If thread is preemptible */
if (_kernel.cpus->current->base.prio >= 0) {
/* and cached thread is not current thread */
if (_kernel.ready_q.cache != _kernel.cpus->current) {
/* trigger a context switch */
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
}
if (_kernel.ready_q.cache != _kernel.cpus->current) {
SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk;
}
#endif /* CONFIG_PREEMPT_ENABLED */

View File

@@ -1,6 +1,5 @@
/*
* Copyright (c) 2018 Linaro, Limited
* Copyright (c) 2023 Arm Limited
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -48,63 +47,3 @@ int arch_swap(unsigned int key)
*/
return _current->arch.swap_return_value;
}
uintptr_t z_arm_pendsv_c(uintptr_t exc_ret)
{
/* Store LSB of LR (EXC_RETURN) to the thread's 'mode' word. */
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
(_kernel.cpus[0].current->arch.mode_exc_return = (uint8_t)exc_ret;));
/* Protect the kernel state while we play with the thread lists */
uint32_t basepri = arch_irq_lock();
/* fetch the thread to run from the ready queue cache */
struct k_thread *current = _kernel.cpus[0].current = _kernel.ready_q.cache;
/*
* Clear PendSV so that if another interrupt comes in and
* decides, with the new kernel state based on the new thread
* being context-switched in, that it needs to reschedule, it
* will take, but that previously pended PendSVs do not take,
* since they were based on the previous kernel state and this
* has been handled.
*/
SCB->ICSR = SCB_ICSR_PENDSVCLR_Msk;
/* For Cortex-M, store TLS pointer in a global variable,
* as it lacks the process ID or thread ID register
* to be used by toolchain to access thread data.
*/
IF_ENABLED(CONFIG_THREAD_LOCAL_STORAGE,
(extern uintptr_t z_arm_tls_ptr; z_arm_tls_ptr = current->tls));
IF_ENABLED(CONFIG_ARM_STORE_EXC_RETURN,
(exc_ret = (exc_ret & 0xFFFFFF00) | current->arch.mode_exc_return));
/* Restore previous interrupt disable state (irq_lock key)
* (We clear the arch.basepri field after restoring state)
*/
basepri = current->arch.basepri;
current->arch.basepri = 0;
arch_irq_unlock(basepri);
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
z_arm_configure_dynamic_mpu_regions(current);
#endif
/* restore mode */
IF_ENABLED(CONFIG_USERSPACE, ({
CONTROL_Type ctrl = {.w = __get_CONTROL()};
/* exit privileged state when returning to thread mode. */
ctrl.b.nPRIV = 0;
/* __set_CONTROL inserts an ISB which is may not be necessary here
* (stack pointer may not be touched), but it's recommended to avoid
* executing pre-fetched instructions with the previous privilege.
*/
__set_CONTROL(ctrl.w | current->arch.mode);
}));
return exc_ret;
}

View File

@@ -27,7 +27,6 @@ _ASM_FILE_PROLOGUE
GTEXT(z_arm_svc)
GTEXT(z_arm_pendsv)
GTEXT(z_do_kernel_oops)
GTEXT(z_arm_pendsv_c)
#if defined(CONFIG_USERSPACE)
GTEXT(z_arm_do_syscall)
#endif
@@ -118,20 +117,125 @@ out_fp_endif:
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
mov r4, lr
mov r0, lr
bl z_arm_pendsv_c
mov lr, r4
/* Protect the kernel state while we play with the thread lists */
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
cpsid i
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
movs.n r0, #_EXC_IRQ_DEFAULT_PRIO
msr BASEPRI_MAX, r0
isb /* Make the effect of disabling interrupts be realized immediately */
#else
#error Unknown ARM architecture
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
ldr r1, =_kernel
ldr r2, [r1, #_kernel_offset_to_current]
/*
* Prepare to clear PendSV with interrupts unlocked, but
* don't clear it yet. PendSV must not be cleared until
* the new thread is context-switched in since all decisions
* to pend PendSV have been taken with the current kernel
* state and this is what we're handling currently.
*/
ldr r7, =_SCS_ICSR
ldr r6, =_SCS_ICSR_UNPENDSV
/* _kernel is still in r1 */
/* fetch the thread to run from the ready queue cache */
ldr r2, [r1, #_kernel_offset_to_ready_q_cache]
str r2, [r1, #_kernel_offset_to_current]
/*
* Clear PendSV so that if another interrupt comes in and
* decides, with the new kernel state based on the new thread
* being context-switched in, that it needs to reschedule, it
* will take, but that previously pended PendSVs do not take,
* since they were based on the previous kernel state and this
* has been handled.
*/
/* _SCS_ICSR is still in r7 and _SCS_ICSR_UNPENDSV in r6 */
str r6, [r7, #0]
#if defined(CONFIG_THREAD_LOCAL_STORAGE)
/* Grab the TLS pointer */
ldr r4, =_thread_offset_to_tls
adds r4, r2, r4
ldr r0, [r4]
/* For Cortex-M, store TLS pointer in a global variable,
* as it lacks the process ID or thread ID register
* to be used by toolchain to access thread data.
*/
ldr r4, =z_arm_tls_ptr
str r0, [r4]
#endif
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
/* Restore EXC_RETURN value. */
mov lr, r0
ldrsb lr, [r2, #_thread_offset_to_mode_exc_return]
#endif
/* Restore previous interrupt disable state (irq_lock key)
* (We clear the arch.basepri field after restoring state)
*/
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE) && (_thread_offset_to_basepri > 124)
/* Doing it this way since the offset to thread->arch.basepri can in
* some configurations be larger than the maximum of 124 for ldr/str
* immediate offsets.
*/
ldr r4, =_thread_offset_to_basepri
adds r4, r2, r4
ldr r0, [r4]
movs.n r3, #0
str r3, [r4]
#else
ldr r0, [r2, #_thread_offset_to_basepri]
movs r3, #0
str r3, [r2, #_thread_offset_to_basepri]
#endif
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* BASEPRI not available, previous interrupt disable state
* maps to PRIMASK.
*
* Only enable interrupts if value is 0, meaning interrupts
* were enabled before irq_lock was called.
*/
cmp r0, #0
bne _thread_irq_disabled
cpsie i
_thread_irq_disabled:
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
push {r2,lr}
mov r0, r2
bl z_arm_configure_dynamic_mpu_regions
pop {r2,r3}
mov lr, r3
#endif
#ifdef CONFIG_USERSPACE
/* restore mode */
ldr r3, =_thread_offset_to_mode
adds r3, r2, r3
ldr r0, [r3]
mrs r3, CONTROL
movs.n r1, #1
bics r3, r1
orrs r3, r0
msr CONTROL, r3
/* ISB is not strictly necessary here (stack pointer is not being
* touched), but it's recommended to avoid executing pre-fetched
* instructions with the previous privilege.
*/
isb
#endif
ldr r4, =_thread_offset_to_callee_saved
adds r0, r2, r4
@@ -149,6 +253,9 @@ out_fp_endif:
subs r0, #36
ldmia r0!, {r4-r7}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* restore BASEPRI for the incoming thread */
msr BASEPRI, r0
#ifdef CONFIG_FPU_SHARING
/* Assess whether switched-in thread had been using the FP registers. */
tst lr, #_EXC_RETURN_FTYPE_Msk
@@ -178,6 +285,30 @@ in_fp_endif:
isb
#endif
#if defined(CONFIG_MPU_STACK_GUARD) || defined(CONFIG_USERSPACE)
/* Re-program dynamic memory map */
push {r2,lr}
mov r0, r2 /* _current thread */
bl z_arm_configure_dynamic_mpu_regions
pop {r2,lr}
#endif
#ifdef CONFIG_USERSPACE
/* restore mode */
ldr r0, [r2, #_thread_offset_to_mode]
mrs r3, CONTROL
bic r3, #1
orr r3, r0
msr CONTROL, r3
/* ISB is not strictly necessary here (stack pointer is not being
* touched), but it's recommended to avoid executing pre-fetched
* instructions with the previous privilege.
*/
isb
#endif
/* load callee-saved + psp from thread */
add r0, r2, #_thread_offset_to_callee_saved
ldmia r0, {r4-r11, ip}
@@ -300,6 +431,7 @@ _stack_frame_endif:
/* exception return is done in z_arm_int_exit() */
ldr r0, =z_arm_int_exit
bx r0
#endif
_oops:
@@ -352,20 +484,219 @@ _oops:
* r8 - saved link register
*/
_do_syscall:
/*
* Build a privilege stack frame from the user stack frame, then switch PSP
* to it. This ensures return from SVC does not rely on the user stack.
*
* Layout of privilege stack created from user stack:
*
* +------+-------------------------+------+-------------------------+--------------------------+
* | User stack | Privilege stack | Notes |
* +------+-------------------------+------+-------------------------+--------------------------+
* |Offset| contents |Offset| contents | |
* +------+-------------------------+------+-------------------------+--------------------------+
* | 0 | R0 -> | 0 | R0 | PSP switches from 0th |
* | | | | | offset of user stack to |
* | | | | | 0th offset of priv stack |
* | 4 | R1 -> | 4 | R1 | |
* | 8 | R2 -> | 8 | R2 | |
* | 12 | R3 -> |12 | R3 | |
* | 16 | R12 -> |16 | R12 | |
* | 20 | LR -> |20 | LR | |
* | 24 | Return Address -x> |24 | z_arm_do_syscall |return address from user |
* | | | | |sf is not copied. Instead,|
* | | | | |it is replaced so that |
* | | | | |z_arm_svc returns to |
* | | | | |z_arm_do_syscall. |
* | | | | | |
* | 28 | xPSR (w/ or w/o pad) -> |28 | xPSR (pad bit cleared) |This completes the basic |
* | | | | |exception sf w/ or w/o pad|
* | | | | | |
* | -- | FP regs + FPSCR -> |-- | FP regs + FPSCR |For arch supporting fp |
* | | (w/ or w/o pad) | | |context an additional |
* | | | | |extended sf is copied. |
* |________________________________|______|_________________________|__________________________|
* | | | | |On returning to |
* | | | | |z_arm_do_syscall, the |
* | | | | |above sf has already been |
* | | | | |unstacked and 8B from the |
* | | | | |then sf are used to pass |
* | | | | |original pre-svc sp & the |
* | | | | |return address. |
* | | | | |Note: at the moment |
* | | | | |z_arm_do_syscall also |
* | | | | |expects the return address|
* | | | | |to be set in r8. |
* | | | | | |
* | | | 0 | address that |z_arm_do_syscall expects |
* | | | | z_arm_do_syscall should |the original pre-svc sp at|
* | | | | set as PSP before |0th offset i.e. new sp[0] |
* | | | | returning from svc. |and, |
* | | | | | |
* | | | 4 | Address that |the return address at |
* | | | | z_arm_do_syscall should |sp[4]. Note that this is |
* | | | | return to after handling|the return address copied |
* | | | | svc |from user exception sf[24]|
* | | | | |which was not copied in |
* | | | | |the previous sf. |
* +------+-------------------------+------+-------------------------+--------------------------+
* "sf" in this function is used as abbreviation for "stack frame".
* Note that the "FP regs + FPSCR" are only present if CONFIG_FPU_SHARING=y, and the optional pad
* is only present if PSP was not 8-byte aligned when SVC was executed.
* Also note that FPU cannot be present in ARMv6-M or ARMv8-M Baseline implementations
* (i.e., it may only be present when CONFIG_ARMV7_M_ARMV8_M_MAINLINE is enabled).
*/
/* Start by fetching the top of privileged stack */
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
movs r3, #24
ldr r1, [r0, r3] /* grab address of PC from stack frame */
mov r8, r1
ldr r1, =_kernel
ldr r1, [r1, #_kernel_offset_to_current]
adds r1, r1, #_thread_offset_to_priv_stack_start
ldr r1, [r1] /* bottom of priv stack */
ldr r3, =CONFIG_PRIVILEGED_STACK_SIZE
subs r3, #(_EXC_HW_SAVED_BASIC_SF_SIZE+8) /* 8 for original sp and pc */
add r1, r3
mov ip, r1
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
ldr r8, [r0, #24] /* grab address of PC from stack frame */
ldr ip, =_kernel
ldr ip, [ip, #_kernel_offset_to_current]
ldr ip, [ip, #_thread_offset_to_priv_stack_start] /* bottom of priv stack */
add ip, #CONFIG_PRIVILEGED_STACK_SIZE
#ifdef CONFIG_FPU_SHARING
/* Assess whether svc calling thread had been using the FP registers. */
tst lr, #_EXC_RETURN_FTYPE_Msk
ite eq
moveq r8, #_EXC_HW_SAVED_EXTENDED_SF_SIZE
movne r8, #_EXC_HW_SAVED_BASIC_SF_SIZE
#else
mov r8, #_EXC_HW_SAVED_BASIC_SF_SIZE
#endif
sub ip, #8 /* z_arm_do_syscall will use this to get original sp and pc */
sub ip, r8 /* 32 for basic sf + 72 for the optional esf */
#endif
/*
* At this point:
* r0 has PSP i.e. top of user stack
* ip has top of privilege stack
* r8 has hardware-saved stack frame size (only in case of mainline)
*/
push {r4-r7}
push {r2}
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
mov r2, r0 /* safe to use r2 since it is saved on MSP */
/* Check for padding in the sf */
ldr r1, [r0, #_EXC_HW_SAVED_BASIC_SF_XPSR_OFFSET] /* grab xPSR from sf which has the pad bit */
movs r3, #1
/* Check if pad bit 9 is set */
lsls r3, r3, #9
tst r1, r3
beq .L_no_padding
/* special handling for padded sf */
bics r1, r3 /* clear the pad bit (priv stack is aligned and doesn't need it) */
adds r2, #4
.L_no_padding:
/* Calculate original pre-svc user sp which is psp + sf size (+4B if pad bit was set) */
adds r2, #_EXC_HW_SAVED_BASIC_SF_SIZE
mov r3, ip
str r2,[r3, #0]
/* Store the pre-SVC user SP at the offset expected by z_arm_do_syscall,
* as detailed in the table above.
*/
str r2,[r3, #_EXC_HW_SAVED_BASIC_SF_SIZE]
/* sf of priv stack has the same xPSR as user stack but with 9th bit reset */
str r1,[r3, #_EXC_HW_SAVED_BASIC_SF_XPSR_OFFSET]
/* r0-r3, r12, LR from user stack sf are copied to sf of priv stack */
mov r1, r0
mov r2, r3
ldmia r1!, {r4-r7}
stmia r2!, {r4-r7}
ldmia r1!, {r4-r5}
stmia r2!, {r4-r5}
/* Store the svc return address at the offset expected by z_arm_do_syscall,
* as detailed in the table above.
*/
str r5, [r3, #(_EXC_HW_SAVED_BASIC_SF_SIZE+4)]
ldr r1, =z_arm_do_syscall
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
str r1, [r0, r3] /* overwrite the PC to point to z_arm_do_syscall */
str r1, [r3, #_EXC_HW_SAVED_BASIC_SF_RETADDR_OFFSET] /* Execution return to z_arm_do_syscall */
ldr r1, [r0, #_EXC_HW_SAVED_BASIC_SF_RETADDR_OFFSET] /* grab address of PC from stack frame */
/* Store the svc return address (i.e. next instr to svc) in r8 as expected by z_arm_do_syscall.
*/
mov r8, r1
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
str r1, [r0, #24] /* overwrite the PC to point to z_arm_do_syscall */
mov r2, r0 /* safe to use r2 since it is saved on MSP */
/* Calculate original pre-svc user sp without pad which is psp + sf size */
add r2, r8
/* Also, check for padding in the sf */
ldr r1, [r0, #_EXC_HW_SAVED_BASIC_SF_XPSR_OFFSET] /* grab xPSR from sf which has the pad bit */
tst r1, #(1<<9) /* Check if pad bit 9 is set */
beq .L_no_padding
bics r1, #(1<<9) /* clear the pad bit (priv stack is aligned and doesn't need it) */
/* Calculate original pre-svc user sp with pad */
add r2, #4
.L_no_padding:
str r2,[ip, #0]
/* Store the pre-SVC user SP at the offset expected by z_arm_do_syscall,
* as detailed in the table above.
*/
str r2,[ip, r8]
str r1,[ip, #_EXC_HW_SAVED_BASIC_SF_XPSR_OFFSET] /* priv sf get user sf xPSR with bit9 reset */
/* r0-r3, r12, LR from user stack sf are copied to sf of priv stack */
mov r1, r0
mov r2, ip
ldmia r1!, {r4-r7}
stmia r2!, {r4-r7}
ldmia r1!, {r4-r5}
stmia r2!, {r4-r5}
/* Store the svc return address at the offset expected by z_arm_do_syscall,
* as detailed in the table above.
*/
add r8, #4
str r5, [ip, r8]
ldr r1, =z_arm_do_syscall
str r1, [ip, #_EXC_HW_SAVED_BASIC_SF_RETADDR_OFFSET] /* Execution return to z_arm_do_syscall */
ldr r1, [r0, #_EXC_HW_SAVED_BASIC_SF_RETADDR_OFFSET] /* grab address of PC from stack frame */
/* Store the svc return address (i.e. next instr to svc) in r8 as expected by z_arm_do_syscall.
*/
mov r8, r1
/* basic stack frame is copied at this point to privilege stack,
* now time to copy the fp context
*/
#ifdef CONFIG_FPU_SHARING
tst lr, #_EXC_RETURN_FTYPE_Msk
bne .L_skip_fp_copy
add r1, r0, #32
add r2, ip, #32
vldmia r1!, {s0-s15}
vstmia r2!, {s0-s15}
/* copy FPSCR + reserved (8 bytes) */
ldmia r1!, {r4, r5}
stmia r2!, {r4, r5}
.L_skip_fp_copy:
#endif
#endif
pop {r2} /* restore CONTROL value */
pop {r4-r7}
/* Point PSP to privilege stack,
* note that r0 still has the old PSP
*/
msr PSP, ip
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
ldr r3, =K_SYSCALL_LIMIT
cmp r6, r3
@@ -419,14 +750,12 @@ valid_syscall_id:
isb
#if defined(CONFIG_BUILTIN_STACK_GUARD)
/* Thread is now in privileged mode; after returning from SCVall it
* will use the default (user) stack before switching to the privileged
* stack to execute the system call. We need to protect the user stack
* against stack overflows until this stack transition.
*/
ldr r1, [r0, #_thread_offset_to_stack_info_start] /* stack_info.start */
msr PSPLIM, r1
#endif /* CONFIG_BUILTIN_STACK_GUARD */
/* Set stack pointer limit (needed in privileged mode) */
ldr ip, =_kernel
ldr ip, [ip, #_kernel_offset_to_current]
ldr ip, [ip, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
msr PSPLIM, ip
#endif
/* return from SVC to the modified LR - z_arm_do_syscall */
bx lr

View File

@@ -46,6 +46,35 @@
K_THREAD_STACK_DECLARE(z_main_stack, CONFIG_MAIN_STACK_SIZE);
#endif
#ifdef CONFIG_USERSPACE
static void setup_priv_stack(struct k_thread *thread)
{
/* Set up privileged stack before entering user mode */
thread->arch.priv_stack_start = (uint32_t)z_priv_stack_find(thread->stack_obj);
/* CONFIG_PRIVILEGED_STACK_SIZE does not account for MPU_GUARD_ALIGN_AND_SIZE or
* MPU_GUARD_ALIGN_AND_SIZE_FLOAT. Therefore, we must compute priv_stack_end here before
* adjusting priv_stack_start for the mpu guard alignment
*/
thread->arch.priv_stack_end = thread->arch.priv_stack_start + CONFIG_PRIVILEGED_STACK_SIZE;
#if defined(CONFIG_MPU_STACK_GUARD)
/* Stack guard area reserved at the bottom of the thread's
* privileged stack. Adjust the available (writable) stack
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
thread->arch.priv_stack_start +=
((thread->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0)
? MPU_GUARD_ALIGN_AND_SIZE_FLOAT
: MPU_GUARD_ALIGN_AND_SIZE;
#else
thread->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
}
#endif
/* An initial context, to be "restored" by z_arm_pendsv(), is put at the other
* end of the stack, and thus reusable by the stack when not needed anymore.
*
@@ -87,9 +116,24 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
#endif /* FP_GUARD_EXTRA_SIZE */
#endif /* CONFIG_MPU_STACK_GUARD */
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
thread->arch.mode = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
#endif
#if FP_GUARD_EXTRA_SIZE > 0
if ((thread->base.user_options & K_FP_REGS) != 0) {
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
}
#endif
#endif
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, stack_ptr);
#if defined(CONFIG_USERSPACE)
thread->arch.priv_stack_start = 0;
if ((thread->base.user_options & K_USER) != 0) {
setup_priv_stack(thread);
iframe = Z_STACK_PTR_TO_FRAME(struct __basic_sf, thread->arch.priv_stack_end);
iframe->pc = (uint32_t)arch_user_mode_enter;
} else {
iframe->pc = (uint32_t)z_thread_entry;
@@ -111,20 +155,6 @@ void arch_new_thread(struct k_thread *thread, k_thread_stack_t *stack,
thread->callee_saved.psp = (uint32_t)iframe;
thread->arch.basepri = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN) || defined(CONFIG_USERSPACE)
thread->arch.mode = 0;
#if defined(CONFIG_ARM_STORE_EXC_RETURN)
thread->arch.mode_exc_return = DEFAULT_EXC_RETURN;
#endif
#if FP_GUARD_EXTRA_SIZE > 0
if ((thread->base.user_options & K_FP_REGS) != 0) {
thread->arch.mode |= Z_ARM_MODE_MPU_GUARD_FLOAT_Msk;
}
#endif
#if defined(CONFIG_USERSPACE)
thread->arch.priv_stack_start = 0;
#endif
#endif
/*
* initial values in all other registers/thread entries are
* irrelevant.
@@ -226,13 +256,10 @@ uint32_t z_arm_mpu_stack_guard_and_fpu_adjust(struct k_thread *thread)
#endif
#ifdef CONFIG_USERSPACE
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3)
FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry, void *p1, void *p2, void *p3)
{
uint32_t sp_is_priv = 1;
/* Set up privileged stack before entering user mode */
_current->arch.priv_stack_start =
(uint32_t)z_priv_stack_find(_current->stack_obj);
#if defined(CONFIG_MPU_STACK_GUARD)
#if defined(CONFIG_THREAD_STACK_INFO)
/* We're dropping to user mode which means the guard area is no
@@ -249,24 +276,26 @@ FUNC_NORETURN void arch_user_mode_enter(k_thread_entry_t user_entry,
_current->stack_info.start -= MPU_GUARD_ALIGN_AND_SIZE;
_current->stack_info.size += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_THREAD_STACK_INFO */
/* Stack guard area reserved at the bottom of the thread's
* privileged stack. Adjust the available (writable) stack
* buffer area accordingly.
*/
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
_current->arch.priv_stack_start +=
((_current->arch.mode & Z_ARM_MODE_MPU_GUARD_FLOAT_Msk) != 0) ?
MPU_GUARD_ALIGN_AND_SIZE_FLOAT : MPU_GUARD_ALIGN_AND_SIZE;
#else
_current->arch.priv_stack_start += MPU_GUARD_ALIGN_AND_SIZE;
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#endif /* CONFIG_MPU_STACK_GUARD */
z_arm_userspace_enter(user_entry, p1, p2, p3,
(uint32_t)_current->stack_info.start,
_current->stack_info.size -
_current->stack_info.delta);
/* 2 ways how arch_user_mode_enter is called:
* - called as part of context switch from z_arm_pendsv, in this case privileged stack is
* already setup and stack pointer points to privileged stack.
* - called directly from k_thread_user_mode_enter, in this case privileged stack is not
* setup and stack pointer points to user stack.
*
* When called from k_thread_user_mode_enter, we need to check and setup the privileged
* stack and then instruct z_arm_userspace_enter to change the PSP to the privileged stack.
* Note that we do not change the PSP in this function to avoid any conflict with compiler's
* sequence which has already pushed stuff on the user stack.
*/
if (0 == _current->arch.priv_stack_start) {
setup_priv_stack(_current);
sp_is_priv = 0;
}
z_arm_userspace_enter(user_entry, p1, p2, p3, (uint32_t)_current->stack_info.start,
_current->stack_info.size - _current->stack_info.delta, sp_is_priv);
CODE_UNREACHABLE;
}
@@ -586,9 +615,11 @@ void arch_switch_to_main_thread(struct k_thread *main_thread, char *stack_ptr,
"mov r3, #0\n"
"ldr r4, =z_thread_entry\n"
"bx r4\n" /* We dont intend to return, so there is no need to link. */
: "+r" (_main)
: "r" (stack_ptr)
: "r0", "r1", "r2", "r3", "r4", "ip", "lr");
/* Force a literal pool placement for the addresses referenced above */
".ltorg\n"
:
: "r" (_main), "r" (stack_ptr)
: "r0", "r1", "r2", "r3", "r4", "ip", "lr", "memory");
CODE_UNREACHABLE;
}
@@ -653,6 +684,8 @@ FUNC_NORETURN void z_arm_switch_to_main_no_multithreading(
"ldr r0, =arch_irq_lock_outlined\n"
"blx r0\n"
"loop: b loop\n\t" /* while (true); */
/* Force a literal pool placement for the addresses referenced above */
".ltorg\n"
:
: [_p1]"r" (p1), [_p2]"r" (p2), [_p3]"r" (p3),
[_psp]"r" (psp), [_main_entry]"r" (main_entry)

View File

@@ -45,8 +45,9 @@ GEN_OFFSET_SYM(_thread_arch_t, mode_exc_return);
#endif
#if defined(CONFIG_USERSPACE)
GEN_OFFSET_SYM(_thread_arch_t, priv_stack_start);
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
GEN_OFFSET_SYM(_thread_arch_t, priv_stack_end);
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
GEN_OFFSET_SYM(_thread_arch_t, sp_usr);
#endif
#endif

View File

@@ -2,6 +2,7 @@
* Userspace and service handler hooks
*
* Copyright (c) 2017 Linaro Limited
* Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -41,45 +42,41 @@ GDATA(_k_syscall_table)
*
* The function is invoked as:
* z_arm_userspace_enter(user_entry, p1, p2, p3,
* stack_info.start, stack_info.size);
* stack_info.start, stack_info.size,
* sp_is_priv);
*/
SECTION_FUNC(TEXT,z_arm_userspace_enter)
/* move user_entry to lr */
mov lr, r0
/* prepare to set stack to privileged stack */
/* load arguments from stack:
* r4 = user stack start
* r5 = user stack size
* r6 = sp_is_priv (1 if already on privileged stack)
*/
pop {r4, r5, r6}
/* get current thread pointer */
ldr r0, =_kernel
ldr r0, [r0, #_kernel_offset_to_current]
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* move p1 to ip */
mov ip, r1
ldr r1, =_thread_offset_to_priv_stack_start
ldr r0, [r0, r1] /* priv stack ptr */
ldr r1, =CONFIG_PRIVILEGED_STACK_SIZE
add r0, r0, r1
ldr r1, =_thread_offset_to_priv_stack_end
ldr r0, [r0, r1]
/* Restore p1 from ip */
mov r1, ip
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
ldr r0, [r0, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
ldr ip, =CONFIG_PRIVILEGED_STACK_SIZE
add r0, r0, ip
#elif defined(CONFIG_CPU_AARCH32_CORTEX_R)
ldr r0, [r0, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
ldr ip, =CONFIG_PRIVILEGED_STACK_SIZE
add r0, r0, ip
ldr ip, =_kernel
ldr ip, [ip, #_kernel_offset_to_current]
str r0, [ip, #_thread_offset_to_priv_stack_end] /* priv stack end */
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_AARCH32_CORTEX_R)
ldr r0, [r0, #_thread_offset_to_priv_stack_end] /* privileged stack ptr */
#endif
/* store current stack pointer to ip
* the current stack pointer is needed to retrieve
* stack_info.start and stack_info.size
*/
mov ip, sp
/* check if current stack is privileged and switch to it if not */
cmp r6, #1
beq 1f
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
#if defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
mov sp, r0
#else
/* set stack to privileged stack
@@ -93,35 +90,28 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
msr PSP, r0
#endif
1:
/* push thread args and entrypoint to stack */
push {r1,r2,r3,lr}
#if defined(CONFIG_BUILTIN_STACK_GUARD)
/* At this point the privileged stack is not yet protected by PSPLIM.
* Since we have just switched to the top of the privileged stack, we
* Since we have switched to the top of the privileged stack, we
* are safe, as long as the stack can accommodate the maximum exception
* stack frame.
*/
/* set stack pointer limit to the start of the priv stack */
ldr r0, =_kernel
ldr r0, [r0, #_kernel_offset_to_current]
ldr r0, [r0, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
ldr r1, =CONFIG_PRIVILEGED_STACK_SIZE
sub r0, r0, r1 /* Calculate start of privileged stack */
/* set stack pointer limit to the start of the privileged stack */
msr PSPLIM, r0
#endif
/* push args to stack */
push {r1,r2,r3,lr}
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
mov r1, ip
push {r0,r1}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_AARCH32_CORTEX_R)
push {r0,ip}
#endif
/* Re-program dynamic memory map.
*
* Important note:
* z_arm_configure_dynamic_mpu_regions() may re-program the MPU Stack Guard
* to guard the privilege stack for overflows (if building with option
* to guard the privileged stack for overflows (if building with option
* CONFIG_MPU_STACK_GUARD). There is a risk of actually overflowing the
* stack while doing the re-programming. We minimize the risk by placing
* this function immediately after we have switched to the privileged stack
@@ -135,29 +125,10 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
ldr r0, [r0, #_kernel_offset_to_current]
bl z_arm_configure_dynamic_mpu_regions
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
pop {r0,r3}
/* load up stack info from user stack */
ldr r0, [r3]
ldr r3, [r3, #4]
mov ip, r3
push {r0,r3}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_AARCH32_CORTEX_R)
pop {r0,ip}
/* load up stack info from user stack */
ldr r0, [ip]
ldr ip, [ip, #4]
push {r0,ip}
#endif
/* clear the user stack area to clean out privileged data */
/* from right past the guard right up to the end */
mov r2, ip
mov r0, r4
mov r2, r5
#ifdef CONFIG_INIT_STACKS
ldr r1,=0xaaaaaaaa
#else
@@ -165,17 +136,18 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
#endif
bl memset
/* At this point:
* r4 contains user stack start
* r5 contains user stack size
* calculate top of user stack in r0 (start+size)
*/
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
pop {r0, r1}
mov ip, r1
adds r0, r4, r5
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) \
|| defined(CONFIG_CPU_AARCH32_CORTEX_R)
pop {r0,ip}
add r0, r4, r5
#endif
/* r0 contains user stack start, ip contains user stack size */
add r0, r0, ip /* calculate top of stack */
/* pop remaining arguments from stack before switching stacks */
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* Use r4 to pop lr, then restore r4 */
@@ -188,7 +160,7 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
pop {r1,r2,r3,lr}
#endif
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
#if defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
/*
* set stack to user stack. We are in SYSTEM state, so r13 and r14 are
* shared with USER state
@@ -223,10 +195,7 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
isb
/* Set PSPLIM to guard the thread's user stack. */
ldr r0, =_kernel
ldr r0, [r0, #_kernel_offset_to_current]
ldr r0, [r0, #_thread_offset_to_stack_info_start]
msr PSPLIM, r0
msr PSPLIM, r4
pop {r0, ip}
#endif
@@ -308,9 +277,8 @@ SECTION_FUNC(TEXT,z_arm_userspace_enter)
* This function is used to do system calls from unprivileged code. This
* function is responsible for the following:
* 1) Fixing up bad syscalls
* 2) Configuring privileged stack and loading up stack arguments
* 3) Dispatching the system call
* 4) Restoring stack and calling back to the caller of the SVC
* 2) Dispatching the system call
* 3) Restoring stack and calling back to the caller of the SVC
*
*/
SECTION_FUNC(TEXT, z_arm_do_syscall)
@@ -328,41 +296,7 @@ SECTION_FUNC(TEXT, z_arm_do_syscall)
* At this point PSPLIM is already configured to guard the default (user)
* stack, so pushing to the default thread's stack is safe.
*/
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE)
/* save current stack pointer (user stack) */
mov ip, sp
/* temporarily push to user stack */
push {r0,r1}
/* setup privileged stack */
ldr r0, =_kernel
ldr r0, [r0, #_kernel_offset_to_current]
adds r0, r0, #_thread_offset_to_priv_stack_start
ldr r0, [r0] /* priv stack ptr */
ldr r1, =CONFIG_PRIVILEGED_STACK_SIZE
add r0, r1
/* Store current SP and LR at the beginning of the priv stack */
subs r0, #8
mov r1, ip
str r1, [r0, #0]
mov r1, lr
str r1, [r0, #4]
mov ip, r0
/* Restore user stack and original r0, r1 */
pop {r0, r1}
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE)
/* setup privileged stack */
ldr ip, =_kernel
ldr ip, [ip, #_kernel_offset_to_current]
ldr ip, [ip, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
add ip, #CONFIG_PRIVILEGED_STACK_SIZE
/* Store current SP and LR at the beginning of the priv stack */
subs ip, #8
str sp, [ip, #0]
str lr, [ip, #4]
#elif defined(CONFIG_CPU_AARCH32_CORTEX_R)
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
/*
* The SVC handler has already switched to the privileged stack.
* Store the user SP and LR at the beginning of the priv stack.
@@ -373,11 +307,6 @@ SECTION_FUNC(TEXT, z_arm_do_syscall)
push {ip, lr}
#endif
#if !defined(CONFIG_CPU_AARCH32_CORTEX_R)
/* switch to privileged stack */
msr PSP, ip
#endif
/* Note (applies when using stack limit checking):
* We do not need to lock IRQs after switching PSP to the privileged stack;
* PSPLIM is guarding the default (user) stack, which, by design, is
@@ -386,14 +315,6 @@ SECTION_FUNC(TEXT, z_arm_do_syscall)
* the maximum exception stack frame.
*/
#if defined(CONFIG_BUILTIN_STACK_GUARD)
/* Set stack pointer limit (needed in privileged mode) */
ldr ip, =_kernel
ldr ip, [ip, #_kernel_offset_to_current]
ldr ip, [ip, #_thread_offset_to_priv_stack_start] /* priv stack ptr */
msr PSPLIM, ip
#endif
/*
* r0-r5 contain arguments
* r6 contains call_id

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
* Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -57,7 +58,8 @@ static ALWAYS_INLINE void arch_switch(void *switch_to, void **switched_from)
extern FUNC_NORETURN void z_arm_userspace_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3,
uint32_t stack_end,
uint32_t stack_start);
uint32_t stack_start,
uint32_t sp_is_priv);
extern void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf);

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
* Copyright 2025 Arm Limited and/or its affiliates <open-source-office@arm.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -71,10 +72,9 @@ extern FUNC_NORETURN void z_arm_switch_to_main_no_multithreading(
#endif /* !CONFIG_MULTITHREADING */
extern FUNC_NORETURN void z_arm_userspace_enter(k_thread_entry_t user_entry,
void *p1, void *p2, void *p3,
uint32_t stack_end,
uint32_t stack_start);
extern FUNC_NORETURN void z_arm_userspace_enter(k_thread_entry_t user_entry, void *p1, void *p2,
void *p3, uint32_t stack_end, uint32_t stack_start,
uint32_t sp_is_priv);
extern void z_arm_fatal_error(unsigned int reason, const struct arch_esf *esf);

View File

@@ -45,10 +45,10 @@
#define _thread_offset_to_priv_stack_start \
(___thread_t_arch_OFFSET + ___thread_arch_t_priv_stack_start_OFFSET)
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
#define _thread_offset_to_priv_stack_end \
(___thread_t_arch_OFFSET + ___thread_arch_t_priv_stack_end_OFFSET)
#if defined(CONFIG_CPU_AARCH32_CORTEX_R)
#define _thread_offset_to_sp_usr \
(___thread_t_arch_OFFSET + ___thread_arch_t_sp_usr_OFFSET)
#endif

View File

@@ -9,6 +9,7 @@
SECTION_DATA_PROLOGUE(.ramfunc,,)
{
__ramfunc_region_start = .;
MPU_ALIGN(__ramfunc_size);
__ramfunc_start = .;
*(.ramfunc)

View File

@@ -61,6 +61,25 @@ void posix_arch_thread_entry(void *pa_thread_status)
z_thread_entry(ptr->entry_point, ptr->arg1, ptr->arg2, ptr->arg3);
}
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
int arch_float_disable(struct k_thread *thread)
{
ARG_UNUSED(thread);
/* Posix always has FPU enabled so cannot be disabled */
return -ENOTSUP;
}
int arch_float_enable(struct k_thread *thread, unsigned int options)
{
ARG_UNUSED(thread);
ARG_UNUSED(options);
/* Posix always has FPU enabled so nothing to do here */
return 0;
}
#endif /* CONFIG_FPU && CONFIG_FPU_SHARING */
#if defined(CONFIG_ARCH_HAS_THREAD_ABORT)
void z_impl_k_thread_abort(k_tid_t thread)
{

View File

@@ -163,6 +163,14 @@ SECTION_FUNC(exception.entry, _isr_wrapper)
lr t0, ___cpu_t_current_OFFSET(s0)
lr tp, _thread_offset_to_tls(t0)
/* Make sure global pointer is sane */
#ifdef CONFIG_RISCV_GP
.option push
.option norelax
la gp, __global_pointer$
.option pop
#endif /* CONFIG_RISCV_GP */
/* Clear our per-thread usermode flag */
lui t0, %tprel_hi(is_user_mode)
add t0, t0, tp, %tprel_add(is_user_mode)
@@ -428,6 +436,12 @@ do_fault:
1: mv a1, sp
#ifdef CONFIG_EXCEPTION_DEBUG
/*
* Restore the s0 we saved early in ISR entry
* so it shows up properly in the CSF.
*/
lr s0, __struct_arch_esf_s0_OFFSET(sp)
/* Allocate space for caller-saved registers on current thread stack */
addi sp, sp, -__callee_saved_t_SIZEOF

View File

@@ -62,7 +62,8 @@ boot_first_core:
#ifdef CONFIG_INIT_STACKS
/* Pre-populate all bytes in z_interrupt_stacks with 0xAA */
la t0, z_interrupt_stacks
li t1, __z_interrupt_stack_SIZEOF
/* Total size of all cores' IRQ stack */
li t1, __z_interrupt_all_stacks_SIZEOF
add t1, t1, t0
/* Populate z_interrupt_stacks with 0xaaaaaaaa */
@@ -71,7 +72,7 @@ aa_loop:
sw t2, 0x00(t0)
addi t0, t0, 4
blt t0, t1, aa_loop
#endif
#endif /* CONFIG_INIT_STACKS */
/*
* Initially, setup stack pointer to

View File

@@ -58,12 +58,12 @@ static inline bool in_user_thread_stack_bound(uintptr_t addr, const struct k_thr
/* See: zephyr/include/zephyr/arch/riscv/arch.h */
if (IS_ENABLED(CONFIG_PMP_POWER_OF_TWO_ALIGNMENT)) {
start = thread->arch.priv_stack_start - CONFIG_PRIVILEGED_STACK_SIZE;
end = thread->arch.priv_stack_start;
start = thread->arch.priv_stack_start + Z_RISCV_STACK_GUARD_SIZE;
} else {
start = thread->stack_info.start - CONFIG_PRIVILEGED_STACK_SIZE;
end = thread->stack_info.start;
}
end = Z_STACK_PTR_ALIGN(thread->arch.priv_stack_start + K_KERNEL_STACK_RESERVED +
CONFIG_PRIVILEGED_STACK_SIZE);
return (addr >= start) && (addr < end);
}
@@ -134,22 +134,53 @@ static void walk_stackframe(stack_trace_callback_fn cb, void *cookie, const stru
ra = csf->ra;
}
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp);) {
if (in_text_region(ra)) {
if (!cb(cookie, ra)) {
break;
}
/*
* Increment the iterator only if `ra` is within the text region to get the
* most out of it
*/
i++;
for (int i = 0; (i < MAX_STACK_FRAMES) && vrfy(fp, thread, esf) && (fp > last_fp); i++) {
if (in_text_region(ra) && !cb(cookie, ra)) {
break;
}
last_fp = fp;
/* Unwind to the previous frame */
frame = (struct stackframe *)fp - 1;
ra = frame->ra;
if ((i == 0) && (esf != NULL)) {
/* Print `esf->ra` if we are at the top of the stack */
if (in_text_region(esf->ra) && !cb(cookie, esf->ra)) {
break;
}
/**
* For the first stack frame, the `ra` is not stored in the frame if the
* preempted function doesn't call any other function, we can observe:
*
* .-------------.
* frame[0]->fp ---> | frame[0] fp |
* :-------------:
* frame[0]->ra ---> | frame[1] fp |
* | frame[1] ra |
* :~~~~~~~~~~~~~:
* | frame[N] fp |
*
* Instead of:
*
* .-------------.
* frame[0]->fp ---> | frame[0] fp |
* frame[0]->ra ---> | frame[1] ra |
* :-------------:
* | frame[1] fp |
* | frame[1] ra |
* :~~~~~~~~~~~~~:
* | frame[N] fp |
*
* Check if `frame->ra` actually points to a `fp`, and adjust accordingly
*/
if (vrfy(frame->ra, thread, esf)) {
fp = frame->ra;
frame = (struct stackframe *)fp;
}
}
fp = frame->fp;
ra = frame->ra;
}
}
#else /* !CONFIG_FRAME_POINTER */

View File

@@ -33,6 +33,9 @@ extern char _heap_start[];
/** MPU foreground map for kernel mode. */
static struct xtensa_mpu_map xtensa_mpu_map_fg_kernel;
/** Make sure write to the MPU region is atomic. */
static struct k_spinlock xtensa_mpu_lock;
/*
* Additional information about the MPU maps: foreground and background
* maps.
@@ -629,6 +632,9 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
#endif
{
int entry;
k_spinlock_key_t key;
key = k_spin_lock(&xtensa_mpu_lock);
#ifdef CONFIG_USERSPACE
struct xtensa_mpu_map *map = thread->arch.mpu_map;
@@ -652,6 +658,8 @@ void xtensa_mpu_map_write(struct xtensa_mpu_map *map)
__asm__ volatile("wptlb %0, %1\n\t"
: : "a"(map->entries[entry].at), "a"(map->entries[entry].as));
}
k_spin_unlock(&xtensa_mpu_lock, key);
}
/**
@@ -765,6 +773,7 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
{
int ret;
uint32_t perm;
struct k_thread *cur_thread;
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
struct k_mem_partition *partition = &domain->partitions[partition_id];
uintptr_t end_addr = partition->start + partition->size;
@@ -833,6 +842,15 @@ int arch_mem_domain_partition_remove(struct k_mem_domain *domain,
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
NULL);
/*
* Need to update hardware MPU regions if we are removing
* partition from the domain of the current running thread.
*/
cur_thread = _current_cpu->current;
if (cur_thread->mem_domain_info.mem_domain == domain) {
xtensa_mpu_map_write(cur_thread);
}
out:
return ret;
}
@@ -841,6 +859,7 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
uint32_t partition_id)
{
int ret;
struct k_thread *cur_thread;
struct xtensa_mpu_map *map = &domain->arch.mpu_map;
struct k_mem_partition *partition = &domain->partitions[partition_id];
uintptr_t end_addr = partition->start + partition->size;
@@ -855,6 +874,20 @@ int arch_mem_domain_partition_add(struct k_mem_domain *domain,
CONFIG_XTENSA_MPU_DEFAULT_MEM_TYPE,
NULL);
/*
* Need to update hardware MPU regions if we are removing
* partition from the domain of the current running thread.
*
* Note that this function can be called with dummy thread
* at boot so we need to avoid writing MPU regions to
* hardware.
*/
cur_thread = _current_cpu->current;
if (((cur_thread->base.thread_state & _THREAD_DUMMY) != _THREAD_DUMMY) &&
(cur_thread->mem_domain_info.mem_domain == domain)) {
xtensa_mpu_map_write(cur_thread);
}
out:
return ret;
}

View File

@@ -311,7 +311,7 @@ You can debug an application in the usual way. Here is an example for the
:goals: debug
.. _pyOCD:
https://github.com/mbedmicro/pyOCD
https://github.com/pyocd/pyOCD
.. _CMSIS DAP:
https://developer.mbed.org/handbook/CMSIS-DAP
@@ -323,7 +323,7 @@ You can debug an application in the usual way. Here is an example for the
http://wiki.seeed.cc/BLE_Nitrogen/
.. _pyOCD issue 259:
https://github.com/mbedmicro/pyOCD/issues/259
https://github.com/pyocd/pyOCD/issues/259
.. _96Boards IE Specification:
https://linaro.co/ie-specification

View File

@@ -20,4 +20,5 @@ if(CONFIG_BOARD_MPS2_AN521_CPU1 AND NOT CONFIG_OPENAMP)
BUILD_BYPRODUCTS "${CPU0_BINARY_DIR}/${KERNEL_BIN_NAME}"
BUILD_ALWAYS True
)
add_dependencies(app empty_cpu0)
endif()

View File

@@ -32,7 +32,7 @@ config TEST_EXTRA_STACK_SIZE
endif # COVERAGE_GCOV
endif
endif # BOARD_MPS2_AN383 || BOARD_MPS2_AN385 || BOARD_MPS2_AN386 || BOARD_MPS2_AN500
if BOARD_MPS2_AN521_CPU0 || BOARD_MPS2_AN521_CPU0_NS || BOARD_MPS2_AN521_CPU1
@@ -57,4 +57,11 @@ config UART_INTERRUPT_DRIVEN
endif # SERIAL
endif # BOARD_MPS2_AN521_CPU0 || BOARD_MPS2_AN521_CPU0_NS || BOARD_MPS2_AN521_CPU1
if QEMU_TARGET
config ISR_STACK_SIZE
default 4096
endif

View File

@@ -111,7 +111,7 @@
compatible = "zephyr,mipi-dbi-spi";
reset-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
dc-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
spi-dev = <&spi2>;
spi-dev = <&spi4>;
write-only;
#address-cells = <1>;
#size-cells = <0>;

View File

@@ -15,7 +15,7 @@ config ESP_SPIRAM
default y if !MCUBOOT
choice SPIRAM_TYPE
default SPIRAM_TYPE_ESPPSRAM64
default SPIRAM_TYPE_ESPPSRAM32
endchoice
config HEAP_MEM_POOL_ADD_SIZE_BOARD

View File

@@ -64,7 +64,7 @@
status = "okay";
erase-block-size = <4096>;
write-block-size = <1>;
spi-max-frequency = <133000000>;
spi-max-frequency = <104000000>;
};
};

View File

@@ -3,5 +3,10 @@ board:
vendor: seagate
revision:
format: custom
default: "25hdd"
revisions:
- name: "25hdd"
- name: "25ssd"
- name: "35"
socs:
- name: stm32f070xb

View File

@@ -163,8 +163,6 @@ Motion and environmental sensors
(`lps22df datasheet`_)
- **LIS2DU12** 3-axis accelerometer
(`lis2du12 datasheet`_)
- **HTS221** Humidity sensor
(`hts221 datasheet`_)
- **STTS22H** Digital temperature sensor
(`stts22hh datasheet`_)
- **MP23db01HP** Microphone / audio sensor
@@ -353,9 +351,6 @@ References
.. _lis2du12 datasheet:
https://www.st.com/en/mems-and-sensors/lis2du12.html
.. _hts221 datasheet:
https://www.st.com/en/mems-and-sensors/hts221.html
.. _stts22hh datasheet:
https://www.st.com/en/mems-and-sensors/stts22h.html

View File

@@ -228,13 +228,6 @@ stm32_lp_tick_source: &lptim1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
hts221@5f {
compatible = "st,hts221";
reg = <0x5f>;
drdy-gpios = <&gpioe 11 GPIO_ACTIVE_HIGH>;
status = "okay";
};
lps22df@5d {
compatible = "st,lps22df";
reg = <0x5d>;

View File

@@ -9,6 +9,7 @@ supported:
- acpi
- smp
testing:
timeout_multiplier: 2
ignore_tags:
- net
- bluetooth

View File

@@ -112,7 +112,6 @@ endfunction(toolchain_ld_link_elf)
# linker options of temporary linkage for code generation
macro(toolchain_ld_baremetal)
zephyr_ld_options(
-Hlld
-Hnosdata
-Xtimer0 # to suppress the warning message
-Hnoxcheck_obj
@@ -123,6 +122,12 @@ macro(toolchain_ld_baremetal)
-Hnocrt
)
if(CONFIG_ARC)
zephyr_ld_options(
-Hlld
)
endif()
# There are two options:
# - We have full MWDT libc support and we link MWDT libc - this is default
# behavior and we don't need to do something for that.

View File

@@ -144,6 +144,7 @@ endif()
include(${COMMON_ZEPHYR_LINKER_DIR}/ram-end.cmake)
zephyr_linker_symbol(SYMBOL __ramfunc_region_start EXPR "(@__ramfunc_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_start EXPR "(@__bss_start@)")
zephyr_linker_symbol(SYMBOL __kernel_ram_end EXPR "(${RAM_ADDR} + ${RAM_SIZE})")
zephyr_linker_symbol(SYMBOL __kernel_ram_size EXPR "(@__kernel_ram_end@ - @__bss_start@)")

View File

@@ -49,6 +49,9 @@ function(zephyr_mcuboot_tasks)
elseif(NOT (CONFIG_BUILD_OUTPUT_BIN OR CONFIG_BUILD_OUTPUT_HEX))
message(FATAL_ERROR "Can't sign images for MCUboot: Neither CONFIG_BUILD_OUTPUT_BIN nor CONFIG_BUILD_OUTPUT_HEX is enabled, so there's nothing to sign.")
endif()
# Add key file as CMake dependency so a file change will rerun the build
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${${file}})
endif()
endforeach()

View File

@@ -50,7 +50,7 @@ endif()
find_package(Deprecated COMPONENTS CROSS_COMPILE)
find_package(Zephyr-sdk 0.16)
find_package(Zephyr-sdk 0.16...<0.17)
# gperf is an optional dependency
find_program(GPERF gperf)

View File

@@ -54,7 +54,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
# To support Zephyr SDK tools (DTC, and other tools) with 3rd party toolchains
# then we keep track of current toolchain variant.
set(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT})
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION}
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE}
REQUIRED QUIET CONFIG HINTS ${ZEPHYR_SDK_INSTALL_DIR}
)
if(DEFINED ZEPHYR_CURRENT_TOOLCHAIN_VARIANT)
@@ -82,10 +82,20 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
list(REMOVE_DUPLICATES Zephyr-sdk_CONSIDERED_VERSIONS)
list(SORT Zephyr-sdk_CONSIDERED_VERSIONS COMPARE NATURAL ORDER DESCENDING)
if("${Zephyr-sdk_FIND_VERSION_RANGE_MAX}" STREQUAL "INCLUDE")
set(upper_bound _EQUAL)
endif()
if(NOT DEFINED Zephyr-sdk_FIND_VERSION_RANGE)
# Range not given, max out to ensure max version is not in effect.
set(Zephyr-sdk_FIND_VERSION_MAX 99999999)
endif()
# Loop over each found Zepher SDK version until one is found that is compatible.
foreach(zephyr_sdk_candidate ${Zephyr-sdk_CONSIDERED_VERSIONS})
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}")
if("${zephyr_sdk_candidate}" VERSION_GREATER_EQUAL "${Zephyr-sdk_FIND_VERSION}"
AND "${zephyr_sdk_candidate}" VERSION_LESS${upper_bound} "${Zephyr-sdk_FIND_VERSION_MAX}"
)
# Find the path for the current version being checked and get the directory
# of the Zephyr SDK so it can be checked.
list(FIND zephyr_sdk_found_versions ${zephyr_sdk_candidate} zephyr_sdk_current_index)
@@ -93,7 +103,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
get_filename_component(zephyr_sdk_current_check_path ${zephyr_sdk_current_check_path} DIRECTORY)
# Then see if this version is compatible.
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} QUIET CONFIG PATHS ${zephyr_sdk_current_check_path} NO_DEFAULT_PATH)
if (${Zephyr-sdk_FOUND})
# A compatible version of the Zephyr SDK has been found which is the highest
@@ -106,7 +116,7 @@ if(("zephyr" STREQUAL ${ZEPHYR_TOOLCHAIN_VARIANT}) OR
if (NOT ${Zephyr-sdk_FOUND})
# This means no compatible Zephyr SDK versions were found, set the version
# back to the minimum version so that it is displayed in the error text.
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
find_package(Zephyr-sdk ${Zephyr-sdk_FIND_VERSION_COMPLETE} REQUIRED CONFIG PATHS ${zephyr_sdk_search_paths})
endif()
endif()

View File

@@ -11,7 +11,7 @@ if (WIN32)
set(ENV{PYTHONIOENCODING} "utf-8")
endif()
set(PYTHON_MINIMUM_REQUIRED 3.8)
set(PYTHON_MINIMUM_REQUIRED 3.10)
find_package(Deprecated COMPONENTS PYTHON_PREFER)

View File

@@ -114,42 +114,92 @@ hr,
}
/* JavaScript documentation directives */
.rst-content dl:not(.docutils) dt {
background-color: var(--admonition-note-background-color) !important;
border-color: var(--admonition-note-title-background-color) !important;
color: var(--admonition-note-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl:not(.field-list) > dt {
background-color: var(--admonition-note-background-color);
border-color: var(--admonition-note-title-background-color);
color: var(--admonition-note-color);
}
.rst-content dl:not(.docutils) dl dt {
background-color: var(--admonition-attention-background-color) !important;
border-color: var(--admonition-attention-title-background-color) !important;
color: var(--admonition-attention-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dl dt {
background-color: transparent;
border-color: transparent;
color: var(--footer-color);
}
.rst-content dt.sig .k {
color: var(--highlight-keyword2-color) !important;
font-style: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute dt {
font-weight: 600;
padding: 0 8px;
margin-bottom: 1px;
width: 100%;
}
.rst-content dt.sig .kt {
color: var(--highlight-keyword-color) !important;
font-style: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method > dt,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).attribute > dt {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
font-size: 90%;
font-weight: normal;
margin-bottom: 16px;
padding: 6px 8px;
}
.rst-content dt.sig .sig-name .n {
color: var(--highlight-function-color) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-prename.descclassname {
color: var(--highlight-type2-color);
font-weight: normal;
}
.rst-content dt.sig .k,
.rst-content dt.sig .kt,
.rst-content dt.sig .n {
font-weight: normal !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-name.descname {
color: var(--highlight-function-color);
font-weight: 700;
}
.rst-content dl:not(.docutils) dt a.headerlink {
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-paren,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
color: var(--highlight-operator-color) !important;
font-weight: normal;
padding: 0 2px;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .optional {
font-style: italic;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > em {
color: var(--code-literal-color);
font-style: normal;
padding: 0 4px;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .k {
font-style: normal;
}
html.writer-html5 .rst-content dl:not(.docutils) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
border-top-color: var(--highlight-background-emph-color);
background: var(--highlight-background-color);
}
html.writer-html5 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt, html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) > dt {
border-left-color: var(--highlight-background-emph-color);
background: var(--highlight-background-color);
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) .sig-param,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).function dt > .optional ~ em,
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).method dt > .optional ~ em {
color: var(--highlight-number-color);
font-style: italic;
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple).class dt > em.property {
color: var(--highlight-keyword-color);
}
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink {
color: var(--link-color) !important;
}
.rst-content dl:not(.docutils) dt a.headerlink:visited {
color: var(--link-color-visited) !important;
html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.glossary):not(.simple) dt a.headerlink:visited {
color: var(--link-color-visited);
}
html.writer-html5 .rst-content dl.field-list > dd strong {
font-family: var(--monospace-font-family);
font-variant-ligatures: none;
}
footer,
@@ -823,6 +873,10 @@ dark-mode-toggle::part(toggleLabel){
font-size: unset;
}
div.graphviz > object {
filter: var(--graphviz-filter);
}
/* Home page grid display */
.grid {
list-style-type: none !important;

View File

@@ -93,4 +93,6 @@
--btn-neutral-background-color: #404040;
--btn-neutral-hover-background-color: #505050;
--footer-color: #aaa;
--graphviz-filter: invert(0.9) brightness(1.2);
}

View File

@@ -91,4 +91,6 @@
--btn-neutral-background-color: #f3f6f6;
--btn-neutral-hover-background-color: #e5ebeb;
--footer-color: #808080;
--graphviz-filter: none;
}

View File

@@ -57,6 +57,7 @@
.getElementById("search-se-settings-icon")
.setAttribute("aria-expanded", visible ? "true" : "false");
};
setSearchEngineSettingsMenuVisibility(false);
window.toggleSearchEngineSettingsMenu = function () {
isVisible = searchMenu.style.display === "block";

View File

@@ -2,7 +2,7 @@
<div class="rst-versions" data-toggle="rst-versions" role="note" aria-label="versions">
<span class="rst-current-version" data-toggle="rst-current-version">
<span class="fa fa-book"> Zephyr Project</span>
v: latest
v: {{ current_version if is_release else "latest" }}
<span class="fa fa-caret-down"></span>
</span>
<div class="rst-other-versions">

View File

@@ -351,6 +351,9 @@ graphviz_dot_args = [
"-Ncolor=gray60",
"-Nfontcolor=gray25",
"-Ecolor=gray60",
"-Gfontname=system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif",
"-Nfontname=system-ui,-apple-system,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif",
"-Efontname=SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace",
]
# -- Options for sphinx_copybutton ----------------------------------------

View File

@@ -363,4 +363,4 @@ in the log.
.. _Eclipse IDE for C/C++ Developers: https://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/oxygen2
.. _GNU MCU Eclipse plug-ins: https://gnu-mcu-eclipse.github.io/plugins/install/
.. _pyOCD v0.11.0: https://github.com/mbedmicro/pyOCD/releases/tag/v0.11.0
.. _pyOCD v0.11.0: https://github.com/pyocd/pyOCD/releases/tag/v0.11.0

View File

@@ -369,12 +369,11 @@ If multiple boards are placed in the same board folder, then the file
Write your devicetree
*********************
The devicetree file :file:`boards/<vendor>/plank/plank.dts` or
:file:`boards/<vendor>/plank/plank_<qualifiers>.dts` describes your board
The devicetree file :file:`boards/<vendor>/plank/plank_<qualifiers>.dts` describes your board
hardware in the Devicetree Source (DTS) format (as usual, change ``plank`` to
your board's name). If you're new to devicetree, see :ref:`devicetree-intro`.
In general, :file:`plank.dts` should look like this:
In general, :file:`plank_<qualifiers>.dts` should look like this:
.. code-block:: devicetree
@@ -424,16 +423,9 @@ In general, :file:`plank.dts` should look like this:
status = "okay";
};
Only one ``.dts`` file will be used, and the most specific file which exists
will be used.
This means that if both :file:`plank.dts` and :file:`plank_soc1_foo.dts` exist,
then when building for ``plank`` / ``plank/soc1``, then :file:`plank.dts` is
used. When building for ``plank//foo`` / ``plank/soc1/foo`` the
:file:`plank_soc1_foo.dts` is used.
This allows board maintainers to write a base devicetree file for the board
or write specific devicetree files for a given board's SoC or variant.
In the case a board has only a single SoC, without any board variants then the dts file can be
named :file:`<plank>.dts` instead, however this is not recommended due to the file silently be
unused if a variant or other SoC is added to the board.
If you're in a hurry, simple hardware can usually be supported by copy/paste
followed by trial and error. If you want to understand details, you will need
@@ -518,7 +510,6 @@ files for a board named ``plank``:
├── Kconfig
├── Kconfig.plank
├── Kconfig.defconfig
├── plank_defconfig
└── plank_<qualifiers>_defconfig
:file:`Kconfig.plank`
@@ -575,23 +566,28 @@ files for a board named ``plank``:
default y
if NETWORKING
config SOC_ETHERNET_DRIVER
default y
endif # NETWORKING
endif # BOARD_PLANK
:file:`plank_defconfig` / :file:`plank_<qualifiers>_defconfig`
:file:`plank_<qualifiers>_defconfig` (or :file:`plank_defconfig` in limited circumstances)
A Kconfig fragment that is merged as-is into the final build directory
:file:`.config` whenever an application is compiled for your board.
If both the common :file:`plank_defconfig` file and one or more board
qualifiers specific :file:`plank_<qualifiers>_defconfig` files exist, then
all matching files will be used.
This allows you to place configuration which is common for all board SoCs,
CPU clusters, and board variants in the base :file:`plank_defconfig` and only
place the adjustments specific for a given SoC or board variant in the
:file:`plank_<qualifiers>_defconfig`.
:file:`plank_defconfig` can only be used with boards that have no qualifiers, no variants and a
single SoC present, though this style of naming is not recommended due to samples/tests or
downstream usage breaking suddenly without warning if a new SoC or board variant/qualifier is
added to an board in upstream Zephyr.
.. note::
Multiple files are not merged and there is no fallback mechanism for files, this means if there
is a board with 2 different SoCs and each one has 2 board variants, a :file:`plank_defconfig`
file would be wholly unused, for the first qualifier and variant
:file:`plank_<soc1>_<variant1>_defconfig` will be used, it will not include other file.
The ``_defconfig`` should contain mandatory settings for your system clock,
console, etc. The results are architecture-specific, but typically look

View File

@@ -905,6 +905,12 @@ Networking
:kconfig:option:`PSA_WANT_ALG_SHA_256` instead of legacy ``CONFIG_MBEDTLS_*``
features. (:github:`71827`)
* The CoAP public API functions :c:func:`coap_get_block1_option` and
:c:func:`coap_get_block2_option` have changed. The ``block_number`` pointer
type has changed from ``uint8_t *`` to ``uint32_t *``. Additionally,
:c:func:`coap_get_block2_option` now accepts an additional ``bool *has_more``
parameter, to store the value of the more flag. (:github:`76052`)
Other Subsystems
****************

View File

@@ -2,6 +2,332 @@
.. _zephyr_3.7:
.. _zephyr_3.7.2:
Zephyr 3.7.2
############
This is an LTS maintenance release with fixes.
Security Vulnerability Related
******************************
The following CVEs are addressed by this release:
* `CVE-2025-27809 <https://www.cve.org/CVERecord?id=CVE-2025-27809>`_
`TLS clients may unwittingly skip server authentication
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-03-1/>`_
* `CVE-2025-27810 <https://www.cve.org/CVERecord?id=CVE-2025-27810>`_
`Potential authentication bypass in TLS handshake
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-03-2/>`_
* `CVE-2025-47917 <https://www.cve.org/CVERecord?id=CVE-2025-47917>`_
`Misleading memory management in mbedtls_x509_string_to_names()
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-7/>`_
* `CVE-2025-48965 <https://www.cve.org/CVERecord?id=CVE-2025-48965>`_
`NULL pointer dereference after using mbedtls_asn1_store_named_data()
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-6/>`_
* `CVE-2025-49087 <https://www.cve.org/CVERecord?id=CVE-2025-49087>`_
`Timing side-channel in block cipher decryption with PKCS#7 padding
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-5/>`_
* `CVE-2025-49600 <https://www.cve.org/CVERecord?id=CVE-2025-49600>`_
`Unchecked return value in LMS verification allows signature bypass
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-3/>`_
* `CVE-2025-49601 <https://www.cve.org/CVERecord?id=CVE-2025-49601>`_
`Out-of-bounds read in mbedtls_lms_import_public_key()
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-4/>`_
* `CVE-2025-52496 <https://www.cve.org/CVERecord?id=CVE-2025-52496>`_
`Race condition in AESNI support detection
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-1/>`_
* `CVE-2025-52497 <https://www.cve.org/CVERecord?id=CVE-2025-52497>`_
`Heap buffer under-read when parsing PEM-encrypted material
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-06-2/>`_
* `CVE-2025-59438 <https://www.cve.org/CVERecord?id=CVE-2025-59438>`_
`Padding oracle through timing of cipher error reporting
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-10-invalid-padding-error/>`_
* `CVE-2025-54764 <https://www.cve.org/CVERecord?id=CVE-2025-54764>`_
`Side channel in RSA key generation and operations (SSBleed, M-Step)
<https://mbed-tls.readthedocs.io/en/latest/security-advisories/mbedtls-security-advisory-2025-10-ssbleed-mstep/>`_
More detailed information can be found in:
https://docs.zephyrproject.org/latest/security/vulnerabilities.html
Issues fixed
************
These GitHub issues were addressed since the previous 3.7.1 tagged release:
* :github:`67637` - Telnet shell asserts if connection is closed
* :github:`72840` - sensor_shell: strange and unexpected output when getting single axis from 3-axis data
* :github:`75119` - Doc: Graphviz fontcolor switched between light and dark themes
* :github:`75121` - Doc: Graphviz figures do not use the same font as the documentation
* :github:`77088` - net: buf: Pre-initialize `user_data` on `net_buf_alloc()`
* :github:`79042` - net: dns: Out of bounds array access in DNS dispatcher
* :github:`79066` - STM32 Ethernet stops receiving under heavy load
* :github:`79805` - Compile error when using networking and SystemView Tracing
* :github:`80574` - Meta-IRQ does not preempt cooperative threads when woken from IRQ (cortex_m)
* :github:`81343` - shell cmd: "devmem load" only works for addresses below 0x80000000
* :github:`81380` - test: twister: hwmap: missing serial_pty definition
* :github:`81454` - drivers: rtc: sam: Missing function rtc_sam_validate_tm
* :github:`81513` - I2C eeprom target does not fully support 16 bit addresses
* :github:`81570` - ESP32 fails on assert when WiFi enabled (3.7.x LTS)
* :github:`81777` - Flash API: `flash_erase` has incorrect userspace handler
* :github:`81781` - posix:fpu: Enabling CONFIG_FPU and CONFIG_FPU_SHARING causes compiler error
* :github:`82139` - Fix DNS parsing errors
* :github:`82370` - modem: the UART exchange between the MCU and the modem is disrupted after rebooting the MCU or modem.
* :github:`82427` - net: lwm2m: Missing mutex unlock in LwM2M Registry
* :github:`82437` - drivers: flash: flash_mcux_flexspi: since adding support for W25Q512JV, FlexSPI with the W25Q128JV no longer works
* :github:`82652` - sockets_service: dns: Sockets service calling closed dispatch socket callback causes fatal
* :github:`82710` - [backport] pm: device_runtime: Fix bitfields misuse
* :github:`82933` - VFS/ext2: Buffer overflow in ext2_inode_read
* :github:`83041` - samples: mgmt: mcumgr: smp_svr: Bluetooth advertising restarted on connection
* :github:`83331` - spi_mcux_ecspi does not handle gpio chipselect correctly
* :github:`83332` - spi_mcux_ecspi does not handle transfers with 32 bits.
* :github:`83354` - log/mpsc_pbuf: logging in spinlock held context can cause recurring exception
* :github:`83399` - auxdisplay: jhd1313: Out-of-bounds read
* :github:`83447` - native_posix entropy driver produces very bad entropy for 64 bit targets
* :github:`83599` - NXP drivers: flash: soc_flash_mcux: CMD_MARGIN_CHECK fails infrequently
* :github:`83625` - vfs/ext2: Incorrectly calculated nbytes_to_read in ext2_inode_read potentially causing data corruption
* :github:`83794` - lis2de12 sensor driver giving 0 values
* :github:`84148` - 3.7: Bluetooth: TBS: TBS client may return NULL instead of the empty string in callbacks
* :github:`84274` - Shell API unsafe to use outside of command handlers
* :github:`84306` - drivers: can: tcan4x5x: Build fails/emits warnings when optional reset-gpios property is not supplied in device tree
* :github:`84384` - RTIO Workqueue - Race condition leads to dead-lock in high-demand applications
* :github:`84438` - Memory leak with socket() + close() when socket offloading is enabled
* :github:`84538` - http_server leak RX buffers when zsock_poll fails in http_server_run
* :github:`84614` - [v3.7-branch] Update MCUboot to include fixes
* :github:`84737` - eth_stm32_hal: Failed to obtain RX buffer - error makes device unreachable
* :github:`84842` - STM32WBA: zephyr/drivers/flash/flash_stm32wba_fm.c: flash_stm32_erase: unexpected erase size
* :github:`84902` - mgmt: mcumgr: grp: img_mgmt: DFU confirmed callback does not check status
* :github:`84952` - logging: log_cmds: backend ID is wrong for backend(s) that do not autostart
* :github:`85211` - dts: atmel sam4s: incorrect sram addresses
* :github:`85301` - Bluetooth: host: missing `NULL` check in `bt_le_create_conn_cancel`
* :github:`85380` - DHCP address disappears when TCP socket is closed.
* :github:`85521` - Issue with User-Defined Payload Transmission Over SMP: Payload Length Calculation and Memory Address Handling
* :github:`85674` - net: ipv6: Neigbor reachablity detection is not compliant with RFC 4861
* :github:`85759` - RTIO Workqueue does not work during Device Initialization (POST_KERNEL)
* :github:`85816` - tests: tests/net/conn_mgr_monitor/net.conn_mgr.dad failed with W5500
* :github:`86116` - soc: NXP: RW61x: SystemCoreClock frequency incorrect
* :github:`86499` - net: Critical Mutex Deadlock
* :github:`86954` - sample.smf.hsm_psicc2 is flaky on SMP platforms
* :github:`87323` - Network buffer leak if sending IPv4 TTL 0 or IPv6 hop limit 0 packets
* :github:`87947` - Check possible recursion when parsing DNS response
* :github:`88047` - __nocache section conflicts with __ramfunc on stm32h750
* :github:`88229` - mbedtls: update to 3.6.3 in 3.7 branch
* :github:`88233` - net: coap_client library asserts on boot
* :github:`88328` - Using I/O pads sourced from VHIF without enabling the eSPI or SHI drivers may lead to issues
* :github:`88506` - stm32: STM32 I2C LL Driver: Stuck in an infinite loop when SDA/SCL is short-circuited
* :github:`88558` - disco_l475_iot1/arduino_r3_connector.dtsi arduino_i2c should be i2c1
* :github:`88694` - mgmt: ec_host_cmd: npcx: add workaround for backend SHI
* :github:`88946` - driver: timer: npcx: fix timer accuracy issue
* :github:`89331` - Many threads locking two mutexes can cause a crash
* :github:`89349` - Flash Map: Bounds checking not immune to integer overflow
* :github:`89413` - Zephyr SPDX does not pass validation
* :github:`89641` - net: dhcp: current DHCP client implementation does not follow RFC2131 and RFC2132
* :github:`89984` - drivers: watchdog: npcx: fix T0 timer reload procedure
* :github:`89990` - STM32: USB: USB CDC IN Endpoint stuck forever after receiving Clear feature - endpoint halt request
* :github:`90103` - http_server: Wildcard resource matching reports incorrect path length
* :github:`90655` - LE-Audio: BAP scan delegator does not send further notifications after add source or modify source are rejected by application layer
* :github:`90688` - coap_resource_parse_observe returns 0 (register) instead of 1 (deregister) upon a deregister of an unknown observer
* :github:`90777` - arch.shared_interrupt.lto.speed compile fail on apollo5 platform
* :github:`90784` - drivers: flash: npcx: add k_usleep when polling busy status
* :github:`90989` - gpio: gpio_adp5585_gpio incorrect gpio gaps handling
* :github:`91360` - [v3.7-branch] Update MCUboot with fixes from 2.2.0 release
* :github:`91799` - Docs version switcher always displays "v: latest"
* :github:`92243` - tls_credentials.h is not found when building ES-Wifi with CONFIG_TLS_CREDENTIALS (v3.7 branch)
* :github:`92413` - Issue with thread suspension in zephyr 3.7.1
* :github:`92557` - ARC: nsim/nsim_vpx5 applications fail to execute on nsimdrv
* :github:`92764` - [ARC][Userspace][v3.7.1] Regression: User threads fail to run with user space enabled (MW toolchain)
* :github:`93790` - drivers: console: posix_arch_console: build warning with `CONFIG_PRINTK=n`
* :github:`94000` - EXT2 fs_stat on mount point fails with a NULL pointer dereference.
* :github:`94925` - mbedtls: update to 3.6.4 in 3.7 branch
* :github:`95297` - Links to the pyOCD repository are outdated
* :github:`95787` - Backport fixes to MCUboot for zephyr v3.7
* :github:`95850` - Applications do not watch MCUboot key file for changes
* :github:`96172` - Backport #95101 (arch: arm: switch to privilege stack in SVC handler)
* :github:`97304` - Backport #96850 (arch: arm: start threads on privileged stack)
Mbed TLS
********
Mbed TLS was updated to version 3.6.5 (from 3.6.2). The release notes can be found at:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.5
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.4
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.3
Mbed TLS 3.6 is an LTS release that will be supported
with security and bug fixes until at least March 2027.
Trusted Firmware-M (TF-M)
*************************
TF-M was updated to version 2.1.2 (from 2.1.1). The release notes can be found at:
https://trustedfirmware-m.readthedocs.io/en/tf-mv2.1.2/releases/2.1.2.html
TF-M 2.1 is an LTS release that will be supported
with security and bug fixes until at least May 2027.
.. _zephyr_3.7.1:
Zephyr 3.7.1
############
This is an LTS maintenance release with fixes.
Issues fixed
************
These GitHub issues were addressed since the previous 3.7.0 tagged release:
* :github:`77088` - net: buf: Pre-initialize user_data on net_buf_alloc()
* :github:`81380` - test: twister: hwmap: missing serial_pty definition
* :github:`81570` - ESP32 fails on assert when WiFi enabled
* :github:`81083` - DA1469x dma driver initialization fails
* :github:`80542` - Hard fault on boot w/ GCC 14 on Cortex-M
* :github:`71896` - xtensa: remove unnecessary padding in arch_mem_domain
* :github:`81372` - arch: riscv: userspace: potential security risk when CONFIG_RISCV_GP=y
* :github:`42227` - Teensy41 support SDHC - Storage init Error
* :github:`66800` - [Coverity CID: 338107] Division or modulo by zero in subsys/shell/backends/shell_uart.c
* :github:`70498` - cellular_modem: Pinnacle 100 does not work with CONFIG_UART_INTERRUPT_DRIVEN
* :github:`71397` - Espressif HAL5.1 - Core panic'ed on EPS32S3 with hello_world sample
* :github:`71916` - Bump minimum Python version (3.10?) ahead of LTSv3 release
* :github:`74291` - Multiple USB contexts for same device lead to bus faults
* :github:`74750` - [Coverity CID: 353644] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
* :github:`74752` - [Coverity CID: 353654] Unintended sign extension in drivers/sensor/ams/tsl2591/tsl2591.c
* :github:`75256` - [Coverity CID: 394233] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
* :github:`75257` - [Coverity CID: 394232] Division or modulo by zero in drivers/sensor/tdk/icm42688/icm42688.h
* :github:`75265` - display: stm32-ltdc: incorrect return value for blanking on/off calls when panel controller is not passed in DT
* :github:`75318` - Zephyr 3.7 RC2 BLE on STM32 Nucleo WB55 does not work
* :github:`75319` - `fatal error: sys/_timespec.h: No such file or directory` with v3.7.0-rc2
* :github:`75427` - `CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT` is misleading as it only enables PEM parsing
* :github:`75676` - tests: dma: chan_blen_transfer: test breakage on Nucleo-H743ZI
* :github:`75686` - ST LIS2DUX12 driver: temperature is not converted to Celsius and raw values are returned
* :github:`75736` - Logging stops on all backend when overloaded for a time
* :github:`75758` - ST LIS2DUX12 driver: will not correctly read values on big-endian HW
* :github:`75834` - xtensa: mpu: adding or removing partitions from memory domain of current running thread has no effect
* :github:`75853` - C++: Boot fails with global STL objects
* :github:`75909` - CONFIG_NET_NATIVE_OFFLOADED_SOCKETS fails after DTLS handshake
* :github:`75912` - RAM retention not working on NXP S32K3
* :github:`75967` - bl5340_dvk LCD does not work
* :github:`76000` - coap: block_number in coap_get_block1_option() is too small
* :github:`76090` - TF-M: builds download source from external git repository
* :github:`76185` - scripts: 'west blobs fetch' does not verify digests after downloading
* :github:`76254` - linker: section_tags: missing include
* :github:`76268` - Bluetooth: PAwR Sync does not compile without PAST receiver compiled in
* :github:`76325` - ESP32S3: Zephyr freezes during OTA Update over UDP and BLE
* :github:`76360` - Crash if enabling v4-mapping-to-v6 and DHCPv4
* :github:`76397` - gdbstub: compilation error on ARM
* :github:`76398` - arch: riscv: stacktrace: user thread stack bound check is wrong
* :github:`76403` - net: wifi: NM type check is incorrect
* :github:`76427` - CONFIG_BT_CTLR_OPTIMIZE_FOR_SPEED not selected by default in zephyr 3.7
* :github:`76446` - drivers: mdio: mdio_nxp_enet: Link goes up and down sporadically
* :github:`76447` - Odroid Go Boot Failure
* :github:`76471` - TCP Delay ACK in case no PSH flag is present causing extremly low download throughput for some clients
* :github:`76519` - Get I3C basic device fails for devices that do not support GETCAP
* :github:`76549` - Bug in STM32 Disco L475 Arduino I2C header
* :github:`76551` - Bluetooth: USB Audio Starvation in BAP Broadcast Sink Sample
* :github:`76603` - sensortile_box_pro board does not support hts221 sensor
* :github:`76607` - Fixes an uninitialized value in lis2dux12
* :github:`76625` - drivers: usb: stm32 udc driver get the global otg interrupt
* :github:`76655` - RT11xx device tree build warnings
* :github:`76717` - Check L2 send properly for offloaded ifaces
* :github:`76718` - PTP - incorrect clock offset calculation
* :github:`76737` - Bluetooth L2CAP TX fragmentation state not cleared upon disconnect
* :github:`76738` - Sending Bluetooth L2CAP messages after reconnecting sometimes leads to crashes due to uninitalized net_buf callback
* :github:`76747` - CONFIG_DEVICE_DT_METADATA=y not tested with usespace enabled
* :github:`76762` - arch: riscv: stacktrace: trace is incomplete when unwinding from function without callee
* :github:`76776` - http1 dynamic post request response doesn't send header a second time
* :github:`76912` - drivers/bluetooth/hci/userchan.c build waring w gcc13
* :github:`76932` - Compilation error on Ubuntu 24.04 when CONFIG_FUSE_FS_ACCESS=y
* :github:`77006` - Bluetooth: Host: ISO buffer not unreffed
* :github:`77007` - Bluetooth: Host: ISO not clearing TX context on disconnect
* :github:`77078` - manifest: update percepio
* :github:`77089` - nxp: lpc55sxx: sram node address error
* :github:`77096` - nxp lpc55xx will crash when trying to use a nxp,ctimer-pwm DTS node
* :github:`77126` - RTC RV3028 clock output disabled by enabling alarm/update callback
* :github:`77129` - NXP's IMX RT1010 triggers assert on SPI Loopback test when EDMA enabled
* :github:`77175` - SCSI Read Capacity reports wrong capacity when used with USB Mass storage device
* :github:`77188` - Unaligned 32-bit reads following casts on dns_socket_dispatcher::local_addr (Cortex-M0)
* :github:`77221` - Websocket compile issue if Posix API is not set
* :github:`77241` - bluetooth: Behavior change in host causing MESH to fail on sending messages
* :github:`77269` - da1469x: entropy and gpio drivers throw assertions
* :github:`77303` - net: socket: recvmsg() doesn't update msg_controllen accordingly
* :github:`77371` - RT11xx bus clocks set incorrectly
* :github:`77396` - doc: Documentation scrolling does not work with arrow keys
* :github:`77424` - IMXRT11xx secondary core improperly deinit the ENET PLL
* :github:`77545` - modules: percepio: Fix python executable name in CMakeLists.txt
* :github:`77557` - drivers: ethernet: nxp_enet: Fused MAC address handling is wrong
* :github:`77594` - Bluetooth: Failures in unit tests
* :github:`77633` - drivers: dai: nxp: sai: RTOS crashes on TX/RX underrun/overrun
* :github:`77658` - backported PRs maintain fail status after issues are added to the PR description
* :github:`77669` - BLE EDTT GATT tests fail with python >= 3.11
* :github:`77784` - STM32 I2S Driver Clock Configuration
* :github:`77824` - llext samples fail with BUS ERROR (zephyr-3.7 stable)
* :github:`77952` - ESP32: Interrupts with ISRs in flash are not disabled during flash operations
* :github:`78138` - riscv: plic: IRQs may not be enabled in non-zero HART
* :github:`78146` - mDNS reponder might fail to serve if mDNS resolver is enabled
* :github:`78244` - arch: riscv: IRQ stacks of secondary cores are not initialized to `0xAA` when `CONFIG_INIT_STACKS=y`
* :github:`78263` - building samples/cpp/hello_world reports "undefined reference to `_impure_ptr` error
* :github:`78268` - LPC55xx USB not working with SPEED_OPTIMIZATIONS=y
* :github:`78490` - net: l2: ieee802154: IEEE-802.15.4 packets dropped when CONFIG_NET_L2_IEEE802154_SECURITY is enabled
* :github:`78494` - subsys: net: socket_tls: Connection vanishes -> Caller blocked forever
* :github:`78495` - net: l2: ieee802154: ctx_lock taken but not given
* :github:`78608` - Bluetooth: classic: avdtp: missing buffer length check
* :github:`78622` - Wrong package for bz2
* :github:`78651` - drivers: PHY Microchip KSZ8081 will block system work queue for 500/1000ms
* :github:`78724` - net: checksum offloading not working for virtual network interfaces used for Virtual LAN (VLAN)
* :github:`78769` - backport: v3.7: dts: arm: st: stm32h5: fix spi 1-3 clocks
* :github:`78927` - doc: mcumgr: Wrong license for mcumgr-client
* :github:`79208` - sysbuild: ExternalZephyrProject_Add() cannot cope with hwmv2 board and revision
* :github:`79288` - driver: clock-control: imx-ccm-rev2: get_rate(FLEXSPI2) returns FLEXSPI1 clock rate
* :github:`79298` - arch: riscv: the `s0` dumped during a fatal error is not correct
* :github:`79301` - arch: irq: multilevel: the value return from `irq_parent_level_3()` is wrong
* :github:`79518` - Temporary Modbus Client "Soft Lock"
* :github:`79576` - Dependencies for `SOC_FLASH_MCUX` are incorrect on LPC55xxx platforms
* :github:`79788` - net: ip: igmp: IGMPv2 does not work when IGMPv3 is enabled
* :github:`79800` - stream_flash: stream_flash_erase_page does not check whether requested offset is in range of stream flash owned area
* :github:`79947` - ESP32 touch_sensor not working
* :github:`80005` - doc: Documentation issue in 'contribute/documentation/guidelines'
* :github:`80134` - up_squared: tests/arch/x86/info/arch.x86.info.userspace [timeout]
* :github:`80200` - CMake: Find package with version ranges are ignored for Zephyr SDK
* :github:`80383` - drivers: flash: spi_nor: values vom DT not correctly used, when `CONFIG_SPI_NOR_SFDP_RUNTIME=y`
* :github:`80429` - Bug in ACD implementation RFC5227
* :github:`80476` - mgmt: mcumgr: stat_mgmt: stat_mgmt_list always send legacy behavior
* :github:`80541` - Incorrect part number LPC55S69 in Konfig.soc
* :github:`80593` - Not possible to write beyond 16MB using flash sample on FRDM_RW612
* :github:`80701` - Changes to cortex_m swap code have major impact on kernel context switching times.
* :github:`80723` - testsuite: coverage: application unable to include `coverage.h`
* :github:`80750` - drivers: can: sam: wrong MRBA configuration
* :github:`80810` - samples: subsys: mgmt: mcumgr: smp_svr: UDP overlay missing random selection
* :github:`80818` - shell: shell_help: terminal offset of subcommands' help text isn't aligned
Mbed TLS
********
Mbed TLS was updated to version 3.6.2 (from 3.6.0). The release notes can be found at:
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.1
* https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-3.6.2
Mbed TLS 3.6 is an LTS release that will be supported
with security and bug fixes until at least March 2027.
MCUboot
*******
MCUboot commit has been updated to ``ea2410697dd0262edec041a0ccb07fdbde7c1aff``.
Trusted Firmware-M
******************
TF-M was updated to version 2.1.1 (from 2.1.0). The release notes can be found at:
* https://trustedfirmware-m.readthedocs.io/en/tf-mv2.1.1/releases/2.1.1.html
TF-M 2.1 is an LTS release synchronized with Mbed TLS 3.6 that
will be supported with security and bug fixes until March 2027.
.. _zephyr_3.7.0:
Zephyr 3.7.0
############

View File

@@ -48,26 +48,26 @@ project.
.. table:: Tools and Libraries for MCUmgr
:align: center
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+---------+
| Name | OS support | Transports | Groups | Type | Language | License |
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+=========+
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPLv3 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | BSD |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
| | | | | | | | | | | | | | | | | (chrome only) | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache |
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+---------+
+--------------------------------------------------------------------------------+-------------------------------------------+--------------------------+--------------------------------------------------+---------------+------------+------------+
| Name | OS support | Transports | Groups | Type | Language | License |
| +---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+ | | |
| | Windows | Linux | mac | Mobile | Embedded | Serial | Bluetooth | UDP | OS | IMG | Stat | Settings | FS | Shell | Zephyr | | | |
+================================================================================+=========+=======+=====+========+==========+========+===========+=====+====+=====+======+==========+====+=======+========+===============+============+============+
| `AuTerm <https://github.com/thedjnK/AuTerm/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Application | C++ (Qt) | GPL-3.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| `mcumgr-client <https://github.com/vouch-opensource/mcumgr-client/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Application | Rust | Apache-2.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| `mcumgr-web <https://github.com/boogie/mcumgr-web/>`_ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Web page | Javascript | MIT |
| | | | | | | | | | | | | | | | | (chrome only) | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| nRF Connect Device Manager: |br| | | | | | | | | | | | | | | | | | | |
| `Android | ✕ | ✕ | ✕ | ✓ | ✕ | ✕ | ✓ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | Library and | Java, | Apache-2.0 |
| <https://github.com/NordicSemiconductor/Android-nRF-Connect-Device-Manager/>`_ | | | | | | | | | | | | | | | | application | Kotlin, | |
| and `iOS | | | | | | | | | | | | | | | | | Swift | |
| <https://github.com/NordicSemiconductor/IOS-nRF-Connect-Device-Manager>`_ | | | | | | | | | | | | | | | | | | |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
| Zephyr MCUmgr client (in-tree) | ✕ | ✓ | ✕ | ✕ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✕ | ✕ | ✕ | ✕ | ✕ | Library | C | Apache-2.0 |
+--------------------------------------------------------------------------------+---------+-------+-----+--------+----------+--------+-----------+-----+----+-----+------+----------+----+-------+--------+---------------+------------+------------+
.. only:: latex

View File

@@ -179,7 +179,7 @@ taking form:
| Content | Size | Description |
+===============+===============+===========================+
| body | no more than | Raw body data fragment |
| | MTU - 3 | |
| | MTU - 5 | |
+---------------+---------------+---------------------------+
| crc16 | 2 bytes | CRC16 of entire packet |
| | | body, preceding length |

View File

@@ -506,6 +506,7 @@ static int adc_sam0_read_async(const struct device *dev,
static const struct adc_driver_api adc_sam0_api = {
.channel_setup = adc_sam0_channel_setup,
.read = adc_sam0_read,
.ref_internal = 1000U, /* Fixed 1.0 V reference */
#ifdef CONFIG_ADC_ASYNC
.read_async = adc_sam0_read_async,
#endif

View File

@@ -205,7 +205,7 @@ static int auxdisplay_jhd1313_backlight_set(const struct device *dev, uint8_t co
const struct auxdisplay_jhd1313_config *config = dev->config;
struct auxdisplay_jhd1313_data *data = dev->data;
if (colour > ARRAY_SIZE(colour_define)) {
if (colour >= ARRAY_SIZE(colour_define)) {
LOG_WRN("Selected colour is too high a value");
return -EINVAL;
}

View File

@@ -63,6 +63,7 @@ config BT_STM32_IPM
depends on DT_HAS_ST_STM32WB_RF_ENABLED
select USE_STM32_HAL_CORTEX
select HAS_STM32LIB
select BT_HCI_SETUP
help
TODO

View File

@@ -565,6 +565,19 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
K_PRIO_COOP(CONFIG_BT_DRIVER_RX_HIGH_PRIO),
0, K_NO_WAIT);
hci->recv = recv;
LOG_DBG("IPM Channel Open Completed");
return 0;
}
static int bt_ipm_setup(const struct device *dev, const struct bt_hci_setup_params *params)
{
ARG_UNUSED(params);
ARG_UNUSED(dev);
int err;
#ifdef CONFIG_BT_HCI_HOST
err = bt_ipm_ble_init();
if (err) {
@@ -572,9 +585,7 @@ static int bt_ipm_open(const struct device *dev, bt_hci_recv_t recv)
}
#endif /* CONFIG_BT_HCI_HOST */
hci->recv = recv;
LOG_DBG("IPM Channel Open Completed");
LOG_DBG("IPM Channel Setup Completed");
return 0;
}
@@ -613,6 +624,7 @@ static const struct bt_hci_driver_api drv = {
.close = bt_ipm_close,
#endif
.send = bt_ipm_send,
.setup = bt_ipm_setup,
};
static int _bt_ipm_init(const struct device *dev)

View File

@@ -181,7 +181,7 @@ static void rx_thread(void *p1, void *p2, void *p3)
LOG_DBG("started");
uint16_t frame_size = 0;
ssize_t frame_size = 0;
while (1) {
static uint8_t frame[512];

View File

@@ -106,7 +106,7 @@ static int can_sam_init(const struct device *dev)
uint32_t mrba = sam_cfg->mram & 0xFFFF0000;
/* keep lower 16bit; update DMA Base Register */
sys_write32(sam_cfg->dma_base, (sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba);
sys_write32((sys_read32(sam_cfg->dma_base) & 0x0000FFFF) | mrba, sam_cfg->dma_base);
ret = can_mcan_configure_mram(dev, mrba, sam_cfg->mram);
if (ret != 0) {

View File

@@ -508,8 +508,10 @@ static int tcan4x5x_wake(const struct device *dev)
static int tcan4x5x_reset(const struct device *dev)
{
#if TCAN4X5X_RST_GPIO_SUPPORT
const struct can_mcan_config *mcan_config = dev->config;
const struct tcan4x5x_config *tcan_config = mcan_config->custom;
#endif /* TCAN4X5X_RST_GPIO_SUPPORT */
int err;
err = tcan4x5x_wake(dev);

View File

@@ -155,10 +155,8 @@ static int mcux_ccm_get_subsys_rate(const struct device *dev,
#ifdef CONFIG_MEMC_MCUX_FLEXSPI
case IMX_CCM_FLEXSPI_CLK:
clock_root = kCLOCK_Root_Flexspi1;
break;
case IMX_CCM_FLEXSPI2_CLK:
clock_root = kCLOCK_Root_Flexspi2;
clock_root = kCLOCK_Root_Flexspi1 + instance;
break;
#endif
#ifdef CONFIG_COUNTER_NXP_PIT

View File

@@ -12,6 +12,7 @@
static char stdout_buff[_STDOUT_BUF_SIZE];
static int n_pend; /* Number of pending characters in buffer */
#if defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE)
static int print_char(int c)
{
int printnow = 0;
@@ -34,6 +35,7 @@ static int print_char(int c)
}
return c;
}
#endif /* defined(CONFIG_PRINTK) || defined(CONFIG_STDOUT_CONSOLE) */
/**
* Ensure that whatever was written thru printk is displayed now

View File

@@ -68,7 +68,9 @@ static void counter_smartbond_pm_policy_state_lock_get(const struct device *dev)
static void counter_smartbond_pm_policy_state_lock_put(const struct device *dev)
{
pm_device_runtime_put(dev);
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
if (pm_policy_state_lock_is_active(PM_STATE_STANDBY, PM_ALL_SUBSTATES)) {
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
}
}
/*

View File

@@ -95,20 +95,14 @@ void sai_isr(const void *parameter)
/* check for TX FIFO error */
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag)) {
LOG_ERR("FIFO underrun detected");
/* TODO: this will crash the program and should be addressed as
* mentioned in TODO list's 2).
*/
z_irq_spurious(NULL);
LOG_WRN("FIFO underrun detected");
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_TX, data->regmap, kSAI_FIFOErrorFlag);
}
/* check for RX FIFO error */
if (SAI_TX_RX_STATUS_IS_SET(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag)) {
LOG_ERR("FIFO overrun detected");
/* TODO: this will crash the program and should be addressed as
* mentioned in TODO list's 2).
*/
z_irq_spurious(NULL);
LOG_WRN("FIFO overrun detected");
SAI_TX_RX_STATUS_CLEAR(DAI_DIR_RX, data->regmap, kSAI_FIFOErrorFlag);
}
}

View File

@@ -210,6 +210,11 @@ LOG_MODULE_REGISTER(nxp_dai_sai);
((dir) == DAI_DIR_RX ? ((UINT_TO_I2S(regmap))->RCSR & (which)) : \
((UINT_TO_I2S(regmap))->TCSR & (which)))
/* used to clear status flags */
#define SAI_TX_RX_STATUS_CLEAR(dir, regmap, which) \
((dir) == DAI_DIR_RX ? SAI_RxClearStatusFlags(UINT_TO_I2S(regmap), which) \
: SAI_TxClearStatusFlags(UINT_TO_I2S(regmap), which))
/* used to retrieve the SYNC direction. Use this macro when you know for sure
* you have 1 SYNC direction with 1 ASYNC direction.
*/

View File

@@ -252,8 +252,10 @@ static int stm32_ltdc_display_blanking_off(const struct device *dev)
const struct display_stm32_ltdc_config *config = dev->config;
const struct device *display_dev = config->display_controller;
/* Panel controller's phandle is not passed to LTDC in devicetree */
if (display_dev == NULL) {
return 0;
LOG_ERR("There is no panel controller to forward blanking_off call to");
return -ENOSYS;
}
if (!device_is_ready(display_dev)) {
@@ -269,8 +271,10 @@ static int stm32_ltdc_display_blanking_on(const struct device *dev)
const struct display_stm32_ltdc_config *config = dev->config;
const struct device *display_dev = config->display_controller;
/* Panel controller's phandle is not passed to LTDC in devicetree */
if (display_dev == NULL) {
return 0;
LOG_ERR("There is no panel controller to forward blanking_on call to");
return -ENOSYS;
}
if (!device_is_ready(config->display_controller)) {

View File

@@ -188,7 +188,9 @@ static inline void dma_smartbond_pm_policy_state_lock_get(void)
static inline void dma_smartbond_pm_policy_state_lock_put(void)
{
#if defined(CONFIG_PM_DEVICE)
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
if (pm_policy_state_lock_is_active(PM_STATE_STANDBY, PM_ALL_SUBSTATES)) {
pm_policy_state_lock_put(PM_STATE_STANDBY, PM_ALL_SUBSTATES);
}
#endif
}

View File

@@ -93,6 +93,7 @@ static void trng_enable(bool enable)
} else {
CRG_TOP->CLK_AMBA_REG &= ~CRG_TOP_CLK_AMBA_REG_TRNG_CLK_ENABLE_Msk;
TRNG->TRNG_CTRL_REG = 0;
NVIC_ClearPendingIRQ(IRQN);
entropy_smartbond_pm_policy_state_lock_put();
}

View File

@@ -41,7 +41,10 @@ static int entropy_native_posix_get_entropy(const struct device *dev,
*/
long value = nsi_host_random();
size_t to_copy = MIN(length, sizeof(long int));
/* The host random() provides a number between 0 and 2**31-1. Bit 32 is always 0.
* So let's just use the lower 3 bytes discarding the upper 7 bits
*/
size_t to_copy = MIN(length, 3);
memcpy(buffer, &value, to_copy);
buffer += to_copy;

View File

@@ -19,9 +19,9 @@
#define ESPI_XEC_VWIRE_ACK_DELAY 10ul
/* Maximum timeout to transmit a virtual wire packet.
* 10 ms expressed in multiples of 100us
* 1 ms expressed in multiples of 1us
*/
#define ESPI_XEC_VWIRE_SEND_TIMEOUT 100ul
#define ESPI_XEC_VWIRE_SEND_TIMEOUT 1000ul
#define VW_MAX_GIRQS 2ul
@@ -461,10 +461,15 @@ static int espi_xec_send_vwire(const struct device *dev,
/* Ensure eSPI virtual wire packet is transmitted
* There is no interrupt, so need to poll register
*/
uint8_t rd_cnt = ESPI_XEC_VWIRE_SEND_TIMEOUT;
uint16_t rd_cnt = ESPI_XEC_VWIRE_SEND_TIMEOUT;
while (reg->SRC_CHG && rd_cnt--) {
k_busy_wait(100);
k_busy_wait(1);
}
if (rd_cnt == 0) {
LOG_ERR("VW %d send timeout", signal);
return -ETIMEDOUT;
}
}

View File

@@ -25,9 +25,9 @@
#define ESPI_XEC_VWIRE_ACK_DELAY 10ul
/* Maximum timeout to transmit a virtual wire packet.
* 10 ms expressed in multiples of 100us
* 1 ms expressed in multiples of 1us
*/
#define ESPI_XEC_VWIRE_SEND_TIMEOUT 100ul
#define ESPI_XEC_VWIRE_SEND_TIMEOUT 1000ul
#define VW_MAX_GIRQS 2ul
@@ -325,10 +325,15 @@ static int espi_xec_send_vwire(const struct device *dev,
/* Ensure eSPI virtual wire packet is transmitted
* There is no interrupt, so need to poll register
*/
uint8_t rd_cnt = ESPI_XEC_VWIRE_SEND_TIMEOUT;
uint16_t rd_cnt = ESPI_XEC_VWIRE_SEND_TIMEOUT;
while (sys_read8(regaddr + SMVW_BI_SRC_CHG) && rd_cnt--) {
k_busy_wait(100);
k_busy_wait(1);
}
if (rd_cnt == 0) {
LOG_ERR("VW %d send timeout", signal);
return -ETIMEDOUT;
}
}

View File

@@ -1329,11 +1329,6 @@ static int espi_npcx_init(const struct device *dev)
const struct device *const clk_dev = DEVICE_DT_GET(NPCX_CLK_CTRL_NODE);
int i, ret;
/* If booter doesn't set the host interface type */
if (!NPCX_BOOTER_IS_HIF_TYPE_SET()) {
npcx_host_interface_sel(NPCX_HIF_TYPE_ESPI_SHI);
}
if (!device_is_ready(clk_dev)) {
LOG_ERR("clock control device not ready");
return -ENODEV;

View File

@@ -199,12 +199,12 @@ struct host_sub_npcx_data host_sub_data;
#define EC_CFG_LDN_HCMD 0x12 /* PM Channel 2 */
/* Index of EC (4E/4F) Configuration Register */
#define EC_CFG_IDX_LDN 0x07
#define EC_CFG_IDX_CTRL 0x30
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x60
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x61
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x62
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x63
#define EC_CFG_IDX_LDN 0x07
#define EC_CFG_IDX_CTRL 0x30
#define EC_CFG_IDX_DATA_IO_ADDR_H 0x60
#define EC_CFG_IDX_DATA_IO_ADDR_L 0x61
#define EC_CFG_IDX_CMD_IO_ADDR_H 0x62
#define EC_CFG_IDX_CMD_IO_ADDR_L 0x63
/* LDN Activation Enable */
#define EC_CFG_IDX_CTRL_LDN_ENABLE 0x01
@@ -1029,15 +1029,15 @@ void npcx_host_init_subs_host_domain(void)
host_c2h_write_io_cfg_reg(EC_CFG_IDX_LDN, EC_CFG_LDN_HCMD);
#if defined(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM)
/* Configure IO address of CMD portt (default: 0x200) */
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM >> 8) & 0xff);
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM & 0xff);
/* Configure IO address of Data portt (default: 0x204) */
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_H,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_H,
((CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) >> 8)
& 0xff);
host_c2h_write_io_cfg_reg(EC_CFG_IDX_DATA_IO_ADDR_L,
host_c2h_write_io_cfg_reg(EC_CFG_IDX_CMD_IO_ADDR_L,
(CONFIG_ESPI_PERIPHERAL_HOST_CMD_DATA_PORT_NUM + 4) & 0xff);
#endif
/* Enable 'Host Command' io port (PM Channel 2) */

View File

@@ -224,15 +224,16 @@ static int eth_nxp_enet_tx(const struct device *dev, struct net_pkt *pkt)
ret = ENET_SendFrame(data->base, &data->enet_handle, data->tx_frame_buf,
total_len, RING_ID, frame_is_timestamped, pkt);
if (ret == kStatus_Success) {
if (ret != kStatus_Success) {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
ret = -EIO;
goto exit;
}
if (frame_is_timestamped) {
eth_wait_for_ptp_ts(dev, pkt);
} else {
LOG_ERR("ENET_SendFrame error: %d", ret);
ENET_ReclaimTxDescriptor(data->base, &data->enet_handle, RING_ID);
}
exit:
@@ -634,20 +635,25 @@ static inline void nxp_enet_fused_mac(uint8_t *mac_addr)
#ifdef CONFIG_SOC_FAMILY_NXP_IMXRT
uint32_t mac_addr_fuse[2] = {0};
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
#if defined(CONFIG_SOC_SERIES_IMXRT10XX)
0x620,
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, CLOCK_GetIpgFreq());
/* OTP bank 4, word 2: MAC0 */
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x22, &mac_addr_fuse[0], 1);
/* OTP bank 4, word 3: MAC1*/
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x23, &mac_addr_fuse[1], 1);
#elif defined(CONFIG_SOC_SERIES_IMXRT11XX)
0xA90,
OCOTP_Init((OCOTP_Type *)OCOTP_BASE, 0);
OCOTP_ReadFuseShadowRegisterExt((OCOTP_Type *)OCOTP_BASE,
0x28, &mac_addr_fuse[0], 2);
#endif
mac_addr_fuse, 2);
mac_addr[0] = mac_addr_fuse[0] & 0x000000FF;
mac_addr[1] = mac_addr_fuse[0] & 0x0000FF00;
mac_addr[2] = mac_addr_fuse[0] & 0x00FF0000;
mac_addr[3] = mac_addr_fuse[0] & 0xFF000000;
mac_addr[4] = mac_addr_fuse[1] & 0x00FF;
mac_addr[5] = mac_addr_fuse[1] & 0xFF00;
mac_addr[1] = (mac_addr_fuse[0] & 0x0000FF00) >> 8;
mac_addr[2] = (mac_addr_fuse[0] & 0x00FF0000) >> 16;
mac_addr[3] = (mac_addr_fuse[0] & 0xFF000000) >> 24;
mac_addr[4] = (mac_addr_fuse[1] & 0x00FF);
mac_addr[5] = (mac_addr_fuse[1] & 0xFF00) >> 8;
#else
ARG_UNUSED(mac_addr);
#endif

Some files were not shown because too many files have changed in this diff Show More