Makefiles: add support to generate both .hex and .bin file and add FLASHFILE variable#8838
Conversation
967ed6b to
9c0eebf
Compare
|
The commits are normally all working and can be reviewed individually to see the whole process. |
|
My gut feeling is that splitting this up would speed up reviewing. |
Ah, seems like you're already doing that. ;) |
|
Rebase required (unless there are more PRs this is based on) |
|
I plan to do another sub-PR I yet did not have time to describe alone. But will rebase. |
e16e238 to
891ebdf
Compare
0409eb5 to
9d48995
Compare
9d48995 to
27a7b63
Compare
19453e8 to
72d6ab9
Compare
eec068e to
27f1b66
Compare
27f1b66 to
8fb6418
Compare
8fb6418 to
795f150
Compare
|
Re-run check to see what has not been updated recently. |
|
This pull request is now not waiting for other pull requests anymore and I added the end of migration commit. The test would prevent compilation: In the current form, it would ignore compiling it in I re-did the "Verifying after rebase" and found one remaining instance of setting |
|
@jia200x @leandrolanzieri how about this? Can this move? |
Update the documentation to say it can also be 'ELFFILE' The first version was setting it to EFLFILE by default but the default behavior was removed to prevent hiding errors. It can also be overwritten for application specific needs, like when using 'riotboot'.
* Remove the transition documentation. * assert that FLASHFILE is now defined
|
I rebased to master to simplify testing in case new boards would be broken. And currently all boards correctly define FLASHFILE as this goes to the end: No error on any boards |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
It seems like everything is up to date. If not I guess murdock will complain with this PR.
ACK!
|
I think it would not complain for the boards in Lines 120 to 124 in 552e425 But the test from #8838 (comment) would have reported an issue. |
|
As I was asked precision about my comment IRL. For the boards in However, the test in my #8838 (comment) comment would have reported error if a current board was not setting If a new board is added, or boards are refactored, a local compilation should also be done which would report the missing I could add an handling for this that detects if the reported toolchain is empty. However, for non default Also, any other errors during the makefile (that is not info-boards-supported) would make the board ignored by murdock so it is not specific to this. |
|
Thanks update. I still think this is good to go! |
|
Thank you for the review. Took 1 year and a half to get rid of such a bad pattern D: Finally done. |
Contribution description
I need to be able to generate a
.binfile to flash nucleo boards by drag-and-dropping the firmware.The main goal of this PR main is to add a target for the bin file. This would allow asking for building the bin file from the command line but not creating it for every build.
HEXFILE = $(ELFFILE:.elf=.bin)hackFLASHFILEvariable which fixes the hack in murdock: initial hardware-in-the-loop support #8801Integrated in sub PRs:
While looking into this I tried fixing other problems to not propagate hack somewhere else:
ELFFILEin its own target and generally break link in sub file targetsMakefile.include: separateseparate targetlinkin subtargets #8844Makefile.include: add %.hex and %.bin rules #8845.hex and .bin targets.hexfilemakefiles: FIX boards generating a binary '.hex' file #8840Makefile.include: refactor command present check #8839BINFILEinstead ofHEXFILEboards/flash.sh: rename HEXFILE to BINFILE #10471common/remotewith PROGRAMMER=jlink boards/common/remote: fix mis-migrated path for flash/reset #10472hifive1included hereFLASHFILEcommon/remoteandcc2538dkto usejlink.inc.mksimilar to boards/common/remote: fix JLink flashing and debug #9851HEXFILEindocker, it is now only handled to deduce it fromELFFILEIt has the side effect to not generate the '.hex' or '.bin' file if not required for the flasher, which I think is better
This ended up in a big PR that I will split.
Verifying after rebase:
Things I should look into after rebasing the PR in case new boards where added:
Issues/PRs references
cleanor-B#1198)It will need rebase after make: replace curly braces with parenthesis #8822 is merged