Skip to content
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

NXP drivers: flash: soc_flash_mcux: is_area_readable() may not confirm entire area #86432

Open
DerekSnell opened this issue Feb 27, 2025 · 0 comments
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug platform: NXP Drivers NXP Semiconductors, drivers

Comments

@DerekSnell
Copy link
Contributor

is_area_readable() is used on some LPC MCUs to confirm if an area is readable before attempting to read it, to avoid faults. This uses the hardware command CMD_BLANK_CHECK, which checks each page in the area. From the LPC55S69 User Manual, the CMD_BLANK_CHECK “If a page is found which is not correctly erased, the FAIL flag is set, the page is reported on DATAW0 and processing stops. The check is performed in incrementing address order”.

If is_area_readable() is called for multiple pages, and the first page is not erased, CMD_BLANK_CHECK terminates and sets the FAIL bit. is_area_readable() returns with no error, indicate the entire range is readable. But only the 1st page was checked.

Impact
Users of is_area_readable() may end up with flash faults when reading a non-readable page that was skipped by is_area_readable(). A potential workaround is to call is_area_readable() for each page.

Thank you to @phonkane for reporting this.

@DerekSnell DerekSnell added bug The issue is a bug, or the PR is fixing a bug area: Flash platform: NXP Drivers NXP Semiconductors, drivers labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Flash bug The issue is a bug, or the PR is fixing a bug platform: NXP Drivers NXP Semiconductors, drivers
Projects
None yet
Development

No branches or pull requests

1 participant