boards/stm32: use common place of openocd config files for all boards using stlink#8475
boards/stm32: use common place of openocd config files for all boards using stlink#8475aabadie merged 6 commits intoRIOT-OS:masterfrom
Conversation
|
I like the idea, better configuration reuse, but the interdependence between the board directories is a bit messy (stm32-stlink depends on files in the nucleo common directory) |
Not sure, st-link allows the use of openocd and this is directly related to boards. Maybe move the common openocd in another directory |
Indeed, I missed that part... |
172a0f1 to
9840960
Compare
|
Good cleanup! I am thinking though: doesn't it rather make sense to move the makefile out of the board tree and dump/merge all the lines from |
|
Updated this PR by moving the common openocd configuration from the common/nucleo to common/stm32-stlink. I think it's better like this. |
Sorry, I missed that comment. I'll give this a try. |
|
cool. (actually, I also saw this file for the first time today :-) ). Maybe we can add a |
Same here !
That's what I'm trying to do :) |
d15d0ce to
72b6156
Compare
|
I reworked a bit this PR, including previous comments. Here the actual status:
|
72b6156 to
ac11203
Compare
haukepetersen
left a comment
There was a problem hiding this comment.
I still like this PR and it is getting there :-)
But I am also still convinced, that we can get rid of boards/common/stm32-stlink/Makefile.include and move the contained information to more general makefiles.
| export STLINK_VERSION ?= 2-1 | ||
|
|
||
| # Include openocd adapters for st-link | ||
| include $(RIOTMAKE)/tools/openocd-adapters/stlink.inc.mk |
There was a problem hiding this comment.
there seems to be a include-loop: here we include stlink.inc.mk and below openocd.inc.mk. But openocd.inc.mk does also include stlink.inc.mk... So seems to me we can drop this line.
|
|
||
| # Default is to use ST-link v2-1 adapter (used by all Nucleos) | ||
| export DEBUG_ADAPTER ?= stlink | ||
| export STLINK_VERSION ?= 2-1 |
There was a problem hiding this comment.
How about to more this line to the top of makefiles/tools/openocd-adapters/stlink.inc.mk and add doc that version 2-1 is the default?
| # configure the serial terminal | ||
| PORT_LINUX ?= /dev/ttyACM0 | ||
| PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*))) | ||
| include $(RIOTMAKE)/tools/serial.inc.mk |
There was a problem hiding this comment.
I think it is not very clean to put the common serial configuration into a common board folder that is referring to a programmer...
I think I have an alternative idea, will PR something later tonight.
There was a problem hiding this comment.
forgot to mention: examples where this might get confusion are for example the green discovery boards, which have an on-board stlink, but don't supply any serial adapter...
There was a problem hiding this comment.
ok, I was not aware of that.
I think I have an alternative idea, will PR something later tonight.
Describe what you have in mind and I'll update this PR
kaspar030
left a comment
There was a problem hiding this comment.
Why move the openocd configs to dist/tools/openocd-adapters?
I'd prefer them in boards/common, or maybe if dist, why not just dist/tools/openocd/configs?
|
|
||
| # select OpenOCD configuration depending on CPU type | ||
| ifeq (,$(OPENOCD_CONFIG)) | ||
| ifeq ($(CPU),stm32f0) |
There was a problem hiding this comment.
Why not OPENOCD_CONFIG := $(RIOTMAKE)/tools/openocd-adapters/configs/$(CPU).cfg?
ac11203 to
a41f6bb
Compare
Done, since #7695 might be a good solution for common serial port configuration
I can move them to boards/common, where I think it's simpler to find. In fact, I don't have a strong opinion on that. |
Good point! Completely missed that factorisation. Done ! |
34e12ae to
c6b895f
Compare
Thinking of it now and it makes more sense to put the common openocd config files in |
I don't think it's directly bound to stm32, since that's a cpu and the config depends on the board. For this, I would say a bigger refactor on the boards folder is necessary, on which we can maybe separate the boards according to it's CPUs, or a similar approach. However, it's also not bound to nucleo devices, even though they're very similar. I'd vote for something like boards/common/st, which is bound only to the manufacturer. |
|
squashed. @haukepetersen @kaspar030 do you still have comments or can we dismiss your reviews since I think your previous comments were addressed ? |
|
@cladmi @kaspar030 @haukepetersen, now that #8549 is merged, putting the openocd common configuration file in |
|
This looks OK to me. |
6a54b6a to
21e0af1
Compare
|
@cladmi, @haukepetersen do you have more comments here ? or can I squash ? |
|
@haukepetersen @cladmi, ok to squash here ? |
|
Ok for me |
|
It would be great if someone could ping @haukepetersen IRL or at least dismiss his review. |
|
Seems that @haukepetersen will never reply here. @cladmi @kaspar030, are you ok for dismissing his review ? |
|
@haukepetersen, if you don't reply or if you are not interested anymore by this PR, please let us know. |
- introduce common place for boards using stlink: same serial, all use openocd - apply this to nucleos
a83ee8d to
265c152
Compare
|
rebased and squashed. @cladmi, I think we left enough time to @haukepetersen to leave his opinion here and since it never came, I'll dismiss his review. |
|
Let's merge this one. |
Contribution description
This PR moves the st-link related codes in
boards/common/nucleo/Makefile.includein a common place, e.gboards/common/stm32-stlink.This is because not only Nucleo boards use st-link, but also b-l072z-lrwan1 and b-l475e-iot01a boards. The support for these 2 boards is also updated by this PR.
Maybe the stlink related code could go in another place so suggestions are welcome.
Maybe this common code could be reused by stm32fxdiscovery boards since they also use stlink (but some has different openocd configurations).
Issues/PRs references
None