Skip to content

Commit e8e47b8

Browse files
committed
Opta: add support to manageBootloader sketch
1 parent fcba02f commit e8e47b8

File tree

3 files changed

+21361
-2
lines changed

3 files changed

+21361
-2
lines changed

libraries/STM32H747_System/examples/STM32H747_manageBootloader/STM32H747_manageBootloader.ino

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
#define GET_OTP_BOARD_INFO
1515
#elif defined(ARDUINO_NICLA_VISION)
1616
#include "nicla_vision_bootloader.h"
17+
#elif defined(ARDUINO_OPTA)
18+
#include "opta_bootloader.h"
19+
#include "mcuboot_opta.h"
20+
#include "ecdsa-p256-encrypt-key.h"
21+
#include "ecdsa-p256-signing-key.h"
1722
#endif
1823

1924
#ifndef CORE_CM7
@@ -86,7 +91,7 @@ void setup() {
8691
video_available = bootloader_data[8];
8792
wifi_available = bootloader_data[5];
8893

89-
#if defined(ARDUINO_PORTENTA_H7_M7)
94+
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
9095
Serial.println("\nDo you want to install/update the default Arduino bootloader? Y/[n]");
9196
Serial.println("Choosing \"No\", will install/update the MCUboot bootloader.");
9297
if(!waitResponse()) {
@@ -102,6 +107,7 @@ void setup() {
102107
if (!MCUboot) {
103108
bootloader_ptr = &bootloader_mbed_bin[0];
104109
bootloader_len = bootloader_mbed_bin_len;
110+
#if defined(ARDUINO_PORTENTA_H7_M7)
105111
if (!video_available) {
106112
if (wifi_available) {
107113
bootloader_ptr = &bootloader_mbed_lite_connected_bin[0];
@@ -111,6 +117,7 @@ void setup() {
111117
bootloader_len = bootloader_mbed_lite_bin_len;
112118
}
113119
}
120+
#endif
114121
}
115122
#endif
116123

@@ -324,7 +331,7 @@ void applyUpdate(uint32_t address) {
324331
}
325332
}
326333

327-
#if defined(ARDUINO_PORTENTA_H7_M7)
334+
#if defined(ARDUINO_PORTENTA_H7_M7) || defined(ARDUINO_OPTA)
328335
if (writeKeys) {
329336
flash.program(&enc_priv_key, ENCRYPT_KEY_ADDR, ENCRYPT_KEY_SIZE);
330337
flash.program(&ecdsa_pub_key, SIGNING_KEY_ADDR, SIGNING_KEY_SIZE);

0 commit comments

Comments
 (0)