edit stm32CubeProg.sh to be able to enter stlink serial number#116
Open
Bipoeman wants to merge 1 commit into
Open
edit stm32CubeProg.sh to be able to enter stlink serial number#116Bipoeman wants to merge 1 commit into
Bipoeman wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request template
Please, Make sure that your PR is not a duplicate.
Search among the Pull request before creating one.
IMPORTANT: Please review the [CONTRIBUTING.md] file for detailed contributing guidelines.
Thanks for submitting a pull request.
Please provide enough information so that others can review your pull request:
Summary
This PR updates the STM32CubeProgrammer flash script to support targeting specific programmers by their serial numbers during SWD operations, and adds support for the J-Link interface.
This PR fixes/implements the following bugs/features
-n/--serial-numberCLI argument parsing.sn=${SERIAL_NUMBER}to the SWD connection string when the argument is provided.jlinkas a valid interface option (port=JLINK).Explain the motivation for making this change. What existing problem does the pull request solve?
When multiple ST-Link programmers or evaluation boards are connected to a single host machine, the STM32CubeProgrammer CLI requires a specific serial number to know which device to flash. Without this parameter, the script blindly connects to the first ST-Link it enumerates, which causes flashing failures or accidental overwrites in multi-device test/CI environments.
Additionally, this adds basic routing for the
jlinkprotocol, allowing users using SEGGER J-Link probes to utilize the same script without needing a separate flashing utility.Validation
./flash.sh -i swd -f firmware.bin -n <serial_1>and verified only board 1 was flashed.getopthandles the new-nflag correctly on both GNU and BSD (macOS) variants.