Commit Graph

1762 Commits

Author SHA1 Message Date
David Brown ae35510b58 Preps for 1.8.0-rc1
Update version fields for 1.8.0-rc1 release.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-08-31 09:09:22 -06:00
Marek Pieta 1b1b4f9595 zephyr: Add MCUboot configuration for Thingy:53
Change introduces default configuration of MCUboot for Thingy:53
secure cpuapp. The default configuration also disables image
revert on application core.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-08-27 12:58:44 -06:00
Johann Fischer d2e87aa352 zephyr: rename remaining CONFIG_USB to CONFIG_USB_DEVICE_STACK
Rename remaining CONFIG_USB to CONFIG_USB_DEVICE_STACK.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-27 15:21:39 +02:00
Johann Fischer faf9cbe0f6 zephyr: CDC ACM UART node to specific overlays
Move CDC ACM UART node from common DTC overlay to
specific overlays, nrf52840_big.overlays and
usb_cdc_acm.overlays.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-27 15:21:39 +02:00
Johann Fischer a6e1e9e339 zephyr: get CDC ACM UART device from devicetree
Adapt to Zephyr OS changes to get CDC ACM UART device.
Remove RECOVERY_UART_DEV_NAME Kconfig option and
use DEVICE_DT_GET() in serial_adapter.c

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-08-27 15:21:39 +02:00
Andrzej Puzdrowski 1fceb9bdba zephyr: Added hooks for example
Example (very basic) hook implementation.
Added case description for test-build with these hooks
and multi-image feature.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Andrzej Puzdrowski 2a29f5dc56 zephyr/boot_serial_extension: added hooks to custom image list MGMT
Introduced boot_img_install_stat_hook() hook fuinction for fetch
the image's slot installation status.

The image's slot installation status is custom property.
It's detailed definition depends on user implementation. It is only
defined that the status will be set to 0 if this hook not provides
another value.

Inserted available hook for read image header as well.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Andrzej Puzdrowski 4f9c7304d0 boot_serial: added hooks for mcuboot image access operations
Added hook for: read image header, validate the image and hook
which is called after image was uploaded completely.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Andrzej Puzdrowski dea293ad4c bootutil_public: added hook for fetch image swap state
Added hook which allows to override boot_read_swap_state_by_id()
routine for the primary slot.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Andrzej Puzdrowski b8f3969f38 loader: added hooks for override mcuboot image access operation
Added hook for read image header.

Added hook which is for inject an image check implementation which can
be used instead of boot_image_check() internal implementation on a primary
slot.
This is usefully especially when primary has to be checked by other entity
on MCUboot's demand.

Added hook which allow to implement image update process
differently.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Andrzej Puzdrowski 914204db41 boot/zephyr: Kconfig for hooks enabling
Added global property which allows to enable hooks
implementations.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 16:22:04 -06:00
Roman Okhrimenko a41a850dd5 cypress: use mbedtls 3.0, do not use hw crypto by default
Signed-off-by: Roman Okhrimenko <roman.okhrimenko@infineon.com>
2021-08-26 10:18:20 -06:00
Andrzej Puzdrowski 5cf941013f zephyr/Kconfig: fix deadlock on cryptolib selectors
If user generate project and the will try to switch signature type
then it is very likely that MBETLS will be enabled simultaneously when
tinycrypt has to be force-selected, which causes kconfig warning on
impossible configuration. Such configuration won't be possible to be
fixed using menuconfig etc.

This patch moves dependency check on !MBEDTLS from kconfig to preprocessor
which makes manual fixing using menuconfig possible.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-26 15:26:16 +02:00
iysheng 506a16f085 docs: Fix some misspelling
Signed-off-by: iysheng <iyysheng@gmail.com>
2021-08-25 20:41:02 -03:00
Almir Okato d363248161 readme.md: Add references to the Espressif IDF port.
Signed-off-by: Almir Okato <almir.okato@espressif.com>
2021-08-24 07:50:45 -03:00
Almir Okato 428e2e7ca7 espressif: Add espressif's readme file to the docs
Add readme-espressif.md documentation for Espressif port.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2021-08-24 07:50:45 -03:00
Almir Okato 5ab8cfdaa3 boot/espressif: Remove toolchain libc linking
Fix unnecessary dependencies caused by toolchain's libc inclusion.

Signed-off-by: Almir Okato <almir.okato@espressif.com>
2021-08-24 07:50:35 -03:00
George Beckstein ab9f8c13e1 Fix unknown type name "size_t" error
This commit adds an include clause to "boot_record.h" to include the stddef.h header that contains the declaration of the "size_t" type.

