7
31
Fork
You've already forked blackmagic
23

Add support for STM32H7R/Sxx parts #2170

Merged
emeb merged 10 commits from emeb/stm32h7rs into main 2026年04月27日 03:46:17 +02:00
emeb commented 2025年12月13日 00:36:09 +01:00 (Migrated from github.com)
Copy link

Detailed description

This change adds new support for the STM32H7R/S family of parts. Although these parts are STM32H7, there are
some differences in the IDs, number of banks and sector sizes as well as the register addresses and bit layouts that make supporting them with the current STM32H7 driver more complex than simply adding a separate driver so that's the approach taken here.

This change is co-authored by zyp who did the initial work. I've updated it for the latest API, made some cleanups
and got a few small details working that had been commented out. Thanks also to dragonmux and ALTracer for invaluable help in coming up to speed on the details.

Your checklist for this pull request

Closing issues

Fixes #2170

## Detailed description This change adds new support for the STM32H7R/S family of parts. Although these parts are STM32H7, there are some differences in the IDs, number of banks and sector sizes as well as the register addresses and bit layouts that make supporting them with the current STM32H7 driver more complex than simply adding a separate driver so that's the approach taken here. This change is co-authored by zyp who did the initial work. I've updated it for the latest API, made some cleanups and got a few small details working that had been commented out. Thanks also to dragonmux and ALTracer for invaluable help in coming up to speed on the details. ## Your checklist for this pull request * [x] I've read the [Code of Conduct](https://github.com/blackmagic-debug/blackmagic/blob/main/CODE_OF_CONDUCT.md) * [x] I've read the [guidelines for contributing](https://github.com/blackmagic-debug/blackmagic/blob/main/CONTRIBUTING.md) to this repository * [x] It builds for hardware native (see [Building the firmware](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-firmware)) * [x] It builds as BMDA (see [Building the BMDA](https://github.com/blackmagic-debug/blackmagic?tab=readme-ov-file#building-black-magic-debug-app)) * [x] I've tested it to the best of my ability * [x] My commit messages provide a useful short description of what the commits do ## Closing issues Fixes #2170
emeb commented 2025年12月13日 00:44:09 +01:00 (Migrated from github.com)
Copy link

Looks like 3 CI failures - two are ROM overflows, but I'm guessing the 'pre-commit' is about code formatting?

Looks like 3 CI failures - two are ROM overflows, but I'm guessing the 'pre-commit' is about code formatting?

Correct - lint / pre-commit is shouting about clang-format things. Please also note the contribution guideline about commit suffixing - in this case, mostly stm32h7rs: .

Correct - `lint / pre-commit` is shouting about clang-format things. Please also note the contribution guideline about commit suffixing - in this case, mostly `stm32h7rs: `.
emeb commented 2025年12月13日 03:44:31 +01:00 (Migrated from github.com)
Copy link

I've corrected the formatting problems and revised the commit messages to include the new target name. The CI failures currently appear to fall into two categories: 1) ROM overflows, and 2) Some sort of mingw CI problem unrelated to my sources.

I've corrected the formatting problems and revised the commit messages to include the new target name. The CI failures currently appear to fall into two categories: 1) ROM overflows, and 2) Some sort of mingw CI problem unrelated to my sources.
dragonmux requested changes 2026年04月18日 08:08:18 +02:00
Dismissed
dragonmux left a comment
Copy link

There are a couple more review notes, and a need to rebase this on main. With those taken care of, we'll be happy to approve this and merge it. Apologies this has taken so long to get to.

There are a couple more review notes, and a need to rebase this on `main`. With those taken care of, we'll be happy to approve this and merge it. Apologies this has taken so long to get to.
@ -0,0 +3,4 @@
*
* Copyright (C) 2017-2020 Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
* Copyright (C) 2022-2023 1BitSquared <info@1bitsquared.com>
* Modified by Rachel Mant <git@dragonmux.network>

Please correct this copyright notice - you wrote this code, not Uwe, or us. Copyright to 1b2 is fine, but please select the appropriate year range from when you started to now, and note that you wrote the file. If memory serves you picked zyp's code up so credit to him is a good shout too, but likewise the code in question originates much newer, thus needing the notice correcting.

