Draft
Conversation
Still need to use interrupts to ensure operations aren't interrupted. This might happen currently at lower frequencies as there is no synchronisation.
Contributor
Author
|
I've fixed the interruption problem with an interrupt but the performance has been badly degraded - I will try to use dummy DMA transfers to synchronise, as is done in the regular SPI PIO program. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4662 - builds on @lhalf's work.
This is quite messy but I'm making an early draft PR for visibility and potential feedback on the design. There's some parts that should be split out into other PRs.
Design
QspiDeviceandQspiBustraits in the style ofembedded_hal_async.Spi*traits is theWriteSingleLineoperation and noTransferorTransferInPlace.embedded_hal_asyncif they make sense.embassy-rp, implementingQspiBus.WiznetSpiBustrait toembassy-net-wiznet- this has a blanket implementation forembedded_hal_async::spi::SpiDevicefor backwards compatibility.Current problems
exec_jmp-onewire.rshas an example of usingexec_jmp.Performance
I get these results with a TCP benchmark (which spends 40% of its time in
smoltcp, mostly doing copies and calculating checksums):SPI mode:
invalid chip version >15MHz SPI.
In QSPI mode:
Maybe a better benchmark could use raw sockets and UDP to avoid a lot of the
smoltcpoverhead. Looking at flamegraphs I think I can get about 15% more performance from combining into one PIO program.