Commit graph

533 commits

Author SHA1 Message Date
Jordan Yates
cc53c73263 mgmt: mcumgr: img_mgmt: typo fix
Fix `Faled` -> `Failed`.

Signed-off-by: Jordan Yates <jordan@embeint.com>
2026-03-10 12:39:23 +01:00
Martin Stumpf
2ef7ee567e mcumgr: Fix 'stat' group error codes
Error codes of group 'stat' were incorrectly labeled as group 'zbasic'.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2026-03-03 18:00:54 +01:00
Jamie McCrae
861079f1fe storage: flash_map: Fix macros for offset/address
Fixes macros that broke after changes were merged which started
using the unit address of partition nodes. This also fixes the
test to ensure devices not starting at 0x0 are properly checked
which previously would silently be unknown

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-02-04 13:51:57 +01:00
Jamie McCrae
bcc5529eae mgmt: mcumgr: transport: Add raw dummy transport
Adds a raw dummy UART transport which can be used for testing
MCUmgr without a real transport

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-27 10:23:45 -06:00
Jamie McCrae
d5df08a1cc mgmt: mcumgr: transport: uart: Add support for non-console raw mode
Adds support for using MCUmgr over UART (not via shell) in a raw
mode which does not include base64 and other SMP over console
encoding

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-27 10:23:45 -06:00
Gaetan Perrot
654dfddc7d mgmt: mcumgr: transport: smp_bt: reduce ret variable scope
The return value variable was initialized but immediately
overwritten before.

Remove the redundant initialization and limit the variable scope to
where it is actually used.

No functional change.

Signed-off-by: Gaetan Perrot <gaetan.perrot@spacecubics.com>
2026-01-25 17:07:05 +01:00
Ibrahim Abdalkader
0c5e7a6a95 sensing: sensor_mgmt: Use kernel heap for allocations
Use the kernel heap instead of the libc heap, improving
security and consistency.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-01-22 08:38:34 +00:00
Ibrahim Abdalkader
afa47a2765 mgmt: mcumgr: grp: Use kernel heap for allocations
Use the kernel heap instead of the libc heap, improving
security and consistency.

Signed-off-by: Ibrahim Abdalkader <i.abdalkader@gmail.com>
2026-01-22 08:38:34 +00:00
Jamie McCrae
917404f5d7 mgmt: mcumgr: transport: uart: Change Kconfig to depends on
Changes CONFIG_MCUMGR_TRANSPORT_UART from selecting
CONFIG_UART_MCUMGR to instead of depending upon it, as it should
never have selected a driver Kconfig and instead always depended
upon it, and is needed for supporting different UART transports

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-21 11:21:46 +00:00
Jamie McCrae
e3371aaf24 mgmt: mcumgr: Add name to CMake libraries
Adds names to these libraries to prevent using auto-generated
names of the paths, which can be longer than the maximum supported
length on the current version of gcc for windows

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 15:31:50 +00:00
Jamie McCrae
42ee9832b4 mgmt: mcumgr: kconfig: Fix various issues
Fixes various issues in the Kconfigs including not properly having
abbreviations in the correct case, line lengths, duplicating other
Kconfigs, etc.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2026-01-20 15:31:50 +00:00
Samuel Kleiser
0fbbba2dc0 mcumgr: fs_mgmt: forward return values from fs_close
A new error code FS_MGMT_ERR_FILE_CLOSE_FAILED is returned when
closing a file fails. This is done on write or close operations - read
operations remain unchecked.

Signed-off-by: Samuel Kleiser <s.kleiser@vega.com>
2026-01-14 09:18:10 -06:00
Jaagup Averin
f430cdef60 subsys/mgmt: Declare PROCESSOR_NAME for native_sim
In case of native build, the CONFIG_architecture
cannot currently be resolved with Kconfig, so we
must fall back to resolving it during compilation
using compiler definitions.

Signed-off-by: Jaagup Averin <jaagup.averin@gmail.com>
2026-01-01 21:27:23 +01:00
Alberto Escolar Piedras
fe1607844c mgmt: mcumgr: Fix remaining net API use
In d45cd6716b the mayority of the
Zephyr codebased was changed to use the Zephyr native net_ prefixed
types, but some were forgotten.
Without this fix/change the code still builds as we are by now setting
CONFIG_NET_NAMESPACE_COMPAT_MODE. But when this is not set, things
fail to build.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2025-12-18 18:52:06 +00:00
Sylvio Alves
f8d2e00a0e includes: remove duplicated entries in zephyr-tree
Remove duplicated #include directives within the same
preprocessor scope across the Zephyr tree.

Duplicates inside different #ifdef branches are preserved
as they may be intentional.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2025-12-17 13:57:38 -05:00
Tomasz Chyrowicz
26128ab73d mcumgr: Prevent FW loader from self-destruction
The FW loader reports and manages exactly two slots:
 - slot 0: this is the slot for the application code to update
 - slot 1: this is the slot, in which the FW loader is placed

The slot 1 is reported, so tools can fetch metadata about the
FW loader installed on the device.
Unfortunately, currently SMP-based FW loader allows to issue slot erase
command for the slot 1, effectively erasing the FW loader code that is
being executed.

This change correctly identifies the slot 1 as an active one, marking it
as used and blocking erase operation on that slot.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-12-11 16:34:55 -05:00
Martin Stumpf
ffb046b797 MCUmgr: OS: fix set datetime millisecond handling
According to the docs the millis were in the format `.SSSSSS`. In
reality though, it only accepted exactly `.SSS`, not `.SS` or `.SSSS`
and specifically also not `.SSSSSS`, contrary to the docs. Further, it did
not fail with an error message but simply produced the wrong value.

With this change it accepts everything from `.` to `.SSSSSS` and
produces the correct result. This is compatible with the previous
behavior, with the documentation and with everything in between.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-12-11 16:59:35 +01:00
Tomasz Chyrowicz
764f0d183b img_mgmt: Use absolute address in active partition
Use absolute addresses while determining a running application
partition.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-12-09 09:51:07 -05:00
Ayush Singh
4f98eede4b mcumgr: client: Allow specifying server address
- Currently, it is not possible to use mcumgr client with smp server
  since there is no way to specify smp server address for requests.
- This patch series adds support for creating smp_client_object
  containing information regarding the host server. This design allows
  multiple smp_client_object to exist for the same underlying smp_udp
  transport, making it much easier to use the same udp socket for multiple
  OTAs.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-12-08 11:41:30 -05:00
Jamie McCrae
ae2b4a44dc mgmt: mcumgr: grp: img_mgmt: Fix detecting where a slot resides
Fixes an issue introduced in commit
32615695ad which wrongly did not
check what the residing device was on before determining if a
slot was part of a partition area

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-25 16:06:23 +00:00
Jamie McCrae
1995b669a1 mgmt: mcumgr: grp: settings_mgmt: Allow saving single setting
Adds functionality that allows saving a single setting to NVM using
the newly added function in the settings subsystem. This also
replaces calling the subtree save function if it the underlying
Kconfig is enabled to reduce code paths in settings mgmt

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-19 15:56:49 -05:00
Jamie McCrae
d9c2bdf51a mgmt: mcumgr: grp: os_mgmt: Add memory pool statistics command support
Adds support for the memory pool statistics (mpstat) command, which
will list details on various memory heaps on the device

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-11-19 06:54:40 -05:00
Jamie McCrae
2f42addef7 mgmt: mcumgr: grp: img_mgmt: Use common reset function
Replaces the img_mgmt specific function with the common SMP
function for resetting the zcbor buffer and allowing a new response
to be sent

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-11-19 06:54:40 -05:00
Jamie McCrae
89b01d5c93 mgmt: mcumgr: transport: Add zcbor buffer reset function
Adds a common zcbor reset buffer function, this allows for the
buffer to be reset after data has been added already to add a
different response, e.g. an error response

Signed-off-by: Jamie McCrae <spam@helper3000.net>
2025-11-19 06:54:40 -05:00
Nicolas Pitre
051623c808 boards: arm: fvp: Add Cortex-A320 board variant support
Add Cortex-A320 support to the unified FVP board structure with ARMv9.2-A
specific configuration parameters.

New board target:
- fvp_base_revc_2xaem/a320

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-18 17:49:40 -05:00
Nicolas Pitre
2aef4fbe5b arch: arm64: Add ARMv9-A architecture and Cortex-A510 CPU support
Add ARMv9-A architecture support with Cortex-A510 CPU as the default
processor for generic ARMv9-A targets.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2025-11-18 17:49:40 -05:00
Jamie McCrae
2e54630612 mgmt: mcumgr: grp: img_mgmt: Add support for up to 8 images
Adds slot/image information for using up to 8 images on a device

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-11-18 10:46:40 -05:00
Jukka Rissanen
d45cd6716b net: Convert network codebase to use renamed network APIs
Rename network symbols in network stack to use the renamed network APIs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
2025-11-17 14:01:32 -05:00
Tomasz Chyrowicz
6a4af2486d mcumgr: img_mgmt: Fix minor issues
Fix a few typos inside img_mgmt.c file.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-11-07 19:22:29 +02:00
Stuart Alldritt
8af379516d mgmt: mcumgr: grp: img_mgmt: increment data_off after reading the SHA
Fix a bug where the image's SHA would be interpreted as TLV headers due
to missing a data_off increment.

Signed-off-by: Stuart Alldritt <s.k.alldritt@gmail.com>
2025-11-03 16:59:50 +02:00
Tomasz Chyrowicz
1b50f08ee9 mgmt: Handle slot version equality
If slots have equal version, but a secondary slot is the active one, the
next boot will switch to the primary slot.
Expose this through SMP commands by marking the primary slot as pending.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-31 22:41:16 +02:00
Jamie McCrae
20be667f16 mgmt: mcumgr: grp: settings_mgmt: Part revert settings save change
Partially reverts commit 7d2fb6c013,
it was originally thought that this commit added a method of saving
one specific key using the value that the device already has set,
but has been found to actually save the value that the user has
provided, bypassing the current value that the device has, which is
not compliant with the settings mgmt protocol, therefore remove
this change and it will need to be reworked in future to function
properly by saving one specific value from the device's current
configuration, not a user-specified value

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-29 20:18:20 +02:00
Anas Nashif
303af992e5 style: fix 'if (' usage in cmake files
Replace with 'if(' and 'else(' per the cmake style guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2025-10-29 11:44:13 +02:00
Valerio Setti
f779adf8e0 mgmt: mcumgr: remove usage of legacy Mbed TLS crypto for hash
The long-term goal of Zephyr is to rely exclusively on PSA Crypto API for
crypto support. At the same time Mbed TLS is going to remove legacy crypto
support starting from the next relase (v4.0).

Therefore this commit removes usage of legacy Mbed TLS crypto in favor
of PSA Crypto API. Mbed TLS will still be used in case of a build where
TF-M is not enabled.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
2025-10-22 15:58:51 +03:00
Jamie McCrae
a44efd9a95 mgmt: mcumgr: transport: udp: Add support for DTLS
Adds support for using DTLS for the transport

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-17 18:28:08 +09:00
Jamie McCrae
1c756cbef5 mgmt: mcumgr: transport: udp: Increase default stack size to 1KiB
Fixes an issue in a board using ethernet that faults with the
default 512 byte size by doubling the default to 1KiB. The actual
size of the thread depends upon the device and application
configuration so needs to be fine tined for each application
anyhow

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-15 15:36:53 +03:00
Rami Saad
7d2fb6c013 mgmt: mcumgr: grp: settings_mgmt: Add capability to save setting by key
Extend the save command to allow passing name/val pair to save a
subtree or individual setting to persistent storage.
Resolves zephyrproject-rtos#90407

Co-authored-by: Jamie <40387179+nordicjm@users.noreply.github.com>
Signed-off-by: Rami Saad <rami.saad@morgansolar.com>
2025-10-13 09:35:23 -04:00
Tomasz Chyrowicz
32615695ad dfu: Allow to use imgtool-based headers
It is possible to add MCUboot header through --pad-header option.
In such cases, the FLASH_LOAD_OFFSET does not point to the beginning of
the slot, but to the beginning of the executable area, thus the check
for the active slot should use ranges instead of exact values.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-10-10 12:57:45 -04:00
Jamie McCrae
b2884ffb20 mgmt: mcumgr: grp: os_mgmt: Use board target for hardware platform
Uses the full hwmv2 board target for the hardware platform output,
seemingly this was missed in the hwmv2 migration and it was using
the board name only. Adds a deprecated Kconfig to restore to the
previous behaviour

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-10-07 14:06:06 +02:00
Tomasz Chyrowicz
cbcf81e3a4 mcumgr: Enable permanent updates in overwrite mode
It is essential for the overwrite mode to allow confirming the secondary
slot to provide the permanent update.
This types of updates is the only mode in which the application may be
upgraded.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-30 15:29:33 +03:00
Tomasz Chyrowicz
2e0d9ed2cf mgmt: Add missing CONFIG_ prefixes
Fix the incorrect usage of Kconfig symbols and revert back the default
behavior to allow for non-active slot confirmation.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-30 15:29:33 +03:00
Tomasz Chyrowicz
c1baf2f763 mgmt: Allow to block confirming non-acive slots
In Direct XIP with revert, it should be possible to block confirmation
of the non-active slot, so only a bootable binaries are marked as valid.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2025-09-22 13:27:27 -04:00
Jeppe Odgaard
6e7268d21b mgmt/mcumgr: add missing designator to ZCBOR_MAP_DECODE_KEY_DECODER
Add missing `.key` designator.

This also fixes a compile error:
> error: either all initializer clauses should be designated or none of
them should be

Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
2025-09-19 08:37:19 -04:00
Andrea Ronco
4b451307dc doc: mgmt: mcumgr: fix typo in fs_mgmt Kconfig
Fixing a typo in FS managment Kconfig docstring

Signed-off-by: Andrea Ronco <aronco@ethz.ch>
2025-09-11 18:08:20 +01:00
Appana Durga Kedareswara rao
7542107048 arm64: Add new CPU_CORTEX_A78 configuration for Cortex-A78 support
Introduce a new Kconfig option CPU_CORTEX_A78 to enable support for the
Arm Cortex-A78 CPU architecture within Zephyr. This configuration can be
selected by boards or SoCs that utilize the Cortex-A78 core, enabling
architecture-specific features and optimizations as needed.

Signed-off-by: Appana Durga Kedareswara rao <appana.durga.kedareswara.rao@amd.com>
2025-09-05 16:48:38 -04:00
Jamie McCrae
d12c6888e3 mgmt: mcumgr: grp: img_mgmt: Add support for SHA512 in images
Adds support for images signed with SHA512.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-09-04 14:43:26 +02:00
Jamie McCrae
c58ae17389 mgmt: mcumgr: grp: img_mgmt: Show firmware loader slot info
Allows returning image information for the firmware loader image
slot, showing version of the application and flags

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2025-08-11 13:18:20 -05:00
Jisheng Zhang
13bdae0ad0 arch: arm: Add initial support for Cortex-M52 Core
Add initial support for the Cortex-M52 Core which is an implementation
of the Armv8.1-M mainline architecture.

The support is based on the Cortex-M55 support that already exists in
Zephyr.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
2025-08-06 12:15:23 +03:00
Daniel DeGrasse
188d78b109 mgmt: update img_mgmt_slot_in_use for ramload with revert mode
We should not block erasing pending images when using ramload with
revert mode, because uploading multiple confirmed images with the same
version would brick the device (preventing future FW updates). Update
the dependencies of img_mgmt_slot_in_use to account for this.

Signed-off-by: Daniel DeGrasse <ddegrasse@tenstorrent.com>
2025-08-05 11:53:58 +01:00
Robert Lubos
62a5260e01 net: Fix alignment error with net_ipaddr_copy()
As struct sockaddr have now alignment of 4 bytes, net_ipaddr_copy()
gives the following error if used for sockaddr:

  error: alignment 1 of ‘struct <anonymous>’ is less than 4
  [-Werror=packed-not-aligned]

Just use memcpy() instead, net_ipaddr_copy() was intended to use with IP
addresses, not socket related structs.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2025-07-04 13:16:32 -05:00