-
Notifications
You must be signed in to change notification settings - Fork 7.4k
drivers: flash: fix RWW issues in flash_mcux_flexspi_hyperflash #88469
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
base: main
Are you sure you want to change the base?
drivers: flash: fix RWW issues in flash_mcux_flexspi_hyperflash #88469
Conversation
Don't access device pointer from critical sections when programming the hyperflash, as this could cause a RWW hazard Signed-off-by: Daniel DeGrasse <[email protected]>
88bbf06
to
7f23e09
Compare
L1CACHE_DisableICache(); | ||
L1CACHE_DisableDCache(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you use the sys_cache_
functions instead? In case the CACHE_MANAGEMENT
is turned off completely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably best to get this conversion done. Changed to use sys_cache*
functions in latest push
Disable the cache during erase and programming operations, as cache pre-fetch operations can cause flash access outside of the application's control Also, reduce the SCLK frequency used after erase operations to 200MHz. Without this, the RT1050 appears to hang after flash program operations Signed-off-by: Daniel DeGrasse <[email protected]>
7f23e09
to
d3bcc61
Compare
NXP specific, re-assigned to @mmahadevan108. |
@mmahadevan108 can you take a look? |
Apply a few fixes to the NXP FlexSPI hyperflash driver to prevent flash read access from the core while programming the flash. These fixes were tested with #85254 on an RT1050-EVK, as this is where I encountered the crashes.
Note that the ICACHE/DCACHE disable step is based on what is done here: https://github.com/nxp-mcuxpresso/mcux-sdk-examples/blob/52b428258efda7d5bd8a2ace2195ca828356743a/evkbimxrt1050/driver_examples/flexspi/hyper_flash/polling_transfer/flexspi_hyper_flash_ops.c#L279