Please correct this copyright notice - you wrote this code, not Uwe, or us. Copyright to 1b2 is fine, but please select the appropriate year range from when you started to now, and note that you wrote the file. If memory serves you picked zyp's code up so credit to him is a good shout too, but likewise the code in question originates much newer, thus needing the notice correcting.
dragonmux marked this conversation as resolved
@ -0,0 +495,4 @@
/*
* XXX: What is this and why does it exist?
* A dry-run walk-through says it'll pull out the psize for the first Flash region added by stm32h7rs_probe()
* because all Flash regions added by stm32h7rs_add_flash match the if condition. This looks redundant and wrong.

Turns out this XXX note is correct - as with the STM32H7 code if you can clean this up, simplifying same we we did there.. that'd be grand

Turns out this XXX note is correct - as with the STM32H7 code if you can clean this up, simplifying same we we did there.. that'd be grand
dragonmux marked this conversation as resolved
Contributor
Copy link

I've made the (c) change as requested but I'm a bit confused about the stm32h7_cmd_psize() change as I don't see any difference between that function in stm32h7rs.c and the equivalent in stm32h7.c - where are the simplifications you mentioned? Perhaps in some other branch?

I've made the (c) change as requested but I'm a bit confused about the stm32h7_cmd_psize() change as I don't see any difference between that function in stm32h7rs.c and the equivalent in stm32h7.c - where are the simplifications you mentioned? Perhaps in some other branch?
dragonmux force-pushed emeb/stm32h7rs from 2d9e26de8f to 9e42793d00
Some checks failed
ci/woodpecker/pr/build-firmware/5 Pipeline was successful
ci/woodpecker/pr/build-firmware/8 Pipeline failed
ci/woodpecker/pr/build-firmware/2 Pipeline was successful
ci/woodpecker/pr/build-firmware/3 Pipeline was successful
ci/woodpecker/pr/build-firmware/6 Pipeline was successful
ci/woodpecker/pr/build-firmware/7 Pipeline was successful
ci/woodpecker/pr/build-firmware/1 Pipeline was successful
ci/woodpecker/pr/build-firmware/4 Pipeline was successful
ci/woodpecker/pr/build-firmware/9 Pipeline was successful
ci/woodpecker/pr/build-firmware/13 Pipeline failed
ci/woodpecker/pr/build-firmware/14 Pipeline was successful
ci/woodpecker/pr/build-firmware/12 Pipeline was successful
ci/woodpecker/pr/build-firmware/15 Pipeline was successful
ci/woodpecker/pr/build-firmware/16 Pipeline was successful
ci/woodpecker/pr/build-firmware/10 Pipeline was successful
ci/woodpecker/pr/build-firmware/17 Pipeline was successful
ci/woodpecker/pr/build-firmware/11 Pipeline was successful
ci/woodpecker/pr/build-firmware/18 Pipeline failed
ci/woodpecker/pr/build-linux/1 Pipeline was successful
ci/woodpecker/pr/build-firmware/19 Pipeline was successful
ci/woodpecker/pr/build-firmware/20 Pipeline was successful
ci/woodpecker/pr/build-linux/2 Pipeline was successful
ci/woodpecker/pr/build-windows Pipeline was successful
2026年04月19日 03:33:25 +02:00
Compare

Ah! It was in stm32f4.c we did the simplification - see ab3a6e63a8

stm32h7.c also needs this applying, but that can be a separate PR. That commit still shows what we're asking for here.

Ah! It was in stm32f4.c we did the simplification - see ab3a6e63a8f28b6b2191a77f727cd305b9202413 stm32h7.c also needs this applying, but that can be a separate PR. That commit still shows what we're asking for here.
Contributor
Copy link

OK - the copyright change and psize logic simplifications as in stm32f4.c have been added to the stm32h7rs.c file and checked in to my github repo. The firmware works fine for loading code on my own STM32H7RS hardware using a V2.3b BMP.

OK - the copyright change and psize logic simplifications as in stm32f4.c have been added to the stm32h7rs.c file and checked in to my github repo. The firmware works fine for loading code on my own STM32H7RS hardware using a V2.3b BMP.
dragonmux force-pushed emeb/stm32h7rs from 471270f369
Some checks failed
ci/woodpecker/pr/build-firmware/4 Pipeline was successful
ci/woodpecker/pr/build-firmware/6 Pipeline was successful
ci/woodpecker/pr/build-firmware/1 Pipeline was successful
ci/woodpecker/pr/build-firmware/3 Pipeline was successful
ci/woodpecker/pr/build-firmware/5 Pipeline was successful
ci/woodpecker/pr/build-firmware/2 Pipeline was successful
ci/woodpecker/pr/build-firmware/7 Pipeline was successful
ci/woodpecker/pr/build-firmware/9 Pipeline was successful
ci/woodpecker/pr/build-firmware/8 Pipeline failed
ci/woodpecker/pr/build-firmware/11 Pipeline was successful
ci/woodpecker/pr/build-firmware/12 Pipeline was successful
ci/woodpecker/pr/build-firmware/10 Pipeline was successful
ci/woodpecker/pr/build-firmware/18 Pipeline failed
ci/woodpecker/pr/build-firmware/15 Pipeline was successful
ci/woodpecker/pr/build-firmware/13 Pipeline failed
ci/woodpecker/pr/build-firmware/17 Pipeline was successful
ci/woodpecker/pr/build-firmware/16 Pipeline was successful
ci/woodpecker/pr/build-firmware/14 Pipeline was successful
ci/woodpecker/pr/build-linux/2 Pipeline was successful
ci/woodpecker/pr/build-linux/1 Pipeline was successful
ci/woodpecker/pr/build-firmware/19 Pipeline was successful
ci/woodpecker/pr/build-firmware/20 Pipeline was successful
ci/woodpecker/pr/build-windows Pipeline was successful
to a896e6d753
Some checks failed
ci/woodpecker/pr/build-linux/1 Pipeline was successful
ci/woodpecker/pr/build-firmware/17 Pipeline was successful
ci/woodpecker/pr/build-firmware/18 Pipeline failed
ci/woodpecker/pr/build-firmware/19 Pipeline was successful
ci/woodpecker/pr/build-firmware/20 Pipeline was successful
ci/woodpecker/pr/build-linux/2 Pipeline was successful
ci/woodpecker/pr/build-windows Pipeline was successful
ci/woodpecker/push/build-firmware/8 Pipeline failed
ci/woodpecker/push/build-firmware/5 Pipeline was successful
ci/woodpecker/push/build-firmware/4 Pipeline was successful
ci/woodpecker/push/build-firmware/1 Pipeline was successful
ci/woodpecker/push/build-firmware/3 Pipeline was successful
ci/woodpecker/push/build-firmware/2 Pipeline was successful
ci/woodpecker/push/build-firmware/7 Pipeline was successful
ci/woodpecker/push/build-firmware/6 Pipeline was successful
ci/woodpecker/push/build-firmware/9 Pipeline was successful
ci/woodpecker/push/build-firmware/13 Pipeline failed
ci/woodpecker/push/build-firmware/10 Pipeline was successful
ci/woodpecker/push/build-firmware/14 Pipeline was successful
ci/woodpecker/push/build-firmware/11 Pipeline was successful
ci/woodpecker/push/build-firmware/15 Pipeline was successful
ci/woodpecker/push/build-firmware/16 Pipeline was successful
ci/woodpecker/push/build-firmware/12 Pipeline was successful
ci/woodpecker/push/build-firmware/17 Pipeline was successful
ci/woodpecker/push/build-linux/1 Pipeline was successful
ci/woodpecker/push/build-linux/2 Pipeline was successful
ci/woodpecker/push/build-firmware/20 Pipeline was successful
ci/woodpecker/push/build-firmware/18 Pipeline failed
ci/woodpecker/push/build-firmware/19 Pipeline was successful
ci/woodpecker/push/build-windows Pipeline was successful
2026年04月27日 01:19:17 +02:00
Compare
dragonmux left a comment
Copy link

LGTM, merging. Thank you for the contribution!

LGTM, merging. Thank you for the contribution!
dragonmux deleted branch emeb/stm32h7rs 2026年04月27日 03:46:19 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
BMD App
Black Magic Debug App (aka. PC hosted) (not firmware)
BMP Firmware
Black Magic Probe Firmware (not PC hosted software)
Bug
Confirmed bug
Build system
Build system
Can't reproduce
Maintainers can't reproduce this problem
CI
Continuous Integration System
Contribution wanted
User contributions welcome
Documentation
Project documentation
Draft
Work in progress draft
Duplicate
This issue or pull request already exists
Enhancement
General project improvement
Feedback wanted
Requires additional submitter feedback
Foreign Host Board
Non Native hardware to runing Black Magic firmware on
GDB
Issue/PR related to GDB
Good first issue
Good for newcommers
HwIssue Mitigation
Solving or mitigating a Hardware issue in Software
Information Needed
Maintainers need more information
NativeHardware
Official Black Magic Debug Hardware
New Host Board
New hardware to run Black Magic firmware on
New Target
New debug target
Off Topic
Something that does not involve the project in any way
Potential Bug
A potential, unconfirmed or very special circumstance bug
Regression
Bug caused by a regression
User Interest Needed
More user interest required before consideration
User Testing Needed
Looking for user testing reports
Won't fix
Outside of the project scope or works as intended
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
blackmagic-debug/blackmagic!2170
Reference in a new issue
blackmagic-debug/blackmagic
No description provided.
Delete branch "emeb/stm32h7rs"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?