Skip to content

Commit afad107

Browse files
pennamgiulcioffi
authored andcommitted
STM32H747_getBootloaderInfo: Add support for bootloader identifier
1 parent 92856f6 commit afad107

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo/STM32H747_getBootloaderInfo.ino

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
uint8_t* bootloader_data = (uint8_t*)(0x801F000);
2+
uint8_t* bootloader_identification = (uint8_t*)(0x80002F0);
23

34
void setup() {
45
Serial.begin(115200);
56
while (!Serial) {}
6-
7+
8+
uint8_t currentBootloaderVersion = bootloader_data[1];
9+
String currentBootloaderIdentifier = String(bootloader_identification, 15);
10+
11+
if(!currentBootloaderIdentifier.equals("MCUboot Arduino")) {
12+
currentBootloaderIdentifier = "Arduino loader";
13+
}
14+
15+
Serial.println(currentBootloaderIdentifier);
716
Serial.println("Magic Number (validation): " + String(bootloader_data[0], HEX));
817
Serial.println("Bootloader version: " + String(bootloader_data[1]));
918
Serial.println("Clock source: " + getClockSource(bootloader_data[2]));

0 commit comments

Comments
 (0)