Skip to content

all: update to the latest version of stm32-svd files/patches (2)#14

Merged
deadprogram merged 4 commits intotinygo-org:mainfrom
knieriem:update-feb-2026-2
Feb 25, 2026
Merged

all: update to the latest version of stm32-svd files/patches (2)#14
deadprogram merged 4 commits intotinygo-org:mainfrom
knieriem:update-feb-2026-2

Conversation

@knieriem
Copy link
Copy Markdown
Contributor

As suggested by #13 (comment), this PR contains my changes to stm32-svd:

  • SVD files now generated by Rust-based svdtools (that is in use upstream since May 2022)
  • add patch.go as a way to revert narrowing to 16-bit access of specific registers (which is done by stm32-rs) back to 32-bit access
  • updates stm32-rs to the commit from 2026-02-21

Patch.go is an updated version of a previous, ed based approach: https://github.com/knieriem/tinygo-stm32-svd.

This change requires some minor changes to src/machine_*files and also a few target files, some of them already described in #10, which I will provide in a PR for TinyGo.

This change also requires some extensions to gen-device-svd (see tinygo-org/tinygo#5212)

The Rust based version appears to be used upstream since May 2022.
stm32-rs narrows access to 16 bit for specific registers,
where TinyGo expects 32-bit access. Patch.go adjusts .yaml
files mainly by deactivating "size: 16" constraints.

While converting src/machine_stm32* to 16-bit access is possible,
32-bit access is currently maintained to ensure bus compatibility
across all STM32 families and avoid breaking existing machine code.

Note: These modifications could alternatively be integrated into
gen-device-svd at the SVD processing level in the future.
Update README.md to include a note about verifying the build process
after syncing with stm32-rs. This ensures that SVD changes
(like register renames) are caught in src/machine before
they are merged.
@knieriem knieriem marked this pull request as ready for review February 23, 2026 12:13
@knieriem
Copy link
Copy Markdown
Contributor Author

Note that this change, together with my updates to gen-device-svd, does not yet fix / address tinygo-org/tinygo#5154. This would be needed to be addressed separately.

It appears @amken3d's tinygo-org/tinygo@dev...amken3d:tinygo:dev-fix5154 is intended to fix the USB grouping problem. I will try to merge these changes with my tinygo-org/tinygo#5212.

A possible point of confusion may be that @amken3d, when they started implementing for the G0B1, were likely unaware of #10 at that time, which references updates to gen-device-svd from May 2025 and the previous work on the G0x1 series, so that there are now some changes that possibly overlap / try to attempt similar issues.

I hope in the end this can be resolved, so that I can perhaps integrate my STM32H7 related support, and support for the smaller devices from the G0x1 series (G031 and G071).

@deadprogram
Copy link
Copy Markdown
Member

It appears @amken3d's tinygo-org/tinygo@dev...amken3d:tinygo:dev-fix5154 is intended to fix the USB grouping problem.

I do not think that the USB grouping problem has been worked on or addressed yet. Only discussed.

)

// This file adjusts some of the patch files in stm32-rs/devices/**
// It doesn't apply modifications twice, so it can be re-run safely.
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.

🥇

@deadprogram
Copy link
Copy Markdown
Member

From my point of view/testing, I think we can merge this PR now.

Any further feedback from @amken3d or anyone else?

@soypat
Copy link
Copy Markdown

soypat commented Feb 24, 2026

github is showing 0 changed files, is this correct?

@deadprogram
Copy link
Copy Markdown
Member

github is showing 0 changed files, is this correct?

No, but for some reason Github trips out. See tinygo-org/tinygo#5219 for this PR/branch in actual use.

@soypat
Copy link
Copy Markdown

soypat commented Feb 24, 2026

If its working and tested by either/or of you then fine by me. Let's get this great change merged!

@deadprogram
Copy link
Copy Markdown
Member

Thank you very much for all your work on this @knieriem and to @soypat for helping review.

Now merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants