-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/any silabs: Allow selecting OpenOCD #10475
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/any silabs: Allow selecting OpenOCD #10475
Conversation
boards/stk3700/dist/openocd.cfg
Outdated
@@ -0,0 +1 @@ | |||
source [find board/efm32.cfg] |
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.
Nice. I think this change should work with all stk boards. I can try on slstk4201a.
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. |
From my point of view this issue is still in the shape to proceed, and just needs someone to OK it to continue. @aabadie, you mentioned you could test it, would you mind? |
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. |
This is just lacking reviews. @aabadie, could you still review, or should I rather ping other EFM32 maintainers? |
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.
Since this is just a simple switch, you might just put that into boards/common/silabs/Makefile.include
.
You can also move the openocd.cfg
there, just add a OPENOCD_CONFIG ?= $(RIOTBOARD)/common/silabs/dist/openocd.cfg
and you should be good.
boards/stk3700/Makefile.include
Outdated
|
||
ifeq ($(PROGRAMMER),jlink) | ||
# setup JLink for flashing | ||
export JLINK_DEVICE := $(CPU_MODEL) |
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 can be set unconditionally.
I tested this on stk3700 and it works great with openocd master. I get strange errors with the 0.10.0 tagged release but of course that's not because of this pr. openocd master
openocd v0.10.0
|
Moving things to I'll give it a try localy -- @benemorius, would you also have this in here, or rather in a follow-up PR? (One reason I originally had this stk3700-only was that sltb001a requried OpenOCD master. Given that 0.10.0 ostensibly causes trouble with stk3700 as well, might just as well go all the way.) |
I've applied the same changes to the |
OpenOCD works well with those devices; the OpenOCD config is provided at the default location and only needs to refer to the setup that OpenOCD ships.
OpenOCD already ships config files for the EFM32 and EFR32 family, no need to duplicate them in RIOT; this removes the "file exists" check for files that are clearly OpenOCD-shipped board configurations, as the script can't (and shouldn't) know OpenOCD's include paths.
This removes duplication for the jlink case (keeping only any non-default values in the board makefiles), and opens up STK3700's OpenOCD programmability for generic boards.
Not too much point in having the STK3700 as a test balloon then; I've generalized this to all silabs boards. (Force push as the original commit is rebased onto master; it's become a bit hard to handle otherwise. The first commit is still the same, though). The changes to the OpenOCD build script were added to avoid having a single-line openocd.cfg for each and every board (or one in the common area): The goal of the check that is conditionally disabled is to have errors fly out of of make rather than of openocd, but the single-line config would just be a band-aid over that check, because if the included file is actually not present, openocd would just err again. (By the way, I do get the error with OpenOCD 0.10.0 occasionally as well, but pressing the reset button does wonders there.) |
2b02a99
to
1dbf07f
Compare
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 a nice clean up and @benemorius and @aabadie confirmed it's still working.
We don't have to test this for every board.
Is it a good idea to skip build tests for a change to the build system? Even if it doesn't effect building, one syntax error in the Makefile can introduce a regression. |
Contribution description
This adds support for flashing and debugging an STK3700 board using the OpenOCD debugger.
OpenOCD support for those chips and board is good in 0.10, all it needs is the hint that it's possible. I've used the seemingly common PROGRAMMER=... idiom to allow picking one's tools.
Testing procedure
In any example (I'm using saul), run
make BOARD=stk3700 PROGRAMMER=openocd flash term
PR scope
I've only changed the behavior I could test. If someone can confirm that OpenOCD works with Leopard Gecko boards (STK3600) as well, I can apply the same changes there as well.
In principle, the same works also for sltb001a, but that requires an OpenOCD git master version (actually only 1y old, but they haven't had a release since then) -- if requiring an unreleased OpenOCD version (for the non-default programmer) is OK, I'd add that there as well.
(Those changes would well go in one commit as their Makefile.include files are virtually identical.)