-
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
makefiles/boot/riotboot: clean bootloader when cleaning application #16197
Conversation
makefiles/boot/riotboot.mk
Outdated
# riotboot bootloader compile target | ||
riotboot/flash-bootloader: riotboot/bootloader/flash | ||
riotboot/bootloader/%: $(BUILDDEPS) | ||
riotboot/bootloader/%: $(BUILDDEPS) | $$(filter-out $$@,$$(RIOTBOOT_CLEAN)) |
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.
or just add | $(CLEAN)
here?
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.
ah, no, it must be riotboot/bootloader/clean
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.
maybe riotboot/bootloader/clean
can be added to "clean" as prerequisite?
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.
That does the trick as well.
cd6be45
to
744b0fb
Compare
Split out the secondexpansion part as it is now unrelated. |
Hmm this also introduces a circular dependency:
|
Only related to |
I think I like the other version better, by adding it ti clean I'll get circular dependencies every time something extra is added to |
ping @kaspar030! |
744b0fb
to
edeacbf
Compare
Figured out a solution with secondexpansion. |
I think there is an issue:
see compilation going on (I think it is riotboot) after |
This is actually alright, thanks @fjmolinas. The elf gets built, then the bootloader, then they get combined into the final .bin. |
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.
Contribution description
When using
riotboot
conveniently the extended binary is used. But ifclean
is also used then the bootloader binary is not cleaned, this can lead to unexpected behavior where a previous bootloader (eg: different start addresses) is used.Testing procedure
make -C tests/riotboot flash
make -C tests/riotboot clean flash -j3
you should see that that the bootloader and application are compiled while in master only the application is:What is actually called can be seen with this patch easily: