Skip to content

Commit 720fa02

Browse files
committed
[nrf mergeup] Merge upstream up to commit e890df7
To align with the upstream SHA in sdk-zephyr west.yml file used during the latest upmerge. Signed-off-by: Robert Lubos <[email protected]>
2 parents 29646ac + e890df7 commit 720fa02

File tree

6 files changed

+37
-9
lines changed

6 files changed

+37
-9
lines changed

boot/bootutil/include/bootutil/crypto/aes_ctr.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ static inline void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx)
8787

8888
static inline void bootutil_aes_ctr_drop(bootutil_aes_ctr_context *ctx)
8989
{
90-
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
91-
/* (void)mbedtls_aes_free(ctx); */
92-
(void)ctx;
90+
mbedtls_aes_free(ctx);
9391
}
9492

9593
static inline int bootutil_aes_ctr_set_key(bootutil_aes_ctr_context *ctx, const uint8_t *k)

boot/bootutil/include/bootutil/crypto/aes_kw.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ static inline void bootutil_aes_kw_init(bootutil_aes_kw_context *ctx)
4545

4646
static inline void bootutil_aes_kw_drop(bootutil_aes_kw_context *ctx)
4747
{
48-
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
49-
/* (void)mbedtls_aes_free(ctx); */
50-
(void)ctx;
48+
mbedtls_nist_kw_free(ctx);
5149
}
5250

5351
static inline int bootutil_aes_kw_set_unwrap_key(bootutil_aes_kw_context *ctx, const uint8_t *k, uint32_t klen)

boot/bootutil/include/bootutil/crypto/sha.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,7 @@ static inline int bootutil_sha_init(bootutil_sha_context *ctx)
134134

135135
static inline int bootutil_sha_drop(bootutil_sha_context *ctx)
136136
{
137-
/* XXX: config defines MBEDTLS_PLATFORM_NO_STD_FUNCTIONS so no need to free */
138-
/* (void)mbedtls_sha256_free(ctx); */
139-
(void)ctx;
137+
mbedtls_sha256_free(ctx);
140138
return 0;
141139
}
142140

boot/zephyr/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,12 @@ config BOOT_USB_DFU_DETECT_DELAY
748748

749749
endif # BOOT_USB_DFU_GPIO
750750

751+
config BOOT_USB_DFU_NO_APPLICATION
752+
bool "Stay in bootloader if no application"
753+
help
754+
Allows for entering USB DFU recovery mode if there is no bootable
755+
application that the bootloader can jump to.
756+
751757
config BOOT_USE_BENCH
752758
bool "Enable benchmark code"
753759
default n

boot/zephyr/main.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,14 @@ int main(void)
566566
* recovery mode
567567
*/
568568
boot_serial_enter();
569+
#elif defined(CONFIG_BOOT_USB_DFU_NO_APPLICATION)
570+
rc = usb_enable(NULL);
571+
if (rc && rc != -EALREADY) {
572+
BOOT_LOG_ERR("Cannot enable USB");
573+
} else {
574+
BOOT_LOG_INF("Waiting for USB DFU");
575+
wait_for_usb_dfu(K_FOREVER);
576+
}
569577
#endif
570578

571579
FIH_PANIC;

boot/zephyr/socs/esp32c2.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_BOOT_MAX_IMG_SECTORS=512
5+
CONFIG_BOOT_UPGRADE_ONLY=y
6+
CONFIG_BOOT_VALIDATE_SLOT0=n
7+
CONFIG_BOOT_SIGNATURE_TYPE_NONE=y
8+
CONFIG_BOOT_BANNER=n
9+
10+
CONFIG_UART_CONSOLE=n
11+
CONFIG_CONSOLE=n
12+
CONFIG_SERIAL=n
13+
14+
CONFIG_MCUBOOT_LOG_LEVEL_OFF=y
15+
CONFIG_LOG_DEFAULT_LEVEL=0
16+
CONFIG_DEBUG=n
17+
18+
CONFIG_XIP=n
19+
CONFIG_HEAP_MEM_POOL_SIZE=4096
20+
CONFIG_MINIMAL_LIBC=y

0 commit comments

Comments
 (0)