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

Fix SPIF read dummy cycles not being reset #13698

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

boraozgen
Copy link
Contributor

Summary of changes

Fixes #13428 by removing the unnecessary setting of _read_dummy_and_mode_cycles.

Citing my explanation here: #13428 (comment)

Actually the usage of _read_dummy_and_mode_cycles and _dummy_and_mode_cycles seems to be a bit inconsistent and probably needs refactoring/explanation. For this particular case, as _dummy_and_mode_cycles is set in the next line and this variable is used in the following _spi_send_read_command(), setting _read_dummy_and_mode_cycles is unnecessary. Furthermore, this causes the issue with SST26 since after _sfdp_detect_best_bus_read_mode() sets this value to 0, which is the default value for SPI chips AFAIK, the _spi_send_read_sfdp_command is called again, and it is set to 8, which is never again set back to 0.

When I remove this line, the driver works properly for both of the SPI chips I have, the SST26VF016B and W25Q32JV. I do not know the requirements for other chips and cannot test them. I can still issue a PR for this if needed. Nevertheless, I believe the whole module should be refactored with this in mind.

Impact of changes

Migration actions required

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[X] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


@boraozgen boraozgen changed the title Fix SFDP read dummy cycles not being reset Fix SPIF read dummy cycles not being reset Oct 2, 2020
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Oct 2, 2020
@ciarmcom ciarmcom requested a review from a team October 2, 2020 13:30
@ciarmcom
Copy link
Member

ciarmcom commented Oct 2, 2020

@boraozgen, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

@0xc0170 0xc0170 requested a review from a team November 3, 2020 11:57
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 3, 2020

@ARMmbed/mbed-os-core Please review

@mergify mergify bot added needs: CI and removed needs: review labels Nov 3, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Nov 4, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 4, 2020

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️

@0xc0170 0xc0170 merged commit 77638f9 into ARMmbed:master Nov 5, 2020
@mbedmain mbedmain added release-version: 6.5.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SPIFBlockDevice has memory alignment issues with SST26VF016 on k64f
5 participants