-
Notifications
You must be signed in to change notification settings - Fork 22
STM32F7 QSPI flash timeouts and 4-byte addressing #152
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
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
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.
Thanks for the patch! Did you test this on hardware? |
Yes, I have tested this on hardware.
UNRELATED:
I did find another bug possibly related to the QSPI code: After flashing Zephyr
and playing with it, flashing stock Mbed could no longer do QSPI mode. The chip
would just crash. But Zephyr would work.
I spent a while trying to debug it and found that perhaps setting 4-byte
addressing first then enabling QSPI mode fixed it. This is the only difference
I saw when comparing Zephyr's code and setting it to do that in Mbed fixed
the chip. I can't reliably reproduce this bug or confirm that's the actual fix-
I was throwing things at the wall.
Should I do a PR for that too?
…On Mon, Mar 20, 2023 at 10:29:38PM -0700, Jamie Smith wrote:
Thanks for the patch! Did you test this on hardware?
--
Reply to this email directly or view it on GitHub:
#152 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Awesome, in that case, I'll give it the green light! Regarding the other issue... it's hard to say. It would be good to fix that issue, but I don't want to merge a fix that hasn't been tested on other devices. It's hard to know if it might break something else. It's tough because we don't have any sort of CI setup that can test any of the devices with QSPI. |
Thanks for the merge! If the bug happens again I'll try and reproduce it proper and fix it for everyone. :) |
You change code inside ST's HALs what is copied into Mbed. How do we ensure that change will be mirrored into new version (during port to MbedOS) if it will be necessary to change it for a reason in future? BR, Jan |
I don't know. Any ideas?
…On Tue, Mar 21, 2023 at 10:34:41AM -0700, JohnK1987 wrote:
You change code inside ST's HALs what is copied into Mbed. How do we ensure that change will be mirrored into new version if it will be necessary to change it for a reason in future?
BR, Jan
--
Reply to this email directly or view it on GitHub:
#152 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Summary of changes
On the STM32769NI the STM32 BSP has an issue where QSPI accesses timeout and require a chip reset. Mbed use to contain a patch to fix this similar to this one but the change was lost during an update.
Enable the workaround ST uses for specific F7 chips but on all chips. There's no downside to this from what I can tell.
The 4-byte addressing was disabled because of timeouts which I think are due to this issue but falsely misattributed to 4-byte addressing. Enable that again.
Further discussions:
ARMmbed#10049
ARMmbed#15108
STMicroelectronics/STM32CubeF7#52
STMicroelectronics/STM32CubeF7#82
Impact of changes
Documentation
None
Pull request type
Test results
I'm not sure how to make a test for this yet. The issue takes an hour to recreate.