Skip to content

Provide better info about the bootloader data #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,41 @@ void setup() {
Serial.begin(115200);
while (!Serial) {}

Serial.println("Validation: " + String(bootloader_data[0], HEX));
Serial.println("BL version: " + String(bootloader_data[1]));
Serial.println("Clock source: " + String(bootloader_data[2]));
Serial.println("USB Speed: " + String(bootloader_data[3]));
Serial.println("Ethernet: " + String(bootloader_data[4]));
Serial.println("Wifi: " + String(bootloader_data[5]));
Serial.println("RAM size: " + String(bootloader_data[6]));
Serial.println("QSPI size: " + String(bootloader_data[7]));
Serial.println("Video: " + String(bootloader_data[8]));
Serial.println("Crypto: " + String(bootloader_data[9]));
Serial.println("Magic Number (validation): " + String(bootloader_data[0], HEX));
Serial.println("Bootloader version: " + String(bootloader_data[1]));
Serial.println("Clock source: " + getClockSource(bootloader_data[2]));
Serial.println("USB Speed: " + getUSBSpeed(bootloader_data[3]));
Serial.println("Has Ethernet: " + String(bootloader_data[4] == 1 ? "Yes" : "No"));
Serial.println("Has WiFi module: " + String(bootloader_data[5] == 1 ? "Yes" : "No"));
Serial.println("RAM size: " + String(bootloader_data[6]) + " MB");
Serial.println("QSPI size: " + String(bootloader_data[7]) + " MB");
Serial.println("Has Video output: " + String(bootloader_data[8] == 1 ? "Yes" : "No"));
Serial.println("Has Crypto chip: " + String(bootloader_data[9] == 1 ? "Yes" : "No"));
}

String getUSBSpeed(uint8_t flag) {
switch (flag){
case 1:
return "USB 2.0/Hi-Speed (480 Mbps)";
case 2:
return "USB 1.1/Full-Speed (12 Mbps)";
default:
return "N/A";
}
}

String getClockSource(uint8_t flag) {
switch (flag){
case 0x8:
return "External clock (ST Link MCO)";
Copy link
Member

@facchinm facchinm Oct 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd change the strings here as

External oscillator
External crystal
Internal clock

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@facchinm Shall I create another PR for it?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup :)

case 0x4:
return "External xtal (X3 on board - not provided by default)";
case 0x2:
return "HSI internal clock";
default:
return "N/A";
}

}

void loop() {
Expand Down