Skip to content

Commit 1fd24fb

Browse files
DerekSnellnashif
authored andcommitted
soc: nxp: mcx: MCXNx4x: update SOC to use flash_k4 driver
Use flash_k4 driver for internal flash instead of ROM API driver. One benefit is the flash program phrase size decreases from 128 Bytes to 16 Bytes. 16 Byte phrases enables this SOC to leverage the Zephyr NVS subsystem, and the MCUboot swap mode. Signed-off-by: Derek Snell <derek.snell@nxp.com> Conflicts: west.yml
1 parent 6681f8d commit 1fd24fb

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

dts/arm/nxp/nxp_mcxnx4x_common.dtsi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -629,8 +629,7 @@
629629
compatible = "soc-nv-flash";
630630
reg = <0 DT_SIZE_M(2)>;
631631
erase-block-size = <8192>;
632-
/* MCXN54x ROM Flash API supports writing of 128B pages. */
633-
write-block-size = <128>;
632+
write-block-size = <16>;
634633
};
635634

636635
uuid: uuid@1100000 {

modules/hal_nxp/mcux/mcux-sdk-ng/drivers/drivers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ if(CONFIG_SOC_MK82F25615 OR CONFIG_SOC_MK64F12 OR CONFIG_SOC_MK66F18 OR
197197
set(CONFIG_MCUX_COMPONENT_driver.sysmpu ON)
198198
endif()
199199

200-
if(CONFIG_SOC_SERIES_MCXW)
200+
if(CONFIG_SOC_SERIES_MCXW OR CONFIG_SOC_MCXN947 OR CONFIG_SOC_MCXN547)
201201
set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.flash_k4)
202202
endif()
203203

@@ -262,7 +262,7 @@ if(CONFIG_SOC_SERIES_MCXA)
262262
set(CONFIG_MCUX_COMPONENT_driver.romapi ON)
263263
endif()
264264

265-
if(CONFIG_SOC_SERIES_MCXN)
265+
if(CONFIG_SOC_SERIES_MCXN AND !CONFIG_SOC_MCXN947 AND !CONFIG_SOC_MCXN547)
266266
set_variable_ifdef(CONFIG_SOC_FLASH_MCUX CONFIG_MCUX_COMPONENT_driver.romapi_flashiap)
267267
endif()
268268

soc/nxp/mcx/mcxn/Kconfig.defconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
2424
default 16000 if MCUX_LPTMR_TIMER
2525
default 150000000 if CORTEX_M_SYSTICK
2626

27+
config MCUX_FLASH_K4_API
28+
default y if (SOC_MCXN947 || SOC_MCXN547) # Initially, only Nx4x uses the k4 driver
29+
2730
# Set to the minimal size of data which can be written.
2831
config FLASH_FILL_BUFFER_SIZE
32+
default 16 if (SOC_MCXN947 || SOC_MCXN547) # Initially, only Nx4x uses the k4 driver
2933
default 128
3034

3135
# The existing SAI diver cannot initialize the PLL on the board,

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ manifest:
210210
groups:
211211
- hal
212212
- name: hal_nxp
213-
revision: cea5006f1829520e40db1b550a9f49cc69ceba7d
213+
revision: 2fe4ab6cd0d5586d12cc396197d956493575a0dd
214214
path: modules/hal/nxp
215215
groups:
216216
- hal

0 commit comments

Comments
 (0)