Commit Graph

1891 Commits

Author SHA1 Message Date
Andrzej Puzdrowski dfce0be6a1 imgtool: export data vector to be signed
Extend sign/create command so it allows to export image's byte string
which is the substrate for the image signature. The new option is
'--vector-to-sign'. It might takes 'payload' or 'digest'.
The exported data might be used to calculate the signature externally.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-04-18 16:31:15 -06:00
Andrzej Puzdrowski f72e3741d6 imgtool: image signature export
Extend sign/create command so it now allow to export the image
signature to the file pointed by --sig-out option.
The image signature will be encoded as base64 formatted string.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-04-18 16:31:15 -06:00
Andrzej Puzdrowski 160303c202 imgtool: Added support for providing the signature by 3rd party
The sign command was extended so it now allow to provide the signature
as base64 formatted RAW file using --fix-sig along with the relevant
public key --fix-sig-pubkey.

This patch is added for support the case where the party which produces
the image dose not have access to the signing image key but must request
third party for the signature.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-04-18 16:31:15 -06:00
Jim Tan ee1b7b9d6e zephyr: fix booting address incorrect in ram-load mode
Signed-off-by: Jim Tan <KuoChun.Tan@ite.com.tw>
2022-04-18 16:28:54 -06:00
David Brown 93d02179b3 sim: Trivial dependency updates
Update dependencies that don't require any code changes.  This leaves
'aes' and 'cipher' which will require code changes to support newer
versions.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-04-12 08:11:57 +02:00
David Brown 42a7e545bf sim: Migrate to Rust 2021 edition
Change the edition in the various Cargo.toml to 2021.  There are no
changes to the code needed for this.  This will require Rust 1.56 in
order to build.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-04-12 08:11:57 +02:00
Øyvind Rønningstad a7d34caaa7 boot_serial: Upgrade from cddl-gen 0.1.0 to zcbor 0.4.0
cddl-gen has been renamed to zcbor.
Update regenerate_serial_recovery_cbor.sh and regenerate/recopy all
files.

Remove the submodule in ext/ since it is no longer necessary when
the zcbor package is installed (only needed for regeneration, not
for building).

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2022-04-06 17:46:15 -06:00
Andrzej Puzdrowski 35f61d305d zephyr/Kconfig: own Kconfig file for serial recovery
Moved Serial recovery options to own Kconfig
file.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-04-05 11:43:28 +02:00
Andrzej Puzdrowski 6c00b5e52e zephyr/Kconfig: fix CONFIG_MCUBOOT_INDICATION_LED usage
This option was reserved for serial recovery mode, while
it should be available for USB DFU as well.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-04-05 11:43:28 +02:00
Marek Pieta f08541a195 boot: zephyr: Disable CONFIG_USB_DEVICE_REMOTE_WAKEUP
Change disables CONFIG_USB_DEVICE_REMOTE_WAKEUP, because it is not
supported by the MCUboot bootloader source code.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2022-04-04 09:16:54 +02:00
Gerard Marull-Paretas aa041a282d zephyr: remove deprecated DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL
DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL is going to be deprecated, so
remove its usages from the Zephyr port. Definition checks have been
replaced with DT_HAS_CHOSEN(zephyr_flash_controller), and the macro
itself has been replaced by
DT_LABEL(DT_CHOSEN(zephyr_flash_controller)). Note that the code could
likely be refactored to make use of compile time device references, ie
use DEVICE_DT_GET, but that task has been left for the maintainers.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2022-03-28 10:47:22 +02:00
Almir Okato a1d641d59e espressif:esp32: Add multi image support
Changes on configuration and flash area organization for supporting
multi image and implementation for booting on different processors
on esp32

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-03-16 03:58:01 -03:00
Almir Okato 20e020984b index.md: fix readme-espressif.md link
Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-03-16 03:57:32 -03:00
Maciej Perkowski 749bc31c8b workflow: Add workflow verifing integration with the upstream Zephyr
During the workflow a Zephyr repository is checked out (by default
main, but any version can be given when workflow is triggered
manually) and west update is run according to Zephyr's manifest.
However, the MCUboot version is then replaced by checking out
MCUboot main (triggered by push or cron), PR's head (triggered by
a PR to MCUboot) or custom SHA (manual trigger). Next, twister is
called for tests/builds in locations given in the workflow
(test_paths).

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-03-14 16:38:09 -06:00
Marek Pieta fb47d2e3f9 boot: zephyr: Fix CONFIG_LOG_IMMEDIATE
CONFIG_LOG_IMMEDIATE was renamed to CONFIG_LOG_MODE_IMMEDIATE.
Change aligns MCUboot code to support new naming convention.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2022-03-14 15:41:00 +01:00
Almir Okato b365e234a3 espressif: add missing information for secure features
Add instructions on the readme-espressif.md on how to encrypt
data on the host.
Also add configuration and instructions for disabling/switch
UART ROM Download Mode.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-03-14 11:19:31 -03:00
Almir Okato 611ea503ff index.md: update the Espressif references to reflect readme.md
Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-03-14 11:19:31 -03:00
David Brown 499cfc1a92 Bump to 1.10.0-dev for development of next release
Bump the readme's version number to the next dev release.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-03-08 11:32:24 -07:00
David Brown cb9b6dac78 Update Mynewt repository.yaml for 1.9 release
Missed this update for the release.  This should point Mynewt to the
latest release.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-03-08 11:32:24 -07:00
Artur Tynecki a3cf3f8041 mbed: Fix calling to BlockDevice::size before initialization
These changes fixes a bug that can cause an uninitialized BlockDevice
to be queried for its size. In some cases, this can return unexpected
results (eg: 0). Move setting block device size after its
initialization.
Co-created: @AGlass0fMilk - George Beckstein

Signed-off-by: Artur Tynecki <artur.tynecki@mobica.com>
Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2022-03-08 09:50:01 -07:00
Artur Tynecki 6822365ecb mbed: Add the size of the MCU boot header area
Add header area size at the start of FLASH parameter in mbed_lib.json
This parameter is not used in MCUboot source code directly but for
example is the argument for imgtool.py sign command which sign
the binary image.
It will be useful to have it in Mbed port settings to use during project
building. For example post build command in cmake which signs image.

Signed-off-by: Artur Tynecki <artur.tynecki@mobica.com>
2022-03-08 09:50:01 -07:00
Artur Tynecki 41c568aba7 mbed: Add enable MCUboot logging parameter and fix logging configuration
This commit add option for a user to enable MCUboot logging from project
configuration level.
Now, logging from MCUboot's sources will be printed in the same way as
mbed-os logs.
Co-created by @AGlass0fMilk - George Beckstein

Signed-off-by: Artur Tynecki <artur.tynecki@mobica.com>
Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2022-03-08 09:50:01 -07:00
Artur Tynecki a91016672e mbed: Add CMake support and fix files paths
The mbed port should be compatible with a new command-line tool
mbed-tools (Mbed CLI 2) which use cmake build system. This allows build
cmake-base applications.
Fix mbed files paths - it's required for the new version of mbed-os
(v6.15)

Signed-off-by: Artur Tynecki <artur.tynecki@mobica.com>
2022-03-08 09:50:01 -07:00
Dominik Ermel 4c0f6c177f boot_serial: Fix SMP echo sending incomplete CBOR container
In case when echo string would be too long to fit into buffer,
there would be no space left for container termination.
Due to lack of error checking such non-terminated container would
be sent out, where error response should be sent out instead.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-07 14:03:15 +01:00
Dominik Ermel 8dae84441f boot_serial: Correct MGMT_ERR_EUNKNOWN value
Should be 1, was 2.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-07 11:15:15 +01:00
Dominik Ermel 5ff8958117 boot_serial: Fix buffer overflow in boot_serial_out
The buf buffer set to collect total console payload consisting
of total size (two bytes), SMP header (eigth bytes), data payload
(bs_obuf, BOOT_SERIAL_OUT_MAX) and CRC (two bytes), pior to base64
encoding has been set to size of BOOT_SERIAL_OUT_MAX.
This means that if output data len, in bs_obuf, would be longer than
BOOT_SERIAL_OUT_MAX - 8 - 2 - 2, then composing of the output buffer
would overflow.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-03-07 10:18:50 +01:00
David Brown c657cbea75 Update to version 1.9.0
Bump version information for 1.9.0 release

Signed-off-by: David Brown <david.brown@linaro.org>
2022-03-02 14:29:33 -07:00
Andrzej Puzdrowski 2b822276cd zephyr/single_loader: make decription working flash
Decryption buffer was fixed to 1024 which imposes failure
while attempting to decrypt bigger image chunks, which is
expected on memories of bigger erase-block-size.

This patch attempt to get teh proper buffer size basing on
SOC's nv flash node.

fixes #1310

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-02-24 07:52:32 -07:00
Wouter Cappelle e3ff17535c Add support for the mcumgr echo command in serial boot mode
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-02-22 09:27:57 -07:00
Sylvio Alves d8eff810ad doc: espressif: add ESP32-S3 development status
This updates information related to ESP32-S3 SoC.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-02-17 16:18:42 -03:00
Sylvio Alves d523094aa4 doc: espressif: add parameter details for esptool and imgtool
esptool and imgtool require additional information that is not clear
to end user.

