Commit Graph

2160 Commits

Author SHA1 Message Date
David Brown 9feea8c616 boot: Check that hash TLV is sufficiently large
Add a check for the size of the TLV entry for the boot record.
Although, this is in the protected area, and should be protected by a
signature, check that we don't induce an integer underflow if that entry
is somehow too short.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-06-07 14:37:01 +02:00
Jamie McCrae 254714bebd boot: zephyr: Align boot serial check start line
Line was missing a space and was not aligned to the bracket on the
previous line.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-05-31 12:27:48 -06:00
Jamie McCrae 56cb610806 boot: zephyr: Add MCUboot status callback support
Adds an optional callback when the MCUboot status changes which can
allow components to react.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-05-31 12:27:48 -06:00
Daniel DeGrasse 3f4d57c7ac zephyr: boards: enable progressive erase for RT1050 and RT1060
RT1050 and 1060 have large flash chips, so tools like MCUMgr will time
out if the entire flash bank is erased before writing data. Enable
progressive erase for these boards to prevent timeouts.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2022-05-31 11:09:39 -06:00
Andrzej Puzdrowski 5f317e4cc8 zephyr: rework LED usage using `struct gpio_dt_spec`
LED usage code were simplified thanks to `struct gpio_dt_spec`
and related methods.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-05-31 11:04:19 -06:00
Andrzej Puzdrowski 2f545b8ebb zephyr: prefer DTS mcuboot-led0 alias over bootloader-led0 alias
bootloader-led0 alias will be deprecated and replaced by dedicated
mcuboot-led0 alias.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2022-05-31 11:04:19 -06:00
Johan Öhman b588907ab1 zephyr: Wrapped the RAM loading mode in Zephyr configs.
The RAM loading mode wasn't wrapped in Zephyr configs like the other boot modes.
Added a config to enable RAM loading as well as two configs to set
IMAGE_EXECUTABLE_RAM_START and IMAGE_EXECUTABLE_RAM_SIZE, respectively. These
two values default to the values from the chosen node sram in the dts.

Signed-off-by: Johan Öhman <johan.ohman@softube.com>
2022-05-31 10:20:19 -06:00
iysheng 6093cbb3dd scripts: Fix some sentences to suit print display
Signed-off-by: iysheng <iysheng@163.com>
2022-05-30 08:13:55 +02:00
Alexandr Kolosov 1d6f98e48d zephyr: boards: fix license header for tlsr9518adk80d board
Signed-off-by: Alexandr Kolosov <rikorsev@gmail.com>
2022-05-24 09:37:21 -06:00
Jamie McCrae 0f7db390d3 bootutil: zephyr: Fix not linking with mbedtls when needed
This fixes a build issue when building mcuboot for zephyr with RSA
image encryption support enabled using mbedtls.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-05-24 14:15:37 +02:00
Ryan McClelland 179d8fa428 boot: zephyr: add Kconfig for arm cortex-m that implements a cache
The Cache is an optional configuration of both the ARM Cortex-M7 and
Cortex-M55. Previously, it was just checking that it was just an M7
rather than knowing that the CPU actually was built with the cache.

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2022-05-22 20:51:21 -03:00
Jamie McCrae 7315e424b9 bootutil: zephyr: Fix not including tinycrypt path when needed
This fixes a build issue when building mcuboot for zephyr with image
encryption support enabled using tinycrypt.

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2022-05-20 11:28:38 -06:00
Alex Kolosov ced3434719 zephyr: boards: add support for Telink tlsr9518adk80d board
Signed-off-by: Alex Kolosov <rikorsev@gmail.com>
2022-05-19 11:26:22 -06:00
Almir Okato 3eb50263b7 imgtool: Fix imgtool sign command without key
The fix adds a condition that checks if either key or fixed_sig are
`not None` before payload signing and TLV addition.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-05-18 09:51:53 -03:00
David Brown e802cd4846 docs: Fix case of Cypress readme file
Fix the case of the cypress readme to fix dead links in the docs.

Signed-off-by: David Brown <david.brown@linaro.org>
2022-05-17 11:20:13 -06:00
Alexey Arbuzov e4fba687d9 Remove unused functions
Signed-off-by: Alexey Arbuzov <lexx.vir@gmail.com>
2022-05-12 18:39:43 -03:00
Almir Okato c4b305863a espressif:esp32: Move app entry point call back to iram_loader_seg region
Entry point call was moved back from main to esp_loader, so it is
called from iram_loader_seg memory region

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-05-11 07:57:27 -03:00
Almir Okato fa173df366 espressif: Add warning for unsupported chip revision
Added checking and warning for ESP32, ESP32-S2, ESP32-C3, ESP32-S3
unsupported chip revisions on their initialization.

Made respectively changes for build system and documentation.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-05-09 15:55:23 -03:00
Almir Okato 1dc71368b2 espressif: grouping common functions for esp chips init functions
Grouped common bootloader init functions among esp32, esp32s2,
esp32c3 and esp32s3 into common files.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2022-05-09 15:55:23 -03:00
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