NXP drivers: flash: soc_flash_mcux: is_area_readable() may not confirm entire area #86432
Labels
area: Flash
bug
The issue is a bug, or the PR is fixing a bug
platform: NXP Drivers
NXP Semiconductors, drivers
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 commandCMD_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 byis_area_readable()
. A potential workaround is to callis_area_readable()
for each page.Thank you to @phonkane for reporting this.
The text was updated successfully, but these errors were encountered: