-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
base: master
Are you sure you want to change the base?
Conversation
This is helpful for users building their own bootloaders, and allowing the user to identify what commit the build was built at. Feedback welcome. |
da23530
to
29788c9
Compare
Tools/AP_Bootloader/bl_protocol.cpp
Outdated
@@ -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 |
There was a problem hiding this comment.
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.
There was a problem hiding this 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 !
29788c9
to
ddfcf85
Compare
ddfcf85
to
8b6bb5c
Compare
Tools/scripts/uploader.py
Outdated
@@ -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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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" |
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 |
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
8b6bb5c
to
e2f95b3
Compare
Allows the bootloader build to be identified with
uploader.py