Hi,
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.
Best Regards,
Alexis Andalon