@@ -70,8 +70,18 @@ void setup() {
70
70
71
71
#if defined(ARDUINO_PORTENTA_H7_M7)
72
72
Serial.println (" \n Do you want to update the default Arduino bootloader? Y/[n]" );
73
- Serial.println (" If No, MCUBoot bootloader will be updated." );
74
- if (waitResponse ()) {
73
+ Serial.println (" If No, MCUboot bootloader will be updated." );
74
+ if (!waitResponse ()) {
75
+ Serial.println (" \n MCUboot has been selected. Do you want to proceed? Y/[n]" );
76
+ if (waitResponse ()) {
77
+ MCUboot = true ;
78
+ bootloader_ptr = &mcuboot_bin[0 ];
79
+ bootloader_len = mcuboot_bin_len;
80
+ } else {
81
+ Serial.println (" \n Proceeding with the default Arduino bootloader..." );
82
+ }
83
+ }
84
+ if (!MCUboot) {
75
85
bootloader_ptr = &bootloader_mbed_bin[0 ];
76
86
bootloader_len = bootloader_mbed_bin_len;
77
87
if (!video_available) {
@@ -83,9 +93,6 @@ void setup() {
83
93
bootloader_len = bootloader_mbed_lite_bin_len;
84
94
}
85
95
}
86
- } else {
87
- bootloader_ptr = &mcuboot_bin[0 ];
88
- bootloader_len = mcuboot_bin_len;
89
96
}
90
97
#endif
91
98
@@ -122,8 +129,16 @@ void setup() {
122
129
if (writeLoader) {
123
130
if (availableBootloaderIdentifier.equals (" MCUboot Arduino" )) {
124
131
setupMCUBootOTAData ();
132
+
125
133
Serial.println (" \n The bootloader comes with a set of default keys to evaluate signing and encryption process" );
126
- Serial.println (" Do you want to load default keys? Y/[n]" );
134
+ Serial.println (" If you load the keys, you will need to upload the future sketches with Security Settings -> Signing + Encryption." );
135
+ Serial.println (" If you select Security Settings -> None, the sketches will not be executed." );
136
+ Serial.println (" Do you want to load the keys? Y/[n]" );
137
+ if (waitResponse ()) {
138
+ Serial.println (" \n Please notice that loading the keys will enable MCUboot Sketch swap. This will increase the sketch update time after the upload." );
139
+ Serial.println (" A violet LED will blink until the sketch is ready to run." );
140
+ Serial.println (" Do you want to proceed loading the default keys? Y/[n]" );
141
+ }
127
142
writeKeys = waitResponse ();
128
143
}
129
144
applyUpdate (BOOTLOADER_ADDR);
@@ -200,7 +215,7 @@ void setupMCUBootOTAData() {
200
215
201
216
int err = ota_data_fs.reformat (&ota_data);
202
217
if (err) {
203
- Serial.println (" Error creating MCUBoot files in OTA partition" );
218
+ Serial.println (" Error creating MCUboot files in OTA partition" );
204
219
}
205
220
206
221
FILE* fp = fopen (" /fs/scratch.bin" , " wb" );
0 commit comments