MC13224 flash memory lost

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

MC13224 flash memory lost

1,651 Views
Houarcheneger
Contributor I

Hi everybody,

 

I have a problem with using the serial falsh memory of MC13224. I use to store some values and sometimes it is like the memory has been erased and reinitialized. The values I get are nonsense but always the same.

I checked in debug mode, the program never access the NVM_Erase functions.

 

Does someone have an idea about this ?

 

Thanks,

 

Houarcheneger.

0 Kudos
7 Replies

823 Views
Gruitbox
Contributor I

Check if you are not writing/reading a location in your flash where your executable data is stored.

0 Kudos

823 Views
Houarcheneger
Contributor I

Thanks,

 

I checked in my project.map file where the executable is stored. It seems I never access to the data sector...

 

 

0 Kudos

823 Views
Gruitbox
Contributor I

Flash memory addresses are mapped to RAM memory addresses when your application is loaded from flash memory into RAM memory.

The map file shows the RAM memory locations where your application will be loaded into.

The flash memory contents are loaded into RAM starting from address 0x00000008.

 

What is the address of the data you are trying to read from flash memory and what is the total binary size of your application.

0 Kudos

823 Views
Houarcheneger
Contributor I

The file Project.bin is 60Ko and the adress of first data in flash is 0X19000.

0 Kudos

823 Views
Gruitbox
Contributor I

The location you are writing to should be good.

Do you erase that sector of the flash before you write any data to it.

Also your JTAG programmer settings may be set to -erase all of the flash data before loading a new application into flash.

Do you initialise the NVM correctly (voltage regulators)

0 Kudos

823 Views
Houarcheneger
Contributor I

Thank you very much for trying to help me !!

 

Every time I have to write some datas in my flash, I erase the concerned sector.

What do you mean about initializing the NVM (voltage regulators) because there is a function that checks if the NVM has been initialized ?

The JTAG programmer should not be concerned since the problem also appears when the programm runs in release mode after several days.

0 Kudos

823 Views
Gruitbox
Contributor I

You should set the voltage regulator to 1.8V.

 

void NVMSetup(void)
{

  crmVRegCntl_t VRegCntl;
  nvmType_t NvmType;
  VRegCntl.vReg = g1P8VReg_c;
  VRegCntl.cntl.vReg1P8VEn = TRUE;
  CRM_VRegCntl(&VRegCntl);
  DelayMs(1);
  NVM_Detect(gNvmInternalInterface_c, &NvmType);

  CRM_VREG_CNTL.vReg1P8VEn = 1;

  while(!CRM_VRegIsReady(V_REG_MASK_1P8V)); //wait ready

}

 

This is necessary to enable read/write flash memory according to the documentation. It has something to do with powersaving when the flash memory is not needed anymore it shuts down the regulators.

0 Kudos