Attempting to include "boot_record.h" in a build for Mbed-OS would throw an error complaining "size_t" was unknown, adding a note to inculde "stddef.h"

Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2021-08-23 13:10:10 -06:00
Sigvart Hovland 9647c46544 boot: zephyr: Fix misaligned #else for `irq_lock`
So in PR #1089 I misaligned the `#else` used for the `irq_lock` as it
should be aligned with `CONFIG_MCUBOOT_CLEANUP_ARM_CORE`. So that
`irq_lock`is called when we don't call `__disable_irq` from arm core
clean up code.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2021-08-23 10:52:57 -06:00
George Beckstein 5609e78b6c Ignore nuttx files for Mbed-OS builds
Signed-off-by: George Beckstein <george.beckstein@gmail.com>
2021-08-20 14:10:42 -03:00
Gustavo Henrique Nihei fca1aa4764 boot/nuttx: Fix trivial compiler warnings emitted by NuttX port
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-20 12:25:24 -03:00
Johann Fischer 25852971db zephyr: remove Kconfig option CONFIG_USB
USB device support configuration is revised,
CONFIG_USB option is deprecated.
Only USB_DEVICE_STACK option should be used to
enable USB device support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-08-19 17:15:50 -06:00
Gustavo Henrique Nihei 01184bd036 boot/nuttx: Enable crypto backend according to configuration from NuttX
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-19 14:50:03 -03:00
Marek Pieta 4960d12cc1 boot_serial: cbor_encode: Fix encoding data length
Change fixes encoding data length and adds support for big endian
byte ordering. According to specification, data length can be
encoded either on 1, 2, 4 or 8 bytes.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2021-08-19 12:48:19 +02:00
Dominik Ermel 428d3ee78b zephyr: Make boot_serial_extension.c compilation conditional
The commit modifies CMakeLists.txt to include the file into compilation
only when CONFIG_ENABLE_MGMT_PERUSER is selected.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-19 11:12:38 +02:00
Dominik Ermel 0435d5d9b7 zephyr: Add option for enabling the storage erase command
The commit adds Kconfig option that enables the storage erase mgmt
command.
Addition of the Kconfig option fixes the problem where Zephyr spcyfic
mgmt commands support fails to compile when board does not define
a storage partition.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-19 11:12:38 +02:00
David Brown e182977199 Revert "Move Cargo.toml to top level"
This reverts commit 78e4441bd3.

Although it shouldn't, this change is provoking numerous errors in
CI.  In order to allow CI to continue, revert this change, and it can be
redone later, after fixing whatever is causing the CI build failures.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-08-19 09:28:04 +02:00
Gustavo Henrique Nihei 9d67f01efc README.md: Add references to the NuttX port
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-18 18:37:50 -03:00
Gustavo Henrique Nihei 93c029a4c5 docs: Add documentation for NuttX port
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-18 18:37:50 -03:00
Gustavo Henrique Nihei 7bcf9862de boot: Add support for the Apache NuttX RTOS
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2021-08-18 18:37:50 -03:00
David Brown 78e4441bd3 Move Cargo.toml to top level
Instead of requiring cargo to be run in the sim directory, create a
top-level "workspace" Cargo file, that references the others.  The main
result of this is that cargo can now be run in the top of the workspace,
and the 'target' directory will be placed there, rather than in the sim
directory.

This is primarily of benefit to tools such as RLS, Rust-analyzer and
various IDEs that expect a crate at the top level of the tree.

Signed-off-by: David Brown <david.brown@linaro.org>
2021-08-17 09:28:37 +02:00
Sudarshan Sreeram 900249cc98 Add espressif directory to .mbedignore
The old mbed CLI 1 tool, currently used to compile the MCUboot port for
Mbed™ OS, compiles all files unless otherwise specified in .mbedignore.
The espressif directory in the boot folder was added to the ignore file
to prevent failed builds.

Signed-off-by: Sudarshan Sreeram <sudarshan.sreeram@arm.com>
Signed-off-by: David Brown <david.brown@linaro.org>
2021-08-13 10:22:31 -06:00
Sigvart Hovland e933e586ec boot: zephyr: Do not use `irq_lock()` if using arm cleanup
`irq_lock()` sets `BASEPRI_MAX` aka. the `BASEPRI` mask to whatever
zephyr has configured it to be by the value of `_EXC_IRQ_DEFAULT_PRIO`.

However by calling arm_cleanup() we also do the call to
`__disable_irq()` setting the PRIMASK to 1. Meaning the only exceptions
we can recive is fault exceptions. Masking out more exceptions does not
really make sense.

