AnsweredAssumed Answered

FLEXNVM_Init()==kStatus_FTFx_PartitionStatusUpdateFailure on KE1xF

Question asked by Basil Omalay on May 7, 2019
Latest reply on May 8, 2019 by Kerry Zhou



Is there anywhere an example of how to use the FSL SDK library for FlexNVM access?


I've tried just to call FLEXNVM_Init() on my MKE1xF but it returns kStatus_FTFx_PartitionStatusUpdateFailure. It's failing inside ftfx_command_sequence() on kStatus_FTFx_AccessError. If I comment out FTFx_FSTAT_ACCERR_MASK, then FLEXNVM_Init() kinda works (returns kStatus_FTFx_Success), but then FLEXNVM_DflashProgram() doesn't seem to write anything (returns kStatus_FTFx_Success, though), and the memory is just filled with 0xff...

My pseudo-code is something like this:

flexnvm_config_t flashCfg;

memset(&flashCfg, 0, sizeof(flashCfg));

status_t status = FLEXNVM_Init(&flashCfg);

status = FLEXNVM_DflashErase(&flashCfg, 0x10000000, 2048, kFTFx_ApiEraseKey);

status = FLEXNVM_DflashProgram(&flashCfg, 0x10000000, buffer, 2048);


FLEXNVM_GetSecurityState() = kFTFx_SecurityStateNotSecure

FLEXNVM_DflashGetProtection() = 0xff (non-protected)


What's wrong with it and how to do it right?