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 11uint8_t * bootloader_data = (uint8_t *)(0x801F000 );
22uint8_t * bootloader_identification = (uint8_t *)(0x80002F0 );
33
4+ #if __has_include("portenta_info.h")
45#include " portenta_info.h"
6+ #define GET_OTP_BOARD_INFO
57uint8_t * boardInfo ();
8+ #endif
69
710void setup () {
811 Serial.begin (115200 );
@@ -27,6 +30,7 @@ void setup() {
2730 Serial.println (" Has Video output: " + String (bootloader_data[8 ] == 1 ? " Yes" : " No" ));
2831 Serial.println (" Has Crypto chip: " + String (bootloader_data[9 ] == 1 ? " Yes" : " No" ));
2932
33+ #ifdef GET_OTP_BOARD_INFO
3034 auto info = *((PortentaBoardInfo*)boardInfo ());
3135 if (info.magic == 0xB5 ) {
3236 Serial.println (" Secure info version: " + String (info.version ));
@@ -38,6 +42,7 @@ void setup() {
3842 String (info.mac_address [2 ], HEX) + " :" + String (info.mac_address [3 ], HEX) + " :" +
3943 String (info.mac_address [4 ], HEX) + " :" + String (info.mac_address [5 ], HEX));
4044 }
45+ #endif
4146}
4247
4348String getUSBSpeed (uint8_t flag) {
Original file line number Diff line number Diff line change 1111#include " mcuboot_bootloader.h"
1212#include " ecdsa-p256-encrypt-key.h"
1313#include " ecdsa-p256-signing-key.h"
14+ #define GET_OTP_BOARD_INFO
1415#elif defined(ARDUINO_NICLA_VISION)
1516#include " nicla_vision_bootloader.h"
1617#endif
@@ -68,6 +69,7 @@ void setup() {
6869 Serial.println (" Has Video output: " + String (bootloader_data[8 ] == 1 ? " Yes" : " No" ));
6970 Serial.println (" Has Crypto chip: " + String (bootloader_data[9 ] == 1 ? " Yes" : " No" ));
7071
72+ #ifdef GET_OTP_BOARD_INFO
7173 auto info = *((PortentaBoardInfo*)boardInfo ());
7274 if (info.magic == 0xB5 ) {
7375 Serial.println (" Secure info version: " + String (info.version ));
@@ -79,6 +81,7 @@ void setup() {
7981 String (info.mac_address [2 ], HEX) + " :" + String (info.mac_address [3 ], HEX) + " :" +
8082 String (info.mac_address [4 ], HEX) + " :" + String (info.mac_address [5 ], HEX));
8183 }
84+ #endif
8285
8386 video_available = bootloader_data[8 ];
8487 wifi_available = bootloader_data[5 ];
You can’t perform that action at this time.
0 commit comments