Skip to content
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

SPI: restore 12MHz as maximum frequency #622

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

facchinm
Copy link
Member

@facchinm facchinm commented Apr 7, 2021

Fixes #593

@CLAassistant
Copy link

CLAassistant commented Apr 7, 2021

CLA assistant check
All committers have signed the CLA.

@matthijskooijman
Copy link
Collaborator

Is 12Mhz really the limit of the SPI hardware? Or is this just a limit of the slave devices used in the bug report and/or the wiring used? Also, this says "restore", so it would be good if the commit message would refer to the commit that lifted this limitation previously and comments on why that was wrong (if it is)?

@facchinm
Copy link
Member Author

facchinm commented Apr 8, 2021

The "previous behaviour" I was referring to is the one documented here https://github.com/arduino/ArduinoCore-samd/blob/master/libraries/SPI/SPI.h#L37-L43 .
It's very likely that the flash under test doesn't support 24Mhz speed, but the library doesn't allow changing the frequency https://github.com/PaulStoffregen/SerialFlash/blob/master/SerialFlashChip.cpp#L33

@cmaglie
Copy link
Member

cmaglie commented Apr 8, 2021

I remember writing the comment in SPI.h. Also I remember that someone experimentally determined that the maximum clock is 12Mhz in SPI Master mode.

Looking to an updated datasheet this seems confirmed by the following:
image
image

84ns translates to roughly 1.000.000.000/84=11.904.761 Hz

@ArduinoBot
Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b212_index.json

ℹ️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request SPI: restore 12MHz as maximum frequency #622
  5. Select one of the boards under SAMD Pull Request SPI: restore 12MHz as maximum frequency #622 in Tools->Board menu
  6. Compile/Upload as usual

@sambartle
Copy link

Do I need to turn off some kind of signature verification to test this?
The "http://downloads.arduino.cc/PR/samd/package_samd-b212_index.json.sig" file doesn't seem to exist.

@sambartle
Copy link

Any progress on fixing the signature verification for this so it can be tested?
It's a really annoying issue causing many problems with other libraries due to their reliance on working SPI.

@facchinm facchinm merged commit 1a7d8d0 into arduino:master Oct 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MKRWAN 1310 Flash Memory access fails.
6 participants