Skip to content
Commit 20cd3a3f authored by Luca Burelli's avatar Luca Burelli Committed by Mahesh Mahadevan
Browse files

drivers/flash/mcux: fix flash_read() operation on LPC55S36



As other targets in the LPC55xxx series, the LPC55S36 has a Flash
controller that raises ECC errors when reading erased pages directly.
To avoid this, there is special code for this platform that calls the
HAL FLASH_IsFlashAreaReadable() function. However, this in turn calls a
function at an hardcoded address in ROM that _always_ causes an
instruction fault, making the situation worse.

This patch reworks the read operation to use the FLASH_Read() HAL
function for this target to gracefully handle error conditions and
properly emulate accesses to erased pages. The preprocessor is required
since some targets do not define the FLASH_Read() function.

Fixes: #80325

Signed-off-by: default avatarLuca Burelli <l.burelli@arduino.cc>
parent 5a03d3f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment