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

tools/cpy2remed: Addition of new programmer for nucleo boards #17550

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

krzysztof-cabaj
Copy link
Contributor

Contribution description

This PR adds a new programmer to the Nucleo boards with an on-board ST-LINK debugger. On-board ST-LINK provides removable media to which program image file in HEX format could be copied for programing. Introduced cpy2remed (copy two removable media) script automates programming process.

OpenOCD programmer could utilize ST-LINK, but in my opinion, more straightforward method without installing additional software could be beneficial for users not familiar with micro-controllers.

Testing procedure

Currently, programmer was tested on STM Nucleo-L552ZE-Q board; however, all Nucleo boards with ST-LINK should work after a minor enhancement - add DIR_NAME_AT_REMED variable to the Makefile.include file.

Go to RIOT/examples/blinky and run command:

make BOARD=nucleo-l552ze-q PROGRAMMER=cpy2remed flash

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

Changes in documentation can be observed using commands:

make doc
xdg-open doc/doxygen/html/group__boards__nucleo-l552-q.html

Issues/PRs references

N/A

@github-actions github-actions bot added Area: boards Area: Board ports Area: build system Area: Build system Area: doc Area: Documentation Area: tools Area: Supplementary tools labels Jan 22, 2022
@@ -1,5 +1,5 @@
PROGRAMMER ?= openocd
PROGRAMMERS_SUPPORTED += bmp dfu-util openocd stm32flash
PROGRAMMERS_SUPPORTED += bmp dfu-util openocd stm32flash cpy2remed
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not supported by all stm32 boards, so far only nucleo-l552ze-q provides the needed configuration

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately yes. I do not have access to other Nucleo boards and I cannot check this. Moreover, I suspect that each board have different removable media name (directory in Linux). Due to this fact I introduce DIR_NAME_AT_REMED variable.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yea so let's just add this for nucleo-l552ze-q for now.

@benpicco benpicco requested a review from maribu January 26, 2022 17:54
make BOARD=nucleo-l552ze-q PROGRAMMER=cpy2remed flash
```


Copy link
Member

Choose a reason for hiding this comment

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

Note that all Nucelos support this, provided the firmware of the ST-Link is up to date. Maybe add a line to point out that updating the ST-Link firmware could be required? (ST actually provides a .jar file to perform the update, and surprisingly Java actually lived up to the "write once run everywhere" and it does actually work also on Linux.) Maybe the link to that website can be added here?

Copy link
Contributor

@benpicco benpicco Jan 26, 2022

Choose a reason for hiding this comment

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

even older boards? I'll give it try!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I could add appropriate text to the documentation page (doc.txt file) but I have only one Nucleo board. My board have such firmware:

Version: V2J37M26
Build:   May 13 2020 17:07:43

Which probably states that this is version 2.37.26. Looking at the STM update page this is third most recent firmware.

Do you think about note. "This PROGRAMMER was tested using 2.37.26 version of the ST-LINK firmware. You could find firmware update at STM webpage."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added note to the doc.txt concerning ST-LINK firmware and fix small issue with } in cpy2remed.sh script.

@krzysztof-cabaj
Copy link
Contributor Author

@benpicco, @maribu - should I add or fix something in code or documentation to move this PR forward?

@benpicco
Copy link
Contributor

cpy2remed should only be added to PROGRAMMERS_SUPPORTED for nucleo-l552ze-q as the other boards lack the DIR_NAME_AT_REMED configuration

@krzysztof-cabaj
Copy link
Contributor Author

Do you think about such change - remove cpy2remed programmer from all stm32 and include only in l552ze-q?

@benpicco
Copy link
Contributor

Please squash

@krzysztof-cabaj
Copy link
Contributor Author

Squashed! There are some problems with doc.txt - description of flashing procedure using cpy2remed for git probably is in this same place which section Accessing shell from PR #17639.

@benpicco
Copy link
Contributor

You have a merge conflict now - please do a git rebase -i master - while you are at it, you can also prefix the commit message 😉

@krzysztof-cabaj
Copy link
Contributor Author

Fixed!

@krzysztof-cabaj
Copy link
Contributor Author

Thanks!

@krzysztof-cabaj
Copy link
Contributor Author

Are there same problems with Murdock? I have just looked at ci.riot - there are no queued jobs ... and my PR still have "Expected — Waiting for status to be reported ". Moreover some PR that are accepted later than my has been already processed.

@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 Feb 11, 2022
@benpicco
Copy link
Contributor

Oops, sorry forgot to add the label

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: build system Area: Build system Area: doc Area: Documentation Area: tools Area: Supplementary tools 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.

4 participants