-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Fix SPI load mode of the FPGA iCE40 #81212
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
nashif
merged 1 commit into
zephyrproject-rtos:main
from
benediktibk:fix/ice40_spi_load_mode
Nov 22, 2024
Merged
Fix SPI load mode of the FPGA iCE40 #81212
nashif
merged 1 commit into
zephyrproject-rtos:main
from
benediktibk:fix/ice40_spi_load_mode
Nov 22, 2024
Conversation
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
e2a22a2 to
6087d6b
Compare
Contributor
Author
|
I am fairly confident that the CI failure is not caused by this PR: |
cfriedt
reviewed
Nov 11, 2024
6087d6b to
9c730e2
Compare
9c730e2 to
c8d4e15
Compare
c8d4e15 to
d5e9250
Compare
The datasheet of the iCE40 specifies that there should be a leading and trailing clocks phase during its configuration with SPI. Due to the limitations of the SPI interface, and probably also due to a lock of support for such a feature for instance in the STM32 SPI peripheral, this is achieved with additional SPI transfers before and after the actual image. Unfortunately, this by default also affects the slave select GPIO, which has to stay high during these phases. This fixes this behaviour via not passing the slave select GPIO to the SPI driver and manipulating this GPIO manually. Signed-off-by: Benedikt Schmidt <[email protected]>
d5e9250 to
197f817
Compare
Contributor
Author
|
Replaced memset for CS gpio with a cs.gpio.port = NULL, according to the comment of @tbursztyka. |
tbursztyka
approved these changes
Nov 20, 2024
josuah
approved these changes
Nov 21, 2024
cfriedt
approved these changes
Nov 21, 2024
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.
The configuration procedure for the FPGA iCE40 requires a leading and trailing clocks phase, which is currently implemented through additional SPI transfers before and after the actual FPGA image. Unfortunately, this also modifies the CS line, which therefore leads to a waveform which doesn't adhere to the specification.
This PR changes this behavior to ensure compliance with the iCE40 datasheet during the configuration.
Leading clocks phase before:

Leading clocks phase after:
