This commit fixes following issue:
One of parameters in comparison using fih_eq() was not of fih_int
type which caused build error when medium or higher FIH mode is enabled.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit adds a utility class that is available when building an application booted by mcuboot with MCUBOOT_DATA_SHARING enabled.
This utility class, `DataShare`, allows the application to iterate through the shared memory region and get each entry stored there.
Signed-off-by: George Beckstein <george.beckstein@gmail.com>
This patch make possible MCUBOOT_BOOTUTIL to integrate the
hook file on their own. This is intended to support hook while
the library is just part of the application.
The hooks file for the MCUboot build is now included in the same manner.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Change enables multi-image DFU in Thingy:53 configuration.
The network core cannot access external flash directly. The flash
simulator must be used to provide a memory region that is used to
forward the new firmware to the network core.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
The dependency, in Kconfig, blocked usage of the ENABLE_MGMT_PERUSER
with other BOOT_SERIAL_ device options.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Change introduces default configuration of MCUboot for Thingy:53
secure cpuapp. The default configuration also disables image
revert on application core.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
Move CDC ACM UART node from common DTC overlay to
specific overlays, nrf52840_big.overlays and
usb_cdc_acm.overlays.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Adapt to Zephyr OS changes to get CDC ACM UART device.
Remove RECOVERY_UART_DEV_NAME Kconfig option and
use DEVICE_DT_GET() in serial_adapter.c
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Example (very basic) hook implementation.
Added case description for test-build with these hooks
and multi-image feature.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Introduced boot_img_install_stat_hook() hook fuinction for fetch
the image's slot installation status.
The image's slot installation status is custom property.
It's detailed definition depends on user implementation. It is only
defined that the status will be set to 0 if this hook not provides
another value.
Inserted available hook for read image header as well.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added hook for: read image header, validate the image and hook
which is called after image was uploaded completely.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added hook which allows to override boot_read_swap_state_by_id()
routine for the primary slot.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added hook for read image header.
Added hook which is for inject an image check implementation which can
be used instead of boot_image_check() internal implementation on a primary
slot.
This is usefully especially when primary has to be checked by other entity
on MCUboot's demand.
Added hook which allow to implement image update process
differently.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
If user generate project and the will try to switch signature type
then it is very likely that MBETLS will be enabled simultaneously when
tinycrypt has to be force-selected, which causes kconfig warning on
impossible configuration. Such configuration won't be possible to be
fixed using menuconfig etc.
This patch moves dependency check on !MBEDTLS from kconfig to preprocessor
which makes manual fixing using menuconfig possible.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit adds an include clause to "boot_record.h" to include the stddef.h header that contains the declaration of the "size_t" type.
Attempting to include "boot_record.h" in a build for Mbed-OS would throw an error complaining "size_t" was unknown, adding a note to inculde "stddef.h"
Signed-off-by: George Beckstein <george.beckstein@gmail.com>
So in PR #1089 I misaligned the `#else` used for the `irq_lock` as it
should be aligned with `CONFIG_MCUBOOT_CLEANUP_ARM_CORE`. So that
`irq_lock`is called when we don't call `__disable_irq` from arm core
clean up code.
Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
USB device support configuration is revised,
CONFIG_USB option is deprecated.
Only USB_DEVICE_STACK option should be used to
enable USB device support.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Change fixes encoding data length and adds support for big endian
byte ordering. According to specification, data length can be
encoded either on 1, 2, 4 or 8 bytes.
Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
The commit modifies CMakeLists.txt to include the file into compilation
only when CONFIG_ENABLE_MGMT_PERUSER is selected.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit adds Kconfig option that enables the storage erase mgmt
command.
Addition of the Kconfig option fixes the problem where Zephyr spcyfic
mgmt commands support fails to compile when board does not define
a storage partition.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
`irq_lock()` sets `BASEPRI_MAX` aka. the `BASEPRI` mask to whatever
zephyr has configured it to be by the value of `_EXC_IRQ_DEFAULT_PRIO`.
However by calling arm_cleanup() we also do the call to
`__disable_irq()` setting the PRIMASK to 1. Meaning the only exceptions
we can recive is fault exceptions. Masking out more exceptions does not
really make sense.
Sometimes applications booted by MCUBoot will not expect the `BASEPRI`
to be set to something else than 0(No effect). Meaning if they depend on
using some exception which now is masked out by `BASEPRI` they will
fail.
Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
When no dynamic memory is used, there is no need for include "os/malloc.h",
and do so will force the user to create an empty "os/malloc.h" file.
Signed-off-by: Carlos Falgueras García <carlos.falgueras@wslw.es>
LOG_IMMEDIATE Kconfig option has been repurposed and is now a Zephyr's
internal, non-visible symbol that should not be used by the end user.
The logging mode used by MCUBoot is defined in prj.conf
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
The commit modifies mcumgr group processing in boot_serial_input
to allow catching any group that has not been processed by user
provided function.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Upstream Zephyr has renamed the 'nonsecure' variants for boards that
support TF-M. The rename consistently uses '_ns' or '_NS' (with
underscore) as the postfix which distinguishes these variants from
their 'secure' versions.
This affects Kconfig symbols used by MCUboot, so fix them to keep
working with the latest zephyr main branch.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The platforms that are listed as integration platforms in
the Zephyr boot sample need to be included in the platform
allow list, otherwise zephyr CI will throw an error. This
commit removes the common list of integration platforms and
adds integration platform entries in each test variant, in
accordance with the allow-list in each of the variants.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This frees the user from the need of create an empty "mcuboot_logging.h"
when the logging is disabled.
Signed-off-by: Carlos Falgueras García <carlos.falgueras@wslw.es>
The "MCUBOOT_LOG_MODULE_(DECLARE|REGISTER)" macros should have a name
coherent with the rest of the logs macors, ie "BOOT_LOG_*". Also,
"bootutil_log.h" should define them as empty when the logs are disabled and
as "MCUBOOT_LOG_MODULE_*" when they are not.
With this change, the mcuboot user doesn't have to define
MCUBOOT_LOG_MODULE_* macros if the logs don't going to be used.
Signed-off-by: Carlos Falgueras García <carlos.falgueras@wslw.es>
The Kconfig option is applied only when MCUBOOT_SERIAL is enabled
so it has been moved into MUCBOOT_SERIAL dependent section
of Kconfig.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The code switches conditional compilation of progressive erase
code from Zephyr specific CONFIG_ option to more platform
agnostic MCUBOOT_ERASE_PROGRESSIVELY.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>