-
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
boards/rpi-pico: specify needed args when using jlink flasher #19537
Conversation
boards/rpi-pico/Makefile.include
Outdated
|
||
ifeq ($(PROGRAMMER),jlink) | ||
JLINK_DEVICE = RP2040_M0_0 | ||
FLASHFILE = $(HEXFILE) |
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.
Funny, yesterday there was some discussion in matrix and there seemed to be a consensus to prefer ELF files for flashing unless there is a reason against ELF files. Admittedly, only few actively participated in the discussion, though.
But if the ELF file works equally well, I'd personally prefer to stick with the ELF file for flashing.
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.
Yup, especially because creating a .hex is an extra step (that takes time, ...)
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's because of this discussion that I think about it. But I don't have strong opinion over .elf vs .hex. I wanted to use J-link probe for sometimes now with this board so it ease debugging when working on new peripheral drivers.
I can confirm that it works too with .elf file so I'll update this PR.
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.
And squashed directly.
Signed-off-by: dylad <dylan.laduranty@mesotic.com>
a039dac
to
bd5cff5
Compare
|
||
ifeq ($(PROGRAMMER),jlink) | ||
JLINK_DEVICE = RP2040_M0_0 | ||
FLASHFILE = $(ELFFILE) |
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.
FLASHFILE = $(ELFFILE) |
I think it should even work like this, as the ELF file is the default flash file anyway. Please squash / amend directly.
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.
Hmmm, I share some doubts here. When I played with J-link before this PR, it defaults to .bin
file and flashing doesn't work. (Because I didn't provide the flash memory offset I guess) so I add to pass FLASHFILE
manually during the make flash
command.
But maybe I'm wrong here. I'll try again tonight. I left my rpi-pico board at home.
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.
This should be the culprit.
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.
OK, let's merge this as is. I can rebase #19541 on top of that and drop this line again there, as then the ELF file would indeed be the default.
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.
As you wish. I've removed the waiting for PRs label.
I'll also try to test #19541 to see if there is any breakage.
Let's merge #19541 first then. |
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
Thanks for the review! |
Contribution description
This PR adds the jlink device variable and use hexfile to flash application with a jlink probe.
Testing procedure
Attach a
jlink
probe to SWD pins.Try to flash any app with
jlink
PROGRAMMER=jlink make BOARD=rpi-pico -C examples/blinky flash
Issues/PRs references
None.