-
Notifications
You must be signed in to change notification settings - Fork 3k
SPIF: fixed _address_size to always initialize as 3_BYTES in ::init() #14909
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
@ndrs-pst, thank you for your changes. |
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, @ARMmbed/mbed-os-core, please complete review of the changes to move the PR forward. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ndrs-pst Thanks for the fix. It looks like we always need to start with 3-byte until 4-byte addressing is enabled in _sfdp_detect_and_enable_4byte_addressing()
. This change looks good to me.
Given that 3-byte addressing is the "initial state", what about moving _address_size = QSPI_CFG_ADDR_SIZE_24
from constructors into ::init()
to start this way every time, rather than using deinit()
to change it back?
@LDong-Arm That's also OK too. |
If we can use the constant What target and what type of storage are you using? |
@LDong-Arm Your approach would be safer then. |
Thanks for the info. Could you please either make the suggested change (set |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Requesting change)
@LDong-Arm Just push more commit, please review. 😃 |
Thanks @ndrs-pst, it looks good now. Could you squash the two commits, and make sure QSPIF/OSPIF are not touched (currently just an empty line is removed from each) so only SPIF is changed? Also the PR description can be updated to include SPIF only. |
… into ::init() instead
@LDong-Arm Just squash the commit and change PR comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Summary of changes
Fixed _address_size attribute in blockdevice::COMPONENT_SPIF when using with device that has size bigger than 16 MiB. (e.g. 32 MiB)
In this scenario, during SPIFBlockDevice::init() _address_size will be set to SPIF_ADDR_SIZE_4_BYTES after enumerated by SFDP command. Then calling to deinit() will not restore _address_size back to initial value SPIF_ADDR_SIZE_3_BYTES again.
Result that the following calling sequence will be failed on the 2nd init()
static SPIFBlockDevice spif_bd;
rc = spif_bd.init(); // rc : SPIF_BD_ERROR_OK
rc = spif_bd.deinit(); // rc : SPIF_BD_ERROR_OK
rc = spif_bd.init(); // rc : SPIF_BD_ERROR_PARSING_FAILED
Impact of changes
Migration actions required
Documentation
None
Pull request type
Test results
Reviewers