-
-
Notifications
You must be signed in to change notification settings - Fork 770
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
Feature: Implement SPI support for blackpill-f4 #1525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, but there are a few stylistic things to fix and a few queries about how things are being done we'd like answered before we can merge. Nice work though!
As a side note in the future: Your PR description goes to great lengths to talk about speed, testing, etc, but at no point does it actually describe as a single easily read paragraph what this PR implements and does. In the future, please start the description with something like:
This PR implements support for the internal (on-board) SPI Flash found on the Blackpill series boards, mirroring the work done for "native" (BMP).
If you open with something like that, it'll help provide context before you drop into technical details that are more a curiosity than providing us with information needed to review the PR itself.
Applied suggested changes from first review pass, awaiting additional review comments or approval; then I will {fast-forward fork's |
We'll aim to review the new code today then. Please do not squash the commits - as they are right now is better for We very explicitly want 3 commits here because it's not about "by feature", it's about small atomic changes that are easily reviewed, etc.. the commits as they are, are a bit big anyway. Ideally we'd want them to be even more granular. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a couple of small things that need tweaking, and once tweaked and keeping this as 3 separate commits (please), we're happy to merge this.
For edits in this review would you like a new commit or amending? |
Amends please, both changes are quite small and clean up the diffs |
afacffb
to
38558b1
Compare
* Inline macros into calls, dropping intermediate variables * Duplicate gpio setup calls into respective branches * Remove a couple comments
38558b1
to
37365f5
Compare
Run-tested ( Afterthoughts: there's no LED indication of SPI activity as blackpill has a single LED. BMF doesn't touch IDLE_RUN during remote-spi, and I don't touch PC13 in platform spi code. For now rely on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, merging.
Detailed description
This PR implements support for the internal (on-board) SPI Flash found on the Blackpill series boards, mirroring the work done for "native" (BMP).
native
hardware, providing no-op stubs for all the other platforms.blackpill-f4
hardware, which I own and test on.This change results in
+320+448 bytes flash footprint forblackpill-f4x1cx
. Testing includedsfdp
andread
from onboard w25q64 to desktop dualboot host (Linux Mint 21.1, Windows 11) using latest manually compiled bmpflash/substrate/fmt/libusb-1.0.Read speed of 8MiB flash chip: Linux 200KiB/s, Win11 175KiB/s. File seems to match remains of NuttX SmartFS I kept there from previous development tests.
Misc. notes:
native
/F1 uses APB1=36;/8=4.5MHz for EXT SPI1 and APB2=72;/8=9Mhz for AUX SPI2).03h Read Data
up to 50MHz and0Bh Fast Read
up to 104MHz.I might add SPI2 on PB12/13/14/15 (F4 APB1=48Mhz) later as external/aux/etc. bus, these pins are not claimed yet.Added SPI2 with same divisor, 48/8=6MHz.Your checklist for this pull request
make PROBE_HOST=native
) -- changes another platformmake PROBE_HOST=hosted
) -- not applicableClosing issues
No issues raised on SPI functionality by users of blackpill-f4 boards, because it was absent from platform code.