Skip to content
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

Bootloader: Add Reading of Git SHA to bootloader #28492

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

joshanne
Copy link
Contributor

Allows the bootloader build to be identified with uploader.py

@joshanne
Copy link
Contributor Author

This is helpful for users building their own bootloaders, and allowing the user to identify what commit the build was built at.

Feedback welcome.

@@ -128,6 +128,7 @@
#define PROTO_DEVICE_FW_SIZE 4 // size of flashable area
#define PROTO_DEVICE_VEC_AREA 5 // contents of reserved vectors 7-10
#define PROTO_DEVICE_EXTF_SIZE 6 // size of available external flash
#define PROTO_DEVICE_BL_GIT_HASH 7 // git hash of bootloader build
Copy link
Contributor Author

@joshanne joshanne Oct 29, 2024

Choose a reason for hiding this comment

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

I've also got changes that add reading off the Application Git SHA if AP_CHECK_FIRMWARE_ENABLED is enabled in the bootloader (and application).

We certainly would find these handy, just a question of if this is desirable in the bootloader.

Copy link
Contributor

@khancyr khancyr left a comment

Choose a reason for hiding this comment

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

great idea, that would prevent to always have to update the bootloader when you do custom one's !

@@ -839,6 +844,9 @@ def dump_board_info(self):
print(" board_type: %u" % self.board_type)
print(" board_rev: %u" % self.board_rev)

git_hash_bl = "%x" % (self.git_hash_bl) if self.bl_rev > 5 else "UNKNOWN"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
git_hash_bl = "%x" % (self.git_hash_bl) if self.bl_rev > 5 else "UNKNOWN"
git_hash_bl = "%x" % (self.git_hash_bl) if self.bl_rev > 5 else "UNAVAILABLE"

@tridge
Copy link
Contributor

tridge commented Nov 5, 2024

if we can get away without a protocol change, by checking for a NACK then that would be less risky, otherwise we need to be sure existing bootloader clients are OK

@peterbarker
Copy link
Contributor

Wrote this about 4 years ago - glad someone's pushing through with it (https://github.com/ArduPilot/ardupilot/pull/14768/files)

Allows for reading of the git sha from the bootloader to ascertain the sha the bootloader is built at
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants