Skip to content

Commit

Permalink
[nrf mergeup] Merge upstream up to commit e890df7
Browse files Browse the repository at this point in the history
To align with the upstream SHA in sdk-zephyr west.yml file used during
the latest upmerge.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos committed Oct 22, 2024
2 parents 29646ac + e890df7 commit 720fa02
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 9 deletions.
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/aes_ctr.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ static inline void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx)

static inline void bootutil_aes_ctr_drop(bootutil_aes_ctr_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_aes_free(ctx); */
(void)ctx;
mbedtls_aes_free(ctx);
}

static inline int bootutil_aes_ctr_set_key(bootutil_aes_ctr_context *ctx, const uint8_t *k)
Expand Down
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/aes_kw.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ static inline void bootutil_aes_kw_init(bootutil_aes_kw_context *ctx)

static inline void bootutil_aes_kw_drop(bootutil_aes_kw_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_aes_free(ctx); */
(void)ctx;
mbedtls_nist_kw_free(ctx);
}

static inline int bootutil_aes_kw_set_unwrap_key(bootutil_aes_kw_context *ctx, const uint8_t *k, uint32_t klen)
Expand Down
4 changes: 1 addition & 3 deletions boot/bootutil/include/bootutil/crypto/sha.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ static inline int bootutil_sha_init(bootutil_sha_context *ctx)

static inline int bootutil_sha_drop(bootutil_sha_context *ctx)
{
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
/* (void)mbedtls_sha256_free(ctx); */
(void)ctx;
mbedtls_sha256_free(ctx);
return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,12 @@ config BOOT_USB_DFU_DETECT_DELAY

endif # BOOT_USB_DFU_GPIO

config BOOT_USB_DFU_NO_APPLICATION
bool "Stay in bootloader if no application"
help
Allows for entering USB DFU recovery mode if there is no bootable
application that the bootloader can jump to.

config BOOT_USE_BENCH
bool "Enable benchmark code"
default n
Expand Down
8 changes: 8 additions & 0 deletions boot/zephyr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,14 @@ int main(void)
* recovery mode
*/
boot_serial_enter();
#elif defined(CONFIG_BOOT_USB_DFU_NO_APPLICATION)
rc = usb_enable(NULL);
if (rc && rc != -EALREADY) {
BOOT_LOG_ERR("Cannot enable USB");
} else {
BOOT_LOG_INF("Waiting for USB DFU");
wait_for_usb_dfu(K_FOREVER);
}
#endif

FIH_PANIC;
Expand Down
20 changes: 20 additions & 0 deletions boot/zephyr/socs/esp32c2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

CONFIG_BOOT_MAX_IMG_SECTORS=512
CONFIG_BOOT_UPGRADE_ONLY=y
CONFIG_BOOT_VALIDATE_SLOT0=n
CONFIG_BOOT_SIGNATURE_TYPE_NONE=y
CONFIG_BOOT_BANNER=n

CONFIG_UART_CONSOLE=n
CONFIG_CONSOLE=n
CONFIG_SERIAL=n

CONFIG_MCUBOOT_LOG_LEVEL_OFF=y
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_DEBUG=n

CONFIG_XIP=n
CONFIG_HEAP_MEM_POOL_SIZE=4096
CONFIG_MINIMAL_LIBC=y

0 comments on commit 720fa02

Please sign in to comment.