cpu/stm32f4: Fix SPI baud rate control settings#2315
Merged
haukepetersen merged 3 commits intoRIOT-OS:masterfrom Jan 16, 2015
Merged
cpu/stm32f4: Fix SPI baud rate control settings#2315haukepetersen merged 3 commits intoRIOT-OS:masterfrom
haukepetersen merged 3 commits intoRIOT-OS:masterfrom
Conversation
Member
Author
|
Would be great if someone (@PeterKietzmann, @haukepetersen) could test this with a logic analyzer for one SPI on APB1 and one on APB2. |
Member
|
Whoops, that must have been my fault. I'll test this! |
Member
|
I tested the speed values for both ports. Now they're correct. Nice you found this. ACK |
Contributor
|
ACK also from my side -> and go. |
haukepetersen
added a commit
that referenced
this pull request
Jan 16, 2015
cpu/stm32f4: Fix SPI baud rate control settings
jnohlgard
pushed a commit
to jnohlgard/RIOT
that referenced
this pull request
Jan 19, 2015
The delays were introduced in an attempt to fix "inexplicable timing errors", although the errors were in the SPI bus driver rather than the nrf24l01p driver. See also: - RIOT-OS#1704 - RIOT-OS#2315 Signed-off-by: Joakim Gebart <[email protected]>
jnohlgard
pushed a commit
to jnohlgard/RIOT
that referenced
this pull request
Jan 19, 2015
The delays were introduced in an attempt to fix "inexplicable timing errors", although the errors were in the SPI bus driver rather than the nrf24l01p driver. See also: - RIOT-OS#1704 - RIOT-OS#2315 Signed-off-by: Joakim Gebart <[email protected]>
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.
The baudrate control for the SPIs are currently not set correctly during initialization. The SPIs on the stm32f4xx series run either on the APB1 or the APB2 bus which are clocked differently (APB1=42MHz, APB2=84MHz). Therefore during spi initialization we need to distinguish between the two possible clock rates to compute our prescaler.
Additionally, the previously configured prescalers were wrong as well and didn't lead to the desired speed on either bus. Please refer to baud rate control bits in the control register at page 905 of the reference manual where f_pclk is the clock speed of the used bus.