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.
Summary
CoreSPI is a Microchip IP block, which can be instantiated on the FPGA inside MPFS SoC. This PR introduces two patches:
A simple bugfix for race condition in case of SPI timeout, resetting the signalling semaphore which may have been posted twice
Adding support for more SPI frame lengths:
The CoreSPI has got a fixed frame length in bits, which is deceded at the time when the IP is instantiated on the FPGA.
This poses a problem when the SPI transfer frame length can't be set during runtime.
In particular, I need to be able to support both 8-bit and 16-bit transfers on the same SPI block, for two different types of IMU sensors.
The problem can be circumvented by supporting SPI word lengths which are even multiples of the native frame length, by just writing multiple frames for each word.
Impact
This adds support for 16, 24 etc. bit widths for CoreSPI block configured for 8-bit frames, and fixes a race condition.
This adds support for more devices for MPFS platform when using 8-bit CoreSPI on the FPGA. It doesn't change the existing basic functionality.
Testing
Tested on custom MPFS board, running PX4, with different IMUs connected, using 8-bit and 16-bit SPI frames.