Skip to content

Fix setting the QE bit on ISSI Flash memories #12947

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
May 12, 2020

Conversation

Uruloke
Copy link
Contributor

@Uruloke Uruloke commented May 8, 2020

Summary of changes

By default QSPIFBlockDevice assumes a Flash memory have two Status registers and when writing the Status registers it writes 2 bytes using the WRSR instruction. This will not work on a ISSI Flash memory as they only have a single status register and attempting to write two bytes using WRSR will cause it to ignore the request and be unable to set the QE bit.

ISSI datasheet specifies that the WRSR instruction only write a single byte so override the number of status registers for ISSI Flash memories.

Fixes #12784.

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

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

Reviewers


By default QSPIFBlockDevice assumes a Flash memory have two Status registers and when writing the Status registers it writes 2 bytes using the WRSR instruction. This will not work on a ISSI Flash memory as they only have a single status register and attempting to write two bytes using WRSR will cause it to ignore the request and be unable to set the QE bit.

ISSI datasheet specifies that the WRSR instruction only write a single byte so override the number of status registers for ISSI Flash memories.
@mergify mergify bot added the needs: CI label May 8, 2020
@VeijoPesonen
Copy link
Contributor

VeijoPesonen commented May 8, 2020

@Uruloke I would like you to paste the test results when you run filesystem tests with your board. Why I'm asking for those is due to the fact our PR checks don't check for how QSPIF modules behave - that's at least my understanding.

mbed test -m detect -n features-storage-filesystem-littlefs-* --app-config tools/test_configs/QSPIFBlockDeviceAndHeapBlockDevice.json

I pulled your PR and checked that tests are passing with your changes on a board I'm having.

mbedgt: test suite report:
| target              | platform_name | test suite                                                                           | result | elapsed_time (sec) | copy_method |
|---------------------|---------------|--------------------------------------------------------------------------------------|--------|--------------------|-------------|
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-dirs                           | OK     | 52.96              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-files                          | OK     | 30.43              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-interspersed                   | OK     | 21.09              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem-seek                           | OK     | 56.8               | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_integration-format             | OK     | 20.11              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience            | OK     | 47.1               | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-resilience_functional | OK     | 72.89              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_recovery-wear_leveling         | OK     | 92.23              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-dirs                  | OK     | 52.99              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-files                 | OK     | 30.61              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-interspersed          | OK     | 21.82              | default     |
| NRF52840_DK-GCC_ARM | NRF52840_DK   | features-storage-filesystem-littlefs-tests-filesystem_retarget-seek                  | OK     | 65.78              | default     |
mbedgt: test suite results: 12 OK

After you send the results you should update the PR description to tell that the tests results are supplied as part of this PR.

@Uruloke
Copy link
Contributor Author

Uruloke commented May 8, 2020

Okay, I'll do this first thing on Monday.

How does the mbed testing work? Does it need a two-way communication with the host PC to work? On my board I only have the SWO output with a custom Stream-based class acting as console. If it needs a serial port of some sort I'll have to modify my board for it.

@VeijoPesonen
Copy link
Contributor

Does it need a two-way communication with the host PC to work?

Yes, it does.

If it needs a serial port of some sort I'll have to modify my board for it.

Ok, if this is going to cause extra work I think we can live without the results.

Copy link
Contributor

@VeijoPesonen VeijoPesonen left a comment

Choose a reason for hiding this comment

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

Looks good to me

@0xc0170
Copy link
Contributor

0xc0170 commented May 11, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented May 11, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@Uruloke
Copy link
Contributor Author

Uruloke commented May 11, 2020

@VeijoPesonen I tried to run the tests as you instructed but having read up on how Greentea actually works I realized there's no way I'd be able to get the automated tests running on my own board. I could possibly manually run each test if I read up more on how it works but it'd take time.

I have verified that the change does work on my board though as I can use LittleFS without issues with it.

@0xc0170 0xc0170 merged commit 5302a35 into ARMmbed:master May 12, 2020
@mergify mergify bot removed the ready for merge label May 12, 2020
@Uruloke Uruloke deleted the issi-flash-memory-support-master branch January 28, 2021 13:50
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.

QSPIFBlockDevice: unable to set QE bit on ISSI Flash memories
4 participants