Contributions to this project are released under a mix of the GPLv3+ and BSD-3-Clause licenses. Please respect the license of any existing files (specified at the top) and if adding a new file, make a value judgement which you prefer to use.
Please note that this project is released under the Contributor Covenant Code of Conduct. By participating in this project you agree to abide by its terms.
When developing this project some tools are necessary, take a look at the Requirements section of the README.
For instructions on how to build the project, please follow the Building section of the README.
- Check against the latest version (
main
branch). - If possible, and applicable, test against another target and/or debug probe.
- Consider broken USB cables and connectors.
- Try to reproduce with BMDA with at least output verbosity bit 1 (INFO) set (
blackmagic -v 1 ...
), as debug messages will be dumped to the starting console.
When reporting issues, be as specific as possible!
- Fork and clone the repository
- Create a new branch:
git switch -c type/branch-name
(git checkout -b type/branch-name
in the old syntax) - Make your change
- Push to your fork and submit a pull request
If you wish to fix a bug, type
in the new branch name should be fix
, otherwise if you wish to implement a new feature, type
should be feature
.
- Ensure you have our repo as a remote (
git remote add upstream https://github.com/blackmagic-debug/blackmagic
) - Switch back to
main
(git switch main
/git checkout main
) - Pull to ensure you're up to date (
git pull upstream
) - Push to your fork (
git push
) - Continue at 2. in the steps for first time
Additionally, please write good and descriptive commit messages that both summarise the change and, if necessary, expand on the summary using description lines. "Patched the adiv5 code" is, while terse and correct, an example of a bad commit message. "adiv5: Fixed an issue in DP handling in adiv5_dp_init()" is an example of a better commit message.
When writing commit messages, please prefix the component being modified using the following rules:
- If the commit modifies target support, prefix with the path under src/target including the name of the file minus its extension - for example, "adiv5:", "stm32f1:" or "flashstub/lmi:"
- If the commit modifies a platform, prefix with the name of that platform followed by the file - for example, "hosted/cli:" or "native/platform:"
- If the commit modifies a significant number of files, us the overarching theme - for example if it's a platform API change then use "platform:"
- If the commit modifies files such as the build system, the main project readme, or any other files about the project that don't form the code for the project, please use "misc:"
We would like to be able to look back through the commit history and tell what happened, when, and why without having to dip into the commit descriptions as this improves the general Git experience and improves everyone's lives.
Try to keep commits focused on a single small and atomic change to ease review, and aid the process if we end up having to git bisect
through your changes, or git revert
in the extreme case something seriously broke.
We use rebasing to merge pull requests, so please keep this in mind.
When making contributions to existing code, we ask that you update the copyright and authorship notice at the top with any authorship information you wish to provide. This is so you get proper attribution. The contribution must be made under the existing code's license terms as stated per file.
When making original contributions as new files to the project, this presents a choice on licensing. Historically the project uses GPLv3+, however contributions have been made using compatible licensing such as MIT and BSD-3-Clause. We would ask that you preferentially choose between GPLv3+ and BSD-3-Clause.
Keep in mind that the resulting binary is GPLv3+ licensed due to how the license is worded, but the individual contributions retain their source licensing when considering re-use in other projects.