Sometimes applications booted by MCUBoot will not expect the `BASEPRI`
to be set to something else than 0(No effect). Meaning if they depend on
using some exception which now is masked out by `BASEPRI` they will
fail.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2021-08-12 15:23:04 -06:00
Dominik Ermel 4a4d1acec3 boot: Fix log reporting magic from incorrect header
Magic for different header was reported than the one that had failed
the check.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-08-12 14:53:52 -06:00
Øyvind Rønningstad 6693067b3a boot_serial: Reintroduce change from fc1ad8d
Also, keep casts to make build pass.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-08-10 16:58:54 -06:00
Øyvind Rønningstad 1e63e8f1d9 boot_serial: Update cddl-gen version
To bring in bugfixes.
Regenerate code.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-08-10 16:58:54 -06:00
Carlos Falgueras García 391b19781e bootutil: Only include <os/malloc.h> if it going to be used
When no dynamic memory is used, there is no need for include "os/malloc.h",
and do so will force the user to create an empty "os/malloc.h" file.

Signed-off-by: Carlos Falgueras García <carlos.falgueras@wslw.es>
2021-08-09 15:10:19 -06:00
Shubham Kulkarni 8787bb04ae boot/espressif: Update main.c to call init and loader functions
Add ESP specific loader code to load host application

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-08-09 14:57:53 -06:00
Shubham Kulkarni cd86965429 boot/espressif: Update MCUBoot port to use bootloader_flash_* APIs
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-08-09 14:57:53 -06:00
Shubham Kulkarni c75b3c74f2 boot/espressif: Add hal subdirectory for IDF sources and headers
Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-08-09 14:57:53 -06:00
Shubham Kulkarni 052561dcc0 boot/espressif: Add CMakeLists.txt and mcuboot_config.h
Add sources and headers required for build

Signed-off-by: Shubham Kulkarni <shubham.kulkarni@espressif.com>
2021-08-09 14:57:53 -06:00
Andrzej Puzdrowski 420ad9adbd zephyr/boot_serial_extension: kconfig of custom command for get images status
made he command implementation selectable.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-07-30 12:26:43 +02:00
Andrzej Puzdrowski 1b62cf2c10 zephyr/boot_serial_extension: added custom command for get images status
Added service for custom command for fetch non-standard image status.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-07-30 12:26:43 +02:00
Piotr Mienkowski 01c84425b6 zephyr: do not set defaults for LOG_IMMEDIATE Kconfig
LOG_IMMEDIATE Kconfig option has been repurposed and is now a Zephyr's
internal, non-visible symbol that should not be used by the end user.

The logging mode used by MCUBoot is defined in prj.conf

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2021-07-30 09:39:50 +02:00
Dominik Ermel bd69c3dd4b boot_serial: Allow platforms to catch any unprocessed groups
The commit modifies mcumgr group processing in boot_serial_input
to allow catching any group that has not been processed by user
provided function.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-07-30 09:17:05 +02:00
Martí Bolívar 994816d04a zephyr: Kconfig: fix board references
Upstream Zephyr has renamed the 'nonsecure' variants for boards that
support TF-M. The rename consistently uses '_ns' or '_NS' (with
underscore) as the postfix which distinguishes these variants from
their 'secure' versions.

This affects Kconfig symbols used by MCUboot, so fix them to keep
working with the latest zephyr main branch.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-07-29 14:53:22 +02:00
Andrzej Puzdrowski fc1ad8d080 cbor_encoder: fix str encoding macros
Fix structure member assignment in tstrx_put() tstrx_put_term()
macro.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-07-29 12:00:52 +02:00
Ioannis Glaropoulos eb4c2fe3b2 boot: zephyr: add integration platforms to the allow list
The platforms that are listed as integration platforms in
the Zephyr boot sample need to be included in the platform
allow list, otherwise zephyr CI will throw an error. This
commit removes the common list of integration platforms and
adds integration platform entries in each test variant, in
accordance with the allow-list in each of the variants.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-07-29 11:40:37 +02:00
Carl-Johan Landin f44fd6199c zephyr: update devicetree py package lib files include path in assembly
This PR updates the path to the devicetree python package lib files according to the Zephyr PR
zephyrproject-rtos#33746 which moved the devicetree lib files.

Old path: ZEPHYR_BASE/scripts/dts/
New path: ZEPHYR_BASE/scripts/dts/python-devicetree/src/devicetree/

Signed-off-by: Carl-Johan Landin <carl-johan.landin@endian.se>
2021-07-26 10:19:14 +02:00
Salome Thirot 2386267279 boot: Fix IS_ENCRYPTED macro definition
The previous definition did not work as setting any type of flag would
make IS_ENCRYPTED true.

Signed-off-by: Salome Thirot <salome.thirot@arm.com>
2021-07-23 15:52:39 +02:00