Skip to content
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/nucleo-X: enable cpy2remed programmer #18057

Merged
merged 1 commit into from
May 24, 2022

Conversation

krzysztof-cabaj
Copy link
Contributor

@krzysztof-cabaj krzysztof-cabaj commented May 5, 2022

Final Contribution description

Finally this PR enables cpy2remed programmer (see #17550) to all STM Nucleo boards.

Initial Contribution description

This PR enables cpy2remed programmer (see #17550) to four STM Nucleo boards: l031k8, l073rz, f303k8 and l432kc .
All boards have initially older ST-LINK firmware - the oldest was:

Version: 0221
Build:   Nov 19 2015 15:23:07

All are updated (without any problems) to minimal firmware which works with cpy2remed programmer - 2.37.36 (V2.J37.M26 - shown in the ST-LinkUpgrade program).

Testing procedure

Go to RIOT/examples/blinky and run command

make BOARD=nucleo-l031k8 PROGRAMMER=cpy2remed flash
make BOARD=nucleo-l073rz PROGRAMMER=cpy2remed flash
make BOARD=nucleo-f303k8 PROGRAMMER=cpy2remed flash
make BOARD=nucleo-l432kc  PROGRAMMER=cpy2remed flash

After a while, green LED (LED0) should start blinking.

Changes in documentaion can be observed using commands:

make doc
xdg-open doc/doxygen/html/group__boards__nucleo-l031k8.html
xdg-open doc/doxygen/html/group__boards__nucleo-l073rz.html
xdg-open doc/doxygen/html/group__boards__nucleo-f303k8.html
xdg-open doc/doxygen/html/group__boards__nucleo-l432kc .html

Issues/PRs references

#17550

@github-actions github-actions bot added Area: boards Area: Board ports Area: doc Area: Documentation labels May 5, 2022
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label May 5, 2022
benpicco
benpicco previously approved these changes May 5, 2022
Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See inline. Maybe your editor has forcefully broken the line mid-word at 80 chars?

Note that e.g. links often tend to be longer than 80 chars, so just ignore the CI complaining about overlong lines if the line contains a link. If the link is less than 80 chars, you could also have the link on its own line and break the line early.

boards/nucleo-f303k8/doc.txt Outdated Show resolved Hide resolved
boards/nucleo-l031k6/doc.txt Outdated Show resolved Hide resolved
boards/nucleo-l073rz/doc.txt Outdated Show resolved Hide resolved
boards/nucleo-l432kc/doc.txt Outdated Show resolved Hide resolved
@krzysztof-cabaj
Copy link
Contributor Author

@maribu thanks for spotting and fixing this issue. I commit all changes.

Copy link
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move all this copy2remed code in a common place and use some Make magic ?

For example, I'm pretty sure the following would work for all nucleo boards:

index eeed8f95d8..661a81aa8d 100644
--- a/boards/common/nucleo/Makefile.include
+++ b/boards/common/nucleo/Makefile.include
@@ -6,3 +6,9 @@ INCLUDES += -I$(RIOTBOARD)/common/stm32/include
 
 # Setup of programmer and serial is shared between STM32 based boards
 include $(RIOTMAKE)/boards/stm32.inc.mk
+
+# variable needed by cpy2remed PROGRAMMER
+# it contains name of ST-Link removable media
+DIR_NAME_AT_REMED = "NODE$(call uppercase,$(subst -,_,$(subst nucleo,,$(BOARD))))"
+
+PROGRAMMERS_SUPPORTED += cpy2remed

@krzysztof-cabaj
Copy link
Contributor Author

Why not move all this copy2remed code in a common place and use some Make magic ?

In my initial PR (#17550) I first add this at global level but was decided that should be moved to particular boards.

@aabadie
Copy link
Contributor

aabadie commented May 6, 2022

In my initial PR (#17550) I first add this at global level but was decided that should be moved to particular boards.

It seems that in #17550, you were only adding the cpy2remed to the supported programmers at a (too) central level (stm32.inc.mk) and were only setting the directory for nucleo-l552ze-q.
My proposal above both adapts the supported programmers and defines the directory automatically for all nucleo boards (assuming the directory name can be computed automatically from the board name).

@krzysztof-cabaj
Copy link
Contributor Author

Ok. I check if suggested solution works for tested Nucleo boards and introduce necessary changes.

@krzysztof-cabaj
Copy link
Contributor Author

I checked names of nucleo boards and code provided by @aabadie (once again thanks!). It should works for all nucleo boards - two boards have different name and some manual overwrite of DIR_NAME_AT_REMED is needed. I introduce necessary changes for nucleo-l552ze-q and p-nucleo-wb55. I tested it on few boards to which I have access and everything is working. Moreover, I clean previously introduced changes in the Makefile.include files.

I have one question, due to fact that this PR adds new programmer not only for mentioned 4 boards but for all nucleo boards should I open a new PR? Or only change this PR title and description to reflect final changes?

@krzysztof-cabaj
Copy link
Contributor Author

@benpicco can move this PR forward ?

@benpicco
Copy link
Contributor

Of course, please squash!

@krzysztof-cabaj
Copy link
Contributor Author

White space error fixed and all commits squashed. @benpicco @maribu thank for rapid response.

@krzysztof-cabaj krzysztof-cabaj changed the title boards/nucleo-l031k8, l073rz, f303k8 and l432kc: enable cpy2remed programmer boards/nucleo-X enable cpy2remed programmer May 18, 2022
@krzysztof-cabaj krzysztof-cabaj changed the title boards/nucleo-X enable cpy2remed programmer boards/nucleo-X: enable cpy2remed programmer May 18, 2022
@benpicco benpicco merged commit 874a7e1 into RIOT-OS:master May 24, 2022
@chrysn chrysn added this to the Release 2022.07 milestone Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: doc Area: Documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants