-
-
Notifications
You must be signed in to change notification settings - Fork 283
SerialFlash: enlarge chip ID buffer #207
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
Conversation
@calvinatintel please don't merge yet-- I'd like to run a Klocwork scan first. |
@SidLeung @bigdinotech ready for review |
Some context; the offending code is only executed when a Spansion device is detected. The 101's onboard SPI Flash (the one which the SerialFlash library will use) is a Winbond, so the only way a user could see this bug while using a 101 is by modifying the SerialFlash library to use SPI (instead of SPI1) and connecting a Spansion device to it. In my opinion, this doesn't affect Bellatrix, what do you guys think? |
Maybe just add a comment then. |
@eriknyquist It's not going to affect Bellatrix and the chances of having someone using SPI on a Spansion device is small. Fix it, push it, and release it on the next round, Castor. BTW, is there a reason between 3 and 5? If so, would you please put it in as comment in the code too? Thanks. |
@bbaltz505 I was trying to suggest that this commit doesn't need to go into Bellatrix. Do you mean add a comment to this PR? |
@eriknyquist , I meant if you were to touch the code, just add a comment. No need to reopen it for Bellatrix though - given your explanation. |
I sent Paul a PR for the same. Since Paul's library works out of the box on a 101 now, I think we want to take it out of the next release and just direct users to download the latest version through the IDE library manager. So I'm not even sure if this PR should be merged? |
@SidLeung missed your earlier comment, yes the reason for 5 is in the SerialFlashChip::readID function; if the device is a Spansion, then |
SerialFlashChip::readID() writes up to 5 bytes into the buffer provided, but the caller only allocates 3 bytes. Increase buffer size to 5 bytes.
No Klocwork issues in this PR, thanks for the help there @bbaltz505 :) |
@calvinatintel ready to merge for Castor |
cherry-picked |
Also applied upstream :) PaulStoffregen/SerialFlash@05965b5 |
Thanks @PaulStoffregen! |
SerialFlashChip::readID() writes up to 5 bytes into
the buffer provided, but the caller only allocates
3 bytes. Increase buffer size to 5 bytes.