AnsweredAssumed Answered

In-software flash programming MKL17Z64 fsl_flash driver

Question asked by dave sturgess on May 7, 2018
Latest reply on May 13, 2018 by Jorge Antonio Alcala Vazquez

I am trying to in-software program the flash on a MKL17Z64... with the fsl_flash driver, I can find no examples of how to do this.

I have in the past successfully carried out the same on the MKL17Z128 but this has two flash blocks so I programmed block 1 while executing from block zero, this is not possible on the 64K part as there is only 1 block.

I believe that a sequence is loaded into RAM which carries out the programming or erase to circumvent this limitation.


I have tried the following (with breakpoint at each function) to step through the process:-

status_t status;

flash_config_t f_config;

status = FLASH_Init(&f_config);

status = FLASH_Erase(&f_config, 0xf000, 1024, 0);

status = FLASH_Program(&f_config, 0xf000, (uint8_t)0x3000, 32);

status = FLASH_Erase(&f_config, 0xf000, 1024, 0);



I get a hard fault on:-

(kFLASH_ExecuteInRamFunctionTotalNum == flashExecuteInRamFunctionInfo->activeFunctionCount))

in function

static status_t  (kFLASH_ExecuteInRamFunctionTotalNum == flashExecuteInRamFunctionInfo->activeFunctionCount))

called from FLASH_init.


Grateful for any help.