-
Notifications
You must be signed in to change notification settings - Fork 7.7k
drivers: flash: max32: Add read support with ECC workaround #93437
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
Open
ttmut
wants to merge
6
commits into
zephyrproject-rtos:main
Choose a base branch
from
analogdevicesinc:max32657/flc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+78
−12
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Default MPU configuration marks whole flash area as cacheable. When reading from an erased section of flash, cache controller may fill cache lines with ECC corrected data. To prevent this, disable caching on storage section so that ECC workaround can be applied during reads and correct data is returned. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Move functions in .flashprog section into RAMFUNC so that they can be executed from SRAM. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Disable interrupts during flash operations to prevent unintended jumps. Interrupts are now disabled before read, erase, and write operations to avoid accidental jumps to other flash sections while working on a specific section. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
To fix MAX32690 flash problems, I created a wrap version of MXC_FLC_Write(...) function which disables ICC before calling write function and enables ICC after this function. Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
The following west manifest projects have changed revision in this Pull Request:
✅ All manifest checks OK Note: This message is automatically posted and updated by the Manifest GitHub Action. |
Update hal_adi to include the new flash read function that checks for false-positive ECC failures and applies a workaround if needed. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
Use wrapper function for read operations to allow using the new HAL function that handles ECC checks and erased page detection. Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
|
ozersa
approved these changes
Jul 22, 2025
MaureenHelm
approved these changes
Jul 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The MAX32657 SoC includes an ECC engine capable of correcting single-bit errors. However, when reading from an unwritten flash location, the ECC controller incorrectly detects an error and flips a bit in the 16th byte, causing 0xFF to be read as 0xFD.
This PR introduces a workaround and related fixes to mitigate this issue:
These changes improve reliability when interacting with flash memory under ECC protection.
A similar issue can be seen in #80351.
Tests
Before:
After: