Skip to content

Commit 6054064

Browse files
committed
STM32H7: update sketches reporting BL info
1 parent 3189698 commit 6054064

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

libraries/STM32H747_System/examples/STM32H747_getBootloaderInfo/STM32H747_getBootloaderInfo.ino

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
uint8_t* bootloader_data = (uint8_t*)(0x801F000);
22
uint8_t* bootloader_identification = (uint8_t*)(0x80002F0);
33

4+
#include "portenta_info.h"
5+
uint8_t* boardInfo();
6+
47
void setup() {
58
Serial.begin(115200);
69
while (!Serial) {}
@@ -23,6 +26,18 @@ void setup() {
2326
Serial.println("QSPI size: " + String(bootloader_data[7]) + " MB");
2427
Serial.println("Has Video output: " + String(bootloader_data[8] == 1 ? "Yes" : "No"));
2528
Serial.println("Has Crypto chip: " + String(bootloader_data[9] == 1 ? "Yes" : "No"));
29+
30+
auto info = *((PortentaBoardInfo*)boardInfo());
31+
if (info.magic == 0xB5) {
32+
Serial.println("Secure info version: " + String(info.version));
33+
Serial.println("Secure board revision: " + String(info.revision >> 8) + "." + String(info.revision & 0xFF));
34+
Serial.println("Secure carrier identification: " + String(info.carrier >> 8) + "." + String(info.revision & 0xFF));
35+
Serial.println("Secure vid: 0x" + String(info.vid, HEX));
36+
Serial.println("Secure pid: 0x" + String(info.pid, HEX));
37+
Serial.println("Secure mac: " + String(info.mac_address[0], HEX) + ":" + String(info.mac_address[1], HEX) + ":" +
38+
String(info.mac_address[2], HEX) + ":" + String(info.mac_address[3], HEX) + ":" +
39+
String(info.mac_address[4], HEX) + ":" + String(info.mac_address[5], HEX));
40+
}
2641
}
2742

2843
String getUSBSpeed(uint8_t flag) {

libraries/STM32H747_System/examples/STM32H747_manageBootloader/STM32H747_manageBootloader.ino

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "LittleFileSystem.h"
55
#include "FATFileSystem.h"
66
#if defined(ARDUINO_PORTENTA_H7_M7)
7+
#include "portenta_info.h"
78
#include "portenta_bootloader.h"
89
#include "portenta_lite_bootloader.h"
910
#include "portenta_lite_connected_bootloader.h"
@@ -42,6 +43,8 @@ uint8_t* bootloader_identification = (uint8_t*)(BOOTLOADER_ADDR + bootloader_ide
4243
const unsigned char* bootloader_ptr = &bootloader_mbed_bin[0];
4344
long bootloader_len = bootloader_mbed_bin_len;
4445

46+
uint8_t* boardInfo();
47+
4548
void setup() {
4649
Serial.begin(115200);
4750
while (!Serial) {}
@@ -65,6 +68,18 @@ void setup() {
6568
Serial.println("Has Video output: " + String(bootloader_data[8] == 1 ? "Yes" : "No"));
6669
Serial.println("Has Crypto chip: " + String(bootloader_data[9] == 1 ? "Yes" : "No"));
6770

71+
auto info = *((PortentaBoardInfo*)boardInfo());
72+
if (info.magic == 0xB5) {
73+
Serial.println("Secure info version: " + String(info.version));
74+
Serial.println("Secure board revision: " + String(info.revision >> 8) + "." + String(info.revision & 0xFF));
75+
Serial.println("Secure carrier identification: " + String(info.carrier >> 8) + "." + String(info.revision & 0xFF));
76+
Serial.println("Secure vid: 0x" + String(info.vid, HEX));
77+
Serial.println("Secure pid: 0x" + String(info.pid, HEX));
78+
Serial.println("Secure mac: " + String(info.mac_address[0], HEX) + ":" + String(info.mac_address[1], HEX) + ":" +
79+
String(info.mac_address[2], HEX) + ":" + String(info.mac_address[3], HEX) + ":" +
80+
String(info.mac_address[4], HEX) + ":" + String(info.mac_address[5], HEX));
81+
}
82+
6883
video_available = bootloader_data[8];
6984
wifi_available = bootloader_data[5];
7085

0 commit comments

Comments
 (0)