File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
libraries/STM32H747_System/examples
STM32H747_getBootloaderInfo
STM32H747_manageBootloader Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change 1
1
uint8_t * bootloader_data = (uint8_t *)(0x801F000 );
2
2
uint8_t * bootloader_identification = (uint8_t *)(0x80002F0 );
3
3
4
+ #if __has_include("portenta_info.h")
4
5
#include " portenta_info.h"
6
+ #define GET_OTP_BOARD_INFO
5
7
uint8_t * boardInfo ();
8
+ #endif
6
9
7
10
void setup () {
8
11
Serial.begin (115200 );
@@ -27,6 +30,7 @@ void setup() {
27
30
Serial.println (" Has Video output: " + String (bootloader_data[8 ] == 1 ? " Yes" : " No" ));
28
31
Serial.println (" Has Crypto chip: " + String (bootloader_data[9 ] == 1 ? " Yes" : " No" ));
29
32
33
+ #ifdef GET_OTP_BOARD_INFO
30
34
auto info = *((PortentaBoardInfo*)boardInfo ());
31
35
if (info.magic == 0xB5 ) {
32
36
Serial.println (" Secure info version: " + String (info.version ));
@@ -38,6 +42,7 @@ void setup() {
38
42
String (info.mac_address [2 ], HEX) + " :" + String (info.mac_address [3 ], HEX) + " :" +
39
43
String (info.mac_address [4 ], HEX) + " :" + String (info.mac_address [5 ], HEX));
40
44
}
45
+ #endif
41
46
}
42
47
43
48
String getUSBSpeed (uint8_t flag) {
Original file line number Diff line number Diff line change 11
11
#include " mcuboot_bootloader.h"
12
12
#include " ecdsa-p256-encrypt-key.h"
13
13
#include " ecdsa-p256-signing-key.h"
14
+ #define GET_OTP_BOARD_INFO
14
15
#elif defined(ARDUINO_NICLA_VISION)
15
16
#include " nicla_vision_bootloader.h"
16
17
#endif
@@ -68,6 +69,7 @@ void setup() {
68
69
Serial.println (" Has Video output: " + String (bootloader_data[8 ] == 1 ? " Yes" : " No" ));
69
70
Serial.println (" Has Crypto chip: " + String (bootloader_data[9 ] == 1 ? " Yes" : " No" ));
70
71
72
+ #ifdef GET_OTP_BOARD_INFO
71
73
auto info = *((PortentaBoardInfo*)boardInfo ());
72
74
if (info.magic == 0xB5 ) {
73
75
Serial.println (" Secure info version: " + String (info.version ));
@@ -79,6 +81,7 @@ void setup() {
79
81
String (info.mac_address [2 ], HEX) + " :" + String (info.mac_address [3 ], HEX) + " :" +
80
82
String (info.mac_address [4 ], HEX) + " :" + String (info.mac_address [5 ], HEX));
81
83
}
84
+ #endif
82
85
83
86
video_available = bootloader_data[8 ];
84
87
wifi_available = bootloader_data[5 ];
You can’t perform that action at this time.
0 commit comments