Commit Graph

1943 Commits

Author SHA1 Message Date
Michel Jaouen d09aa6b4f9 imgtool: Add clear image generation with encryption capability
Create an option to generate a clear image with encryption capability
that can be installed on a primary slot. Since image has encryption
capability image can be swapped encrypted in secondary slot

Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
2022-01-14 09:30:57 -03:00
Andrzej Puzdrowski c9ac802a99 Readme: bump version to 1.9.0-dev
Bump version to development version of future release.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-01-14 11:30:54 +01:00
Wouter Cappelle 953a76180d Add support for signed images in single loader mode
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-01-13 14:05:30 -07:00
Andrzej Puzdrowski f9dbf68374 boot/bootutil: added log on swap type used
Added LOG for informing which a swap type is performed.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-01-11 11:35:31 -07:00
Almir Okato 39eb63df1d espressif: Update readme-espressif.md to include information about
hardware-assisted Flash Encryption and Secure Boot.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-01-10 18:33:45 -03:00
Andrzej Puzdrowski d16598f561 zephyr/boot_serial_extension: us BOOT_LOG instead of LOG_
Use MCUboot logging macros instead of zephyr-rtos native.
This fixes build failure on MCUBOOT_LOG_MODULE_DECLARE() when
LOG is disabled.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-01-10 12:38:37 +01:00
Gustavo Henrique Nihei d6e98106b6 espressif: Improve CI script for targetting multiple chips at once
This enables using "espressif_run.sh" locally for a quick validation
that the build passes for multiple Espressif targets.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-29 09:19:02 -03:00
Almir Okato 14763b1cd2 espressif: ESP32, ESP32S2 and ESP32C3 native flash encryption
Native flash encryption was added as option for Espressif chips and
added to the initialization process before MCUboot workflow.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2021-12-28 10:51:54 -03:00
Gustavo Henrique Nihei 818964d513 espressif: Use "TAG" field from SOC_LOG* macros from IDF libraries
This also removes the need for passing "-Wno-unused-variable" compiler
flag, since now TAG is being used as part of the log message.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-22 10:54:52 -03:00
Gerson Fernando Budke d9307312f7 boot/nuttx: Switch from printf to syslog
Use syslog in favor of printf function for print messages. The syslog
ensure that all characters are corrected flushed. Syslog is already
used when log is enabled and this only switch to same log interface.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2021-12-22 09:34:38 -03:00
Gustavo Henrique Nihei e571855f58 ci: Define concurrency groups for cancelling duplicate jobs
This commit will force running jobs of a given PR to be cancelled once
the same branch is updated, avoiding the CI wasting time testing
outdated content.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-20 09:20:30 -03:00
Gustavo Henrique Nihei 67b73d3c79 espressif: Add CI jobs for Secure boot enabled images
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-20 09:20:14 -03:00
Gustavo Henrique Nihei a3495105af espressif: Fix support for signing algorithms
The build system previously restricted the usage of some signing
algorithms due to build issues.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-20 09:20:14 -03:00
David Brown 1bc106e44c sim: Homogenize max-align-32 feature check
This feature check was done statically instead of dynamically in the
build.rs file.  Change this to match the rest.  Perhaps we might want to
change all of them to be done at compile time, but that should be done
with all of the features.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-12-17 08:54:09 -03:00
Gustavo Henrique Nihei 41f123c24a docs: Update Image Trailer documentation according to latest changes
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Gustavo Henrique Nihei 7bfd14bbc5 sim: Fit unit tests to larger write align values
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Gustavo Henrique Nihei 4aa286d2db flash_map: Increase minimum supported write align via flash_area_align
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Gustavo Henrique Nihei ffe4ec9cdb bootutil: Support trailers larger than sector size for swap scratch
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Gustavo Henrique Nihei cf120baa65 bootutil: Define new magic for the updated image trailer layout
The magic value applies to images built with maximum write alignment
values other than 8 bytes, whose trailer region is generated in a
different layout.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Kristine Jassmann 7df909ee2d bootutil: Remove arbitrary limit on BOOT_MAX_IMG_SECTORS
Count is initialized before it is passed to flash_area_get_sectors. The
flash driver should use count to ensure an overrun does not occur.

Signed-off-by: Kristine Jassmann <kristine.jassmann@renesas.com>

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Kristine Jassmann 73c38c6fde bootutil: Allow larger minimum flash write
[kristine.jassmann@renesas.com: Allow larger minimum flash write]
[michael.thomas@renesas.com: Add changes for 1.8]
[michael.thomas@renesas.com: Add magic alignment fix]
[gustavo.nihei@espressif.com: bootutil: Address issues from PR 949]

Co-authored-by: Kristine Jassmann <kristine.jassmann@renesas.com>
Co-authored-by: Michael Thomas <michael.thomas@renesas.com>
Co-authored-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
Signed-off-by: Kristine Jassmann <kristine.jassmann@renesas.com>
Signed-off-by: Michael Thomas <michael.thomas@renesas.com>
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-16 13:19:12 -07:00
Dominik Ermel 1eedec3e79 boot_serial: Fix Zephyr include path for reboot.h
It is sys/reboot.h now.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-12-16 14:51:02 +01:00
Fabio Utzig 152cca0767 bootutil: fix scratch status offset calculation
Update `boot_status_off` to take into consideration that scratch only
has to store status for one swap of sectors, thus requiring much less
flash space than what is required in the primary slot.

This commits does a bit of refactoring on the functions that return
parts of trailer size to make the code clearer.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-12-16 08:08:36 -03:00
Fabio Utzig b3039fd659 sim: Remove unused variables
Fix warning running the simulator due to variables that are not being
used anymore.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-12-16 07:34:50 -03:00
David Brown 53e6f5b8a5 samples: zephyr: Use move swap for Zephyr tests
Change the configs for the Zephyr tests to use move swap, as this is the
code intended for future use.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-12-15 17:15:56 -07:00
Andrzej Puzdrowski e9c6b4d7af zephyr/main: always call sys_clock_disable()
Build-time conditional call is not needed anymore since the empty
sys_clock_disable() callback is provided if the platform
doesn't support system clock disable capability.

Reference:
78dc8ce338

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-15 16:23:51 +01:00
Andrzej Puzdrowski 03ed502ad7 zephyr: removed CONFIG_SYSTEM_CLOCK_DISABLE=y
CONFIG_SYSTEM_CLOCK_DISABLE property was removed from
zephyr codebase. It is not needed anymore since the empty
sys_clock_disable() callback is provided if the platform
doesn't support system clock disable capability.

Reference:
78dc8ce338

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-15 16:23:51 +01:00
Gustavo Henrique Nihei bc65d2b10a bootutil: Close flash_area after failure to read swap information
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-14 09:30:00 -03:00
Fabio Utzig 5577cbd833 sim: define stm32f4 with non-linear sectors slots
Change the flash layout of the stm32f4 simulated device to include
sectors of different sizes inside both slots; both slots have been
updated to still share the same layout. This layout changes allow for
testing and validation that a swap with scratch is possible even if not
all sectors inside a slot are the same size, as long as they all fit in
scratch.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2021-12-13 23:16:20 -03:00
Gustavo Henrique Nihei 3ee626f36e espressif: Fix ESP32-C3 support for booting signed apps
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-09 13:15:45 -03:00
Gustavo Henrique Nihei 523ef3fc2f espressif: Add support for hardware Secure Boot
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-09 13:15:45 -03:00
Gustavo Henrique Nihei ce3668fd60 espressif: Use "TAG" field from ESP_LOG* macros from IDF libraries
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-09 13:15:45 -03:00
Gustavo Henrique Nihei 6a6b8915a8 espressif: Bump IDF version to v4.4
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-12-09 13:15:45 -03:00
Petro Karashchenko bb927ac014 nuttx: extend configuration options
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2021-12-09 13:06:35 -03:00
Martí Bolívar caa1f6bbd9 assemble.py: don't read BOARD.dts.pre.tmp
This file has been removed from upstream Zephyr in commit 2b7c61e306a
("cmake: re-work devicetree preprocessing steps").

Get the board name from .config instead; this is a stable place for it
to be found. Load the EDT itself from the pickle file in the build
directory; this has the advantage of fixing the script when out of
tree devicetree bindings are used.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-12-08 14:18:18 -07:00
Francesco Domenico Servidio 50f1101231 doc: Updated index.md and readme.md
Updated index.md and readme.md:
- Removed outdated info
- Added info about newly added ports
- Fixed a few style issues.
- Rephrased a few sections.

Signed-off-by: Francesco Domenico Servidio <francesco.servidio@nordicsemi.no>
2021-12-08 13:50:43 -07:00
Maureen Helm 05143ce236 boot: zephyr: Configure mimxrt685_evk board
The mimxrt685_evk board has large slots so we need to increase
CONFIG_BOOT_MAX_IMG_SECTORS from the default.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-12-07 15:20:52 -07:00
Radoslaw Koppel 7200669330 zephyr: Fix serial recovery skipping on nrf53
The nRF53 mcu has moved RESETREAS register
(from POWER to RESET peripheral).
This fix uses nrfx helper to select the proper register.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2021-12-07 10:57:23 -03:00
Andrzej Puzdrowski dacc7d606e boot: zephyr: Remove CONFIG_USB from Thingy53 configuration
This was ommited before when this config was droped from
otheres configurations.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-02 14:08:00 +01:00
Andrzej Puzdrowski 6daf9539ee zephyr: Removed old external flash configs for Thingy53.
Removed old external flash configs for Thingy53.

Signed-off-by: Ole Sæther <ole.saether@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-02 14:08:00 +01:00
Andrzej Puzdrowski a1c43cbea9 zephyr: fix typo in CONFIG_ERASE_PROGRESSIVELY conversion
Kconfig macro was converted with typo to not a MCUboot's
internal macro switch. It was MCBOOT_ERASE_PROGRESSIVELY instead
of MCUBOOT_ERASE_PROGRESSIVELY.
Bug was introduced in
42c985cead

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-01 18:14:35 +01:00
Andrzej Puzdrowski c9ac5cc6ff boot_serial: cleanup max output size calculation
Calculation of BOOT_SERIAL_OUT_MAX was based on MCUBOOT_IMAGE_NUMBER
while in other places BOOT_IMAGE_NUMBER is taken into account as
number of images. Let's align the calculation to use same literal value
as others.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-01 16:36:51 +01:00
Andrzej Puzdrowski 94dc19d4a6 bootutil: move BOOT_IMAGE_NUMBER definition to bootutil.h
Definition is used (and redefined) by boot_serial.c module as well.
Let's allow to use one definition for all.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-01 16:36:51 +01:00
Andrzej Puzdrowski 961a6107ad doc/design: fix typo in swap-using-scratch description
`image-trailer-size` should be mentioned instead
of `image-trailer-sectors-size` in the maximal-image-size
evaluation description.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-12-01 14:42:29 +01:00
Jerzy Kasenberg cbb5b23070 mynewt: Add call to custom pre-boot function
Custom boot_preboot() function can be used to start
DFU in similar way as is already done in zephyr.

Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
2021-11-30 18:47:25 -03:00
Gustavo Henrique Nihei 1d7f496e1d sim: Calculate offsets from boot_max_align instead of hardcoding them
This patch prepares the simulator to execute images with a max align
value other than 8 bytes.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-11-30 13:42:52 -03:00
Mikkel Jakobsen e0a8061af5 boot: zephyr: configure mimxrt1024_evk board
The mimxrt1024_evk board have a large slot so we need
to increase CONFIG_BOOT_MAX_IMG_SECTORS from the default.

Signed-off-by: Mikkel Jakobsen <mikkel.aunsbjerg@prevas.dk>
2021-11-30 17:39:30 +01:00
Andrzej Puzdrowski 9abda329fe doc/design: Add header for swap using scratch algorithm
Added sub-header for point where swap-using-scratch algorithm
is described.
Added note on the maximum image size allowed for this mode.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-11-30 14:58:34 +01:00
Andrzej Puzdrowski cd35fef32d doc/design: note on the image trailer size
Image trailer might consume notable amount of image slot size.
This path adds note for emphasize that fact.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-11-30 14:58:34 +01:00
Andrzej Puzdrowski 3c1e6d3873 doc/design: Explain swap without using scratch algorithm
Added description for explain how the algorithm works.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-11-30 14:58:34 +01:00