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

Add support for Puya PY32F071 flash#2080

Merged
dragonmux merged 6 commits intoblackmagic-debug:mainfrom
Badokas:support-py32f017
Aug 8, 2025
Merged

Add support for Puya PY32F071 flash#2080
dragonmux merged 6 commits intoblackmagic-debug:mainfrom
Badokas:support-py32f017

Conversation

@Badokas
Copy link
Copy Markdown
Contributor

@Badokas Badokas commented Feb 17, 2025

Detailed description

Added support for Puya PY32F071 flash.

Your checklist for this pull request

Closing issues

--

@Badokas
Copy link
Copy Markdown
Contributor Author

Badokas commented Apr 2, 2025

@dragonmux any comments on this PR? I see some activity on #2096 and afraid this might be outdated.

@dragonmux
Copy link
Copy Markdown
Member

We'll aim to give it a review in the next couple of days, though it will be targeted to v2.1 when the merge window for that opens as we're in the process of trying to finish stabilising v2.0 for final release.

Please rebase it on main, which will eliminate that merge commit. Wrt #2096, those changes do not obsolete your own and we'll be doing a fixup round once the two PRs can be merged. That PR is focused on reducing repetition in the existing PY32 code specifically.

@dragonmux dragonmux added this to the v2.1 release milestone Apr 2, 2025
@dragonmux dragonmux added the New Target New debug target label Apr 2, 2025
@Badokas Badokas force-pushed the support-py32f017 branch from 754cd2e to d82aba0 Compare April 2, 2025 10:52
Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

This PR overall looks great - the only real review notes here are about constants that will be undergoing signed-unsigned conversions unnecessarily, and naming constants for improved descriptiveness.

We look forward to getting to merge this in v2.1!

NB: Please review the contribution guidelines and prefix your commit messages accordingly. In this case, they should both have the prefix puya: .

Comment thread src/target/puya.c Outdated
Comment thread src/target/puya.c Outdated
Comment thread src/target/puya.c Outdated
Comment thread src/target/puya.c
@Badokas Badokas force-pushed the support-py32f017 branch 2 times, most recently from cb70f83 to 829dcc4 Compare April 3, 2025 09:50
Copy link
Copy Markdown
Contributor

@ALTracer ALTracer left a comment

Choose a reason for hiding this comment

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

There is another big copypaste chunk which is why I submitted #2096. If you don't have a preference which code to copy and adapt, then please consider a for-loop approach. Or I can rebase my PR after your changes get merged and see for myself if I can get size down without being able to test.
Do you have a hyperlink to an English release of PY32F07x Reference Manual which covers PY32F071 and PY32F072? If yes, would you please add both F07x and F00a refmans at the top comment-block of this driver source file?

Comment thread src/target/puya.c Outdated
@Badokas
Copy link
Copy Markdown
Contributor Author

Badokas commented Apr 3, 2025

There is another big copypaste chunk which is why I submitted #2096. If you don't have a preference which code to copy and adapt, then please consider a for-loop approach. Or I can rebase my PR after your changes get merged and see for myself if I can get size down without being able to test. Do you have a hyperlink to an English release of PY32F07x Reference Manual which covers PY32F071 and PY32F072? If yes, would you please add both F07x and F00a refmans at the top comment-block of this driver source file?

It would be great if you could rebase – I totally agree about duplication, but before your PR I thought this is the way of things in blackmagic-debug. We just needed quickly to support PY32F071 which we use in our project. We've tested on ~5 different boards with this SoC, seems to be working without issues.
I don't have English datasheet, took registers directly from PUYA drivers and IAP demo code (both hosted publicly on GH but don't have precise references rn).

@dragonmux
Copy link
Copy Markdown
Member

Or I can rebase my PR after your changes get merged and see for myself if I can get size down without being able to test.

We are planning, ALTracer, to take this first then yours and then do a fixup of that copy-paste block. This PR as it is stands pretty well on its own within the existing framework, so unless the contributor wishes to work on cleaning that particular part of the contribution up we don't see a reason to block it..

Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

Please rebase this on main to get rid of that merge commit, and we'll get this marked approved for the v2.1 cycle.

@Badokas Badokas force-pushed the support-py32f017 branch from f10c1fd to 829dcc4 Compare April 3, 2025 23:13
dragonmux
dragonmux previously approved these changes Apr 4, 2025
Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

LGTM, we'll merge this once v2.1's merge window opens. When that happens, we'll leave another message on this PR asking it to be rebased just as we go to do the merge itself.

Thank you for the contribution!

@dragonmux
Copy link
Copy Markdown
Member

Please rebase this on main and we'll get it merged now the v2.1 merge window has opened.

@dragonmux
Copy link
Copy Markdown
Member

Unsure how exactly you did the rebase here, but please would you run the following assuming that the remote upstream points to this repo:

git fetch --all --prune
git switch main
git pull upstream
git switch support-py32f017
git rebase -i main
git push -f

@Badokas
Copy link
Copy Markdown
Contributor Author

Badokas commented Aug 2, 2025

Well, this became outdated due to #2096 so I needed to update my end

@dragonmux
Copy link
Copy Markdown
Member

No worries, we'll re-review when you tell us you're ready then.

@Badokas
Copy link
Copy Markdown
Contributor Author

Badokas commented Aug 7, 2025

It's ready now.

Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

We've got just one note, which once addressed and the branch rebased on main, we'll be happy to approve and merge this PR.

Comment thread src/target/puya.c Outdated
Copy link
Copy Markdown
Member

@dragonmux dragonmux left a comment

Choose a reason for hiding this comment

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

LGTM, merging. Thank you for the contribution!

@dragonmux dragonmux merged commit cc48fb8 into blackmagic-debug:main Aug 8, 2025
34 of 36 checks passed
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.

3 participants