The partition for flexRAM and flexNVM by which using EEROM can only be runed on RAM,not FLAH?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The partition for flexRAM and flexNVM by which using EEROM can only be runed on RAM,not FLAH?

648 Views
fengli
Contributor I

hello,sir:

      I'm Feng from China ,using MK10DX256VLL7 for a designing,I want to use the function of EEROM by settiing flexNVM and flexRAM.

     First,We need partition before using EEROM, if the program runs on RAM, the partition command only be executed once, because ( SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00 before mass erase,thougn power off and then on.This is right.

     But if the same program runs on FLASH,the patition command can be executed successfully,but if power off and then on, ( SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00  is false,that is ( SIM_FCFG1&SIM_FCFG1_DEPART(0xF))   == 0x00000F00 .so once power reset,the patition command will be executed once.however,at last,the program would be running on FLSH,I do not know  how to resolve this question,can give me a suggestion ? thank you!

Code warrior 10.6.4 is my development environment.

The patition command as follow:

int partition_flash(int eeprom_size, int dflash_size)

{

      /* Test to make sure the device is not already partitioned. If it

       * is already partitioned, then return with no action performed.

       */

      if ((SIM_FCFG1 & SIM_FCFG1_DEPART(0xF)) != 0x00000F00)

      {

          printf("\nDevice is already partitioned.\n");

          return 0;

      }

      /* Write the FCCOB registers */

      FTFE_FCCOB0 = FTFE_FCCOB0_CCOBn(0x80); // Selects the PGMPART command

      FTFE_FCCOB1 = 0x00;

      FTFE_FCCOB2 = 0x00;

      FTFE_FCCOB3 = 0x00;

      /* FCCOB4 is written with the code for the subsystem sizes (eeprom_size define) */

      FTFE_FCCOB4 = eeprom_size;

      /* FFCOB5 is written with the code for the Dflash size (dflash_size define) */

      FTFE_FCCOB5 = dflash_size;

      /* All required FCCOBx registers are written, so launch the command */

      FTFE_FSTAT = FTFE_FSTAT_CCIF_MASK;

      /* Wait for the command to complete */

      while(!(FTFE_FSTAT & FTFE_FSTAT_CCIF_MASK));

      return 1;

}

IN a word , the patition command would be executed once power reset, because the  SIM_FCFG1_DEPART of SIM register can not be saved when running on FLASH.

Labels (1)
0 Kudos
2 Replies

362 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Feng,

I'm afraid you were a little confused with the Program Partition Command.

The Program Partition Command must not be launched from flash memory, since flash memory resources are not accessible during Program Partition Command execution.

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

362 Views
fengli
Contributor I

Hi jeremyzhou,

     Thanks for your reply,but my final code must be programed into FLASH,that is to say the code runs on FLASH  at power on, how to design?

the Partition Command should not be included at last when running on FLASH? or Partition Command is executed RAM once,then deleted,the final code is programmed into FLSAH? pardon my unskilled!

Wish you happy everyday!

thank you !

0 Kudos