Skip to content

DISCO_F769NI has QSPI timeouts #15108

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

Closed
Jookia opened this issue Sep 27, 2021 · 8 comments
Closed

DISCO_F769NI has QSPI timeouts #15108

Jookia opened this issue Sep 27, 2021 · 8 comments

Comments

@Jookia
Copy link
Contributor

Jookia commented Sep 27, 2021

Description of defect

When reading from a LittleFSv2 filesystem, reads will fail sometimes.
Adding tracing or block device slicing causes this issue to become less pronounced.

Here's an example error with tracing (and a printf in HAL_QSPI_* functions):

[2317.075817 0.000972] ÿClosing "/fs/numbers.txt"... OK
[2317.078827 0.003010] Opening the root directory... OK
[2317.081825 0.002998] root directory:
[2317.082858 0.001033]     .
[2317.083829 0.000971]     ..
[2322.085432 5.001603] [ERR ][STQS]: HAL_QSPI_Receive error 1 status 1
[2322.090482 0.005050] [ERR ][QSPIF]: QSPI Read failed
[2322.094494 0.004012] [ERR ][QSPIF]: Read Command failed
[2322.099857 0.005363] Closing the root directory... OK
[2322.101475 0.001618] Opening "/fs/numbers.txt"... [ERR ][STQS]: HAL_QSPI_Receive error 1 status 1
[2322.109472 0.007998] [ERR ][QSPIF]: QSPI Read failed
[2322.113477 0.004004] [ERR ][QSPIF]: Read Command failed
[2322.118441 0.004965] Fail :(
[2322.119431 0.000990]
[2322.119441 0.000010]
[2322.119447 0.000006] ++ MbedOS Error Info ++
[2322.121459 0.002012] Error Status: 0x80FF0100 Code: 256 Module: 255
[2322.125466 0.004007] Error Message: Fatal Run-time error
[2322.128478 0.003012] Location: 0x8000415
[2322.130466 0.001988] Error Value: 0x0
[2322.132442 0.001976] Current Thread: main Id: 0x20002854 Entry: 0x8002951 StackSize: 0x1000 StackMem: 0x20001830 SP: 0x2000277C
[2322.141476 0.009034] For more info, visit: https://mbed.com/s/error?error=0x80FF0100&tgt=DISCO_F769NI
[2322.148481 0.007005] -- MbedOS Error Info --
[2322.151437 0.002956] error:  (-4001)
[2322.152460 0.001023]

(times are added by grabserial)

Target(s) affected by this defect ?

32F769IDISCOVERY

Toolchain(s) (name and version) displaying this defect ?

arm-none-eabi- 11.2.0 from Arch Linux
arm-none-eabi- 10.2.1 from Arch Linux User Repository
mbed-cli installed from pip

What version of Mbed-os are you using (tag or sha) ?

mbed-os-6.14.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli from pip, so 1.10.5
See toolchains reported earlier

How is this defect reproduced ?

Run the LittleFS example with the filesystem changed to LittleFSv2. Keep rebooting the board until failure.

The testing setup we use is this:

main.cpp
target.json
hal_log.patch

This bug seems fairly similiar to #10049

Re-applying the changes to 5c872a4 as mbed_fix.patch seems to fix the issue. Maybe the HAL needs to define QSPI1_V1_0 for the 32F769NI? Or maybe it's a false positive.

@jeromecoutant
Copy link
Collaborator

@Jookia
Copy link
Contributor Author

Jookia commented Sep 27, 2021

Hi, yes my patch mbed_fix.patch does that and seems to fix the issue or make it harder to reproduce.

@jeromecoutant
Copy link
Collaborator

But both remove are needed, or only 1 ?

@Jookia
Copy link
Contributor Author

Jookia commented Sep 27, 2021 via email

@Jookia
Copy link
Contributor Author

Jookia commented Sep 28, 2021

Uncommenting EITHER of those seems to fix the issue.

@Jookia
Copy link
Contributor Author

Jookia commented Oct 7, 2021

I just want to note that with my fix I haven't seen this pop up again. It's quite possible there's been some silent corruption, but it seems like it's fixed it. I've opened a bug upstream.

@jeromecoutant
Copy link
Collaborator

Great

In parallel, you can propose a patch in mbed-os, I will approve it as soon as STMicroelectronics/STM32CubeF7#52 is confirmed

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 22, 2022

As it's been almost a year without any update, I'll close this as won't fix.

@0xc0170 0xc0170 closed this as completed Jul 22, 2022
Jookia added a commit to Jookia/mbed-os that referenced this issue Mar 11, 2023
On the STM32769NI at least this patch is required for stable QSPI use.
Enable it uncondtionally in case other boards need it too.

Further discussions:

ARMmbed#10049
ARMmbed#15108

STMicroelectronics/STM32CubeF7#52
STMicroelectronics/STM32CubeF7#82
Jookia added a commit to Jookia/mbed-os that referenced this issue Mar 11, 2023
On the STM32769NI at least this patch is required for stable QSPI use.
Enable it uncondtionally in case other boards need it too.

Further discussions:

ARMmbed#10049
ARMmbed#15108

STMicroelectronics/STM32CubeF7#52
STMicroelectronics/STM32CubeF7#82
multiplemonomials pushed a commit to mbed-ce/mbed-os that referenced this issue Mar 21, 2023
* STM32F7: Unconditionally enable QSPI workarounds

On the STM32769NI at least this patch is required for stable QSPI use.
Enable it uncondtionally in case other boards need it too.

Further discussions:

ARMmbed#10049
ARMmbed#15108

STMicroelectronics/STM32CubeF7#52
STMicroelectronics/STM32CubeF7#82

* QSPIF: Attempt 4-byte addressing on Macronix chips

mbed-os PR 11531 introduced 4-byte addressing in the QSPIF block device:

ARMmbed#11531

During testing it was found that this code broke on the NRF52840_DK and
DISCO_F769NI.

The NRF52840_DK controller seems unable to handle 4-byte addressing at
all and has been disabled entirely in another code section.

The DISCO_F769NI breakage was attributed to the flash chip but after more
research I believe this is related to the QSPI controller, not the 4-byte
addressing itself.

Now that the QSPI controller has a workaround, enable 4-byte addressing
again and hope it works fine this time.
Jookia added a commit to Jookia/mbed-os that referenced this issue May 8, 2023
On the STM32769NI at least this patch is required for stable QSPI use.
Enable it uncondtionally in case other boards need it too.

Further discussions:

ARMmbed#10049
ARMmbed#15108

STMicroelectronics/STM32CubeF7#52
STMicroelectronics/STM32CubeF7#82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants