Good morning,
I am using a MK64FX512VLQ12 with MCUXpresso IDE.I should set the FlexNVM as EEprom. I wrote the following code:
ftfx_config_t flex_conf;
flexnvm_config_t nvm_conf;
ftfx_partition_flexram_load_opt_t flexram_load_op;
ftfx_flexram_func_opt_t flexram_fun_op;
int main(void) {
/* Init board hardware. */
uint8_t dati_scrittura;
status_t r_write;
uint8_t da;
uint32_t k;
uint8_t dati_read [10];
ftfx_read_resource_opt_t read_res;
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
r_write = FLEXNVM_Init (&nvm_conf);
if (r_write != kStatus_FTFx_Success)
printf ("Errore Init: %d\n\r", r_write);
else
{
printf ("Ok Init\n\r");
printf ("Block base: 0x%04X\n\r", nvm_conf.ftfxConfig.flexramBlockBase);
printf ("Total size: %d\n\r", nvm_conf.ftfxConfig.flexramTotalSize);
printf ("Eeprom Total size: %d\n\r", nvm_conf.ftfxConfig.eepromTotalSize);
}
flexram_fun_op = kFTFx_FlexramFuncOptAvailableForEeprom;
r_write = FLEXNVM_SetFlexramFunction (&nvm_conf, flexram_fun_op);
if (r_write != kStatus_FTFx_Success)
printf ("Errore Flexram function: %d\n\r", r_write);
else
printf ("Ok Flexram function\n\r");
while (1);
}
The Init function is performed successfully. The FLEXNVM_SetFlexramFunction returns error 103 i.e. Access Error. I also tried to use other functions such as Erase All or FLEXNVM_ProgramPartition and they all return the usual error. How should I do to set the Flexnvm as Eeprom?