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
FRDM-K22F: SPI frequency is set to 93 kHz #840
Comments
Can you please also test K64F? They share the same implementation, so this should appear for K64F also. |
The same situation is on the K64F, and every single other targets, since it explicitly puts the frequency on 100kHz in the SD filesystem code initialization section: _spi.frequency(100000); Some logic analyser tests show nothing wrong with the frequency of the SPI. What does seem to be the issue should appear better if you put your logic analyzer at 24MHz: there is an extremely short low-time between two consecutive words: at 100kHz it is less than 100ns, while at 400kHz it is 600ns, and after that it keeps increasing. In your picture it can already be seen though. What I think is happening that at the last rising edge the peripheral returns the read data to the mbed function. Now the peripheral still has to make a falling edge to go to its active low state. At high frequencies this means the mbed functions provide enough overhead that before the next command is sent, there is a gap between the commands. At low frequencies the peripheral waiting before it may make its falling edge is longer than the overhead of the functions. Now the moment it has a falling edge, it pretty much directly makes a rising edge again to start the next SPI command, resulting in a very tiny low period, and I think thats the problem. Why this happens I don't know, you would think it is protected against that. But it might be solvable using all the different delay settings of the SPI peripheral. It should also appear on the K64F though. |
This should now be also solved with above pull request, maybe @PrzemekWirkus can reverify it. |
ARM Internal Ref: IOTMORF-300 |
Seems resolved. Please reopen if not. |
I've just ran few SD card tests and I can see on logical analyzer that SPI frequency (CLK) is set to ~93kHZ.
Result: SD card tests are failing for K22F:
The text was updated successfully, but these errors were encountered: