Return the device pointer if the node identifier
refers to a watchdog node with status “okay”,
otherwise return NULL.
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Updates the CI workflows to use the Zephyr SDK 0.15.0 for
building and testing Zephyr in the CI.
Fixes:
E: CMake Error at cmake/modules/verify-toolchain.cmake:79 (find_package):
Could not find a configuration file for package "Zephyr-sdk" that is
compatible with requested version "0.15".
The following configuration files were considered but not accepted:
Signed-off-by: Bartosz Bilas <bartosz.bilas@hotmail.com>
Update flash_map_backend.h to be compatible with a C++ compiler
Signed-off-by: Andrés Sánchez Pascual <tito97_sp@hotmail.com>
Signed-off-by: GitHub <noreply@github.com>
The image_ok was written to the wrong offset
when outputting HEX format. This commit fixes that.
Drive-by change: Use actual length of boot magic
instead of assuming it's 16 bytes long.
Signed-off-by: Alexander Mihajlovic <alexander@eub.se>
zephyr is transition away from devicetree label property for nodes
that are associated with devices. So remove it from flash nodes.
Signed-off-by: Kumar Gala <galak@kernel.org>
This adds short explanation (in form of a comment) why CPU shouldn't
enter idle state in timeout based serial recovery.
Ref: 3942e9bf8f ("boot_serial: fix serial recovery mode with timeout")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
If 'BOOT_SERIAL_WAIT_FOR_DFU' is selected, the CPU shouldn't enter idle
state, waiting for interrupt from the console because we expect booting
if no mcumgr command is received within a configured timeout (with the
'CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT').
Without this fix, when using 'BOOT_SERIAL_WAIT_FOR_DFU' the boot process
hangs forever, waiting for input from console.
Fixes: e3822f8180 ("boot_serial: zephyr: Add optional timeout to enter serial recovery")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
zephyr is transition away from devicetree label property for nodes
that are associated with devices. So remove it from
"zephyr,cdc-acm-uart" nodes.
Signed-off-by: Kumar Gala <galak@kernel.org>
Replace the `device_get_binding` usage with
a `DEVICE_DT_GET` which is being deprecated in the upstream zephyr.
Signed-off-by: Bartosz Bilas <b.bilas@grinn-global.com>
This patch removes CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE option
which was used to point to hooks implementation file.
It is better that the project customization is up to add required
files instead. This gives more flexibility in provisioning these
sources (there may be multiple files).
This also simplifies Kconfig options.
In order to keep possibility for build-test the Hooks feature
hooks_sample.c will be included into the build if commandline
will specify -DTEST_BOOT_IMAGE_ACCESS_HOOKS=Y option.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The `BOOT_LOG_INF` function, which uses the format specifiers defined
by the C standard, was incorrectly printing a variable with the type of
`off_t` using the `%x` format specifier, which is intended to be used
with the `int` type.
The `off_t` type, specified by the POSIX standard, is not guaranteed to
be `int`, and it may be defined as `long` or `long long` depending on
the toolchain and the target architecture.
This commit updates the print routine such that it casts the arguments
of the `off_t` type to `intmax_t` and prints them out using the
corresponding `%jx` format specifier.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
remove flash_device_get_binding as we can utilizes DEVICE_DT_GET to
get the flash_dev pointer set at build time. This removes usage of
device_get_binding and handles the lack of 'label' properties in
the devicetree better.
Signed-off-by: Kumar Gala <galak@kernel.org>
The legacy logging subsystem was removed in below commit:
https://github.com/zephyrproject-rtos/zephyr/commit/c5f2cde
This commit maintains compatibility with Zephyr upstream before
and after the change by using the now removed CONFIG_LOG1 and
CONFIG_LOG2 defines.
Signed-off-by: Martin Jäger <martin@libre.solar>
Add relevant "zephyr/" prefixes to allow building with the Zephyr
option CONFIG_LEGACY_INCLUDE_PATH=n.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Sine https://github.com/zephyrproject-rtos/zephyr/pull/47629 was
merged the qspi nod driver is enabled by default. This cause unwanted
flash footprint rise for configurations which are not using the qspi.
This patch disables it back.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Add the serial adapter for ESP32 for boot recovery and MCUMGR
communication.
Signed-off-by: Almir Okato <almir.okato@espressif.com>
espressif: Configure console via bootloader_support functions
Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
add support for RT1170 and RT1160 CM7 cores, which have large flash
sizes and require an increase to the value of BOOT_MAX_IMG_SECTORS
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Update some of the dependencies to newer versions, and run `cargo
update`. This will resolve some potential security warnings about
issues found in older versions of dependencies. I don't believe any of
these affect this code.
Signed-off-by: David Brown <david.brown@linaro.org>
repos/mcuboot/boot/boot_serial/test/src/testcases/
boot_serial_upload_bigger_image.c: In function
‘TEST_CASE_boot_serial_upload_bigger_image’:
repos/mcuboot/boot/boot_serial/test/src/testcases/
boot_serial_upload_bigger_image.c:91:42: error:
‘Value8Bit’ undeclared (first use in this function)
91 | buf[payload_off + len - 2] = Value8Bit;
| ^~~~~~~~~
Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
Since #1383 the configuration translation header and
the logging translation header are not used by the simiulator.
Thanks to that __BOOTSIM__ dependence might be removed - what is done
in this patch.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The progressive erase and non-progressive erase code has been
refactored; some additional comments have been added to logic.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Types of a few variables have been changed to more align with
what they represent; variables have been renamed to make their
purpose more clear.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
<zephyr/zephyr.h> is just a shim to the <zephyr/kernel.h> header, better
use it directly as it is explicit that Kernel APIs are being included.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Zephyr has prefixed all of its includes with <zephyr/...>. While the
_old_ mode can still be used (CONFIG_LEGACY_INCLUDE_PATH) and is still
enabled by default, it's better to be prepared for its removal in the
future.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
According to mbedTLS' Changelog "Mbed TLS 3.0.0 branch released
2021-07-07" -> "Removals":
MBEDTLS_ECP_MAX_BITS is no longer a configuration option because it
is now determined automatically based on supported curves.
Hence remove MBEDTLS_ECP_MAX_BITS from configuration files to fix build
issues with Zephyr when there is unfortunate order of include
statements, like:
/__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c
In file included from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/ssl.h:30,
from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/debug.h:27,
from /__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c:16:
/__w/zephyr/modules/crypto/mbedtls/include/mbedtls/ecp.h:314: error: "MBEDTLS_ECP_MAX_BITS" redefined [-Werror]
314 | #define MBEDTLS_ECP_MAX_BITS 1
|
In file included from /__w/zephyr/bootloader/mcuboot/boot/zephyr/include/mcuboot-mbedtls-cfg.h:25,
from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/build_info.h:59,
from /__w/zephyr/modules/crypto/mbedtls/include/mbedtls/debug.h:25,
from /__w/zephyr/zephyr/modules/mbedtls/zephyr_init.c:16:
/__w/zephyr/bootloader/mcuboot/boot/zephyr/include/config-rsa.h:72: note: this is the location of the previous definition
72 | #define MBEDTLS_ECP_MAX_BITS 2048
|
cc1: all warnings being treated as errors
Signed-off-by: Marcin Niestroj <m.niestroj@emb.dev>
The sim platform was sharing a few header
files with the zephyr-rtos port. This patch provides
sim own headers.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
There is code for sharing data between booloader and application.
So far only zephyr had config flags to enable this.
This adds configuration that allows to turn on data sharing code
in mynewt version.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
BOOT_CUSTOM_START is defined by APP package (here).
This changes default value from 0 to empty
to allow for constructing packege that provides function
boot_custom_start() and automatically sets BOOT_CUSTOM_START to 1
for easy setup.
Signed-off-by: Jerzy Kasenberg <jerzy.kasenberg@codecoup.pl>
Move formatting of version string to use snprintf, which Zephyr
provides, instead defining utility function for that purpose.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Added note of deprecation of hardware properties of
the gpio-pin used for triggering the recovery DFU modes.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Added support for configure GPIO-pin used for triggering the
recovery DFU using DTS. That pin is assigned thanks to
`mcuboot-button0` pin-allias.
DTS configuration takes precedence over the Kconfig pin configurations.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
MCUboot allows one recovery protocol at build-time.
Therefore detection procedure can use the build-time pin
configuration instead of run-time parameters.
This patch prepares detec_value() function for switching to
DTS pin configuration.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
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>
Adds an optional callback when the MCUboot status changes which can
allow components to react.
Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
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>
LED usage code were simplified thanks to `struct gpio_dt_spec`
and related methods.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>