File tree Expand file tree Collapse file tree 6 files changed +37
-9
lines changed
bootutil/include/bootutil/crypto Expand file tree Collapse file tree 6 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,7 @@ static inline void bootutil_aes_ctr_init(bootutil_aes_ctr_context *ctx)
87
87
88
88
static inline void bootutil_aes_ctr_drop (bootutil_aes_ctr_context * ctx )
89
89
{
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 );
93
91
}
94
92
95
93
static inline int bootutil_aes_ctr_set_key (bootutil_aes_ctr_context * ctx , const uint8_t * k )
Original file line number Diff line number Diff line change @@ -45,9 +45,7 @@ static inline void bootutil_aes_kw_init(bootutil_aes_kw_context *ctx)
45
45
46
46
static inline void bootutil_aes_kw_drop (bootutil_aes_kw_context * ctx )
47
47
{
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 );
51
49
}
52
50
53
51
static inline int bootutil_aes_kw_set_unwrap_key (bootutil_aes_kw_context * ctx , const uint8_t * k , uint32_t klen )
Original file line number Diff line number Diff line change @@ -134,9 +134,7 @@ static inline int bootutil_sha_init(bootutil_sha_context *ctx)
134
134
135
135
static inline int bootutil_sha_drop (bootutil_sha_context * ctx )
136
136
{
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 );
140
138
return 0 ;
141
139
}
142
140
Original file line number Diff line number Diff line change @@ -748,6 +748,12 @@ config BOOT_USB_DFU_DETECT_DELAY
748
748
749
749
endif # BOOT_USB_DFU_GPIO
750
750
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
+
751
757
config BOOT_USE_BENCH
752
758
bool "Enable benchmark code"
753
759
default n
Original file line number Diff line number Diff line change @@ -566,6 +566,14 @@ int main(void)
566
566
* recovery mode
567
567
*/
568
568
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
+ }
569
577
#endif
570
578
571
579
FIH_PANIC ;
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments