AnsweredAssumed Answered

K22 FLASH

Question asked by kathirkamu annakamu on Feb 9, 2017
Latest reply on Feb 14, 2017 by Kerry Zhou

Dear Sir,

I am porting my software from MK20DX128VLF5 to MK22DX256VLF5 contoller. I am storing variables in the FLASH region from address 0x1000_0000 .

 

 I have written a snippet like this

 

size = (BYTE*)&param10 - (BYTE*)&param1;

WDog1_Disable();

FLASH1_SetBlockFlash((unsigned char *)&param1, 0x10000000, size);

WDog1_Clear();//CLEAR_WATCHDOG;
WDog1_Enable();

 

and my bean setting is 

The same code and setting  works well for MK20DX128VLF5. But in MK22DX256VLF5. its keep on looping the flash routine byte FLASH1_SetFlash(FLASH1_TDataAddress Src, FLASH1_TAddress Dst, word Count). its keep on looping do while loop on this section 

 

FLASH1_RemainingDataSize = 0U;
FLASH1_CurrentCommand = FLASH1_CMD_WRITE;
FLASH1_CmdPending = TRUE;
Result = IntFlashLdd1_Write(IntFlashLdd1_DevDataPtr, (LDD_TData *)Src, Dst, (LDD_FLASH_TDataSize)Count); /* Start reading from the flash memory */
if (Result == ERR_OK) {

 

do {
IntFlashLdd1_Main(IntFlashLdd1_DevDataPtr);
} while (FLASH1_CmdPending);

 


Result = FLASH1_CmdResult;
} else {
FLASH1_CmdPending = FALSE; /* Command parameter error */
if (Result == ERR_PARAM_ADDRESS) {
Result = ERR_RANGE;
}
}
return (byte)Result;

 

Thanks & Regards,

A.Kathirkamu

Outcomes