AnsweredAssumed Answered

K22 + KSDK 1.3 C90TFS/FTFx Driver, FlashVerifySection(...) method

Question asked by Chris Keeser on Apr 17, 2017
Latest reply on Apr 19, 2017 by Chris Keeser

I'm using a K22FN512xxx12 device (FTFA flash controller) and I am trying to make sense of the "number" parameter in the FlashVerifySection(config, dest, number, margin, commandSeq) function.  The description for the parameter in the C90TFS/FTFx Driver User Manual states:  "Number of alignment unit to be verified. Refer to corresponding reference manual to get correct information of alignment constrain." [sic]

 

Searching through the reference manual I am not able to find the relevant information (I have no idea what I am looking for).  What I do know for my K22 device:

Flash size: 512 KB

Block size: 256 KB
Sector size: 2048 B

Program size: 4 B

 

The example application (For a K64 device) has the following code:

/* Verify section for several sector of PFLASH */
number = FTFx_PSECTOR_SIZE/FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT;
for(margin_read_level = 0; margin_read_level < 0x2; margin_read_level++)
{
   ret = FlashVerifySection(&flashSSDConfig, destination, number, margin_read_level, g_FlashLaunchCommand);
   if (FTFx_OK != ret)
   {
     ErrorTrap(ret);
   }
}

Where 'FTFx_PSECTOR_SIZE' = 4096 (for the example K64 project) and 'FSL_FEATURE_FLASH_PFLASH_SECTION_CMD_ADDRESS_ALIGMENT' = 16 (for the example K64 project).  This means number = 256 (for the example K64 project) which ... doesn't make any sense to me.

 

How am I supposed to calculate the number parameter for my device (MK22FN512xxx12) and what is its meaning / purpose?

 

Thanks for any help!

Outcomes