Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Feature: STM32H523/H533 support - #2131

Merged
dragonmux merged 4 commits into
blackmagic-debug:mainfrom
ALTracer:feature/stm32h523
Jul 24, 2025
Merged

Feature: STM32H523/H533 support#2131
dragonmux merged 4 commits into
blackmagic-debug:mainfrom
ALTracer:feature/stm32h523

Conversation

@ALTracer

Copy link
Copy Markdown
Contributor

Detailed description

Additionally, I've noticed there's actually two flash capacity SKUs possible for STM32H563 (2MB, 1MB) and STM32H523 (512KB, 256KB) but only 2MB was handled, so I added a known feature/trick of reading out FLASH_SIZE from engineering bytes and calculating bank size / sector count from that. STM32H503 is always 128KB and is unaffected.
mon rev extended, likewise. mon uid works.
Data area not handled yet, option bytes not handled.

Tested on https://github.com/WeActStudio/WeActStudio.STM32H523CoreBoard with blackpill-f411ce. First 32 KiB demo (based on USBX) passes verification. 106 KB/sec write speed, 138 KiB/s read speed.
Ideally STM32H562RG should be tested before merge, too (as found in https://github.com/WeActStudio/WeActStudio.STM32H5_64Pin_CoreBoard); and "STM32H5xx" now means "STM32H573/H563/H562" -- H573 has crypto and EMAC, H563 has Ethernet MAC, H562 has neither.

Your checklist for this pull request

Closing issues

No request filed yet.

@dragonmux dragonmux added the New Target New debug target label Jul 14, 2025
@dragonmux dragonmux added this to the v2.1 release milestone Jul 14, 2025

@dragonmux dragonmux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Generally looking good - there are just a handful of fairly small things that we'd appreciate being addressed so this is all good to go for the v2.1 cycle starting.

Comment thread src/target/stm32h5.c Outdated
Comment thread src/target/stm32h5.c Outdated
Comment thread src/target/stm32h5.c Outdated
@ALTracer
ALTracer force-pushed the feature/stm32h523 branch from e7b4b77 to 4d375ca Compare July 14, 2025 20:48
@ALTracer

Copy link
Copy Markdown
Contributor Author

Okay, retested on STM32H562RG that is 1 MiB capacity, and here's a bugreport. main BMD recognizes it as 2 MiB and fails to erase any sectors of second bank, thinking all 128 sectors belong to first bank. Should I split out the flash_size logic into a separate bugfix PR? Then H523 and SRAM alias can stay here as an unrelated feature. Or you can claim support of STM32H563xI not STM32H563xG. In H573 only 2MB STM32H573xG exists.
This PR branch code correctly determines two 512 KiB banks with 64 sectors each, erases fine (cherry-picked a squash of blank-check feature for testing on top).

@dragonmux

Copy link
Copy Markdown
Member

This is one for @esden to chime in but our feeling here is to have you tidy up, move this to the v2.0 milestone and merge it ASAP for the final release. The splash-back that's possible is super minimal as it's only poking at the STM32H5 support, not something deeper in the debugging core.

@ALTracer
ALTracer force-pushed the feature/stm32h523 branch from 4d375ca to 2000554 Compare July 16, 2025 20:42

@dragonmux dragonmux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, please rebase this on main and we'll get it merged. Thank you for the contribution!

@ALTracer
ALTracer force-pushed the feature/stm32h523 branch from 2000554 to 19efc5b Compare July 23, 2025 04:04
@dragonmux
dragonmux merged commit 19efc5b into blackmagic-debug:main Jul 24, 2025
36 checks passed
@ALTracer
ALTracer deleted the feature/stm32h523 branch February 21, 2026 21:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

New Target New debug target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants