Commit Graph

1770 Commits

Author SHA1 Message Date
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
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