Skip to content

Commit 00ee4a5

Browse files
wilkinswkartben
authored andcommitted
drivers: flash: mcux: fix read for LPC55XXX
The LPC55XXX SoC series requires the use of a HAL function to read from uninitialized flash without triggering a hardfault. This broadens an existing #ifdef clause so that it is triggered for all chips in the series instead of only the LPC55S36. Signed-off-by: Wilkins White <ww@novadynamics.com>
1 parent 564e7eb commit 00ee4a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/flash/soc_flash_mcux.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ static int flash_mcux_read(const struct device *dev, off_t offset,
238238
* on erased or otherwise unreadable pages. Emulate erased pages,
239239
* return other errors.
240240
*/
241-
#ifdef CONFIG_SOC_LPC55S36
242-
/* On LPC55S36, use a HAL function to safely copy from Flash. */
241+
#ifdef CONFIG_SOC_SERIES_LPC55XXX
242+
/* On LPC55XXX, use a HAL function to safely copy from Flash. */
243243
rc = FLASH_Read(&priv->config, addr, data, len);
244244
switch (rc) {
245245
case kStatus_FLASH_Success:
@@ -262,15 +262,15 @@ static int flash_mcux_read(const struct device *dev, off_t offset,
262262
rc = -EIO;
263263
break;
264264
}
265-
#else /* CONFIG_SOC_LPC55S36 */
265+
#else /* CONFIG_SOC_SERIES_LPC55XXX */
266266
/* On all other targets, check if the Flash area is readable.
267267
* If so, copy data from it directly.
268268
*/
269269
rc = is_area_readable(addr, len);
270270
if (!rc) {
271271
memcpy(data, (void *) addr, len);
272272
}
273-
#endif /* CONFIG_SOC_LPC55S36 */
273+
#endif /* CONFIG_SOC_SERIES_LPC55XXX */
274274

275275
if (rc == -ENODATA) {
276276
/* Erased area, return dummy data as an erased page. */

0 commit comments

Comments
 (0)