It also update ESP32 status for Zephyr porting.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-02-17 16:18:42 -03:00
David Brown ee366953fe Update to 1.9.0-rc2
Bump the version number in the readme, and imgtool for the 1.9.0-rc2
release.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-02-10 12:21:07 -07:00
David Brown b32ff6d653 doc: Update release notes for 1.9.0-rc2
Add notes on changes since rc1.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-02-10 12:21:07 -07:00
Carles Cufi b9192a4c80 boot: serial: Adapt to Zephyr's new CRC APIs
As part of https://github.com/zephyrproject-rtos/zephyr/pull/42457,
Zephyr recently changed its CRC APIs. The commit below
adapted the use of mcumgr in-tree, but MCUboot was missing the change:
07c78e515c

Note that although on other platforms the function called is
crc_ccitt(), the CRC16 actually used by MCUboot/mcumgr is:
https://reveng.sourceforge.io/crc-catalogue/16.htm#crc.cat.crc-16-xmodem

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-02-10 09:47:08 -03:00
Wouter Cappelle e3822f8180 boot_serial: zephyr: Add optional timeout to enter serial recovery
This PR adds the possibility to only enter the bootloader's
serial recovery mode when a mcumgr command is received within a
given timeout.

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-02-09 16:20:58 -07:00
Wouter Cappelle c028d45057 imgtool: skip erased values in trailer generation
When generating an image with trailer (--pad or --confirm), the
imgtool also adds the erased values into that area. This is not
wanted for flash drivers which use ECC and treat writing erased
values as a real write action, which cannot be overwritten anymore.
See issue #1288

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-02-09 13:35:01 -07:00
Wouter Cappelle bb7a39d114 Add config option for caching of validation state of an image in primary slot for single loader
Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-02-09 13:31:56 -07:00
Piotr Mienkowski b6d5cf3589 imgtool: change --max-align default value
The value of `--max-align` parameter passed to imgtool can never be
less than the value of `--align` parameter. At present the default
value of `--max-align` is fixed at 8. This forces user to pass the
parameter even when its value can be safely inferred.

Change the default value of the `--max-align` parameter to the larger
of the two values: `--align` or 8. Consequently, the user is required
to pass the parameter only if the flash alignment of the primary and
secondary slot differ.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2022-02-07 15:58:40 -07:00
David Brown 8af51e529f samples/zephyr: Remove the body of the shell test runner
Instead of trying to main two test runners for the Zephyr sample
directory, have the old test runner just print out a message that users
should use the new test runner.  Eventually, we can just remove old
runner entirely.

Instead of asking the user for each test if it worked or not, the new
test runner looks at the serial log and makes this conclusion itself.
It is able to run the whole test suite completely automatically.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-02-07 15:57:22 -07:00
Wouter Cappelle 10a877cb76 zephyr: fix compilation when no CONFIG_BOOT_ENCRYPTION_KEY_FILE
Fix compilation of zephyr builds when there is no
CONFIG_BOOT_ENCRYPTION_KEY_FILE set.
bug introduced by #1255

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-01-28 10:20:11 -03:00
Almir Okato 42e679d60a espressif:esp32s3: Add esp32s3 initial support
ESP32-S3 target and related files added to the Espressif port.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-01-26 20:52:04 -03:00
Almir Okato 553315c15b readme.md: remove "IDF" from Espressif reference
This change is to avoid misunderstanding as IDF is not supported
on top of MCUboot.
The Espressif port acts as a bare metal bootloader that can be
used on Espressif chips to boot supported OSes (like Zephyr or NuttX).

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-01-26 19:43:12 -03:00
David Brown d484b827a9 Bump versioning information to 1.9.0-rc1
Signed-off-by: David Brown <david.brown@linaro.org>
2022-01-21 14:01:05 -07:00
David Brown eaa8b31917 docs: Update release notes for 1.9.0 release
Signed-off-by: David Brown <david.brown@linaro.org>
2022-01-21 14:01:05 -07:00
Wouter Cappelle 7679215d00 single_loader: zephyr: Fix compilation with VALIDATE_PRIMARY_SLOT enabled
Fixes compilation when VALIDATE_PRIMARY_SLOT & SINGLE_APPlICATION_SLOT
are enabled.

Signed-off-by: Wouter Cappelle <wouter.cappelle@crodeon.com>
2022-01-20 19:54:29 -03:00
Sebastian Bøe c8ba937ee3 zephyr: Use a smaller sha256 implementation
Reduce the size of the sha256 implementation by 1300 bytes by using a
slower implementation.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2022-01-20 16:09:37 +01:00
Francesco Domenico Servidio 4fb288af9e doc: updated release.md
Fixed spacing after periods.
Rephrased slighly unclear sentences.
Added other very minor fixes.

Signed-off-by: Francesco Domenico Servidio <francesco.servidio@nordicsemi.no>
2022-01-18 13:21:17 -07:00
Francesco Domenico Servidio 5851150146 doc: fixed ecdsa.md
Rephrased a few sentences.
Fixed a few typos.
Fixed lists.
Added additional small fixes.

Signed-off-by: Francesco Domenico Servidio <francesco.servidio@nordicsemi.no>
2022-01-17 18:14:59 +01:00
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