Skip to content

STM32: Configurable bank support #4125

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 6, 2025

Conversation

diondokter
Copy link
Contributor

@diondokter diondokter commented Apr 24, 2025

It builds locally, but not sure how I can make the metapac work here without it being merged there since the stm32-data-generated only exists for main...

embassy-rs/stm32-data#596

To make this work, I added two features 'single-bank' and 'dual-bank'. They are optional. If a chip can't configure this, the user doesn't have to select one.
If a chip does have multiple flash options, selecting one of the features is required. There's also a cfg being set so the flash drivers knows it needs to check the configured settings.

The config system is generic, but it's only implemented for the G4 in this PR.

An alternative approach is going the same route as the dual core settings where you get a STM32* feature for single bank and one for dual bank. Let me know if that's more desirable.

closes #2309

@diondokter diondokter changed the title Configurable bank support STM32: Configurable bank support Apr 24, 2025
@diondokter
Copy link
Contributor Author

Alright, I've implemented the configurable flash support for all STM chips I could find that have that feature in one way or another

@diondokter diondokter force-pushed the configurable-bank-support branch from 5cf9bda to cff6eb9 Compare May 1, 2025 09:52
@diondokter
Copy link
Contributor Author

bender run

@embassy-ci
Copy link

embassy-ci bot commented May 1, 2025

run: permission denied

@jamesmunns
Copy link
Contributor

bender run

1 similar comment
@bugadani
Copy link
Contributor

bugadani commented May 1, 2025

bender run

@embassy-ci
Copy link

embassy-ci bot commented May 1, 2025

run: permission denied

jamesmunns
jamesmunns previously approved these changes May 1, 2025
Copy link
Contributor

@jamesmunns jamesmunns left a comment

Choose a reason for hiding this comment

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

Fake approval to see if that makes bender happy, don't actually merge

@jamesmunns
Copy link
Contributor

bender run

@jamesmunns jamesmunns self-requested a review May 1, 2025 10:14
@jamesmunns jamesmunns dismissed their stale review May 1, 2025 10:15

was just a test

@jamesmunns jamesmunns removed their request for review May 1, 2025 10:15
@diondokter diondokter force-pushed the configurable-bank-support branch 2 times, most recently from 7d84a6c to a65a129 Compare May 1, 2025 12:13
@diondokter diondokter force-pushed the configurable-bank-support branch from a65a129 to e478bdf Compare May 1, 2025 12:28
@diondokter
Copy link
Contributor Author

Alright, this should be finished.

I found there was some dual bank implementation for the F4 series. So I could rip that out. This makes the PR net negative LOC! :D

The F4 & F7 series are weird with their banks and sectors, but they should work.
For anything that runs on the HIL I've added dual/single-bank feature with which they should be factory programmed, so should all remain working.

@jamesmunns
Copy link
Contributor

bender run

@diondokter
Copy link
Contributor Author

Hmmm well, I'm sure I didn't break the uart and that it's flaky somehow

Copy link
Member

@lulf lulf left a comment

Choose a reason for hiding this comment

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

Looks good to me, I've merged embassy-rs/stm32-data#596 so please update this PR with the correct ref.

@diondokter diondokter force-pushed the configurable-bank-support branch from 033d673 to 8017d58 Compare May 6, 2025 11:17
@diondokter
Copy link
Contributor Author

Alright, that should be it!

@lulf lulf added this pull request to the merge queue May 6, 2025
Merged via the queue into embassy-rs:main with commit 966914f May 6, 2025
7 checks passed
@diondokter diondokter deleted the configurable-bank-support branch May 6, 2025 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

STMG4 Dual Bank Flash support
4 participants