What I want to do?
What I want to do this?
By the way I tagged K66 here because it's pretty much identical to the K65.
The SDK has a driver specified for this (fsl_ftfx_flexnvm) that could be useful, in this file there's the following function that can be use to partition the memory:
status_t FLEXNVM_ProgramPartition(flexnvm_config_t *config, ftfx_partition_flexram_load_opt_t option, uint32_t eepromDataSizeCode, uint32_t flexnvmPartitionCode)
To enable this function you will need to change the following defines MK65F18/MK66F18_features.h if this are not enabled:
#define FSL_FEATURE_FLASH_HAS_FLEX_NVM (1) #define FSL_FEATURE_FLASH_HAS_PROGRAM_SECTION_CMD (1)
I hope this helps you.
The `FLEXNVM_ProgramPartition()` seems like the right way to go. Can you see my question below with regards to partitioning the DFlash.
It looks like a reboot is required so the FlexNVM can be correctly configured by reading the DataFlash0 IFR, can you confirm?
1.- Yes, you will need to erase to erase the flash before executing this command.
2.- I don't think this is need it, in the description of the command is not mention and it only need to finish the command.