Commit Graph

2248 Commits

Author SHA1 Message Date
Jamie McCrae 02267cfdb5 docs: release-notes: Add note on Zephyr boot banner
Adds a note about the new Zephyr MCUboot boot banner feature

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-23 11:28:48 +01:00
Jamie McCrae 1496129235 boot: zephyr: Add optional MCUboot boot banner
Adds an optional MCUboot boot banner which displays the MCUboot
version and zephyr version

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-23 11:28:48 +01:00
Alex Tsamakos 7174dd2ba8 boot: zephyr: boards: actinius: enable multithreading in config
Adds config with multithreading enabled for all Actinius boards

Signed-off-by: Alex Tsamakos <alex@actinius.com>
2024-04-23 11:26:34 +01:00
David Brown d2e69bf720 docs: Release notes for ptest updates
Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown 80704f874b sim: Allow slow tests to be skipped
The normal simulation test takes several hours to run on most machines. Allow a
few very slow tests to be skipped by setting the environment variable
`MCUBOOT_SKIP_SLOW_TESTS` to some value. For obvious reasons, this shouldn't be
done if these power failure simulation tests are needed.

With this change, on my desktop Linux machine, the test time with the skipping
goes from about 2 hours, to around 5 minutes.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown 29d97b94a8 ptest: Use 1-based indices for tests
Adjust the printed numbers, as well as the values to `--test` so that the tests
are numbered starting from 1 instead of zero.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown 0ceb85ad58 ptest: Add `--test` argument
The `--test` (`-t`) argument allows the caller to limit the tests that are
invoked by ptest. The argument can be specified multiple times to run several
tests. The numbers are based on the output of `--list`.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown 67fc1fc181 ptest: Add `list` command
The `list` command will show what tests are available.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown c32ad20fae ptest: Add workflow argument
Allow the `--workflow` argument to override the workflow file that is used, with
a reasonable default of the workflow used by CI.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
David Brown 8798337940 ptest: Add command line parsing
Add a skeleton of a command line parser to the ptest utility.  This will allow
future changes to add additional options, such as listing and filtering the
tests that are used.

This adds a single subcommand `run`, which mimics the previous ptest behavior.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-19 11:50:52 -06:00
Robert Paananen 556b32a679 boot: Removed unnecessary if-statement
If-statement checks if length is greater than some value right after a check if it is equal to the same value.
This will never be true.

Signed-off-by: Robert Paananen <robert@paananen.nu>
2024-04-18 10:49:14 +01:00
David Brown 69858eb50e doc: Release notes for TLV check
Add a release not stub for the TLV check.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-18 11:27:15 +02:00
David Brown da2e2ab4e3 boot: Enforce TLV entries to be protected
Only allow TLV entries that are needed for signature verification to be placed
in the unprotected area of the TLV.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-18 11:27:15 +02:00
David Brown ea1cdfdeff boot: Add tlv query for protected region
Add a query to the TLV iterator that will indicate if the currently iterated TLV
entry was found in the protected region or not.

Signed-off-by: David Brown <david.brown@linaro.org>
2024-04-18 11:27:15 +02:00
Sylvio Alves 8c0e36c886 boot: zephyr: esp32: rename boards to meet hwmv2
Renames boards to account for hwmv2 changes

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-16 18:02:13 -03:00
Jerzy Kasenberg ed6460b815 mynewt: Add single_loader support
There is existing functionality for Zephyr where mcuboot works
with single slot (no swap) and image can be updated via boot_serial.

To have same functionality in mynewet single_loader.c file is copied
from zephyr tree and 2 pkg.yml files are modified to utilize new
file when BOOTUTIL_SINGLE_APPLICATION_SLOT is defined

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-04-14 20:17:44 -03:00
Jerzy Kasenberg 23d4f12169 mynewt: Change main to mynewt_main
mynewt system for some time now uses mynewt_main() as
starting point called from startup code.
This changes function name main to mynewt_main but
provides backup main function that will be linked if
pre 1.12 mynewt-core is used with mcuboot

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-04-14 20:16:39 -03:00
David Vincze 93c3f78b85 docs: Add release note snippet on builtin key support
Signed-off-by: David Vincze <david.vincze@arm.com>
Change-Id: I730a02067c0c51c46189e86fa5ddd0f325311874
2024-04-10 12:05:08 -06:00
David Vincze f06bc71180 bootutil/crypto: Builtin ECDSA key support for PSA Crypto backend
Enable the usage of builtin keys in the ECDSA verification module with
the PSA Crypto API based cryptographic backend.
This way parsing and importing the verification keys can also be avoided.

Change-Id: I6ada1ef8ed04a3f12c228ef399e3a7b8ebc7fb5e
Signed-off-by: David Vincze <david.vincze@arm.com>
2024-04-10 12:05:08 -06:00
David Vincze e369784ba4 bootutil: Allow the usage of builtin keys in verification
Introduce a new MCUBOOT_BUILTIN_KEY option to enable the usage of
builtin keys for signature verification. This way the details of the key
handling mechanism are abstracted away from the boot code and this
responsibility is delegated to the given crypto library.
This is an alternative option to the existing MCUBOOT_HW_KEY feature,
however in this case we can entirely rely on key IDs and not only the
code, but also the image metadata does not contain any public key data.

Change-Id: Id01b67951310549b2734730c58bfa7210a2d5236
Signed-off-by: David Vincze <david.vincze@arm.com>
2024-04-10 12:05:08 -06:00
Jerzy Kasenberg 39757d6a42 mynewt: Add support for MCUBOOT_SINGLE_APPLICATION_SLOT
So far mynewt code required definition of second slot in bsp.
Even in cases when overwrite only option was used bsp had to
have secondary slot with 0 length or pointing to some
unreachable flash or flash area.

Now when BOOTUTIL_SINGLE_APPLICATION_SLOT is set to 1
there is not need for fake flash areas when mcuboot
provides way for upgrade like boot serial or other
supported ways (USB DFU or USB MSC)

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2024-04-08 17:53:51 -03:00
Petr Buchta c5a528ba4e New OVERWRITE_ONLY_KEEP_BACKUP option
It builds on top of OVERWRITE_ONLY mode and uses secondary slot
as a backup of the primary slot. The main difference is that after
image copy to the primary slot the secondary slot is not erased.
This is meant to be used together with BOOTSTRAP option that will
reinstall the primary image with the backup in case it's not valid.

Signed-off-by: Petr Buchta <petr.buchta@nxp.com>
2024-04-05 10:42:21 -06:00
Jamie McCrae a65ea49515 boot: zephyr: Rename boards
Renames boards to account for hwmv2 changes

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-02 21:39:01 +01:00
Jamie McCrae 8dab2b975e docs: release-notes: Add note on zephyr cache fix
Adds a note on the fix for zephyr cache support

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-20 07:47:28 +00:00
Jamie McCrae 24ac8cc2be boot: zephyr: Fix disabling I/D caches
Fixes an issue whereby the instruction and data caches being
disabled before booting code had bit-rotted and no longer worked,
adds a new Kconfig that allows this option to be turned off if
wanted.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-20 07:47:28 +00:00
Daniel DeGrasse 5d067f0e0c zephyr: boards: set BOOT_MAX_IMG_SECTORS value for rd_rw612_bga
MX25UM flash on rd_rw612_bga is very large (8MB), so we must increase
the number of max sectors when targeting this board with MCUboot

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-14 10:17:01 +01:00
Dominik Ermel aafcbad6ec boot: Refactoring image dependency functions to reduce code size
There have been duplicate functions:
 boot_verify_dependencies
 boot_verify_slot_dependencies
 boot_verify_slot_dependency
with, very similar internals, scattered around unit.
The commit have moved them on top and squashed where possible.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-03-13 14:19:43 +01:00
Jamie McCrae 9fb7ce5d02 boot: zephyr: Fix estimated size calculation
Fixes an issue with the estimated size calculation which wrongly
used the maximum align size for some multiplications, this would
mean that in some instances the estimated maximum image size was
smaller than the actual allowed size

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-13 11:14:41 +00:00
Grzegorz Chwierut 7ace8bd4ad zephyr: boards: Remove CONFIG_FPROTECT from nrf54l15
CONFIG_FPROTECT is defined only in NRF repository, it
should not be added here.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-03-11 18:00:20 +01:00
Jamie McCrae 8b4c70ab6d boot: zephyr: Update changed Nordic family Kconfig
Updates a Kconfig that was renamed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-07 09:35:41 +00:00
Sylvio Alves b794d335a4 espressif: modify SOC_FAMILY according to new HWMv2
Update FAMILY reference as needed.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-03-04 15:47:01 -03:00
David Leach fefe701a5d zephyr: nxp: Update board names for hwmv2
Updates board names as per hwmv2

Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae ef530384d6 boot: zephyr: boards: Rename configuration files
Renames configuration files for board names that have changed
with hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae 040fc714b1 boot: zephyr: boards: Remove removed boards
Removes configuration for boards that have not been in zephyr
for a long time

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae fda4afc939 zephyr: Update board names for hwmv2
Updates board names as per hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
dependabot[bot] 70b029770d build(deps): bump nokogiri from 1.15.4 to 1.16.2 in /docs
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.15.4 to 1.16.2.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.15.4...v1.16.2)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-01 14:38:43 +01:00
Szymon Janc 226e35bbc7 ci: mynewt: Update external repositories
Match version with what is now used in upstream Mynewt. Also add
ARM CMSIS which is now taken from original repo.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2024-03-01 13:29:29 +00:00
Dominik Ermel ca02c75060 boot/zephyr: Define SOC_FLASH_0_ID and SPI_FLASH_0_ID
The defines have been taken from the Zephyr flash_map.h
but as they are provided there for MCUboot only, they can be just
defined here.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-02-23 15:51:40 +01:00
Andrzej Puzdrowski 89feb4d8e3 zephyr/boards: nrf54l15pdk_nrf54l15_cpuapp config
Renamed the DK config file to proper name.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2024-02-20 17:45:12 +01:00
Dominik Ermel 6f7f87384d boot: Fix swap-move algorithm failing to validate multi-image
In multi image swap validation of images could fail due to
headers being incorrectly re-read from storage.

Fixes #1768

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-02-20 16:29:41 +01:00
Mateusz Michalek 4b4cc85c67 zephyr: Add NRF54L configuration
Adds default Kconfig configuration that allows to build MCUboot
for NRF54L.
Currently this configuration turns off WDT and FPROTECT,
which is TODO to fix.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
2024-02-13 13:04:47 +01:00
Andrej Butok 06bc54846d imgtool: fix "align" script error
Fix "align" possible script error, caused by #1833.
Set default value for the align parameter.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2024-02-07 10:48:03 -07:00
Lucian Zala 79c284b0a5 scripts: imgtool: Fix img verify for hex file format
Currently imgtool --verify fails for hex files with:

Invalid image magic; is this an MCUboot image?

Added support for hex files by converting hex to bin
using IntelHex::tobinstr().

Reusing image.load() needs a bit of rework, maybe a
common load method will be done in the future,

Signed-off-by: Lucian Zala <zala.lucian@gmail.com>
2024-01-31 10:49:25 +00:00
Jamie McCrae a4eda30f5b zephyr: Add estimated size of update trailer to sysbuild
Adds a new field which is set to the estimated size of the
upgrade slot data, this is used to know how much space should
be reserved in an update image to determine if an update will
fit or not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-30 13:43:58 +00:00
Øyvind Rønningstad 205d7e5b41 boot_serial: Adapt to zcbor 0.8.x
Change one _term to _lit that was missed earlier.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-30 12:18:51 +00:00
Øyvind Rønningstad cf882ef3b5 zcbor: Make changes to zcbor code to satisfy mynewt compile options
bit-casting between uint and float.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-30 12:18:51 +00:00
Øyvind Rønningstad c8d213a9a1 zcbor: Copy source and header files
from zcbor 0.8.1

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-30 12:18:51 +00:00
Øyvind Rønningstad f09e205b1e zcbor: Make changes to zcbor code to satisfy mynewt compile options
printf format type and bit-casting between uint and float.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 08:16:49 +00:00
Øyvind Rønningstad 63ddb71d51 boot_serial: Adapt to API changes in zcbor 0.8.0
New arguments in zcbor_new_state are set to NULL/0 because they are
only needed when using the zcbor_unordered_map API.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 08:16:49 +00:00
Øyvind Rønningstad a899390056 zcbor: Add copy notice to all copied files
And update script

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2024-01-25 08:16:49 +00:00