remove empty strings from FetchContent to eliminate cmake build warnings like this:
CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
The BUILD_COMMAND keyword was followed by an empty string or no value at
all. Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
ARG_BUILD_COMMAND variable rather than setting it to an empty string.
Signed-off-by: raiden00pl <raiden00@railab.me>
This commit enhances the bootloader capabilities. The image's header
is extended with header version, size, platform identifier and
pointer to optional next header. CRC32 now includes part of
the header in its calculation as well.
The change also avoids having two different magics for image uploaded
over programmer and update image. Both these images have the same
magic and this magic is changed internally by the bootloader's logic.
The change is needed because image with standard magic is automatically
considered as a confirmed image (uploaded with programmer).
The current implementation avoids tails at all, therefore the user
application uploading the image does not have to erase the tail before
new upload. The image is considered as confirmed if it has standard
magic or its recovery is present. This means the bootloader has to
erase the header of the update image after the update is done (to
avoid update loop and to mark the image as unstable). This page is
written back during the confirmation.
This is a breaking change, but necessary for the future development
of the bootloader. The added header version field will allow to
add minor/major updates while keeping the backwards compatibility.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Co-authored-by: Pavel Pisa <pisa@fel.cvut.cz>
Co-authored-by: Karel Koci <cynerd@email.cz>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
API function nxboot_get_confirm was returning incorrect value if
primary image was flashed directly into the embedded flash (this
image does not have a tail, but is automatically considered as valid
and stable based on the header magic value).
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This commit adds NuttX based bootloader with the support for image
update and recovery if not confirmed. The algorithm utilizes three
flash partitions: primary (image runs from this area), secondary
and tertiary. Secondary and tertiary areas are used for update upload
and recovery.
The update is performed by simple copy from update area to primary
area with recovery being created in recovery area if not already present.
Once image is confirmed by the user, the image in update area is
confirmed as well, update area becomes recovery area and vice versa.
This means the recovery is always present (except for the first update)
and subsequent updates just copy image from update to primary. This
makes the update significantly faster and more considerable to flash
wear while keeping the recovery/revert possibility.
A header (aligned to flash's erase size) must be added to the beginning
of the image. Python script nximage.py can be used to prepend this
header to built binary. The algorithm also uses one erase page at the
end of a partition (partition, not image!) to store flags used to
indicate image confirm status and to detect update/recovery partitions.
Any program uploading update image to the update partition has to erase
this page for the boot to work correctly!
The algorithm implementation is based on a patch initially developed
for MCUboot project but rejected by the project's maintainers
https://github.com/mcu-tools/mcuboot/pull/1902
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Will cause compilation warning if NDEBUG is defined We can't modify the code of the external library, so let's ignore it
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
Configuration option MCUBOOT_REPOSITORY adds possibility to configure
MCUboot GIT repository to be downloaded (for specified hash commit or
version). This allows to use different forks and personal repositories.
MCUboot main repository is kept as default option.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Older versions of mcuboot did not support swap using move and therefore
the build would have failed CONFIG_MCUBOOT_SWAP_USING_MOVE=y.
Newer mcuboot contains initial support of swap using move for NuttX. Also
Makefile was updated to as some bootutil files were removed from mcuboot.
Signed-off-by: Michal Lenc <michallenc@seznam.cz>
This can be useful for development purposes when you don't need any complex bootloader yet,
but just want to jump to the app image.
Can be helpful when we need to switch from secure environment to non-secure environment.
This option, which resolves to -w when CONFIG_CYGWIN_WINTOOL is
configured, is now appended to INCDIR in tools/Config.mk.
See git commit # 5eae32577e5d5226e5d3027c169eeb369f83f77d in the main
The current examples belongs to 'examples/mcuboot' directory. This
moves related example code and Kconfig entries to their respective
project inside examples/mcuboot directory. It cleans all Kconfig
entries at 'boot/mcuboot', including Kconfig, Makefile and
README.md files.
This not perform any code modification.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
This adjusts code and Kconfig variables as preparation to move MCUboot
examples to examples/mcuboot folder.
This changes perfor below sed operations:
's/MCUBOOT_UPDATE_AGENT_EXAMPLE/EXAMPLES_MCUBOOT_UPDATE_AGENT/g'
's/MCUBOOT_SLOT_CONFIRM_EXAMPLE/EXAMPLES_MCUBOOT_SLOT_CONFIRM/g'
It replaces 'apps/boot/mcuboot' prefix by 'apps/examples/mcuboot' and
adjust it with respective application name on below source files:
boot/mcuboot/mcuboot_agent_main.c
boot/mcuboot/mcuboot_confirm_main.c
This commit does not other changes in the code.
Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
Even though the options existed, the second application would override
the values, resulting in the missing first application on the final
binary.
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>