-
Notifications
You must be signed in to change notification settings - Fork 2k
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
make: verify before flash #11093
make: verify before flash #11093
Conversation
I like the idea, but I would define it empty by default and add the handling if defined. Also, both variables need to be documented. |
One observation: this works only if the flasher only flashes and nothing more. If the flasher also resets, then the reset has to be added as an additional step that is always performed. |
I tested, and with @jcarrano On Both these case should be documented as requirements. Another solution is to allow overwriting |
I fixed a typo in the PR description. ( |
I don't think that's a problem. I'd even say it's better: after FLASH the board is reset, so having it reset after verify is consistent. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
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.
ACK. I'd love to see this merged. In a previous post @cladmi already confirmed that it works, so testing is already done.
I agree that more documentation would be nice. But honestly, this would require some dedicated section in Doxygen for the build system to add this to. This is however currently missing. (I think that such a section would be helpful to keep the use of the build system more consisted, as people will have some place to look at when trying to figure out how to add something to the build system. But that is out of scope of this PR anyway.)
Contribution description
Some flashers (jlink) check if the flash contents already matches the to-be-written binary and if yes, skip re-programming. That saves time and flash cycles.
This PR adds make infrastructure to support that with other flashers, too.
Basically it works by, instead of doing
$flash $flash_args
, it does$flash_verify || $flash $flash_args
.If no
FLASH_VERIFY
is provided,false
is used thus flashing is done as before.Another commit implements this for edbg.
Testing procedure
With an edbg supported board, try
make all; make flash-only; make flash-only
and observe that the first flashing actually programs the device, the second skips programming.Also test non-edbg boards (which don't yet supply "FLASH_VERIFY").
Issues/PRs references
none