Skip to content

Commit f7c8f58

Browse files
committed
Add case for downgrading BL
1 parent b6aa0f9 commit f7c8f58

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libraries/Portenta_System/examples/PortentaH7_updateBootloader/PortentaH7_updateBootloader.ino

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ void setup() {
2929
Serial.print("\nA new bootloader version is available: v" + String(availableBootloaderVersion));
3030
Serial.println(" (Your version: v" + String(currentBootloaderVersion) + ")");
3131
Serial.println("Do you want to update the bootloader? Y/[n]");
32+
} else if(availableBootloaderVersion < currentBootloaderVersion){
33+
Serial.println("\nA newer bootloader version is already installed: v" + String(currentBootloaderVersion));
34+
Serial.println("Do you want to downgrade the bootloader to v" + String(availableBootloaderVersion) + "? Y/[n]");
3235
} else {
33-
Serial.println("The latest version of the bootloader is already installed (v" + String(availableBootloaderVersion) + ").");
36+
Serial.println("\nThe latest version of the bootloader is already installed (v" + String(currentBootloaderVersion) + ").");
3437
Serial.println("Do you want to update the bootloader anyway? Y/[n]");
3538
}
3639

@@ -131,4 +134,4 @@ void applyUpdate(uint32_t address) {
131134

132135
void loop() {
133136
delay(1000);
134-
}
137+
}

0 commit comments

Comments
 (0)