-
Couldn't load subscription status.
- Fork 163
mcux: C40 flash (S32K3x): add S32K344 array geometry header, IP Aliases and Cleanup #618
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
base: master
Are you sure you want to change the base?
mcux: C40 flash (S32K3x): add S32K344 array geometry header, IP Aliases and Cleanup #618
Conversation
|
@sumitbatra-nxp Please submit this change to the SDK team. I have provided you details on where to submit the PR via our chat channel. |
|
Let us know once this is accepted by the SDK team and update this PR if needed. |
|
Sure.. |
a21e4f4 to
26299d2
Compare
26299d2 to
ec8c38e
Compare
|
@manuargue @mmahadevan108 .. I have corrected all the comments from the SDK team and ones made by Manuel here. |
ec8c38e to
a679f8b
Compare
|
@mmahadevan108 .. All changes are complete and mcusdk PR is also marked as fixed |
|
Awaiting approval from @manuargue before merging this. |
|
Hi @sumitbatra-nxp, could you please help to update README to record the patch, for examples: https://github.com/zephyrproject-rtos/hal_nxp/pull/597/files#diff-d76b726c36140769d6ad0c555299f9442e47a435a0758efde38d56c2ca775313R243? Thanks a lot. |
a679f8b to
be2df90
Compare
- fsl_c40_flash.c: Initialize `ret` in FLASH_Erase() to
`kStatus_FLASH_Success` to avoid potential use-before-set warnings on some
toolchains/static analyzers (no functional change).
- S32K344_features.h: Define C40 array geometry for S32K344 using unsigned
constants:
* FSL_FEATURE_FLASH_C40_BLOCK_SIZE_CODE (1 MiB)
* FSL_FEATURE_FLASH_C40_BLOCK_COUNT_CODE (4)
* FSL_FEATURE_FLASH_C40_BLOCK_SIZE_DATA (256 KiB)
Note: erase/program granularities are controller-level and handled by driver.
- S32K344_glue_mcux.h: Provide conditional aliases mapping FLASH↔IP_FLASH and
PFLASH↔IP_PFLASH to harmonize SDK naming and improve build portability.
Signed-off-by: Sumit Batra <sumit.batra@nxp.com>
be2df90 to
e38b89b
Compare
@ZhaoxiangJin .. I tried adding something as per my understanding in the mcux/README, but I am not sure if that is what was required. |
The information is ok, thanks. |
|
@manuargue , please revisit this PR. |
Title: mcux: C40 flash (S32K3x): run mutating ops from SRAM for XIP; add S32K344 array geometry header
Summary
This PR adds features header describing the C40 array geometry.
No behavior change on non-XIP builds.
flash_c40: add SoC features header
Introduces fsl_c40_flash_features.h with S32K344 C40 geometry (block sizes/counts).
Purely additive; intended for consumers (e.g., Zephyr internal-flash glue) that need compile-time array parameters.
Rationale
On Cortex-M XIP systems, flash program/erase/lock sequences must not execute from the same flash array they modify. Relocating these critical routines to SRAM is a standard mitigation that avoids bus contention and hard faults, especially under bootloader + application scenarios.
Compatibility
No public API changes.
Testing
Hardware: NXP S32K344 (MR-CANHUBK3).
Verified program/erase and sector protection operations via Zephyr flash_shell and MCUboot chain-load.
Confirmed stable execution with functions relocated to SRAM.
Follow-ups / Consumers
Zephyr driver glue for C40 uses this update; following Zephyr PR bumps west.yml to this HAL revision.
This PR is created to support Zephyr PR - zephyrproject-rtos/zephyr#97401
Signed-off-by: Sumit Batra sumit.batra@nxp.com