Skip to content

drivers: flash: mcux: fix read for LPC55XXX #90361

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

Closed
wants to merge 1 commit into from

Conversation

wilkinsw
Copy link
Contributor

The soc_flash_mcux.c driver only invokes the HAL function for a flash read when CONFIG_SOC_LPC55S36 is defined. When using another chip in the series (LPC55S16 in my case) the FLASH_Read() call was not being used. This causes the flash driver to trigger a hard fault if the target flash area is uninitialized.

This change broadens the guard to instead use CONFIG_SOC_SERIES_LPC55XXX. This is one symbolic level up from (and is selected by) SOC_LPC55S36 as well as the other SOCs in that series which uses this driver.

The Kconfig for the symbol is here:
https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/nxp/lpc/lpc55xxx/Kconfig.soc#L4

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 <[email protected]>
Copy link

Hello @wilkinsw, and thank you very much for your first pull request to the Zephyr project!
Our Continuous Integration pipeline will execute a series of checks on your Pull Request commit messages and code, and you are expected to address any failures by updating the PR. Please take a look at our commit message guidelines to find out how to format your commit messages, and at our contribution workflow to understand how to update your Pull Request. If you haven't already, please make sure to review the project's Contributor Expectations and update (by amending and force-pushing the commits) your pull request if necessary.
If you are stuck or need help please join us on Discord and ask your question there. Additionally, you can escalate the review when applicable. 😊

@wilkinsw
Copy link
Contributor Author

I opened this from main, closing to reopen from a feature branch.

@wilkinsw wilkinsw closed this May 24, 2025
Copy link

Please retry analysis of this Pull-Request directly on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ADC Analog-to-Digital Converter (ADC) area: Flash area: Sensors Sensors platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants