Skip to content

QSPIF: options to preset reset sequence for legacy SFDP #13399

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

Merged
merged 1 commit into from
Aug 21, 2020

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Aug 7, 2020

Summary of changes

Fixes: #13129
(Special thanks to @keithmwheeler for the analysis, which I confirm.)

The first revision (1.0) of SFDP (ref: JESD216) does not include a field to indicate software reset support. The currently available document JESD216D from JEDEC has a change log at the end, and the first revision of the Basic Parameters Table has fewer entries than the location indicating software reset.

Some Mbed OS targets such as DISCO_F746NG include flashes with legacy SFDP, thus we add an option to preset the reset mode. Users of custom targets can utilise this option too.

To use, set options to your application's mbed_app.json:

  • If your QSPI flash has an enable + reset sequence (0x66 followed by 0x99)
        "target_overrides": {
            "<YOUR_TARGET>": {
                "enable-and-reset": true
            }
        }
  • If your QSPI flash requires a single reset command (0xF0)
        "target_overrides": {
            "<YOUR_TARGET>": {
                "direct-reset": true
            }
        }
  • Don't set either option if your device's SFDP is the second revision (1.5 as SFDP reports) or newer - the reset sequence should be automatically determined at run time.

Please consult your flash device's data sheet to determine the reset sequence.

Impact of changes

  • No impact on existing applications
  • Fixes QSPIF on DISCO_F746NG (which I have one)
  • Users of other flash devices (e.g. custom targets, shields, etc.) with legacy SFDP can use the added options to fix initialisation issues

Migration actions required

None for targets that already work properly with QSPIF. See PR description for how to use the added options.

Documentation

See the PR description, or mbed_lib.json for QSPIF.


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

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

Fixes the issue on my local DISCO_F746NG.


Reviewers

@ARMmbed/mbed-os-core, @geky, @ARMmbed/mbed-os-storage


@ciarmcom
Copy link
Member

ciarmcom commented Aug 7, 2020

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

@ciarmcom ciarmcom requested review from geky and a team August 7, 2020 17:00
Copy link
Collaborator

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: no test done

@adbridge
Copy link
Contributor

@LDong-Arm why have you marked this as a feature PR?

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Aug 12, 2020

@LDong-Arm why have you marked this as a feature PR?

It's a new configuration to enable support for some legacy flashes, rather than fixing an error in our code. Since it fixes the support for an existing flash controller in Mbed OS, would you prefer marking it as a fix instead?

@adbridge
Copy link
Contributor

@LDong-Arm why have you marked this as a feature PR?

It's a new configuration to enable support for some legacy flashes, rather than fixing an error in our code. Since it fixes the support for an existing flash controller in Mbed OS, would you prefer marking it as a fix instead?

Unless it does one of these things "New feature / Functionality change / New API" then it is a patch (I'm ruling out major as that's way more significant)

@LDong-Arm
Copy link
Contributor Author

Unless it does one of these things "New feature / Functionality change / New API" then it is a patch (I'm ruling out major as that's way more significant)

Fair enough, I've changed it.

evedon
evedon previously approved these changes Aug 18, 2020
Copy link
Contributor

@evedon evedon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @LDong-Arm !

@mergify mergify bot added needs: CI and removed needs: review labels Aug 18, 2020
@evedon
Copy link
Contributor

evedon commented Aug 18, 2020

Unless it does one of these things "New feature / Functionality change / New API" then it is a patch (I'm ruling out major as that's way more significant)

Fair enough, I've changed it.

@adbridge Note that label should be updated.

@adbridge adbridge added release-type: patch Indentifies a PR as containing just a patch and removed release-type: feature labels Aug 18, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 19, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 19, 2020

Jenkins CI Test : ❌ FAILED

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-ARM ✔️
jenkins-ci/mbed-os-ci_build-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest

@mergify mergify bot added needs: work and removed needs: CI labels Aug 19, 2020
@LDong-Arm
Copy link
Contributor Author

@adbridge @0xc0170 The client test failed with

timeout_error_msg = "Didn't find client registered in 300 s"

Doesn't look related to this change?

@adbridge
Copy link
Contributor

@LDong-Arm will try re-running ci

@mbed-ci
Copy link

mbed-ci commented Aug 20, 2020

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-ARM ✔️
jenkins-ci/mbed-os-ci_build-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 ✔️

@mergify mergify bot added needs: work and removed needs: CI labels Aug 20, 2020
@mergify
Copy link

mergify bot commented Aug 21, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

The first revision (1.0) of SFDP (ref: JESD216) does not include
fields for software reset support. It's only been added in the
second revision (1.5) (ref: JESD216A).

Some Mbed OS targets such as DISCO_F746NG include flashes with
legacy SFDP, thus we add an option to preset the reset mode.
@LDong-Arm
Copy link
Contributor Author

Rebased

@mergify mergify bot dismissed evedon’s stale review August 21, 2020 10:39

Pull request has been modified.

@0xc0170
Copy link
Contributor

0xc0170 commented Aug 21, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Aug 21, 2020

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

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

@0xc0170 0xc0170 removed the needs: CI label Aug 21, 2020
@0xc0170 0xc0170 merged commit 1c0318c into ARMmbed:master Aug 21, 2020
@mergify mergify bot removed the ready for merge label Aug 21, 2020
@mbedmain mbedmain added release-version: 6.3.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Sep 14, 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.

Error with mbed 6.0, gcc 9.2 and GD25Q16 QSPI Flash -- incorrect SFDP parsing from QSPIFBlock
8 participants